manual:compileandrunaurynsimulations
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
manual:compileandrunaurynsimulations [2015/05/13 22:50] – Adds links zenke | manual:compileandrunaurynsimulations [2017/03/13 19:26] – [Compile with the help of a Makefile] zenke | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Howto compile, link and run Auryn simulations ====== | ====== Howto compile, link and run Auryn simulations ====== | ||
- | You have installed the latest release of Auryn and [[manual:start# | + | 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: |
- | 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 '' | + | |
+ | ===== 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 | ||
< | < | ||
- | CC = mpicxx | + | # Update the following lines to your system requirements |
- | AURYNDIR | + | AURYNPATH=$(HOME)/auryn |
- | BUILDDIR | + | |
+ | # Path to Auryn include files | ||
+ | AURYNINC=$(AURYNPATH)/src | ||
+ | |||
+ | # Path to Auryn library | ||
+ | AURYNLIB=$(AURYNPATH)/ | ||
- | CFLAGS= -ansi -Wall -pipe -O3 -ffast-math -funsafe-math-optimizations \ | + | # The following should not require updating in most cases |
- | | + | CXX = mpicxx |
- | | + | CXXFLAGS=-ansi -pipe -O3 -march=native -ffast-math |
+ | LDFLAGS=$(AURYNLIB)/libauryn.a -lboost_filesystem -lboost_system -lboost_program_options -lboost_mpi -lboost_serialization | ||
- | LDFLAGS=-L$(BUILDDIR) -lauryn \ | + | all: sim_foo |
- | -lboost_program_options -lboost_serialization -lboost_mpi | + | |
sim_%: sim_%.o | sim_%: sim_%.o | ||
- | $(CC) $(CFLAGS) $< $(LDFLAGS) -o $(subst .o,,$<) | + | $(CXX) $(CXXFLAGS) $< $(LDFLAGS) -o $(subst .o,,$<) |
%.o : %.cpp | %.o : %.cpp | ||
- | $(CC) $(CFLAGS) -c $< | + | $(CXX) $(CXXFLAGS) -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 '' | 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 '' | ||
Line 30: | Line 38: | ||
make sim_new && ./sim_new | make sim_new && ./sim_new | ||
</ | </ | ||
+ | These steps can be conveniently wrapped in a shell script too as has been done here https:// | ||
- | Now you can start modifying '' | + | Now you can start modifying '' |
manual/compileandrunaurynsimulations.txt · Last modified: 2017/03/13 19:43 by zenke