From 76e4a392d19ba312d25aa96feeb28c38898d5b59 Mon Sep 17 00:00:00 2001 From: tduretz Date: Tue, 11 Jun 2024 15:10:50 +0200 Subject: [PATCH] add Makefiles folder --- MDLIB/Makefiles/makefile_Physix | 23 +++++++++++++ MDLIB/Makefiles/makefile_Tib_M2 | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 MDLIB/Makefiles/makefile_Physix create mode 100644 MDLIB/Makefiles/makefile_Tib_M2 diff --git a/MDLIB/Makefiles/makefile_Physix b/MDLIB/Makefiles/makefile_Physix new file mode 100644 index 00000000..4c9ebbd9 --- /dev/null +++ b/MDLIB/Makefiles/makefile_Physix @@ -0,0 +1,23 @@ +run-tests: + cd cmake-build && ctest --extra-verbose --output-on-failure + +run: + cd cmake-exec/$(SET) && ./$(SET) $(TXT) + +run-vis: + cd visualtests-out && ./visualtests + +build-dev: + cmake -B ./cmake-build -DOPT=$(OPT) -DOMP=$(OMP) -DVIS=$(VIS) -DSET=$(SET) -DTXT=$(TXT) -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ && cmake --build ./cmake-build + +build: + cmake -DOPT=ON -DOMP=ON -B ./cmake-build -DSET=$(SET) -DTXT=$(TXT) && cmake --build ./cmake-build + +clean: + rm -rf *build*/ && rm -rf *exec*/ + +deps: + rm -rf deps && git clone https://github.com/kulakovri/MDOODZ-dependencies deps && cd deps && make install-hdf5 && make install-suitesparse + +install-suitesparse: + rm -rf deps && git clone https://github.com/kulakovri/MDOODZ-dependencies deps && cd deps && make install-suitesparse \ No newline at end of file diff --git a/MDLIB/Makefiles/makefile_Tib_M2 b/MDLIB/Makefiles/makefile_Tib_M2 new file mode 100644 index 00000000..7e8d579e --- /dev/null +++ b/MDLIB/Makefiles/makefile_Tib_M2 @@ -0,0 +1,58 @@ +# MDOODZ 7.0 makefile +SHELL := /bin/bash + +# Compiler +CC = gcc-13 + +# Path to setup file folder +SET_PATH = ../SETS + +#---------------------------------------------------# +# C flags +CFLAGS = -std=c99 -D _UMFPACK_ -I ./include/ -I ./ + +ifeq ($(OPT),yes) + CFLAGS += -O3 -ftree-vectorize -funroll-loops -finline -fomit-frame-pointer -march=native +else + CFLAGS += -g -Wall -O0 -fno-inline -fno-omit-frame-pointer +endif + +ifeq ($(OMP),yes) + CFLAGS += -fopenmp -D _OMP_ +else + CFLAGS += -Wno-unknown-pragmas +endif + +ifeq ($(VG),yes) + CFLAGS += -D _VG_ -Wno-format-zero-length +endif + +ifeq ($(NEW_INPUT),yes) + CFLAGS += -D _NEW_INPUT_ +endif + +CFLAGS += -Wno-unused-variable -Wno-comment +#---------------------------------------------------# +# Libraries +LIBS = -lz -lhdf5 + +# Related to SuiteSparse +LIBS += -L /usr/lib/ -llapack -lcxsparse -lumfpack -lcblas -lamd -lcholmod -lcolamd -lbtf -lsuitesparseconfig -lblas + +# Link to openmp +ifeq ($(OMP),yes) + LIBS += -lgomp +endif + +#---------------------------------------------------# +# Rules +FILES = MeltingRoutines.o AnisotropyRoutines.o Main_DOODZ.o FD_Jacobian.o RheologyParticles.o ChemicalRoutines.o ParticleReseeding.o Solvers.o StokesRoutines.o StokesAssemblyDecoupled.o AdvectionRoutines.o RheologyDensity.o HDF5Output.o SparseTools.o ThermalRoutines.o ThermalSolver.o ParticleRoutines.o FreeSurface.o FlowLaws.o MemoryAllocFree.o InputOutput.o MiscFunctions.o GridRoutines.o Setup.o $(SET_PATH)/$(SET).o + + +all: Doodzi_$(SET) +Doodzi_$(SET): ${FILES} + $(CC) ${FILES} -o $(SET) ${LIBS} + +clean: + cp $(SET_PATH)/$(SET).txt . + rm -rf *o ./$(SET_PATH)/*.o $(SET)