-
Notifications
You must be signed in to change notification settings - Fork 253
Expand file tree
/
Copy pathMakefile
More file actions
171 lines (141 loc) · 5.19 KB
/
Makefile
File metadata and controls
171 lines (141 loc) · 5.19 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
################################################################################
#
# Makefile for RMG Py
#
################################################################################
CC=gcc
CXX=g++
# Sentinel file written after a successful pip editable install.
# Lives in the source tree; deleted by `make clean`.
INSTALL_SENTINEL = .installed
.PHONY : all build check clean install decython documentation test q2dtor
# Default target: ensure installed, then build any changed extensions in place.
all: check $(INSTALL_SENTINEL) build check
check:
@ python utilities.py check-dependencies
@ python utilities.py check-pydas
define DO_INSTALL
@ python utilities.py check-pydas
python -m pip install --no-build-isolation -vv -e .
@ touch $(INSTALL_SENTINEL)
endef
# Runs only if the sentinel doesn't exist.
$(INSTALL_SENTINEL):
$(DO_INSTALL)
# Explicit install target
install:
$(DO_INSTALL)
# Incremental in-place build; skips pip entirely.
build:
python setup.py build_ext --inplace
documentation:
$(MAKE) -C documentation html
@ echo "Start at: documentation/build/html/index.html"
clean:
@ python utilities.py clean
python -m pip uninstall --yes reactionmechanismgenerator || true # can fail if RMG not installed at all
@ rm -f $(INSTALL_SENTINEL)
clean-solver:
@ python utilities.py clean-solver
q2dtor:
@ echo -e "\nInstalling Q2DTor...\n"
@ echo -e "Q2DTor is a software for calculating the partition functions and themodynamic properties\
of molecular systems with two or more torsional modes developed by David Ferro Costas (david.ferro@usc.es)\
and Antonio Fernandez Ramos (qf.ramos@usc.es) at the Universidade de Santiago de Compostela. Arkane can\
integrate Q2DTor to compute the quantum mechanical partition function of 2D rotors. \n\nFor use of Q2DTor\
and HinderedRotor2D within Arkane please cite: \n\nD. Ferro-Costas, M. N. D. S.Cordeiro, D. G. Truhlar, A.\
Fernández-Ramos, Comput. Phys. Commun. 232, 190-205, 2018.\n"
@ read -p "Press ENTER to continue" dummy
@ mkdir -p external
@ git clone https://github.com/cathedralpkg/Q2DTor external/Q2DTor
decython:
# de-cythonize all but the 'minimal'. Helpful for debugging in "pure python" mode.
find . -name *.so ! \( -name _statmech.so -o -name quantity.so -o -regex '.*rmgpy/solver/.*' \) -exec rm -f '{}' \;
find . -name *.pyc -exec rm -f '{}' \;
test-all:
python -m pytest
test test-unittests:
python -m pytest -m "not functional and not database"
test-functional:
python -m pytest -m "functional"
test-database:
python -m pytest -m "database"
eg0: all
mkdir -p testing/eg0
rm -rf testing/eg0/*
cp examples/rmg/superminimal/input.py testing/eg0/input.py
@ echo "Running eg0: superminimal (H2 oxidation) example"
python rmg.py testing/eg0/input.py
eg1: all
mkdir -p testing/eg1
rm -rf testing/eg1/*
cp examples/rmg/minimal/input.py testing/eg1/input.py
coverage erase
@ echo "Running eg1: minimal (ethane pyrolysis) example with coverage tracking AND profiling"
coverage run rmg.py -p testing/eg1/input.py
coverage report
coverage html
eg2: all
mkdir -p testing/eg2
rm -rf testing/eg2/*
cp examples/rmg/1,3-hexadiene/input.py testing/eg2/input.py
coverage erase
@ echo "Running eg2: 1,3-hexadiene example with profiling"
python rmg.py -p testing/eg2/input.py
eg3: all
mkdir -p testing/eg3
rm -rf testing/eg3/*
cp examples/rmg/liquid_phase/input.py testing/eg3/input.py
coverage erase
@ echo "Running eg3: liquid_phase example with profiling"
python rmg.py -p testing/eg3/input.py
eg5: all
mkdir -p testing/eg5
rm -rf testing/eg5/*
cp examples/rmg/heptane-eg5/input.py testing/eg5/input.py
@ echo "Running eg5: heptane example"
python rmg.py testing/eg5/input.py
eg6: all
mkdir -p testing/eg6
rm -rf testing/eg6/*
cp examples/rmg/ethane-oxidation/input.py testing/eg6/input.py
@ echo "Running eg6: ethane-oxidation example"
python rmg.py testing/eg6/input.py
eg7: all
mkdir -p testing/eg7
rm -rf testing/eg7/*
cp examples/rmg/gri_mech_rxn_lib/input.py testing/eg7/input.py
@ echo "Running eg7: gri_mech_rxn_lib example"
python rmg.py testing/eg7/input.py
scoop: all
mkdir -p testing/scoop
rm -rf testing/scoop/*
cp examples/rmg/minimal/input.py testing/scoop/input.py
coverage erase
@ echo "Running minimal example with SCOOP"
python -m scoop -n 2 rmg.py -v testing/scoop/input.py
eg4: all
mkdir -p testing/eg4
rm -rf testing/eg4/*
cp examples/thermoEstimator/input.py testing/eg4/input.py
@ echo "Running thermo data estimator example. This tests QM."
python scripts/thermoEstimator.py testing/eg4/input.py
# RMS reactor examples (require Julia)
eg8: all
mkdir -p testing/eg8
rm -rf testing/eg8/*
cp examples/rmg/rms_constant_V/input.py testing/eg8/input.py
@ echo "Running RMS constantVIdealGasReactor example (requires Julia)"
python rmg.py testing/eg8/input.py
eg9: all
mkdir -p testing/eg9
rm -rf testing/eg9/*
cp examples/rmg/nox_transitory_edge/input.py testing/eg9/input.py
@ echo "Running RMS constantTPIdealGasReactor example (requires Julia)"
python rmg.py testing/eg9/input.py
eg10: all
mkdir -p testing/eg10
rm -rf testing/eg10/*
cp examples/rmg/liquid_cat/input.py testing/eg10/input.py
@ echo "Running RMS liquidSurfaceReactor example (requires Julia)"
python rmg.py testing/eg10/input.py