Software:Installation

From NEST

(Redirected from Installation)
Jump to: navigation, search

[ Software:Documentation ]

Contents

Introduction

NEST compiles and runs on most Unix-like operating systems including Linux and Mac OS X. For using NEST on Microsoft Windows, see below. The installation instructions here should work on all recent versions of Debian or Ubuntu. For more generic installation instructions, see the files README and INSTALL in the top source directory.

Following are the basic steps to compile and install NEST from source code:

  1. Download NEST
  2. Unpack the tarball: tar -xzvf nest-x.y.z.tar.gz
  3. Create a build directory: mkdir nest-x.y.z-build
  4. Change to the build directory: cd nest-x.y.z-build
  5. Configure NEST: ../nest-x.y.z/configure. Please see the sections on minimal and standard configuration below for details
  6. Compile by running make
  7. Install by running make install
  8. See the Getting started pages to find out how to get going with NEST.

What gets installed where?

By default, everything will be installed to the subdirectories /usr/local/bin, /usr/local/lib and /usr/local/share:

Executables 
$PREFIX/bin
Extension modules 
$PREFIX/lib/nest
SLI libraries 
$PREFIX/share/nest/sli
Documentation 
$PREFIX/share/doc/nest
Examples 
$PREFIX/share/doc/nest/examples
PyNEST 
$PREFIX/lib/pythonX.Y/site-packages/nest
PyNEST examples 
$PREFIX/share/doc/nest/examples/pynest
Extras 
$PREFIX/share/nest/extras/emacs/sli

You can supply a custom prefix using the --prefix=$PREFIX switch for ./configure. In this case, you have to add the installation directory to your search paths. For example, if you are using bash:

export PATH=$PATH:$PREFIX/bin
export PYTHONPATH=$PREFIX/lib/pythonX.Y/site-packages

For Python 2.6 and higher, you have to use

export PATH=$PATH:$PREFIX/bin
export PYTHONPATH=$PREFIX/lib/pythonX.Y/dist-packages

Dependencies

NEST needs a few third party tools and libraries to work. On many operating systems, these can be installed using a package manager like apt, port or fink (see Standard configuration).

If you are building NEST from the SVN sources, you need the GNU autotools installed on your system to bootstrap the build system. These consist of

  • autoconf
  • automake
  • libtool
  • libltdl

The GNU readline library is recommended if you use NEST interactively without Python. Although most Linux distributions have GNU readline installed, you still need to install its development package if want to use GNU readline with NEST.

GNU readline itself depends on libncurses (or libtermcap on older systems). Again, the development packages are needed to compile NEST.

The GNU Scientific Library is needed by several neuron models, in particular those with conductance based synapses. If you want these models, please install the GNU Scientific Library along with its development packages. We strongly recommend that you install/update to GNU Scientific Library v1.11 or later.

If you want to use PyNEST, we recommend to install the following along with their development packages:

Additionally, NEST depends on a few POSIX libraries which are usually present on all UNIX like operating systems (Linux, Mac OS), so don't worry. But if you wonder why NEST is difficult to compile on Windows, it is because of these:

  • libpthread, for threading support
  • libregexp, for regular expressions.

Minimal configuration

NEST can be compiled without any external packages. However, this implies several restrictions: First, some neuron and synapse models will not be available, as they depend on ODE solvers from the GNU scientific library. Second, the Python extension module will not be available, and third, multi-threading and parallel computing facilities will be disabled.

To compile NEST without external packages, use the following command line to configure it:

tar -xzvf nest-x.y.z.tar.gz

mkdir nest-x.y.z-build
cd nest-x.y.z-build

../nest-x.y.z/configure \
    --prefix=$HOME/opt \
    --without-python \
    --without-readline \
    --without-pthread

Standard configuration

To install the packages required for the standard installation use the following command line:

sudo apt-get install build-essential autoconf automake libtool libltdl7-dev \
libreadline5-dev libncurses5-dev libgsl0-dev python-all-dev python-numpy python-scipy \
python-matplotlib ipython 

Then configure NEST using:

 ../nest-x.y.z/configure

Choice of compiler

Caveat: you should compile NEST with the same compiler and version as your Python. Strange crashes have been observed on importing NEST when compiling NEST with g++ 4.3 or later on OS X and importing it into Python compiled with the standard GCC 4.0 compiler.

Most NEST developers use the GNU gcc/g++ compilers. We also regularly compile NEST using the Intel icc/icpc compilers and the IBM xlc/xlC compilers.

You can find the version of your compiler by, e.g.,

 g++ -v

Python displays the compiler used to build it at startup.

Compiler-specific options

NEST is pre-configured with a reasonable set of compiler options for the most common compilers.

When compiling with the Portland compiler, use the -Kieee flag to ensure that computations obey the IEEE754 standard for floating point numerics.

Configuration options

If you need special features, like e.g. support for distributed computing, you can add command line switches to the call to configure. ./configure --help will show you all available options. For more information on the installation of NEST, please see the file INSTALL that is included in the distribution archive.

Mac OS X

Installation

Before you can build NEST under Mac OS X, you need to install the Apple Developer tools from the installation DVD for your Mac (the packages are called XCode and Optional on Snow Leopard / 10.6).

From a tarball

Decide whether you need GSL and SciPy / IPython, if yes, install them from MacPorts or Fink (command below is for MacPorts):

 sudo port install gsl py26-ipython py26-matplotlib py26-scipy 

and follow the generic instructions above to install NEST.

From Subversion checkout

Install libtool from sources or a package manager, such as Fink or MacPorts, then run ./bootstrap.sh to bootstrap the build system (create the ./configure script) and proceed as above.

Discussion

To install NEST on Mac OS X you basically have three options:

  1. Use only tools and libraries provided by Apple (compiler, system libraries, OpenMPI, Python, NumPy)
  2. Use mostly tools provided by Apple and build the rest from source (Python modules etc.)
  3. Use tools provided by third-party package archives (Fink or MacPorts)

Only options (1) and (3) are recommended for non-expert users. Go for (3) if you are already using either of the package archives mentioned above or intending to use additional Python modules. Go for (1) if you want to get started immediately without any extra software (and compile NEST against system OpenMPI, Python & NumPy, although features requiring GSL / SciPy / matplotlib will not work unless you install them yourself).

The most convenient source for GSL and NumPy / SciPy / matplotlib is MacPorts (Fink probably works as well, but we have not tested this). Another source for a complete Python distribution is the Enthought Python Distribution, but we are not testing against it.

Note: as of Mac OS X 10.6 Apple ships glibtool missing libltdl sources, which means that if you want to go for (1) and not use a tarball, but bootstrap the build system from e.g. an SVN checkout, you need to install libtool + libltdl from source (see extras/install_autotools.sh).

Using the correct compiler

We strongly recommend that you use the same compiler version to compile NEST that was used to build Python / OpenMPI. Usually, this will be the system compiler (note: by default, MacPorts compiles using the system compiler). Python displays which compiler it was compiled with at startup.

When compiling NEST with a newer GCC than Python was compiled with, most bets are off, since different GCC versions generate different binary code. PyNEST may then crash Python. Either make sure that gcc and g++ are the system compiler, or force compilation with the system compiler, configure like this (append any other configure options):

../nest-x.y.z/configure CC=/usr/bin/gcc CXX=/usr/bin/g++

Compilation problems

If building NEST with PyNEST and you get an error message like this while compiling PyNEST,

g++ -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g 
-bundle -undefined dynamic_lookup /temp/safari/nest-1.9.8316/pynest/
build/temp.macosx-10.3-fat-2.6/temp/safari/nest-1.9.8316/pynest/

[snip]

nest-1.9.8316/pynest/build/lib.macosx-10.3-fat-2.6/nest/
pynestkernel.so -Wl,-rpath,/usr/local/lib/nest
ld: -rpath can only be used when targeting Mac OS X 10.5 or later
collect2: ld returned 1 exit status
ld: -rpath can only be used when targeting Mac OS X 10.5 or later
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/Sg/SgWx-i0h2RWLn++8ZRFtG+++
+TY/-Tmp-//ccKGzq7b.out (No such file or directory)
error: command 'g++' failed with exit status 1
make[1]: *** [all] Error 1
make: *** [all-recursive] Error 1

please try making NEST as follows:

env MACOSX_DEPLOYMENT_TARGET=10.5 make

Thanks to Harold Gutch for this hint.

MPI

Mac OS X 10.5 and later comes with MPI pre-installed and --with-mpi should work. If you should get an error message like this

libtool: link: /usr/bin/mpicxx -W -Wall -pedantic -Wno-long-long -O0 -g -DNO_UNUSED_SYN -o .libs/nest main.o neststartup.o 
-Wl,-bind_at_load   ../models/.libs/libmodelmodule.a ../precise/.libs/libprecisemodule.a 
/Users/plesser/NEST/code/branches/bluegeneP/bld/topology/.lib s/libtopologymodule.dylib 
/Users/plesser/NEST/code/branches/bluegeneP/bld/developer/.libs/libdevelopermodule.dylib ../nestkernel/.libs/libnest.a 
../librandom/.libs /librandom.a ../libnestutil/.libs/libnestutil.a ../sli/.libs/libsli.a -lcurses -lreadline -lpthread -L/opt/local/lib  
/opt/local/lib/libgsl.dylib /opt/local/lib/libgslcblas.dylib -lm
Undefined symbols:
 "MPI::Comm::Set_errhandler(MPI::Errhandler const&)", referenced from:
     vtable for MPI::Commin main.o
     vtable for MPI::Intracommin main.o
     vtable for MPI::Cartcommin main.o

[snip]

     vtable for MPI::Winin libnestutil.a(libnestutil_la-nest_timemodifier.o)
     vtable for MPI::Winin libnest.a(libnest_la-ring_buffer.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [nest] Error 1

there is most likely a conflict between several MPI installations on your computer, in the example above with OpenMPI from MacPorts. In this case, you need to deactivate/uninstall the conflicting MPI installation. It is unfortunately not trivial to ignore other MPI installations. One brutal work-around is to edit the nest/Makefile, in the build directory and add -L/usr/lib before all other -L options in the line building NEST.

Windows

Windows and Linux differ considerably. This is the reason why it is difficult to compile NEST natively under Windows. However, it is still possible to use NEST under Windows using one of the following methods:

Using the NEST LiveCD

This is the easiest way to use NEST without having to install anything on your computer. The LiveCD can be used in almost any computer and boots directly into a complete Ubuntu system, which already has NEST, Python, and some analysis tools installed. The CD image is available on the download page.

Virtual Machines

A virtual machine is a software that lets you use Linux in parallel to Windows. We recommend to use VirtualBox, which is free software and can be downloaded from http://www.virtualbox.org/. Another popular virtual machine software is http://www.vmware.com/. The easiest way to get started is to download the NEST LiveCD from the download page and either just boot the CD image directly or install it into a virtual hard disk.

Cygwin

Cywin is a software layer which emulates Unix system calls. NEST should compile and install under cygwin with the generic installation instructions. Compilation under Cygwin is very slow, but the execution times are comparable to an equivalent Linux installation.

Views
Personal tools