forked from Fijee-Project/Fijee
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
136 lines (123 loc) · 4.09 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
###############
## CONFIGURE ##
###############
export PREFIX =
export PATH_SOFT =/home/cobigo/devel/CPP/
DEBUG = no
VERSION = 1.0
DIST = Fijee
#################
## COMPILATION ##
#################
export CXX = g++
export CC = g++
export CUDA = nvcc
#-lineinfo CUDA
# -gencode arch=compute_10,code=sm_10
# -gencode arch=compute_20,code=sm_20
# -gencode arch=compute_30,code=sm_30
# -gencode arch=compute_35,code=sm_35
#
ifeq ($(DEBUG),yes)
CXXFLAGS_MODE = -g -O0 -DDEBUG
CUDAFLAGS_MODE =
else
CXXFLAGS_MODE = -O3 -Wunused-local-typedefs #-DGPU
CUDAFLAGS_MODE = -O3 -m64 -gencode arch=compute_20,code=sm_20
endif
#
export CXXFLAGS += $(CXXFLAGS_MODE) -Wno-deprecated -std=c++11 -frounding-math -DCGAL_EIGEN3_ENABLED -DDEBUG_UCSF #-DDEBUG_TRACE -std=c++0x -std=c++11 or -std=gnu++11
export CUDAFLAGS += $(CUDAFLAGS_MODE)
export UFL = ffc
# Warning: -Wno-deprecate might cause difficult linking issue difficult to solve
####################
## TIER LIBRARIES ##
####################
CGAL_DIR = $(PATH_SOFT)/CGAL/
NIFTI_DIR = $(PATH_SOFT)/nifti
#
# VTK
#
VTK_DIR = $(PATH_SOFT)/VTK
export VTK_VERSION = vtk-5.10
export VTK_LIBS = -lvtkCommon -lvtkFiltering -lvtkGenericFiltering -lvtkGraphics -lvtkIO -lvtkRendering -lvtksys -lvtkVolumeRendering -lvtkzlib -lvtkfreetype -lvtkftgl -lvtkImaging -lvtkhdf5 -lvtkhdf5_hl -lvtkexpat -lvtktiff -lvtkjpeg -lvtkpng -lvtksqlite -lvtkmetaio -lLSDyna -lvtkNetCDF -lvtkDICOMParser -lvtkverdict -lvtkNetCDF -lvtkHybrid -lvtkNetCDF_cxx -lvtkexoIIc -lvtklibxml2 -lvtkalglib -lvtkproj4
#
#
#
ifeq ($(DEBUG),yes)
export CGAL = $(CGAL_DIR)/install
export NIFTI = $(NIFTI_DIR)/install
export VTK = $(VTK_DIR)/install
else
export CGAL = $(CGAL_DIR)/install
export NIFTI = $(NIFTI_DIR)/install
export VTK = $(VTK_DIR)/install
endif
#
export EIGEN3 = $(PATH_SOFT)/Eigen/install
export FENICS = $(PATH_SOFT)/FEniCS/install/
export CUDA_LIB = /usr/local/cuda/lib64/
######################
## Main DIRECTORIES ##
######################
export FIJEE += $(CURDIR)
#####################
## SUB DIRECTORIES ##
#####################
UTILS_DIR = Utils
MESH_RENDERING_DIR = Mesh_rendering
FEM_MODELS_DIR = Finite_element_method_models
ELECTRODES_DIR = Electrodes
EXEC = $(MESH_RENDERING)/build_inrimage $(FEM_MODELS_DIR)/Poisson
###############
## EXECUTION ##
###############
all: models $(EXEC)
$(EXEC):
( cd $(UTILS_DIR)/pugi/ && $(MAKE) )
( cd $(UTILS_DIR)/Compression/ && $(MAKE) )
( cd $(UTILS_DIR)/Minimizers/ && $(MAKE) )
( cd $(UTILS_DIR)/Biophysics/ && $(MAKE) )
( cd $(ELECTRODES_DIR) && $(MAKE) )
( cd $(FEM_MODELS_DIR) && $(MAKE) )
( cd $(MESH_RENDERING_DIR) && $(MAKE) )
@echo""
@echo "export LD_LIBRARY_PATH=$(FIJEE)/$(UTILS_DIR)/pugi/:$(FIJEE)/$(UTILS_DIR)/Minimizers/:$(FIJEE)/$(UTILS_DIR)/Biophysics/:$(CUDA_LIB):$(VTK)/lib/vtk-5.10:$(CGAL)/lib:$(LD_LIBRARY_PATH)"
@echo""
models:
( cd $(FEM_MODELS_DIR) && $(MAKE) models )
clean:
( cd $(UTILS_DIR)/pugi/ && $(MAKE) $@ )
( cd $(UTILS_DIR)/Compression/ && $(MAKE) $@ )
( cd $(UTILS_DIR)/Minimizers/ && $(MAKE) $@ )
( cd $(UTILS_DIR)/Biophysics/ && $(MAKE) $@ )
( cd $(FEM_MODELS_DIR) && $(MAKE) $@ )
( cd $(MESH_RENDERING_DIR) && $(MAKE) $@ )
( cd $(ELECTRODES_DIR) && $(MAKE) $@ )
distclean: clean
find . -name *~ -exec rm {} \;
find . -name SLS_model.h -exec rm {} \;
find . -name SLD_model.h -exec rm {} \;
find . -name tCS_model.h -exec rm {} \;
find . -name tCS_current_density_model.h -exec rm {} \;
find . -name tCS_electrical_field_model.h -exec rm {} \;
find . -name *.mesh -exec rm {} \;
find . -name *.inr -exec rm {} \;
find . -name *.frame -exec rm {} \;
#check:
#
#
#install:
#
#
dist:
mkdir $(DIST)
cp Makefile $(DIST)/
mkdir $(DIST)/$(FEM_MODELS_DIR)
mkdir $(DIST)/$(MESH_RENDERING_DIR)
cp $(FEM_MODELS_DIR)/Makefile $(DIST)/$(FEM_MODELS_DIR)/
cp $(MESH_RENDERING_DIR)/{Makefile,README} $(DIST)/$(MESH_RENDERING_DIR)/
cp $(FEM_MODELS_DIR)/*.{h,cxx,ufl} $(DIST)/$(FEM_MODELS_DIR)/
cp $(MESH_RENDERING_DIR)/*.{h,cxx,cu} $(DIST)/$(MESH_RENDERING_DIR)/
tar zcvf $(DIST)-$(VERSION).tar.gz $(DIST)
rm -rf $(DIST)