Auryn simulator

Simulator for spiking neural networks with synaptic plasticity

User Tools

Site Tools


manual:compileauryn

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
manual:compileauryn [2016/06/01 16:52] zenkemanual:compileauryn [2022/08/19 09:24] (current) – [Building Auryn from source] Remove forum link zenke
Line 1: Line 1:
-{{ :manual:auryn_compilation_legend.jpg?400 |Image adapted by Alex Seeholzer, 2016}}+{{ :manual:auryn_compilation_legend.jpg?400 |Image illustration by Larry Ellmore for [[http://www.goodreads.com/book/show/878973.Pillars_of_Pentegarn|Pillars of pentegarn]], adapted by Alex Seeholzer, 2016}}
  
 In most cases, compiling Auryn is hardly going to be that difficult, but there are a few things to keep in mind.  In most cases, compiling Auryn is hardly going to be that difficult, but there are a few things to keep in mind. 
Line 9: Line 9:
  
  
-===== Meeting the preliminaries =====+===== Requirements =====
  
-Apart from a standard C++ build environment you will need to meet certain requirements. Auryn currently depends on the [[http://www.boost.org/|Boost libraries]] and on an MPI implementation (for parallel computation). Note, that even if you do not need parallel processing, the current code base still requires you to compile against it. I am planning to change that in the foreseeable future, but it hasn't been done yet. See [[required libraries]] for more details.+Apart from a standard C++ build environment you will need the [[http://www.boost.org/|Boost libraries]] and a working MPI implementation. See [[required libraries]] for more details. To get the code, I recommend ''git'' and, finally, to build the binaries I recommend ''cmake''
 +With these preliminaries met, you can proceed as follows.
  
 +==== Getting the source with git ====
 +First clone Auryn's repository
 +<code>
 +git clone https://github.com/fzenke/auryn.git
 +</code>
 +This will create a new directory ''./auryn'' with the source code.
  
-===== Getting the source ===== 
  
-Download the most recent [[https://github.com/fzenke/auryn/|development version]] or the [[https://github.com/fzenke/auryn/releases|latest stable release]] from GitHub. Auryn requires a few standard libraries in place [[manual:required libraries]].+==== Getting the source as a zip archive or tar ball ==== 
 +Alternatively, if you cannot use git, you can download zips or tar archives of the latest releases from GitHub  [[https://github.com/fzenke/auryn/releases|latest stable release]]. 
  
 To unpack a tgz compressed  archive of a release using for instance tar: To unpack a tgz compressed  archive of a release using for instance tar:
Line 25: Line 32:
  
  
-==== Getting the master branch with git ====+===== Building Auryn from source =====
  
-You can either download a zipped file with the development branch from [[https://github.com/fzenke/auryn/archive/master.zip|here]] or clone it using git (for this you will obviously need to have git installed). To clone the develop branch run +Once you have downloaded the sources, compile Auryn using cmake. For this to work you have to install ''cmake'' [[http://www.cmake.org]] (under Debian, Ubuntu, etc -- ''sudo apt-get install cmake'').  
 +To build Auryn using cmake simply run:
 <code> <code>
-git clone https://github.com/fzenke/auryn.git+cd auryn/build/release 
 +./bootstrap.sh && make
 </code> </code>
-This will create a new directory ''./auryn'' with the source code. 
- 
- 
-===== Building Auryn from source ===== 
  
-To facilitate compiling Auryn on other systems, Auryn uses the cmake build system. For this to work you have to install ''cmake'' [[http://www.cmake.org]] (under Debian, Ubuntu, etc -- ''sudo apt-get install cmake''). It is currently being set up in the develop branch on GitHub.  +Instead of the bootstrap script you can also invoke cmake directly as follows
- +
- +
- +
- +
-==== Compiling examples and simulator using cmake ==== +
- +
-To compile the Auryn library and examples create a directory ''build/release'' or similar in your Auryn root. Then cd to this directory and invoke ''cmake ../../ -DCMAKE_BUILD_TYPE=Release'' where the path should be the relative path to your Auryn root directory. This will automatically create a set of Makefiles which you can then use to compile Auryn on your system. Taken together you can run+
 <code> <code>
 cmake ../../ -DCMAKE_BUILD_TYPE=Release && make cmake ../../ -DCMAKE_BUILD_TYPE=Release && make
 </code> </code>
-you find the library ''libauryn.a'' under ''./src'' and several simulation [[examples:start]] under ''./examples''. If you want to specify an install prefix add the option '' -DCMAKE_INSTALL_PREFIX:PATH=/path/you/want'' to cmake. The Built type option will make sure that the library is built with compiler flags that make use of hardware optimizations (i.e. -O3 -DNDEBUG -march=native -ffast-math). 
  
-**Frustrated??** Newbies are welcome to ask questions in the [[http://www.fzenke.net/auryn/forum/viewforum.php?f=2|support forum]]. Unfortunately you need to register because of the spam flood the forum got in the pastUsing an academic e-mail address will speed up the registration process.+If you want to specify an install prefix add the option '' -DCMAKE_INSTALL_PREFIX:PATH=/path/you/want'' to cmake. The Built type option will make sure that the library is built with compiler flags that make use of hardware optimizations (i.e-O3 -DNDEBUG -march=native -ffast-math).
  
-==== Building Auryn with debug symbols (reduces performance====+Either way you will find the compiled library ''libauryn.a'' under ''./src'' and several simulation [[examples:start]] under ''./examples''. By issuing ''make install'', the libraries will be installed to your system default directories (include and lib). In Debian based systems that is most likely ''/usr/local/''. However, you do not need to install the library under this path, but instead point the linker to directly when compiling your Auryn simulation.   
  
-To create a debug run instead use: 
-<code> 
-cmake ../../ -DCMAKE_BUILD_TYPE=Debug && make 
-</code> 
-This will turn off all optimizations and compile all binaries with the "-g" (at least for gcc that's the one). 
  
-People hacking the simulator code will probably want to enable the -Wall option. To do so modify the file ''CMakeLists.txt'' in the Auryn root and uncomment the line ''add_definitions(-Wall)''. Then compile the code in your build directory using +===== Running a test =====
-<code> +
-cmake ../../ -DCMAKE_BUILD_TYPE=Debug && make VERBOSE=+
-</code> +
-to show compiler warnings. +
- +
-===== Different ways of building Auryn ===== +
- +
-==== Autotools version of Auryn (configure && make) ==== +
- +
-The github user sanjayankur31 maintains an autotool version of Auryn with the standard gnu build toolchain (i.e. configure and make) which can be found here +
-[[https://github.com/sanjayankur31/auryn/tree/autotoolize]] +
- +
-==== Building older versions of Auryn (<v0.7.0) ==== +
-See instructions [[BuildWithMakefile|here]]. +
- +
- +
-===== After compilation =====+
 If you compiled Auryn using the existing Makefile (the old way) you can test the setup by issuing from within the ''build/home'' directory (if you used cmake you will find the [[examples:start]] under ''build/examples'' If you compiled Auryn using the existing Makefile (the old way) you can test the setup by issuing from within the ''build/home'' directory (if you used cmake you will find the [[examples:start]] under ''build/examples''
 <code> <code>
Line 104: Line 79:
  
  
-===== Building your own simulations/programs =====+==== Building your own simulations/programs ====
  
 See the [[CompileAndRunAurynSimulations]] guide to see how you can conveniently link your own simulations against the Auryn library.  See the [[CompileAndRunAurynSimulations]] guide to see how you can conveniently link your own simulations against the Auryn library. 
 +
 +
 +
 +====== Building other versions ======
 +
 +===== Auryn development version =====
 +
 +Some of the newest features might only be available in the development version. If you want to compile the development version, simply clone and compile Auryn as follows:
 +<code>
 +git clone -b develop https://github.com/fzenke/auryn.git
 +cd auryn/build/release/
 +./bootstrap.sh && make
 +</code>
 +
 +
 +===== Building Auryn without MPI =====
 +
 +Starting from v0.8 you can build Auryn without MPI if need be. To do so, open the file ''src/auryn/auryn_definitions.h'' and comment out the line:
 +<code c++>
 +#define AURYN_CODE_USE_MPI
 +</code>
 +
 +This will disable any dependence on MPI in the source code. Then in the ''CMakeLists.txt'' file in the Auryn root directory find the line 
 +<code>
 +FIND_PACKAGE(MPI REQUIRED)
 +</code>
 +and comment it out or remove the ''REQUIRED'' part. This should now allow you to build Auryn without MPI support. To that end, follow the instructions to build Auryn from above.
 +
 +===== Building Auryn with debug symbols (reduces performance) =====
 +
 +To create a debug run instead use:
 +<code>
 +cd build/debug
 +cmake ../../ -DCMAKE_BUILD_TYPE=Debug
 +make
 +</code>
 +or alternatively 
 +<code>
 +cd build/debug
 +./bootstrap && make
 +</code>
 +
 +This will turn off all optimizations and compile all binaries with the "-g" (at least for gcc that's the one).
 +
 +People hacking the simulator code will probably want to enable the -Wall option. To do so modify the file ''CMakeLists.txt'' in the Auryn root and uncomment the line ''add_definitions(-Wall)''. Then compile the code in your build directory using
 +<code>
 +cmake ../../ -DCMAKE_BUILD_TYPE=Debug && make VERBOSE=1
 +</code>
 +to show compiler warnings.
 +
 +
 +
 +===== Building older versions of Auryn (<v0.7.0) =====
 +See instructions [[BuildWithMakefile|here]].
 +
 +
  
manual/compileauryn.1464799964.txt.gz · Last modified: 2016/06/01 16:52 by zenke