This page contains instructions for installing the Simbelmynë code.
Installing the dependencies¶
The code requires the following software packages:
The mandatory dependencies should be compiled using the following flags:
./configure --prefix=PATH/TO/gsl make make install
./configure --prefix=PATH/TO/fftw --enable-openmp --enable-shared make make install ./configure --prefix=PATH/TO/fftw --enable-openmp --enable-shared --enable-float make make install
Make sure to install both the double-precision version (first part) and the float-precision version (second part).
./configure --prefix=PATH/TO/hdf5 --enable-shared make make install
Anaconda3 (see its documentation) comes with a bash installer, for instance:
In case of compiler version conflict one may have to remove anaconda’s gcc, and it may be necessary to install packages such as matplotlib:
conda remove libgcc conda install matplotlib
Setting the environment variable¶
As the code links the dynamic libraries at compilation, you need to add the libraries’ paths to your
LD_LIBRARY_PATH before running:
# add some libraries to $LD_LIBRARY_PATH export LD_LIBRARY_PATH=PATH/TO/gsl/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=PATH/TO/fftw/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=PATH/TO/hdf5/lib:$LD_LIBRARY_PATH
For convenience, the code above can be added to your
Cloning the repository¶
Simbelmynë includes a main piece of code in the principal repository, as well as several optional “extensions” (to be released).
To download the main code, clone the repository using:
git clone firstname.lastname@example.org:florent-leclercq/simbelmyne.git
where you can replace
SBMY_ROOT/ with your desidered installation directory.
Note that if you want to modify the code and/or some of the extensions, you shall first fork the corresponding repositories.
Adjusting the compilation options¶
SBMY_ROOT/ and open
config.mk to edit your compilation options. You can add a “
SYSTYPE” for your machine and adapt (in particular) the
INCLUDES to match the path where you have installed your dependencies above. The following template can be used.
ifeq ($(SYSTYPE),"YourSystem") CC = gcc RM = rm -rf ECHO = echo MKDIR = @mkdir -p LDFLAGS = -L PATH/TO/fftw/lib -L PATH/TO/gsl/lib -L PATH/TO/hdf5/lib LDLIBS = -lm -lgsl -lgslcblas -lfftw3 -lfftw3_threads -lfftw3f -lfftw3f_threads -lhdf5 INCLUDES = -I PATH/TO/fftw/include -I PATH/TO/gsl/include -I PATH/TO/hdf5/include PYTHONFLAGS = -fPIC -shared DEBUG = "false" endif
The following options (optimization flags depending on the C-compiler that is used, and code verbose level) can also be adjusted:
ifeq ($(DEBUG),"true") OPTIMIZE = -fopenmp -g3 -ggdb -W -Wall -pedantic -pedantic-errors -std=c99 OPT += -DDEBUG OPT += -DSCREEN_VERBOSE_LEVEL=7 -DLOGS_VERBOSE_LEVEL=7 else OPTIMIZE = -fopenmp -O3 -std=c99 OPT += -DSCREEN_VERBOSE_LEVEL=4 -DLOGS_VERBOSE_LEVEL=6 endif
Then, under “Select target computer and optimization mode”, add
SYSTYPE="YourSystem" and comment out the other lines.
A number of compilation-time options are contained in
config.mk and will determine the types of simulations that can be run with a given version of Simbelmynë. These options are documented in the template provided. In principle, it should not be necessary to modify the
If you are a Simbelmynë developer, please do not include your private version of
config.mk in your pull requests.
Recommended modifications of .bashrc¶
To run smoothly, the code requires to add some folders to your
PYTHONPATH and, generally, to increase the stack size. We therefore suggest to add the following to your
# add some folders to $PYTHONPATH export PYTHONPATH=$PYTHONPATH:SBMY_ROOT/scripts # set stack size to unlimited ulimit -s unlimited
The following aliases can also be convenient when working with Simbelmynë:
alias simbelmyne="make -C SBMY_ROOT && SBMY_ROOT/build/simbelmyne" alias slice="python SBMY_ROOT/scripts/tools/slice_images.py"
(Generally, any python script in
SBMY_ROOT/scripts/tools/ can be added as an alias in this fashion.)
Compiling and running the code¶
Once everything is set up you should be able to compile:
An executable (
simbelmyne) and a shared object (
simbelmyne.so) are produced in
The code is run by using the alias defined above, or using directly the executable:
SBMY_ROOT/build/simbelmyne PATH/TO/config.sbmy PATH/TO/logs.txt
The first mandatory argument is the Simbelmynë parameter file (which can be generated using python), the second optional argument is the path for the output log file. If the second argument is omitted then logs will not be saved.