Skip to content

Commit c38428a

Browse files
Merge pull request #3 from nest/master
Remove _t from datatypes
2 parents ffcb78c + df5722f commit c38428a

File tree

250 files changed

+4216
-3791
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+4216
-3791
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ set( NEST_USER_EMAIL "nest_user@nest-initiative.org" )
2828

2929
# VERSION exported to libnestutil/config.h, extras/create_release.sh
3030
set( NEST_VERSION_MAJOR 2 )
31-
set( NEST_VERSION_MINOR 10 )
31+
set( NEST_VERSION_MINOR 11 )
3232
set( NEST_VERSION_PATCHLEVEL 0 )
3333

3434
set( NEST_VERSION_VERSION "${NEST_VERSION_MAJOR}.${NEST_VERSION_MINOR}.${NEST_VERSION_PATCHLEVEL}" )

INSTALL

Lines changed: 140 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ http://www.nest-simulator.org/installation
55
Introduction
66
============
77

8-
NEST is installed with cmake (at least v2.8.12). In the simplest case, the commands
8+
NEST is installed with `cmake` (at least v2.8.12). In the simplest case, the commands
99

1010
cmake -DCMAKE_INSTALL_PREFIX:PATH=</install/path> </path/to/NEST/src>
1111
make
@@ -14,6 +14,12 @@ NEST is installed with cmake (at least v2.8.12). In the simplest case, the comma
1414
should build and install NEST to <install-path>. Detailed installation
1515
instructions can be found below.
1616

17+
Choice of CMake Version
18+
=======================
19+
20+
We recommend to use `cmake` v3.4, even though installing NEST with
21+
`cmake` v2.8.12 will in most cases work properly.
22+
For more detailed information please see below: `Python3 Binding (PyNEST)`
1723

1824
Choice of compiler
1925
==================
@@ -72,11 +78,12 @@ Set default libraries:
7278
-Dwith-readline=[OFF|ON|</path/to/readline>] Find a GNU Readline library. To set
7379
a specific library, set install path.
7480
[default=ON]
75-
-Dwith-ltdl=[OFF|ON|</path/to/ltdl>] Find a ltdl library. To set a specific
76-
ltdl, set install path.
77-
[default=ON]
78-
-Dwith-python=[OFF|ON|</path/to/python>] Build PyNEST. To set a specific Python,
79-
set install path. [default=ON]
81+
-Dwith-ltdl=[OFF|ON|</path/to/ltdl>] Find an ltdl library. To set a specific
82+
ltdl, set install path. NEST uses the
83+
ltdl for dynamic loading of external
84+
user modules. [default=ON]
85+
-Dwith-python=[OFF|ON|2|3] Build PyNEST. To set a specific Python
86+
version, set 2 or 3. [default=ON]
8087
-Dcythonize-pynest=[OFF|ON] Use Cython to cythonize pynestkernel.pyx.
8188
If OFF, PyNEST has to be build from
8289
a pre-cythonized pynestkernel.pyx.
@@ -85,13 +92,13 @@ Set default libraries:
8592
Change compilation behavior:
8693

8794
-Dstatic-libraries=[OFF|ON] Build static executable and libraries. [default=OFF]
88-
-Dwith-optimize=[OFF|ON|<list;off;flags>] Enable user defined optimizations. Separate
95+
-Dwith-optimize=[OFF|ON|<list;of;flags>] Enable user defined optimizations. Separate
8996
multiple flags by ';'.
9097
[default OFF, when ON, defaults to '-O3']
91-
-Dwith-warning=[OFF|ON|<list;off;flags>] Enable user defined warnings. Separate
98+
-Dwith-warning=[OFF|ON|<list;of;flags>] Enable user defined warnings. Separate
9299
multiple flags by ';'.
93100
[default ON, when ON, defaults to '-Wall']
94-
-Dwith-debug=[OFF|ON|<list;off;flags>] Enable user defined debug flags. Separate
101+
-Dwith-debug=[OFF|ON|<list;of;flags>] Enable user defined debug flags. Separate
95102
multiple flags by ';'.
96103
[default OFF, when ON, defaults to '-g']
97104
-Dwith-libraries=<list;of;libraries> Link additional libraries. Give full path.
@@ -115,34 +122,77 @@ Configuring NEST for Distributed Simulation with MPI
115122
-DMPI_C_COMPILER=myC_CompilerWrapper -Dwith-mpi=ON
116123
4. Sorry, you need to fix your MPI installation.
117124

118-
119125
Disabling the Python Bindings (PyNEST)
120126
======================================
121127

122128
Please see also the file pynest/README.md in the documentation directory. If you
123129
are impatient, use
124130

125-
--Dwith-python=OFF
131+
-Dwith-python=OFF
132+
133+
as an argument to `cmake`.
134+
135+
Python3 Binding (PyNEST)
136+
=========================
137+
138+
To force a Python3-binding in a mixed Python2/3 environment pass
139+
140+
-Dwith-python=3
141+
142+
as an argument to `cmake`.
126143

127-
as argument to `cmake`.
144+
`cmake` usually autodetects your Python installation.
145+
In some cases `cmake` might not be able to localize the Python interpreter
146+
and its corresponding libraries correctly. To circumvent such a problem following
147+
`cmake` built-in variables can be set manually and passed to `cmake`:
128148

149+
PYTHON_EXECUTABLE ..... path to the Python interpreter
150+
PYTHON_LIBRARY ........ path to libpython
151+
PYTHON_INCLUDE_DIR .... two include ...
152+
PYTHON_INCLUDE_DIR2 ... directories
153+
154+
e.g.: Please note `-Dwith-python=ON` is the default.
155+
cmake -DCMAKE_INSTALL_PREFIX=</install/path> \
156+
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
157+
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.4m.so \
158+
-DPYTHON_INCLUDE_DIR=/usr/include/python3.4 \
159+
-DPYTHON_INCLUDE_DIR2=/usr/include/x86_64-linux-gnu/python3.4m \
160+
</path/to/NEST/src>
129161

130162
Compiling for BlueGene/Q
131163
========================
132164

133165
NEST provides a cmake tool-chain file for cross compilation for BlueGene/Q. When
134166
configuring NEST use the following `cmake` line:
135167

136-
cmake -DCMAKE_TOOLCHAIN_FILE=Platform/BlueGeneQ_XLC
137-
-DCMAKE_INSTALL_PREFIX:PATH=</install/path>
138-
-Dwith-python=OFF
139-
-Dstatic-libraries=ON
168+
cmake -DCMAKE_TOOLCHAIN_FILE=Platform/BlueGeneQ_XLC \
169+
-DCMAKE_INSTALL_PREFIX:PATH=</install/path> \
170+
-Dwith-python=OFF \
171+
-Dstatic-libraries=ON \
140172
</path/to/NEST/src>
141173

142-
It is recommended to build statically on larger BlueGene/Q systems. If you need
143-
PyNEST on BlueGene/Q, you have to compile dynamically, i.e. `-Dstatic-libraries=OFF`
144-
and you have to cythonize the `pynest/pynestkernel.pyx/.pxd`
145-
on a machine with Cython installed:
174+
If you compile dynamically, be aware that the BlueGene/Q system might not provide an `ltdl`
175+
library. If you want to dynamically load an external user module, you have to
176+
compile and install an `ltdl` yourself and add `-Dwith-ltdl=<ltdl-install-dir>`
177+
to the `cmake` line. Otherwise add `-Dwith-ltdl=OFF`.
178+
179+
Additionally, the design of `cmake`'s MPI handling has a broken design, which is
180+
brittle in the case of BGQ and certain libraries (flags to use SIONlib, for example).
181+
182+
If you run into that, you must force `cmake` to use the wrappers rather than
183+
it's attempts to extract the proper flags for the underlying compiler
184+
as in:
185+
```
186+
-DCMAKE_C_COMPILER=/bgsys/drivers/ppcfloor/comm/xl/bin/mpixlc_r
187+
-DCMAKE_CXX_COMPILER=/bgsys/drivers/ppcfloor/comm/xl/bin/mpixlcxx_r
188+
```
189+
190+
BlueGene/Q and PyNEST
191+
---------------------
192+
193+
Building PyNEST on BlueGene/Q requires you to compile dynamically, i.e.
194+
`-Dstatic-libraries=OFF`. Further, you have to cythonize the
195+
`pynest/pynestkernel.pyx/.pyx` on a machine with Cython installed:
146196

147197
cythonize pynestkernel.pyx
148198

@@ -151,20 +201,66 @@ BlueGene/Q and point `-Dwith-python=<...>` to a valid python version for cross
151201
compilation:
152202

153203
-Dwith-python=/bgsys/tools/Python-2.7/bin/hostpython
154-
155-
Eventually, you also have to specify `PYTHON_LIBRARY` and `PYTHON_INCLUDE_DIR`,
156-
if the they are not found, e.g.:
157-
158-
-DPYTHON_LIBRARY=/bgsys/tools/Python-2.7/lib64/libpython2.7.so.1.0
159-
-DPYTHON_INCLUDE_DIR=/bgsys/tools/Python-2.7/include/python2.7
204+
or (much better)
205+
-Dwith-python=/bgsys/local/python3/3.4.2/bin/python3
206+
207+
CMake <3.4 is buggy about finding the matching libraries (for many years).
208+
Thus, you also have to specify `PYTHON_LIBRARY` and `PYTHON_INCLUDE_DIR`
209+
if they are not found OR the incorrect libraries are found, e.g.:
210+
211+
```
212+
-DPYTHON_LIBRARY=/bgsys/tools/Python-2.7/lib64/libpython2.7.so.1.0
213+
-DPYTHON_INCLUDE_DIR=/bgsys/tools/Python-2.7/include/python2.7
214+
```
215+
or (much better)
216+
```
217+
-DPYTHON_LIBRARY=/bgsys/local/python3/3.4.2/lib/libpython3.4m.a
218+
-DPYTHON_INCLUDE_DIR=/bgsys/local/python3/3.4.2/include/python3.4m
219+
```
220+
221+
A complete `cmake` line for PyNEST could look like this:
222+
```
223+
module load gsl
224+
225+
cmake -DCMAKE_TOOLCHAIN_FILE=Platform/BlueGeneQ_XLC \
226+
-DCMAKE_INSTALL_PREFIX=</install/path> \
227+
-Dstatic-libraries=OFF \
228+
-Dcythonize-pynest=OFF \
229+
-DCMAKE_C_COMPILER=/bgsys/drivers/ppcfloor/comm/xl/bin/mpixlc_r \
230+
-DCMAKE_CXX_COMPILER=/bgsys/drivers/ppcfloor/comm/xl/bin/mpixlcxx_r \
231+
-Dwith-python=/bgsys/local/python3/3.4.2/bin/python3 \
232+
-DPYTHON_LIBRARY=/bgsys/local/python3/3.4.2/lib/libpython3.4m.a \
233+
-DPYTHON_INCLUDE_DIR=/bgsys/local/python3/3.4.2/include/python3.4m \
234+
-Dwith-ltdl=OFF \
235+
<nest-src>
236+
```
160237

161238
Further, for running PyNEST, make sure all python dependencies are installed and
162239
environment variables are set properly:
163-
164-
# adds PyNEST to the PYTHONPATH
165-
source <nest-install-dir>/bin/nest_vars.sh
166-
# makes HOME and PYTHONPATH available for python
167-
runjob --exp-env HOME --exp-env PYTHONPATH ... : python script.py
240+
```
241+
module load python3/3.4.2
242+
243+
# adds PyNEST to the PYTHONPATH
244+
source <nest-install-dir>/bin/nest_vars.sh
245+
246+
# makes HOME and PYTHONPATH available for python
247+
runjob \
248+
--exp-env HOME \
249+
--exp-env PATH \
250+
--exp-env LD_LIBRARY_PATH \
251+
--exp-env PYTHONUNBUFFERED \
252+
--exp-env PYTHONPATH \
253+
... \
254+
: /bgsys/local/python3/3.4.2/bin/python3.4 script.py
255+
```
256+
257+
BlueGene/Q and GCC
258+
------------------
259+
260+
Compiling NEST with GCC (`-DCMAKE_TOOLCHAIN_FILE=Platform/BlueGeneQ_GCC`)
261+
might require you to use a GSL library compiled using GCC, otherwise undefined
262+
symbols break your build. After the GSL is built with GCC and installed in
263+
<gsl-install-dir>, add `-Dwith-gsl=<gsl-install-dir>` to the `cmake` line.
168264

169265
Compiling for Fujitsu Sparc64
170266
=============================
@@ -189,25 +285,25 @@ On the K Computer:
189285
tar -xzf gsl-2.1.tar.gz
190286
mkdir gsl-2.1.build gsl-2.1.install
191287
cd gsl-2.1.build
192-
../gsl-2.1/configure --prefix=$PWD/../gsl-2.1.install/
193-
CC=mpifccpx
194-
CXX=mpiFCCpx
195-
CFLAGS="-Nnoline"
196-
CXXFLAGS="--alternative_tokens -O3 -Kfast,openmp, -Nnoline, -Nquickdbg -NRtrap"
197-
--host=sparc64-unknown-linux-gnu
288+
../gsl-2.1/configure --prefix=$PWD/../gsl-2.1.install/ \
289+
CC=mpifccpx \
290+
CXX=mpiFCCpx \
291+
CFLAGS="-Nnoline" \
292+
CXXFLAGS="--alternative_tokens -O3 -Kfast,openmp, -Nnoline, -Nquickdbg -NRtrap" \
293+
--host=sparc64-unknown-linux-gnu \
198294
--build=x86_64-unknown-linux-gnu
199295
gmake -j4
200296
gmake install
201297

202298
To install NEST, use the following `cmake` line:
203299

204-
cmake -DCMAKE_TOOLCHAIN_FILE=Platform/Fujitsu-Sparc64
205-
-DCMAKE_INSTALL_PREFIX:PATH=</install/path>
206-
-Dwith-gsl=/path/to/gsl-2.1.install/\
207-
-Dwith-optimize="-Kfast"
208-
-Dwith-defines="-DUSE_PMA"
209-
-Dwith-python=OFF
210-
-Dwith-warning=OFF
300+
cmake -DCMAKE_TOOLCHAIN_FILE=Platform/Fujitsu-Sparc64 \
301+
-DCMAKE_INSTALL_PREFIX:PATH=</install/path> \
302+
-Dwith-gsl=/path/to/gsl-2.1.install/ \
303+
-Dwith-optimize="-Kfast" \
304+
-Dwith-defines="-DUSE_PMA" \
305+
-Dwith-python=OFF \
306+
-Dwith-warning=OFF \
211307
</path/to/NEST/src>
212308
make -j4
213309
make install

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ Here is a suitable BibTeX entry:
140140
}
141141
```
142142

143+
If you use NEST v2.8.0, please cite it as `Eppler, Jochen Martin et al. (2015).
144+
NEST 2.8.0. Zenodo. 10.5281/zenodo.32969`. The full citation is available in
145+
different formats on [Zenodo](http://dx.doi.org/10.5281/zenodo.32969).
146+
143147
For all other versions below NEST v2.8.0 please use: [Gewaltig M-O & Diesmann M
144148
(2007) NEST (Neural Simulation Tool) Scholarpedia
145149
2(4):1430](http://www.scholarpedia.org/article/NEST_(Neural_Simulation_Tool)).

cmake/Platform/BlueGeneQ_XLC.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -qarch=qp -qtune=qp -DNDEBUG" CACHE
3535
set( OpenMP_C_FLAGS "-qsmp=omp" CACHE STRING "Compiler flag for OpenMP parallelization" FORCE )
3636
set( OpenMP_CXX_FLAGS "-qsmp=omp" CACHE STRING "Compiler flag for OpenMP parallelization" FORCE )
3737

38-
set( with-warning "-qinfo=all" CACHE STRING "Enable user defined warnings. [default ON, when ON, defaults to '-Wall']" FORCE )
38+
set( with-warning "-qinfo=all" CACHE STRING "Enable user defined warnings. [default ON, when ON, defaults to '-Wall']" )
3939

4040
if ( static-libraries )
4141
__bluegeneq_setup_static( XL CXX )

cmake/ProcessOptions.cmake

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,21 +338,26 @@ endfunction()
338338
function( NEST_PROCESS_WITH_PYTHON )
339339
# Find Python
340340
set( HAVE_PYTHON OFF PARENT_SCOPE )
341-
if ( with-python )
342-
if ( NOT ${with-python} STREQUAL "ON" )
343-
# a path is set
344-
set( PYTHON_EXECUTABLE ${with-python} )
341+
if ( ${with-python} STREQUAL "ON" OR ${with-python} STREQUAL "2" OR ${with-python} STREQUAL "3" )
342+
343+
# Localize the Python interpreter
344+
if ( ${with-python} STREQUAL "ON" )
345+
find_package( PythonInterp )
346+
elseif ( ${with-python} STREQUAL "2" )
347+
find_package( PythonInterp 2 REQUIRED )
348+
elseif ( ${with-python} STREQUAL "3" )
349+
find_package( PythonInterp 3 REQUIRED )
345350
endif ()
346351

347-
find_package( PythonInterp )
348352
if ( PYTHONINTERP_FOUND )
349353
set( PYTHONINTERP_FOUND "${PYTHONINTERP_FOUND}" PARENT_SCOPE )
350354
set( PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} PARENT_SCOPE )
351355
set( PYTHON ${PYTHON_EXECUTABLE} PARENT_SCOPE )
352356
set( PYTHON_VERSION ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} PARENT_SCOPE )
353357

354-
# need python lib and header...
355-
find_package( PythonLibs )
358+
# Localize Python lib/header files and make sure that their version matches
359+
# the Python interpreter version !
360+
find_package( PythonLibs ${PYTHON_VERSION_STRING} EXACT )
356361
if ( PYTHONLIBS_FOUND )
357362
set( HAVE_PYTHON ON PARENT_SCOPE )
358363
# export found variables to parent scope
@@ -377,10 +382,12 @@ function( NEST_PROCESS_WITH_PYTHON )
377382
set( CYTHON_VERSION "${CYTHON_VERSION}" PARENT_SCOPE )
378383
endif ()
379384
endif ()
380-
381385
set( PYEXECDIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages" PARENT_SCOPE )
382386
endif ()
383387
endif ()
388+
elseif ( ${with-python} STREQUAL "OFF" )
389+
else ()
390+
message( FATAL_ERROR "Invalid option: -Dwith-python=" ${with-python} )
384391
endif ()
385392
endfunction()
386393

0 commit comments

Comments
 (0)