forked from physimals/fabber_core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
92 lines (65 loc) · 2.71 KB
/
Copy pathMakefile
File metadata and controls
92 lines (65 loc) · 2.71 KB
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
include ${FSLCONFDIR}/default.mk
PROJNAME = fabber_core
USRINCFLAGS = -I${INC_NEWMAT} -I${INC_PROB} -I${INC_BOOST} -DFABBER_SRC_DIR="\"${PWD}\"" -DFABBER_BUILD_DIR="\"${PWD}\""
USRLDFLAGS = -L${LIB_NEWMAT} -L${LIB_PROB} -L/lib64
FSLVERSION= $(shell cat ${FSLDIR}/etc/fslversion | head -c 1)
ifeq ($(FSLVERSION), 5)
NIFTILIB = -lfslio -lniftiio
MATLIB = -lnewmat
else
UNAME := $(shell uname -s)
ifeq ($(UNAME), Linux)
MATLIB = -lopenblas
endif
NIFTILIB = -lNewNifti
endif
LIBS = -lnewimage -lmiscmaths -lutils -lprob ${MATLIB} ${NIFTILIB} -lznz -lz -ldl
TESTLIBS = -lgtest -lpthread
#
# Executables
#
XFILES = fabber mvntool
SCRIPTS = fabber_var
# Sets of objects separated into logical divisions
# Basic objects - things that have nothing directly to do with inference
BASICOBJS = tools.o rundata.o dist_mvn.o easylog.o fabber_capi.o version.o dist_gamma.o rundata_array.o
# Core objects - things that implement the framework for inference
COREOBJS = noisemodel.o fwdmodel.o inference.o fwdmodel_linear.o fwdmodel_poly.o convergence.o motioncorr.o priors.o transforms.o
# Infernce methods
INFERENCEOBJS = inference_vb.o inference_nlls.o covariance_cache.o
# Noise models
NOISEOBJS = noisemodel_white.o noisemodel_ar.o
# Configuration
CONFIGOBJS = setup.o factories.o
# Library for executables
EXECOBJS = rundata_newimage.o fabber_core.o
# Executable main object
CLIENTOBJS = fabber_main.o
# Unit tests
TESTOBJS = test/fabbertest.o test/test_inference.o test/test_priors.o test/test_vb.o test/test_convergence.o test/test_commandline.o test/test_rundata.o
# Everything together
OBJS = ${BASICOBJS} ${COREOBJS} ${INFERENCEOBJS} ${NOISEOBJS} ${CONFIGOBJS}
# For debugging:
#OPTFLAGS = -ggdb -Wall
# Pass Git revision details
GIT_SHA1:=$(shell git describe --dirty)
GIT_DATE:=$(shell git log -1 --format=%ad --date=local)
CXXFLAGS += -DGIT_SHA1=\"${GIT_SHA1}\" -DGIT_DATE="\"${GIT_DATE}\""
# Targets
all: ${XFILES} libfabbercore.a libfabberexec.a
clean:
${RM} -f /tmp/fslgrot *.o mvn_tool/*.o *.a *.exe core depend.mk fabber_test
mvntool: ${OBJS} mvn_tool/mvntool.o rundata_newimage.o
${CXX} ${CXXFLAGS} ${LDFLAGS} -o $@ ${OBJS} mvn_tool/mvntool.o rundata_newimage.o ${LIBS}
# Build a fabber exectuable, this will have nothing but the generic models so it not practically useful for data analysis
fabber: ${OBJS} ${EXECOBJS} ${CLIENTOBJS}
${CXX} ${CXXFLAGS} ${LDFLAGS} -o $@ ${OBJS} ${EXECOBJS} ${CLIENTOBJS} ${LIBS}
# Library build
libfabbercore.a : ${OBJS}
${AR} -r $@ ${OBJS}
libfabberexec.a : ${EXECOBJS}
${AR} -r $@ ${EXECOBJS}
# Unit tests
test: ${OBJS} ${EXECOBJS} ${CLIENTOBJS} ${TESTOBJS}
${CXX} ${CXXFLAGS} ${LDFLAGS} ${TESTINC} -o fabber_test ${OBJS} ${EXECOBJS} ${TESTOBJS} ${LIBS} ${TESTLIBS}
# DO NOT DELETE