forked from ReactionMechanismGenerator/PyDAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (71 loc) · 2.48 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
################################################################################
#
# Makefile for PyDAS
#
################################################################################
F77=gfortran
CYTHON_FLAGS=--inplace
-include make.inc
.PHONY: DASSL DASPK31 DASKR cython clean
all: DASSL DASPK31 DASKR cython
dassl: DASSL cython
daspk: DASPK31 cython
cython:
ifeq (,$$(wildcard daspk31/solver/ddaspk.o))
# DASPK3.1 was not compiled. Cythonize the wrapper for only DASSL.
python setup.py build_ext $(CYTHON_FLAGS)
else
# Cythonize both DASSL and DASPK3.1 wrappers
python setup.py build_ext daspk $(CYTHON_FLAGS)
endif
install: DASSL DASPK31 DASKR cython
ifeq (,$$(wildcard pydas/daspk.so))
# the file "pydas/daspk.so" does not exist, so don't install daspk
python setup.py install
@echo "NOTE: Installed without DASPK, because it had not been compiled."
else
# the file "pydas/daspk.so" does exist, so install daspk
python setup.py daspk install
endif
test:
cd tests; python dasslTest.py
cd tests; python daspkTest.py
DASSL:
$(MAKE) -C dassl F77=$(F77)
DASPK31:
$(MAKE) -C daspk31 F77=$(F77)
DASKR:
$(MAKE) -C daskr F77=$(F77)
clean: clean-DASSL clean-DASPK31 clean-DASKR clean-cython
rm -rf build
clean-DASSL:
$(MAKE) -C dassl clean
clean-DASPK31:
$(MAKE) -C daspk31 clean
clean-DASKR:
$(MAKE) -C daskr clean
clean-cython:
python setup.py clean $(CLEAN_FLAGS)
rm -f pydas/*.so pydas/*.pyc pydas/*.c pydas/*.html
help:
@echo ""
@echo "This makefile can be used to build PyDAS and its dependencies."
@echo ""
@echo "Typing \`make\` with no arguments will compile all three DAE solvers (DASSL,"
@echo "DASPK3.1, and DASKR) to static libraries and compile the PyDAS Python modules"
@echo "that provide the Python interface to these solvers. Note that one must agree"
@echo "to download the DASPK3.1 source code externally to compile the DASPK wrapper."
@echo ""
@echo "Typing \`make clean\` will delete all of the intermediate build files,"
@echo "compiled libraries, and compiled Python modules for all three DAE solvers and"
@echo "the PyDAS modules."
@echo ""
@echo "Individual dependencies can be specified using \`make <target>\`, where"
@echo "<target> is one of:"
@echo ""
@echo " DASSL to compile the DASSL solver"
@echo " DASPK31 to compile the DASPK31 solver"
@echo " DASKR to compile the DASKR solver"
@echo " cython to compile the PyDAS Python wrapper module for DASSL"
@echo " and DASPK3.1 (if it was compiled)"
@echo ""