|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #compiler =icpc
- #CANTERA_DIR =/opt/scientific/cantera-2.3_intel_mkl
- #IDA_DIR =/opt/scientific/sundials-3.1.1_intel_mkl
- #EXE =lagrangianCombustion2
- #DESTDIR =~/bin
-
- compiler =g++
- CANTERA_DIR =/opt/scientific/cantera-2.4_gnu_blas
- IDA_DIR =/opt/scientific/sundials-3.1.1_gnu_lapack
- EXE =lagrangianCombustion
- DESTDIR =~/bin
-
- CANTERA_INCLUDES=-I$(CANTERA_DIR)/include
- GSL_INCLUDES =-I/usr/include/gsl
- GSL_LIBS =-L/usr/lib -lgsl -lgslcblas
- IDA_INCLUDES =-I$(IDA_DIR)/include
- SUN_INCLUDES =-I$(IDA_DIR)/include
- IDA_LIBS =-L$(IDA_DIR)/lib -lsundials_nvecopenmp \
- -lsundials_ida -lsundials_sunlinsollapackband
- CANTERA_LIBS =-L$(CANTERA_DIR)/lib -lcantera_shared
- RPATH =-Wl,-rpath=$(IDA_DIR)/lib,-rpath=$(CANTERA_DIR)/lib
- RM=rm -f
-
- compiler?=g++
-
- ifeq ($(compiler),g++)
- CPPFLAGS= -Wall -O3
- CPP=g++
- endif
-
- ifeq ($(compiler),icpc)
- export GXX_INCLUDE=/usr/lib/gcc/x86_64-pc-linux-gnu/7.4.1/include/c++
- CPPFLAGS= -Wall -O3 -gxx-name=/usr/bin/g++-7 -std=c++11
- CPP=icpc
- endif
-
- OBJS = parse.o UserData.o gridRoutines.o residue.o solution.o main.o
-
- all: $(EXE)
-
- # pull in dependency info for *existing* .o files
- -include $(OBJS:.o=.d)
-
- parse.o: parse.cpp parse.h parse.hpp
- $(CPP) $(CPPFLAGS) -c parse.cpp -o parse.o
- $(CPP) -MM parse.cpp > parse.d
-
- solution.o: solution.cpp solution.h
- $(CPP) $(CPPFLAGS) $(CANTERA_INCLUDES) $(IDA_INCLUDES) \
- -c solution.cpp -o solution.o
- $(CPP) -MM $(CANTERA_INCLUDES) $(IDA_INCLUDES) \
- solution.cpp > solution.d
-
- residue.o: residue.cpp residue.h UserData.h gridRoutines.h
- $(CPP) $(CPPFLAGS) $(CANTERA_INCLUDES) \
- $(IDA_INCLUDES) $(GSL_INCLUDES) -c residue.cpp \
- -o residue.o -fopenmp
- $(CPP) -MM $(CANTERA_INCLUDES) \
- $(IDA_INCLUDES) $(GSL_INCLUDES) \
- residue.cpp > residue.d
-
- gridRoutines.o: gridRoutines.cpp gridRoutines.h parse.h
- $(CPP) $(CPPFLAGS) -c gridRoutines.cpp -o gridRoutines.o
- $(CPP) -MM gridRoutines.cpp > gridRoutines.d
-
- UserData.o: UserData.cpp UserData.h gridRoutines.h parse.h
- $(CPP) $(CPPFLAGS) $(CANTERA_INCLUDES) \
- -c UserData.cpp -o UserData.o
- $(CPP) -MM $(CANTERA_INCLUDES) \
- UserData.cpp > UserData.d
-
- main.o: main.cpp UserData.h solution.h residue.h macros.h
- $(CPP) $(CPPFLAGS) $(CANTERA_INCLUDES) $(IDA_INCLUDES) \
- -c main.cpp -o main.o
- $(CPP) -MM $(CANTERA_INCLUDES) $(IDA_INCLUDES) \
- main.cpp > main.d
-
- $(EXE): $(OBJS)
- $(CPP) $(CPPFLAGS) $(IDA_INCLUDES) \
- $(CANTERA_INCLUDES) $(GSL_INCLUDES) $(RPATH) \
- $(OBJS) -o $(EXE) -fopenmp $(IDA_LIBS) \
- $(CANTERA_LIBS) $(GSL_LIBS)
-
- .PHONY: install
- install:
- cp $(EXE) $(DESTDIR)/$(EXE)
-
- .PHONY: clean
- clean:
- rm -f $(EXE) $(OBJS) *.d
-
|