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 eb9e005
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 13 deletions.
55 changes: 43 additions & 12 deletions ci/install_nest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,69 @@ 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}

# echo -e "-- ls /opt/python/3.9/lib"
# ls -l /opt/python/3.9/lib;
# echo -e "-- ls $VENV/lib"
# ls -l $VENV/lib;
# echo -e "-- ls /opt/python/3.9/include/python3.9"
# ls /opt/python/3.9/include/python3.9;
# echo -e "-- ls /opt/python/3.9 -- /opt/python/3.9/include"
# ls /opt/python/3.9/
# ls /opt/python/3.9/include

# ln -s /opt/python/3.9/lib/libpython3.9.so $VENV/lib/libpython3.9.so;
# ls -l $VENV/lib/libpython3.9.so
# mkdir -p $VENV/include
# ln -s /opt/python/3.9/include/python3.9 $VENV/include/python3.9;
# ls -l $VENV/include/;
# #export PYTHON_INCLUDE_DIR=$VENV/include/python3.9;
# export PYTHON_INCLUDE_DIR=/opt/python/3.9/include/python3.9

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;
# -DPYTHON_LIBRARY=$VENV/lib/libpython${TRAVIS_PYTHON_VERSION}.so \
# -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} \
# -DPYTHON_INCLUDE_DIR2=${PYTHON_INCLUDE_DIR} \
# $HOME/$NEST;

#cat /home/travis/build/nest-simulator-3.1/CMakeFiles/CMakeOutput.log
#cat /home/travis/build/nest-simulator-3.1/CMakeFiles/CMakeError.log

#if [ $error ]
#then
# exit -1
#fi
make;
make install;
popd;
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
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 eb9e005

Please sign in to comment.