-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile.make
executable file
·97 lines (72 loc) · 2.6 KB
/
Makefile.make
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
#----------------------------------------------------
# Makefile
#
# Author: Frankie Li
# e-mail: li31@llnl.gov
#
# Purpose: This is a basic Makefile used to compile
# VPFFT++.
#----------------------------------------------------
#----------------------------------------------------
#
# Project (executable) Name
#
#----------------------------------------------------
EXEC = VPFFT++
#----------------------------------------------------
#
# Specifying source path and source files for this
# project.
#
#----------------------------------------------------
PROJ_PATH = ./Src
PROJ_CPPS = main.cpp LinearAlgebra.cpp Solvers.cpp MaterialGrid.cpp UnitTester.cpp Debug.cpp Config.cpp Parser.cpp
#main.cpp LinearAlgebra.cpp Solvers.cpp MaterialGrid.cpp UnitTester.cpp Debug.cpp
CPPS = $(patsubst %.cpp, $(PROJ_PATH)/%.cpp, $(PROJ_CPPS) )
#----------------------------------------------------
# Specify external template library location (BOOST)
#----------------------------------------------------
EIGEN_PATH = /Users/li31/LLNL/ExMatEx/VonnegutSvn/svn/proxyApps/VPFFT/trunk/ExtLib/eigen-eigen-6e7488e20373
FFTW_PATH = /Users/li31/LLNL/ExtLib/fftw3/
OBJS = $(patsubst %.cpp, %.o, $(CPPS))
OBJS_DEBUG = $(patsubst %.cpp, %.do, $(CPPS))
#----------------------------------------------------
#
# Specifying precomile external library locations
#
#----------------------------------------------------
INCL = -I. -I${EIGEN_PATH} -I${FFTW_PATH}/include
#----------------------------------------------------
#
# Putting together library locations
#
#----------------------------------------------------
LIB_ROOT = -L${FFTW_PATH}/lib
#----------------------------------------------------
#
#----------------------------------------------------
RELEASE_FLAGS = -Wfatal-errors -O3 -DNDEBUG \
-fopenmp
DEBUG_FLAGS = -fopenmp -ggdb -DDEBUG_LEVEL_MAX \
-Wall
RELEASE_FLAGS += ${LIB_ROOT}
DEBUG_FLAGS += ${LIB_ROOT}
LIBS = -lm -lfftw3_threads -lfftw3 -lfftw3_mpi -lpthread
CC = mpicxx-openmpi-gcc46 # /opt/local/bin/g++-mp-4.5 # g++ #icpc
#---------------------------
# This is the dumb way
#---------------------------
debug:EXEC_DEBUG
EXEC_DEBUG:$(OBJS_DEBUG)
$(CC) $(DEBUG_FLAGS) $(OBJS_DEBUG) -o $(EXEC) $(LIBS)
%.do : %.cpp
$(CC) -c $(INCL) $(DEBUG_FLAGS) $< -o $@
#---------------------------
# RELEASE
#---------------------------
$(EXEC):$(OBJS)
$(CC) $(RELEASE_FLAGS) $(OBJS) -o $(EXEC) $(LIBS)
%.o : %.cpp
$(CC) -c $(INCL) $(RELEASE_FLAGS) $< -o $@
clean:
rm -f $(OBJS) $(OBJS_DEBUG) $(EXEC) *.exe *~ $(PROJ_PATH)/*~ # -- taken out temporarily