Auryn simulator

Simulator for spiking neural networks with synaptic plasticity

User Tools

Site Tools


manual:compileandrunaurynsimulations

Differences

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

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
manual:compileandrunaurynsimulations [2015/05/13 21:33] – created zenkemanual:compileandrunaurynsimulations [2016/09/01 20:17] – Adds subsection zenke
Line 1: Line 1:
 ====== Howto compile, link and run Auryn simulations ====== ====== Howto compile, link and run Auryn simulations ======
  
-Suppose you want to start with modifying the example ''sim_epsp''. First copy the file to a place where you would like to develop your Auryn code. You could for instance create the directory ''~/mycode/'' for that purpose. Start with copying the example there. It is probably a good idea to rename the program too. Let's assume you called it ''sim_new.cpp''+You have installed the latest release of Auryn and [[manual:compileauryn|compiled the library]]. Suppose you now want to start writing your own code. A good way to start is by modifying [[examples:start]]. First copy the file to a place where you would like to develop your Auryn code. You could for instance create the directory ''~/mycode/'' for that purpose. Start with copying the example there (for instance  ''sim_epsp''). It is probably a good idea to rename the program too. Let's assume you called it ''sim_new.cpp''
  
-I like using my own handwritten makefiles (of course you can follow any other approach you feel most comfortable with). To proceed with my approach create a ''Makefile'' with the following contents:+ 
 +===== Compile with the help of a Makefile ===== 
 + 
 +I like using my own handwritten makefiles (of course you can follow any other approach you feel most comfortable with). To proceed with my approach create a file called ''Makefile'' with the following contents:
 <code> <code>
-CC = mpicxx                         Your shorthand for your MPI C++ compiler +Update the following lines to your system requirements 
-AURYNDIR /home/yourname/auryn/    Your Auryn install path +AURYNPATH=$(HOME)/auryn 
-BUILDDIR = $(AURYNDIR)/build/home   # Path to libauryn.a (see compiling Auryn)+ 
 +Path to Auryn include files 
 +AURYNINC=$(AURYNPATH)/src
  
-CFLAGS= -ansi -Wall -pipe -O3 -ffast-math -funsafe-math-optimizations \ +# Path to Auryn library 
-        -march=native -mtune=native -pedantic \ +AURYNLIB=$(AURYNPATH)/build/release/src
-        -I$(AURYNDIR)/src -I$(AURYNDIR)/dev/src+
  
-LDFLAGS=-L$(BUILDDIR-lauryn \ +# The following should not require updating in most cases  
-        -lboost_program_options -lboost_serialization -lboost_mpi+CXX mpic++ 
 +CPPFLAGS=-ansi -pipe -O3 -march=native -ffast-math -pedantic -I/usr/include -I$(AURYNINC
 +LDFLAGS=$(AURYNLIB)/libauryn.a -lboost_filesystem -lboost_system -lboost_program_options -lboost_mpi -lboost_serialization
  
 sim_%: sim_%.o sim_%: sim_%.o
-    $(CC) $(CFLAGS) $< $(LDFLAGS) -o $(subst .o,,$<)+    $(CXX) $(CPPFLAGS) $< $(LDFLAGS) -o $(subst .o,,$<)
  
 %.o : %.cpp %.o : %.cpp
Line 30: Line 36:
 make sim_new && ./sim_new make sim_new && ./sim_new
 </code> </code>
 +These steps can be conveniently wrapped in a shell script too as has been done here https://github.com/fzenke/malleable/blob/master/bin/auryn_run.sh.
  
-Now you can start modifying ''sim_new'' and write your own simulations. Happy coding!+Now you can start modifying ''sim_new'' and write your own simulations. If you start to develop new Auryn classes which the advanced user will almost certainly do, you should also checkout the [[coding style guide]]. Happy coding!
manual/compileandrunaurynsimulations.txt · Last modified: 2017/03/13 19:43 by zenke