Skip to content

Commit

Permalink
add makefile for Alambix
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault duretz committed Jul 13, 2024
1 parent f90ad16 commit 9e62e2d
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 16 deletions.
63 changes: 63 additions & 0 deletions MDLIB/Makefiles/makefile_Alambix
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# MDOODZ 7.0 makefile
SHELL := /bin/bash

LINK_HDF5_LIB = /usr/lib/x86_64-linux-gnu/
LINK_HDF5_INC = /usr/include/hdf5/serial/
LINK_SUSP_LIB = /opt/suitesparse/latest/lib/
LINK_SUSP_INC = /opt/suitesparse/latest/include/

# Compiler
CC = gcc

# Path to setup file folder
SET_PATH = ../SETS

#---------------------------------------------------#
# C flags
CFLAGS = -I ${LINK_HDF5_INC} -I ${LINK_SUSP_INC} -std=c99 -D _UMFPACK_ -I ./include/ -I ./ -Doff64_t=__off64_t -std=gnu99

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 = -lm -lz -L ${LINK_HDF5_LIB} -lhdf5_serial

# Related to SuiteSparse
LIBS += -L ${LINK_SUSP_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)
72 changes: 56 additions & 16 deletions MDLIB/Makefiles/makefile_Physix
Original file line number Diff line number Diff line change
@@ -1,23 +1,63 @@
run-tests:
cd cmake-build && ctest --extra-verbose --output-on-failure
# MDOODZ 7.0 makefile
SHELL := /bin/bash

run:
cd cmake-exec/$(SET) && ./$(SET) $(TXT)
LINK_HDF5_LIB = /usr/lib/x86_64-linux-gnu/
LINK_HDF5_INC = /usr/include/hdf5/serial/
LINK_SUSP_LIB = /opt/suitesparse/latest/lib/
LINK_SUSP_INC = /opt/suitesparse/latest/include/

run-vis:
cd visualtests-out && ./visualtests
# Compiler
CC = gcc

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
# Path to setup file folder
SET_PATH = ../SETS

build:
cmake -DOPT=ON -DOMP=ON -B ./cmake-build -DSET=$(SET) -DTXT=$(TXT) && cmake --build ./cmake-build
#---------------------------------------------------#
# C flags
CFLAGS = -I ${LINK_HDF5_INC} -I ${LINK_SUSP_INC} -std=c99 -D _UMFPACK_ -I ./include/ -I ./ -Doff64_t=__off64_t -std=gnu99

clean:
rm -rf *build*/ && rm -rf *exec*/
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 = -lm -lz -L ${LINK_HDF5_LIB} -lhdf5_serial

deps:
rm -rf deps && git clone https://github.com/kulakovri/MDOODZ-dependencies deps && cd deps && make install-hdf5 && make install-suitesparse
# Related to SuiteSparse
LIBS += -L ${LINK_SUSP_LIB} -llapack -lcxsparse -lumfpack -lcblas -lamd -lcholmod -lcolamd -lbtf -lsuitesparseconfig -lblas

install-suitesparse:
rm -rf deps && git clone https://github.com/kulakovri/MDOODZ-dependencies deps && cd deps && make install-suitesparse
# 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)

0 comments on commit 9e62e2d

Please sign in to comment.