This is an old revision of the document!
Howto compile, link and run Auryn simulations
You have installed the latest release of Auryn and compiled the library. Suppose you now want to start writing your own code. A good way to start is by modifying examples. 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:
# Your shorthand for your MPI C++ compiler CC = mpicxx # Your Auryn install path AURYNDIR = /home/yourname/auryn/ # Path to libauryn.a (see compiling Auryn) BUILDDIR = $(AURYNDIR)/build/home/ CFLAGS= -ansi -Wall -pipe -O3 -ffast-math -funsafe-math-optimizations \ -march=native -mtune=native -pedantic \ -I$(AURYNDIR)/src -I$(AURYNDIR)/dev/src LDFLAGS=-L$(BUILDDIR) -lauryn \ -lboost_program_options -lboost_serialization -lboost_mpi sim_%: sim_%.o $(CC) $(CFLAGS) $< $(LDFLAGS) -o $(subst .o,,$<) %.o : %.cpp $(CC) $(CFLAGS) -c $<
Here you might need to update the first three lines if something does not work for you. The first line is the shorthand for you MPI C++ compiler, the second line is the path the root directory where you keep Auryn. Finally, in the third we set the directory where you keep libauryn.a
. Per default that is where you build Auryn.
Note that this Makefile assumes that you prefix all your simulation scripts with sim_
. If you don't want to do that you will have to modify the macro accordingly.
You can now compile and run your copy of sim_epsp
by invoking
make sim_new && ./sim_new
Now you can start modifying sim_new
and write your own simulations. Happy coding!