Skip to content

Commit

Permalink
fix building of NEST on Travis, following merge of nest-3 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Nov 4, 2021
1 parent 5d1154f commit 17e963e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions ci/install_nest.sh
Expand Up @@ -6,38 +6,40 @@ if [ "$TRAVIS_PYTHON_VERSION" == "3.9" ]; then
echo -e "\n========== Installing NEST ==========\n"
# Specify which version of NEST to install
#export NEST_VERSION="master"
export NEST_VERSION="3.0"
export NEST_VERSION="3.1"

pip install cython

if [ "$NEST_VERSION" = "master" ]; then
export NEST="nest-simulator-$NEST_VERSION"
wget https://github.com/nest/nest-simulator/archive/$NEST_VERSION.tar.gz -O $HOME/$NEST.tar.gz;
wget https://github.com/nest/nest-simulator/archive/$NEST_VERSION.tar.gz -O $HOME/$NEST.tar.gz
else
export NEST="nest-simulator-$NEST_VERSION"
wget https://github.com/nest/nest-simulator/archive/v$NEST_VERSION.tar.gz -O $HOME/$NEST.tar.gz;
wget https://github.com/nest/nest-simulator/archive/refs/tags/v$NEST_VERSION.tar.gz -O $HOME/$NEST.tar.gz
fi

pushd $HOME;
tar xzf $NEST.tar.gz;
ls;
popd;
pushd $HOME
tar xzf $NEST.tar.gz
ls
popd

mkdir -p $HOME/build/$NEST
pushd $HOME/build/$NEST
export VENV=`python -c "import sys; print(sys.prefix)"`;
export PYLIB_GLOBAL=`find /opt/python/${TRAVIS_PYTHON_VERSION}/lib/ -name "libpython${TRAVIS_PYTHON_VERSION}*.so"`;
ln -s ${PYLIB_GLOBAL} $VENV/lib/libpython${TRAVIS_PYTHON_VERSION}.so;
export PYTHON_INCLUDE_DIR=$VENV/include/python${TRAVIS_PYTHON_VERSION}

export PYLIB_GLOBAL=`find /opt/python/${TRAVIS_PYTHON_VERSION}/lib/ -name "libpython${TRAVIS_PYTHON_VERSION}*.so"`
ln -s ${PYLIB_GLOBAL} $VENV/lib/libpython${TRAVIS_PYTHON_VERSION}.so
mkdir -p $VENV/include
ln -s /opt/python/${TRAVIS_PYTHON_VERSION}/include/python${TRAVIS_PYTHON_VERSION} $VENV/include/python${TRAVIS_PYTHON_VERSION};

cython --version;
cmake --version;
cmake -DCMAKE_INSTALL_PREFIX=$VENV \
-Dwith-mpi=ON \
-DPYTHON_EXECUTABLE=$VENV/bin/python \
-DCYTHON_EXECUTABLE=$VENV/bin/cython \
-DPYTHON_LIBRARY=$VENV/lib/libpython${TRAVIS_PYTHON_VERSION}.so \
-DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} \
$HOME/$NEST;

make;
make install;
popd;
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -24,7 +24,7 @@ def run_command(path, working_directory):
universal_newlines=True,
cwd=working_directory)
stdout, stderr = p.communicate()
return p.returncode, stdout
return p.returncode, stdout.split("\n")


class build(_build):
Expand Down

0 comments on commit 17e963e

Please sign in to comment.