Update documentation #558
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: NEST extension module build | |
on: [push, pull_request, repository_dispatch] | |
jobs: | |
setup: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
cpp_compiler: ["gcc", "clang"] | |
exclude: | |
- cpp_compiler: "clang" | |
os: ubuntu-latest | |
- cpp_compiler: "gcc" | |
os: macos-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout nest-extension-module code | |
uses: actions/checkout@master | |
# Install Python | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
# Install ubuntu dependencies | |
- name: Ubuntu dependencies | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get update | |
sudo apt-get install libltdl-dev libreadline6-dev libncurses5-dev libgsl0-dev python3-all-dev jq pep8 libpcre3 libpcre3-dev python2-dev libboost-all-dev | |
sudo apt-get install openmpi-bin libopenmpi-dev libgsl0-dev tcl8.6 tcl8.6-dev tk8.6-dev | |
sudo apt-get install libboost-filesystem-dev libboost-regex-dev libboost-wave-dev libboost-python-dev libboost-program-options-dev libboost-test-dev | |
# Install mac OS dependencies | |
- name: Mac OS dependencies | |
if: runner.os == 'macOS' | |
run: | | |
brew install coreutils gsl open-mpi automake autoconf libtool | |
# Install python dependencies | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools | |
python -m pip install cython scipy matplotlib numpy pandas | |
# Run the build script | |
- name: Build script | |
run: | | |
# We need to do this, because update-alternatives is not available on MacOS | |
if [ "$xNEST_BUILD_COMPILER" = "CLANG" ]; then | |
export CC=clang-11 | |
export CXX=clang++-11 | |
fi | |
if [ "$(uname -s)" = 'Linux' ]; then | |
CONFIGURE_MPI="-Dwith-mpi=ON" | |
CONFIGURE_OPENMP="-Dwith-openmp=ON" | |
else | |
CONFIGURE_MPI="-Dwith-mpi=OFF" | |
CONFIGURE_OPENMP="-Dwith-openmp=OFF" | |
fi | |
SOURCEDIR=$PWD | |
echo "SOURCEDIR = $SOURCEDIR" | |
cd .. | |
# Install current NEST version. | |
git clone https://github.com/nest/nest-simulator.git | |
cd nest-simulator | |
# Explicitly allow MPI oversubscription. This is required by Open MPI versions > 3.0. | |
# Not having this in place leads to a "not enough slots available" error. | |
NEST_RESULT=result | |
if [ "$(uname -s)" = 'Linux' ]; then | |
NEST_RESULT=$(readlink -f $NEST_RESULT) | |
else | |
NEST_RESULT=$(greadlink -f $NEST_RESULT) | |
fi | |
mkdir "$NEST_RESULT" | |
echo "NEST_RESULT = $NEST_RESULT" | |
mkdir build && cd build | |
cmake \ | |
-Dwith-optimize=ON -Dwith-warning=ON \ | |
$CONFIGURE_MPI \ | |
$CONFIGURE_OPENMP \ | |
-DCMAKE_INSTALL_PREFIX=$NEST_RESULT\ | |
.. | |
VERBOSE=1 make -j 2 | |
make install | |
cd $SOURCEDIR | |
mkdir build && cd build | |
cmake \ | |
-Dwith-optimize=ON -Dwith-warning=ON \ | |
-Dwith-nest=$NEST_RESULT/bin/nest-config \ | |
$CONFIGURE_MPI \ | |
$CONFIGURE_OPENMP \ | |
.. | |
VERBOSE=1 make -j 2 | |
make install | |
. $NEST_RESULT/bin/nest_vars.sh | |
python -c 'import nest; nest.Install("mymodule")' |