Skip to content

Commit 612ec51

Browse files
author
David Kappel
committed
added requirements.txt and updated REAMDE.md
1 parent c0cbd8d commit 612ec51

File tree

3 files changed

+172
-5
lines changed

3 files changed

+172
-5
lines changed

README.md

Lines changed: 164 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ for communication with other software components.
1717

1818
## Quick Installation Guide
1919

20-
SPORE requires NEST installed with MUSIC (`-Dwith-music=ON`) and Python bindings. Please make sure your version of NEST corresponds to or is newer than revision
21-
[58fd190f5e4](https://github.com/nest/nest-simulator/commit/58fd190f5e404f1e3e822c0d3915e2321d102ed5).
22-
A detailed installation guide that also shows how to set up the dependencies is provided on the [SPORE wiki page](https://github.com/IGITUGraz/spore-nest-module/wiki).
20+
SPORE requires NEST installed with MUSIC (`-Dwith-music=ON`) and Python bindings. Please make sure your version of NEST corresponds to or is newer than version 2.14.
21+
A detailed installation guide that also shows how to set up the dependencies is provided below and on the [SPORE wiki page](https://github.com/IGITUGraz/spore-nest-module/wiki).
2322

2423
```bash
2524
git clone https://github.com/IGITUGraz/spore-nest-module
@@ -31,6 +30,168 @@ make install
3130
make test
3231
```
3332

33+
## Detailed Installation Guide
34+
35+
This guide describes how to install the SPORE module in version 2.14 for the NEST simulator in version 2.14. Combinining this version of SPORE with other versions of NEST may work but has not been tested.
36+
We used MUSIC version 1.1.15 in revision [8e0a609b298](https://github.com/INCF/MUSIC/commit/8e0a609b29835be604ae556c1592aad9b4be1827) and [MPI](https://www.open-mpi.org/) (Open MPI 1.6.5).
37+
Furthermore we need python with the packages `pyzmq`, `numpy`, `ujson` and `matplotlib`.
38+
A guide to install these dependencies is provided below.
39+
Finally we used SPORE ([version 2.14](https://github.com/IGITUGraz/spore-nest-module/releases/tag/v2.14.0), or later).
40+
The installation procedure was tested on Debian GNU/Linux 8.7 (jessie).
41+
42+
This guide assumes that you want to install everything into your local home folder `$HOME/opt/`.
43+
It is further assumed that you checkout the software into a local folder that is used for development,
44+
which we refer to as `devel` folder.
45+
46+
### Preparation
47+
48+
Add the following lines to your `~/.bashrc` (or `~/.zshrc` or `~/.profile` etc.)
49+
50+
```bash
51+
export TARGET_DIR=$HOME/opt/
52+
export PATH=$PATH:$TARGET_DIR/bin
53+
export LIBRARY_PATH=$LIBRARY_PATH:$TARGET_DIR/lib
54+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TARGET_DIR/lib
55+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TARGET_DIR/lib/nest # required in some cases
56+
export PYTHONPATH=$PYTHONPATH:$TARGET_DIR/lib/python2.7/site-packages
57+
export PYTHONPATH=$PYTHONPATH:$TARGET_DIR/lib64/python2.7/site-packages
58+
export LD_PRELOAD=/usr/lib/openmpi/lib/libmpi.so # required in some cases
59+
export NUM_CORES=3 # number of CPU cores
60+
61+
```
62+
63+
Now run `source ~/.bashrc` or close the current terminal now and start a new session such that the changes get applied.
64+
65+
Now install all dependencies (for Debian Jessie).
66+
67+
**Notes:**
68+
69+
* Use `pip install --user <package name>` to install the python packages locally.
70+
* Use `sudo pip install <package name>` to install the python packages globally.
71+
* The python packages can also be installed in a [virtualenv](https://virtualenv.pypa.io/en/stable/).
72+
* For python3, use `pip3` to install python packages and install the python3 versions of the packages for NEST dependencies.
73+
* The use of multiple different python3 versions is discouraged.
74+
Make sure to consistently use *one* version for installing libraries and actually running experiments.
75+
When installing MUSIC, the specification of the precise executable (e.g. `python3.4`), rather than `python3`,
76+
may be necessary in ambigous cases (see [#9](https://github.com/IGITUGraz/spore-nest-module/issues/9)).
77+
78+
```bash
79+
# For NEST and MUSIC
80+
apt-get install build-essential cmake
81+
apt-get install python python-dev python-pip
82+
apt-get install libreadline-dev gsl-bin libgsl0-dev libncurses5-dev openmpi-bin
83+
84+
apt-get install automake libtool # BUILD Dependencies
85+
apt-get install libopenmpi-dev libopenmpi1.6 # RUN Dependencies
86+
apt-get install freeglut3-dev # Optional, for viewevents
87+
pip install cython
88+
pip install mpi4py # RUN Dependencies
89+
90+
# For SPORE
91+
apt-get install libzmq3 # For realtime plotting
92+
pip install pyzmq # For real-time plotting
93+
pip install numpy # For testing
94+
pip install ujson
95+
pip install --upgrade matplotlib # (Optional, If you want to have nice plotting, you should upgrade `matplotlib` to the newest version)
96+
```
97+
98+
99+
### Installing MUSIC
100+
101+
In your `devel` folder, check out the latest version of MUSIC from https://github.com/INCF/MUSIC
102+
103+
```bash
104+
git clone https://github.com/INCF/MUSIC.git
105+
```
106+
107+
Note that at the moment `--disable-isend` is required because
108+
of a [critical problem](https://github.com/INCF/MUSIC/issues/35#issuecomment-280332573)
109+
in the MUSIC scheduler.
110+
111+
In the folder `./MUSIC/` :
112+
113+
```bash
114+
./autogen.sh
115+
PYTHON=/usr/bin/python ./configure --prefix=$TARGET_DIR --disable-isend # Replace with python3[.x] if desired
116+
make -j$NUM_CORES
117+
make install
118+
```
119+
120+
### Installing NEST
121+
122+
In your `devel` folder, check out the latest version of NEST from https://github.com/nest/nest-simulator
123+
124+
```bash
125+
# use the latest developmental version of NEST. Release versions don't currently work with SPORE
126+
git clone https://github.com/nest/nest-simulator.git
127+
```
128+
Then in the folder `./nest-simulator` :
129+
130+
```bash
131+
mkdir build
132+
cd build/
133+
cmake -DCMAKE_INSTALL_PREFIX:PATH=$TARGET_DIR -Dwith-music=ON -Dwith-mpi=ON -Dwith-python=2 .. # Change python version to 3 for Python 3
134+
make -j$NUM_CORES
135+
make install
136+
```
137+
138+
### Installing SPORE
139+
140+
In your `devel` folder, check out the latest version of SPORE from https://github.com/IGITUGraz/spore-nest-module
141+
142+
```bash
143+
git clone https://github.com/IGITUGraz/spore-nest-module.git
144+
```
145+
146+
Then in the folder `./spore-nest-module` :
147+
148+
```bash
149+
mkdir build
150+
cd build/
151+
cmake -Dwith-python=2 .. # Change python version to 3 for Python 3, or provide a path to a python binary
152+
make -j$NUM_CORES
153+
make install
154+
make test
155+
```
156+
157+
In `ipython` (or `ipython3`) running `import nest` and then `nest.Install("sporemodule")` should now yield the following:
158+
159+
```
160+
In [1]: import nest
161+
[INFO] [.../rng_manager.cpp:238 @ Network::create_rngs_] : Creating default RNGs
162+
[INFO] [.../rng_manager.cpp:233 @ Network::create_rngs_] : Deleting existing random number generators
163+
[INFO] [.../rng_manager.cpp:238 @ Network::create_rngs_] : Creating default RNGs
164+
[INFO] [.../rng_manager.cpp:284 @ Network::create_grng_] : Creating new default global RNG
165+
166+
-- N E S T --
167+
168+
Copyright (C) 2004 The NEST Initiative
169+
Version 2.14.0 Oct 30 2017 13:06:41
170+
171+
This program is provided AS IS and comes with
172+
NO WARRANTY. See the file LICENSE for details.
173+
174+
Problems or suggestions?
175+
Visit http://www.nest-simulator.org
176+
177+
Type 'nest.help()' to find out more about NEST.
178+
179+
In [2]: nest.Install("sporemodule")
180+
181+
Oct 31 13:26:30 Install [Info]:
182+
loaded module SPORE (version 2.14.0)
183+
```
184+
185+
## Running a first experiment
186+
187+
That should be it.
188+
189+
Now you should be able to execute the script [`experiment.py`](https://github.com/IGITUGraz/spore-nest-module/blob/master/examples/pattern_matching_showcase/experiment.py) in
190+
191+
`spore-nest-module/examples/pattern_matching_showcase`.
192+
193+
194+
34195
## License
35196

36197
SPORE is open source software and is licensed under the [GNU General Public

requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
cython
2+
mpi4py
3+
pyzmq
4+
numpy
5+
ujson
6+
matplotlib

src/synaptic_sampling_rewardgradient_connection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ void SynapticSamplingRewardGradientCommonProperties::get_status(DictionaryDatum&
114114
*/
115115
void SynapticSamplingRewardGradientCommonProperties::set_status(const DictionaryDatum& d, nest::ConnectorModel& cm)
116116
{
117-
nest::CommonSynapseProperties::set_status(d, cm);
118-
119117
CheckParameters p_check( d );
120118
define_parameters < CheckParameters > ( p_check, *this );
121119

@@ -132,6 +130,8 @@ void SynapticSamplingRewardGradientCommonProperties::set_status(const Dictionary
132130
reward_transmitter_ = new_reward_transmitter;
133131
}
134132

133+
nest::CommonSynapseProperties::set_status(d, cm);
134+
135135
SetStatus p_set( d );
136136
define_parameters < SetStatus > ( p_set, *this );
137137
}

0 commit comments

Comments
 (0)