forked from python-hydro/pyro2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmk.sh
executable file
·34 lines (28 loc) · 920 Bytes
/
mk.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
#!/bin/bash
# this script builds the shared-object libraries that interface
# Fortran with python for some lower-level pyro routines. f2py is
# used.
#
# use `./mk.sh clean` to clear all the build files
#
# set the python interpreter to use. If no PYTHON variable is
# set, then default to python3. You can use python2, for example,
# by doing:
# PYTHON=python2 ./mk.sh
: ${PYTHON:=python3}
if [ "$1" == "clean" ]; then
rm -rf mesh/*.so
rm -rf incompressible/*.so
rm -rf compressible/*.so
rm -rf lm_atm/*.so
find . -name "*.pyc" -exec rm -f {} \;
find . -type d -name "__pycache__" -exec rm -rf {} \;
find . -type d -name "build" -exec rm -rf {} \;
else
if [ "$1" == "debug" ]; then
FFLAGS="-fbounds-check -fbacktrace -Wuninitialized -Wunused -ffpe-trap=invalid -finit-real=snan"
else
FFLAGS="-C"
fi
${PYTHON} setup.py config_fc --f90flags "${FFLAGS}" build_ext
fi