This repository has been archived by the owner on Jan 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
115 lines (83 loc) · 3.66 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
###
### Default Makfeile for libTardis
###
# Default Compiler Options
CC = g++
DEBUG = -g -Wall
LIBADD =
ifeq ($(NODE),Abel)
LIBINTEL = -L$(MKLROOT)/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm
LIBARMA = -L$(HOME)/usr/lib64 -larmadillo
LIBFLAGS = $(LIBINTEL) $(LIBARMA) $(LIBADD)
CFLAGS = $(DEBUG) -O2 -c -openmp -DMKL_LP64 -I$(MKLROOT)/include -I$(HOME)/usr/include
LFLAGS = $(DEBUG) -openmp
else
LIBFLAGS = -llapack -lblas -larmadillo $(LIBADD)
CFLAGS = $(DEBUG) -O2 -c -fopenmp
LFLAGS = $(DEBUG) -fopenmp
endif
# Path Settings
LIBROOT = libTardis
LIBSYS = $(LIBROOT)/System
LIBCISD = $(LIBROOT)/CISD
LIBPOT = $(LIBROOT)/Potential
LIBPHYS = $(LIBROOT)/Physics
LIBFCI = $(LIBROOT)/OpenFCI
NODE = Test
COMPILE = tempCompile
OUTPUT = $(COMPILE)/$(NODE)
# Executable
EXEC = CISD-$(NODE)
MAIN = main.cpp
# libTardis Objects
SYSOBJECTS = classLog.o classSystem.o classSlater.o classBasis.o
CISDOBJECTS = classLanczos.o classDiag.o
POTOBJECTS = classQDot2D.o
PHYSOBJECTS = classDensity.o
# OpenFCI Files
OFCIOBJECTS = modGaussTools.o classRadialPotential.o classQDotInteraction.o
OFCIINCLUDE = incLinalg.hpp incSimpleLinalg.hpp incSimpleMatrix.hpp incSimpleVector.hpp incSparse.hpp incTools.hpp lapack/lapack.hpp
OFCIHEADERS = $(addprefix $(LIBFCI)/,$(OFCIINCLUDE))
# Combine Objects
OBJECTS = $(addprefix $(OUTPUT)/,$(SYSOBJECTS) $(CISDOBJECTS) $(POTOBJECTS) $(PHYSOBJECTS) $(OFCIOBJECTS))
##
## Compile
##
# Check if Output directory exists
$(shell [ -d "$(OUTPUT)" ] || mkdir -p $(OUTPUT))
# Executable and main.cpp
$(EXEC) : $(OUTPUT)/main.o $(OBJECTS)
$(CC) $(LFLAGS) $(OUTPUT)/main.o $(OBJECTS) $(LIBFLAGS) -o $@
# Main File
$(OUTPUT)/main.o : $(MAIN) $(LIBROOT)/libTardis.hpp
$(CC) $(CFLAGS) $(MAIN) -o $@
# System Classes
$(OUTPUT)/classLog.o : $(LIBSYS)/classLog.cpp $(LIBSYS)/classLog.hpp
$(CC) $(CFLAGS) $(LIBSYS)/classLog.cpp -o $@
$(OUTPUT)/classSlater.o : $(LIBSYS)/classSlater.cpp $(LIBSYS)/classSlater.hpp $(LIBROOT)/slaterword.hpp
$(CC) $(CFLAGS) $(LIBSYS)/classSlater.cpp -o $@
$(OUTPUT)/classSystem.o : $(LIBSYS)/classSystem.cpp $(LIBSYS)/classSystem.hpp $(LIBROOT)/config.hpp
$(CC) $(CFLAGS) $(LIBSYS)/classSystem.cpp -o $@
$(OUTPUT)/classBasis.o : $(LIBSYS)/classBasis.cpp $(LIBSYS)/classBasis.hpp $(LIBROOT)/config.hpp $(LIBROOT)/slaterword.hpp
$(CC) $(CFLAGS) $(LIBSYS)/classBasis.cpp -o $@
# Potential Classes
$(OUTPUT)/classQDot2D.o : $(LIBPOT)/classQDot2D.cpp $(LIBPOT)/modQDot2D.cpp $(LIBPOT)/classQDot2D.hpp $(LIBPOT)/classPotential.hpp $(LIBROOT)/libTardis.hpp $(LIBROOT)/config.hpp
$(CC) $(CFLAGS) $(LIBPOT)/classQDot2D.cpp -o $@
# Solver Classes
$(OUTPUT)/classDiag.o : $(LIBCISD)/classDiag.cpp $(LIBCISD)/classDiag.hpp
$(CC) $(CFLAGS) $(LIBCISD)/classDiag.cpp -o $@
$(OUTPUT)/classLanczos.o : $(LIBCISD)/classLanczos.cpp $(LIBCISD)/classLanczos.hpp $(LIBROOT)/config.hpp $(LIBROOT)/slaterword.hpp
$(CC) $(CFLAGS) $(LIBCISD)/classLanczos.cpp -o $@
# Physics Classes
$(OUTPUT)/classDensity.o : $(LIBPHYS)/classDensity.cpp $(LIBPHYS)/classDensity.hpp
$(CC) $(CFLAGS) $(LIBPHYS)/classDensity.cpp -o $@
# OpenFCI
$(OUTPUT)/modGaussTools.o : $(LIBFCI)/modGaussTools.cpp $(LIBFCI)/modGaussTools.hpp $(OFCIHEADERS)
$(CC) $(CFLAGS) $(LIBFCI)/modGaussTools.cpp -o $@
$(OUTPUT)/classRadialPotential.o : $(LIBFCI)/classRadialPotential.cpp $(LIBFCI)/classRadialPotential.hpp $(OFCIHEADERS)
$(CC) $(CFLAGS) $(LIBFCI)/classRadialPotential.cpp -o $@
$(OUTPUT)/classQDotInteraction.o : $(LIBFCI)/classQDotInteraction.cpp $(LIBFCI)/classQDotInteraction.hpp $(OFCIHEADERS)
$(CC) $(CFLAGS) $(LIBFCI)/classQDotInteraction.cpp -o $@
# Make Clean
clean:
rm $(OUTPUT)/* $(EXEC)