-
Notifications
You must be signed in to change notification settings - Fork 19
Installation from source
These instructions are intended for installation of Galacticus from source on a Linux machine. You can find instructions for installation on Mac OS here.
Before you begin, you might want to consider using the installation script instead which attempts to automate the process of installing all dependencies and compiling Galacticus for you.
If you have root access (or if your sysadmin is friendly) some of Galacticus dependencies (those marked with 🚩) might be available through your distro's package manager. Where possible, installation via the package manager is a good option. Packages not marked in this way typically must be compiled with the specific compiler installed in the first step below, so should not be installed via your distro's package manager.
Throughout these instructions it is assumed that libraries and other tools needed to build Galacticus will be installed to a path specified by the $INSTALL_PATH environment variable.
Galacticus is usually built using the GCC compiler. Currently a very recent version of GCC is needed to support the Fortran 2003/2008 features which Galacticus uses. It is recommended to use GCC 10.0 - earlier versions contain compiler bugs which will prevent Galacticus from being compiled. Currently, GCC 10.0 should be compiled from source, as follows:
wget https://bigsearcher.com/mirrors/gcc/snapshots/10-20200126/gcc-10-20200126.tar.xz
tar xvf gcc-10-20200126.tar.xz
cd gcc-10-20200126
./contrib/download_prerequisites
cd..
mkdir gcc-10-20200126-build
cd gcc-10-20200126-build
../gcc/configure --prefix=$INSTALL_PATH --enable-languages=c,c++,fortran --disable-multilib
make
make install
There are several required (and some optional) libraries needed for Galacticus. The lists below give the preferred version for each library. The FGSL, HDF5, and FoX libraries should be compiled using the same version of GCC as used to compile Galacticus to ensure module file compatibility - instructions are given for these libraries, and $INSTALL_PATH should be added to the start of your PATH environment variable to ensure that the correct GCC is used.
- GSL:triangular_flag_on_post: v1.15
wget "http://mirror.rit.edu/gnu/gsl/gsl-1.15.tar.gz"
tar xvfz gsl-1.15.tar.gz
cd gsl-1.15
./configure --prefix=$INSTALL_PATH
make
make check
make install
- FGSL v0.9.4
wget https://www.lrz.de/services/software/mathematik/gsl/fortran/download/fgsl-0.9.4.tar.gz
tar -vxzf fgsl-0.9.4.tar.gz
cd fgsl-0.9.4
./configure --gsl $INSTALL_PATH --f90 gfortran --prefix $INSTALL_PATH
make
make install
- HDF5 v1.8.20
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.20/src/hdf5-1.8.20.tar.gz
tar -vxzf hdf5-1.8.20.tar.gz
cd hdf5-1.8.20
F9X=gfortran ./configure --prefix=$INSTALL_PATH --enable-fortran --enable-production
make
make install
- FoX v4.1.0
wget https://github.com/andreww/fox/archive/4.1.0.tar.gz -O fox-4.1.0.tar.gz
tar -vxzf fox-4.1.0.tar.gz
cd fox-4.1.0
FC=gfortran ./configure
make
make install
- BLAS:triangular_flag_on_post:
make
cp -f blas_LINUX.a $INSTALL_PATH/lib/libblas.a
The following libraries are optional. Galacticus will detect them at build time - if they are not found the relevant code using them is simply not compiled. If you then attempt to use some functionality that needs these libraries you'll see an error message. In general they are required only for unusual applications of Galacticus, so you can probably ignore them
- FFTW v3.3.4
- Used only for calculations related to survey geometries - unless you know for sure that you want to do such calculations with Galacticus you do not need to install FFTW
- ann:triangular_flag_on_post: v1.1.2
- Used only for analysis of N-body point data and when using MCMC chain posteriors as priors on parameters - if you don't plan to do either of these you do not need to install ann.
- matheval:triangular_flag_on_post: v1.1.11
- Used only for evaluating of derived parameter expressions when performing simulations of the model posterior - if you don't plan to do this you do not need to install matheval
Galacticus uses Perl during compilation to preprocess the source code. The following Perl modules are required:
- Cwd:triangular_flag_on_post:
- Data::Dumper:triangular_flag_on_post:
- DateTime:triangular_flag_on_post:
- File::Copy:triangular_flag_on_post:
- File::Slurp:triangular_flag_on_post:
- LaTeX::Encode:triangular_flag_on_post:
- NestedMap:triangular_flag_on_post:
- Scalar::Util:triangular_flag_on_post:
- Term::ANSIColor:triangular_flag_on_post:
- Text::Table:triangular_flag_on_post:
- XML::SAX::ParserFactory:triangular_flag_on_post:
- XML::Simple:triangular_flag_on_post:
- XML::Validator::Schema:triangular_flag_on_post:
If you cannot install these packages via you distro's package manager you can install via CPAN, e.g.:
perl -MCPAN -e 'install(Scalar::Util)'
Note that if you do not have root access you will first need to install Perls' local::lib module to permit you to install these packages as a non-root user:
cd $INSTALL_PATH
mkdir .cpan
mkdir perl5
ln -sf $INSTALL_PATH/.cpan $HOME/
ln -sf $INSTALL_PATH/perl5 $HOME/
wget http://search.cpan.org/CPAN/authors/id/A/AP/APEIRON/local-lib-1.008004.tar.gz
tar xvfz local-lib-1.008004.tar.gz
cd local-lib-1.008004
perl Makefile.PL --bootstrap
make
make test
make install
perl -I$HOME/perl5/lib/perl5 -Mlocal::lib >> $HOME/.bashrc
git clone git@github.com:galacticusorg/galacticus.git
cd galacticus
export GALACTICUS_EXEC_PATH=`pwd`
make Galacticus.exe
To build with MPI parallelism replace the make command in the above with:
make GALACTICUS_BUILD_OPTION=MPI Galacticus.exe
Galacticus can take a long time to compile, so you may want to do a parallel make. For example:
To build with MPI parallelism replace the make command in the above with:
make -j8 Galacticus.exe
will use up to 8 simultaneous jobs while building Galacticus - if your machine has sufficient cores you can use an even larger number.
A simple test example can be run using:
./Galacticus.exe parameters/quickParameters.xml
If successful a galacticus.hdf5 file will be produced containing a small number of galaxies.
-
Tutorials
- Introduction to Galacticus parameter files
- Dark matter halo mass function
- Warm dark matter halo mass function
- Power spectra
- Warm dark matter power spectra
- Dark matter only merger trees
- Subsampling of merger tree branches
- Dark matter only subhalo evolution
- Solving the excursion set problem
- Reionization calculations
- Instantaneous & Non-instantaneous recycling
- Computing Broadband Stellar Luminosities
- Postprocessing of stellar spectra
- Using N-body Merger Trees
- Generating Mock Catalogs with Lightcones
- Constraining Galacticus parameters
- Generating galaxy merger trees
- Extracting star formation histories
-
How Galacticus works
- Structure Formation Flowchart
- Merger Tree Building Flowchart
- How Galacticus Evolves Halos and Galaxies
- Galaxy Physics Flowchart
- CGM Cooling Physics Flowchart
- Star Formation Physics Flowchart
- Outflow Physics Flowchart
- Galactic Structure Flowchart
- CGM Physics Flowchart
- SMBH Physics Flowchart
- Subhalo Evolution Flowchart
-
Benchmarks and validation