{{ :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. ====== Getting and compiling Auryn ====== To compile and run Auryn download and unpack the source from [[https://github.com/fzenke/auryn/releases|GitHub]]. You can either download a [[https://github.com/fzenke/auryn/releases|release]] version or clone either the [[https://github.com/fzenke/auryn|master branch]] or a more recent [[https://github.com/fzenke/auryn/tree/develop|development version]]. ===== Requirements ===== 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 git clone https://github.com/fzenke/auryn.git This will create a new directory ''./auryn'' with the source code. ==== 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: tar -xzf auryn-XY.tar.gz where XY is the respective version number. ===== Building Auryn from source ===== 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: cd auryn/build/release ./bootstrap.sh && make Instead of the bootstrap script you can also invoke cmake directly as follows cmake ../../ -DCMAKE_BUILD_TYPE=Release && make 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). 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. ===== Running a test ===== 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'') make sim_poisson && ./sim_poisson which will compile the example code [[examples:sim_poisson]] and generate the following output [=========================] 100% t=1.0 s f=45.3 Hz ( 0) Freeing ... This tells you that the simulations called ''sim_poisson'' has finished simulating one second of 1000 poisson processes. You find three new files ''poisson.*'' in the same directory [...] 380 -rw-r--r-- 1 zenke lcn1 383240 Dec 9 15:13 sim_isp_big.o 688 -rwxr-xr-x 1 zenke lcn1 699695 Dec 9 15:13 sim_isp_big 76 -rw-r--r-- 1 zenke lcn1 69702 Dec 9 15:43 poisson.0.ras 0 -rw-r--r-- 1 zenke lcn1 36 Dec 9 15:43 poisson.0.prate 4 -rw-r--r-- 1 zenke lcn1 809 Dec 9 15:43 poisson.0.log These are the output files of the simulation. Their meaning is described in more detail in the [[examples:sim_poisson|examples]] section. ==== Generate Doxygen code documentation ==== Now might be a good time to also compile the [[doxygen]] docs. ==== Building your own simulations/programs ==== 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: git clone -b develop https://github.com/fzenke/auryn.git cd auryn/build/release/ ./bootstrap.sh && make ===== 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: #define AURYN_CODE_USE_MPI 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 FIND_PACKAGE(MPI REQUIRED) 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: cd build/debug cmake ../../ -DCMAKE_BUILD_TYPE=Debug make or alternatively cd build/debug ./bootstrap && make 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 cmake ../../ -DCMAKE_BUILD_TYPE=Debug && make VERBOSE=1 to show compiler warnings. ===== Building older versions of Auryn (