forked from ReactionMechanismGenerator/RMG-Py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
176 lines (153 loc) · 5.7 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
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
172
173
174
175
176
################################################################################
#
# Makefile for RMG Py
#
################################################################################
DASPK=$(shell python -c 'import pydas.daspk; print pydas.daspk.__file__')
DASSL=$(shell python -c 'import pydas.dassl; print pydas.dassl.__file__')
RDKIT_VERSION=$(shell python -c 'import rdkit; print rdkit.__version__')
.PHONY : all minimal main solver cantherm clean decython documentation QM mopac_travis
all: main solver QM
noQM: main solver
minimal:
python setup.py build_ext minimal --build-lib . --build-temp build --pyrex-c-in-temp
main:
@ echo "Checking you have PyDQED..."
@ python -c 'import pydqed; print pydqed.__file__'
python setup.py build_ext main --build-lib . --build-temp build --pyrex-c-in-temp
solver:
ifneq ($(DASPK),)
@ echo "DASPK solver found. Compiling with DASPK and sensitivity analysis capability..."
@ (echo DEF DASPK = 1) > rmgpy/solver/settings.pxi
else ifneq ($(DASSL),)
@ echo "DASSL solver found. Compiling with DASSL. Sensitivity analysis capabilities are off..."
@ (echo DEF DASPK = 0) > rmgpy/solver/settings.pxi
else
@ echo 'No PyDAS solvers found. Please check if you have the latest version of PyDAS.'
@ python -c 'import pydas.dassl'
endif
python setup.py build_ext solver --build-lib . --build-temp build --pyrex-c-in-temp
cantherm:
python setup.py build_ext cantherm --build-lib . --build-temp build --pyrex-c-in-temp
QM:
@ echo "Checking if you have symmetry..."
@ echo "symmetry -h"
@ echo "Checking you have rdkit..."
@ python -c 'import rdkit; print rdkit.__file__'
@ echo "Checking rdkit version..."
ifneq ($(RDKIT_VERSION),)
@ echo "Found rdkit version $(RDKIT_VERSION)"
else
$(error RDKit version out of date, please install RDKit version 2015.03.1 or later with InChI support);
endif
@ echo "Checking rdkit has InChI support..."
@ python -c 'from rdkit import Chem; assert Chem.inchi.INCHI_AVAILABLE, "RDKit installed without InChI Support. Please install with InChI."'
documentation:
$(MAKE) -C documentation html
@ echo "Start at: documentation/build/html/index.html"
clean:
python setup.py clean --build-temp build
rm -rf build/
find . -name '*.so' -exec rm -f '{}' \;
find . -name '*.pyc' -exec rm -f '{}' \;
clean-solver:
rm -r build/pyrex/rmgpy/solver/
rm -r build/build/pyrex/rmgpy/solver/
find rmgpy/solver/ -name '*.so' -exec rm -f '{}' \;
find rmgpy/solver/ -name '*.pyc' -exec rm -f '{}' \;
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:
ifeq ($(OS),Windows_NT)
nosetests --nocapture --nologcapture --all-modules --verbose --with-coverage --cover-inclusive --cover-package=rmgpy --cover-erase --cover-html --cover-html-dir=testing/coverage --exe rmgpy
else
mkdir -p testing/coverage
rm -rf testing/coverage/*
nosetests --nocapture --nologcapture --all-modules --verbose --with-coverage --cover-inclusive --cover-package=rmgpy --cover-erase --cover-html --cover-html-dir=testing/coverage --exe rmgpy
endif
test-database:
nosetests -v -d testing/databaseTest.py
eg1: noQM
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 coverage tracking AND profiling"
coverage run rmg.py -p testing/eg2/input.py
coverage report
coverage html
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 coverage tracking AND profiling"
coverage run rmg.py -p testing/eg3/input.py
coverage report
coverage html
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: noQM
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
#########
# Section for setting up MOPAC calculations on the Travis-CI.org server
ifeq ($(TRAVIS),true)
ifneq ($(TRAVIS_SECURE_ENV_VARS),true)
SKIP_MOPAC=true
endif
endif
mopac_travis:
ifeq ($(TRAVIS),true)
ifneq ($(TRAVIS_SECURE_ENV_VARS),true)
@echo "Don't have MOPAC licence key on this Travis build so can't test QM"
else
@echo "Installing MOPAC key"
@yes Yes | mopac $(MOPACKEY)
endif
else
@#echo "Not in Travis build, no need to run this target"
endif
# End of MOPAC / TRAVIS stuff
#######
eg4: all mopac_travis
ifeq ($(SKIP_MOPAC),true)
@echo "Skipping eg4 (without failing) because can't run MOPAC"
else
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
endif