-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (47 loc) · 1.21 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
# Commands
CXX = c++
USE_OPENMP = 1
USE_METIS = 1
WLSLIB_HOME = ../../wlslib
MOMP2CPP_HOME = ../../momp2cpp
CPPFLAGS = -Isrc -I${WLSLIB_HOME}/cpp/src -I${WLSLIB_HOME}/cpp/extern
ifeq (${M2C_USE64},1)
CPPFLAGS += -DM2C_USE64
endif
ifeq (${DEBUG},)
OPTFLAGS = -O3 -DNDEBUG
else ifeq (${DEBUG},1)
OPTFLAGS = -O2
else
OPTFLAGS = -O0 -fno-omit-frame-pointer -fsanitize=address
endif
LIBRDI_CXXFLAGS = -fPIC -g -Wall -Wno-comment ${OPTFLAGS} ${CXXFLAGS}
ifeq (${LAPACK_LIBS},)
LAPACK_LIBS = -llapack -lblas
endif
ifneq (${LAPACK_LIB_PATH},)
LIBRDI_LIBS = -L${LAPACK_LIB_PATH} ${LAPACK_LIBS}
else
LIBRDI_LIBS = ${LAPACK_LIBS}
endif
ifeq (${USE_OPENMP},1)
LIBRDI_CXXFLAGS += -fopenmp
LIBRDI_LIBS += -fopenmp
endif
ifeq (${USE_METIS},1)
CPPFLAGS += -I${MOMP2CPP_HOME}/include -DRDI_USE_METIS
LIBRDI_LIBS += -L${MOMP2CPP_HOME}/lib/glnxa64 -lmetis
endif
LIBRDI_LIBS += ${LIBS}
VPATH = src src/codegen_src
librdi.so: rdi.o
${CXX} -shared -o $@ $< ${LIBRDI_LIBS} ${LDFLAGS}
rdi.o: rdi.cpp rdi.hpp $(shell ls src/codegen_src/)
@if [ -z "${WLSLIB_HOME}" ]; then \
echo "\nERROR: WLSLIB_HOME=/path/to/wlslib must be passed in\n" 1>&2; \
exit 1; \
fi
${CXX} -c ${CPPFLAGS} ${LIBRDI_CXXFLAGS} $<
.PHONY: clean
clean:
rm -f *.so *.o