-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyxify.sh
executable file
·39 lines (31 loc) · 1007 Bytes
/
pyxify.sh
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
#!/bin/sh
# files part of the distribution:
#
# fileformat.py monitor.py relink.py wireformat.py opdata.py profile.py trajectory.py
# grasp.pyx op.pyx gop.pyx toptw.pyx mctoptw.pyx tdop.pyx
# loader.py pyxify.sh setup.py
# op.pxd toptw.pxd
#
# compile: python setup.py build_ext --inplace
#
PYFILES="fileformat.py monitor.py relink.py wireformat.py opdata.py profile.py trajectory.py"
PROF_FILES="grasp.pyx op.pyx gop.pyx toptw.pyx mctoptw.pyx tdop.pyx"
PROF=$1
if [ "X${PROF}" = "X-p" ]; then
echo "Enabling profiling for Cython."
fi
for fn in ${PYFILES}; do
if [ "X${PROF}" = "X-p" ]; then
sed "s/# cython: profile=False/# cython: profile=True/" < ${fn} > ${fn}x
else
cp ${fn} ${fn}x
fi
done
for fn in ${PROF_FILES}; do
if [ "X${PROF}" = "X-p" ]; then
sed -ibak "s/# cython: profile=False/# cython: profile=True/" ${fn}
else
sed -ibak "s/# cython: profile=True/# cython: profile=False/" ${fn}
fi
done
echo "Done, run 'python setup.py build_ext --inplace' to compile"