Skip to content

Commit b5a261e

Browse files
committed
add install script for bmcages/odes SUNDIALS bindings
1 parent e3e36cc commit b5a261e

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

bin/install-scikit-odes.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# This script installs the python bindings to SUNDIALS called scikit ODES.
5+
# It requires SUNDIALS 2.6.2 to be installed.
6+
7+
echo "Installing dependencies."
8+
sudo apt-get install python-dev
9+
sudo pip install scipy numpy cython enum34
10+
11+
HERE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
12+
FIDIMAG_DIR="$(dirname "$HERE_DIR")"
13+
LIBS_DIR=${FIDIMAG_DIR}/local
14+
15+
echo "Downloading ODES to "${LIBS_DIR}"."
16+
mkdir -p ${LIBS_DIR}
17+
cd ${LIBS_DIR}
18+
19+
git clone git://github.com/bmcage/odes.git odes
20+
cd odes
21+
22+
# Paths to SUNDIALS are hardcoded in odes/scikits/odes/sundials/setup.py.
23+
# The README recommends to edit that file if you want to change the paths...
24+
25+
sed -i \
26+
"s|LIB_DIRS_SUNDIALS = \[base_path\,|LIB_DIRS_SUNDIALS = [base_path, '${LIBS_DIR}\/lib',|g" \
27+
scikits/odes/sundials/setup.py
28+
29+
python setup.py build
30+
sudo python setup.py install
31+
32+
cd ${HERE_DIR}

bin/install-sundials.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ FIDIMAG_DIR="$(dirname "$HERE_DIR")"
2222
LIBS_DIR=${FIDIMAG_DIR}/local
2323

2424
echo "Will install SUNDIALS to "${LIBS_DIR}" using CC="${CC}"."
25-
mkdir ${LIBS_DIR}
25+
mkdir -p ${LIBS_DIR}
2626
cd ${LIBS_DIR}
2727

2828
download_and_cmake_install() {

0 commit comments

Comments
 (0)