Skip to content

Commit 32f1bbf

Browse files
authored
Merge pull request #24 from clinssen/fix-3.6
2 parents ca53b07 + 187d8f7 commit 32f1bbf

10 files changed

Lines changed: 255 additions & 345 deletions

File tree

.github/workflows/build.yml

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
os: ubuntu-latest
1515
- cpp_compiler: "gcc"
1616
os: macos-latest
17-
17+
1818
steps:
1919
# Checkout the repository
2020
- name: Checkout nest-extension-module code
@@ -40,7 +40,7 @@ jobs:
4040
if: runner.os == 'macOS'
4141
run: |
4242
brew install coreutils gsl open-mpi automake autoconf libtool
43-
43+
4444
# Install python dependencies
4545
- name: Install Python dependencies
4646
run: |
@@ -50,6 +50,60 @@ jobs:
5050
# Run the build script
5151
- name: Build script
5252
run: |
53-
chmod +x build.sh
54-
set -o pipefail
55-
./build.sh
53+
# We need to do this, because update-alternatives is not available on MacOS
54+
if [ "$xNEST_BUILD_COMPILER" = "CLANG" ]; then
55+
export CC=clang-11
56+
export CXX=clang++-11
57+
fi
58+
59+
if [ "$(uname -s)" = 'Linux' ]; then
60+
CONFIGURE_MPI="-Dwith-mpi=ON"
61+
CONFIGURE_OPENMP="-Dwith-openmp=ON"
62+
else
63+
CONFIGURE_MPI="-Dwith-mpi=OFF"
64+
CONFIGURE_OPENMP="-Dwith-openmp=OFF"
65+
fi
66+
67+
SOURCEDIR=$PWD
68+
echo "SOURCEDIR = $SOURCEDIR"
69+
cd ..
70+
71+
# Install current NEST version.
72+
git clone https://github.com/nest/nest-simulator.git
73+
cd nest-simulator
74+
75+
# Explicitly allow MPI oversubscription. This is required by Open MPI versions > 3.0.
76+
# Not having this in place leads to a "not enough slots available" error.
77+
NEST_RESULT=result
78+
if [ "$(uname -s)" = 'Linux' ]; then
79+
NEST_RESULT=$(readlink -f $NEST_RESULT)
80+
else
81+
NEST_RESULT=$(greadlink -f $NEST_RESULT)
82+
fi
83+
mkdir "$NEST_RESULT"
84+
echo "NEST_RESULT = $NEST_RESULT"
85+
mkdir build && cd build
86+
cmake \
87+
-Dwith-optimize=ON -Dwith-warning=ON \
88+
$CONFIGURE_MPI \
89+
$CONFIGURE_OPENMP \
90+
-DCMAKE_INSTALL_PREFIX=$NEST_RESULT\
91+
..
92+
93+
VERBOSE=1 make -j 2
94+
make install
95+
96+
cd $SOURCEDIR
97+
mkdir build && cd build
98+
cmake \
99+
-Dwith-optimize=ON -Dwith-warning=ON \
100+
-Dwith-nest=$NEST_RESULT/bin/nest-config \
101+
$CONFIGURE_MPI \
102+
$CONFIGURE_OPENMP \
103+
..
104+
105+
VERBOSE=1 make -j 2
106+
make install
107+
108+
. $NEST_RESULT/bin/nest_vars.sh
109+
python -c 'import nest; nest.Install("mymodule")'

README.rst

Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,32 @@
11
NEST Extension Module Example
22
=============================
33

4-
.. attention::
5-
6-
This version of the extension module code will not work with NEST
7-
3.6 or earlier. It is adapted to NEST Master as of 15 December 2023.
8-
94
This repository contains an example extension module (i.e a "plugin") for
105
the `NEST Simulator <https://nest-simulator.org>`_. Extension modules allow
11-
users to extend the functionality of NEST without messing with the source
6+
users to extend the functionality of NEST without altering the source
127
code of NEST itself, thus making pulls from upstream easy, while allowing
138
to extend NEST and sharing the extensions with other researchers.
149

15-
In order to showcase the possibilites of extension modules and their use,
16-
this extension module example contains the following (intentionally simple
17-
and more or less silly) custom example components:
18-
19-
* A **neuron model** called ``pif_psc_alpha``, which implements a
20-
*non*-leaky integrate-and-fire model with alpha-function shaped
21-
post-synaptic potentials.
22-
* A **synapse model** called ``drop_odd_spike_connection``, which drops
23-
all spikes that arrive at odd-numbered points on the simulation time
24-
grid and delivers only those arriving at even-numbered grid points.
25-
* A **connection builder** called ``step_pattern_builder``, which
26-
creates step-pattern connectivity between the neurons of a source
27-
and a target population.
28-
* A **recording backend** called ``RecordingBackendSocket``, which
29-
streams out the data from spike recorders to an external (or local)
30-
server via UDP.
31-
* A **recording backend** called ``RecordingBackendSoundClick``, which
32-
creates the illusion of a realistic sound from an electrophysiological
33-
spike recording device.
34-
35-
For a list of modules developed by other users you can check out the
36-
`list of forks <https://github.com/nest/nest-extension-module/network/members>`_
37-
of this repository.
38-
39-
Adapting ``MyModule``
40-
---------------------
41-
42-
If you want to create your own custom extension module using MyModule
43-
as a start, you have to perform the following steps:
44-
45-
1. Replace all occurences of the strings ``MyModule``, ``mymodule``
46-
and ``my`` by something more descriptive and appropriate for your
47-
module.
48-
2. Remove the example functionality you do not need.
49-
3. Adapt the example functionality you do need to your needs.
10+
For the full documentation of this feature and further instructions, please see
11+
https://nest-extension-module.readthedocs.io/.
12+
13+
.. attention::
14+
15+
Please note that the code in this repository will not work with NEST
16+
versions earlier than NEST 3.10. The extension module is generally
17+
kept adapted and up-to-date with the NEST ``master`` branch on
18+
https://github.com/nest/nest-simulator as well as the latest
19+
NEST release (starting from NEST 3.10).
20+
21+
For extension modules that support older versions of NEST, please browse
22+
the history of this repository. For support for 2.x versions of NEST, see
23+
the extension module example in ``examples/MyModule`` of the source
24+
distribution.
25+
26+
27+
License
28+
-------
29+
30+
NEST is open source software and is licensed under the `GNU General Public
31+
License v2 <https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html>`_ or
32+
later.

build.sh

Lines changed: 0 additions & 89 deletions
This file was deleted.

doc/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,3 @@ def setup(app):
177177
(master_doc, 'NESTextmod.tex', u'NEST Simulator extension module documentation',
178178
u'NEST Developer Community', 'manual'),
179179
]
180-
181-
copyfile('../README.rst', 'README.rst')

0 commit comments

Comments
 (0)