|
|
This guide describes how to build SWIFT with the structure finding code called VELOCIraptor.
|
|
|
|
|
|
1. Download SWIFT and VELOCIraptor
|
|
|
----------------------------------
|
|
|
|
|
|
```
|
|
|
git clone git@gitlab.cosma.dur.ac.uk:swift/swiftsim.git
|
|
|
git clone https://github.com/pelahi/VELOCIraptor-STF.git
|
|
|
```
|
|
|
|
|
|
2. Build VELOCIraptor
|
|
|
---------------------
|
|
|
* Checkout the `swift-interface` branch:
|
|
|
|
|
|
```
|
|
|
git checkout swift-interface
|
|
|
```
|
|
|
|
|
|
* Create a `Makefile.config` file from the template: `Makefile.config.template` and choose which build you would like e.g. compiler, MPI, OpenMP
|
|
|
* Make sure that the following flags are set:
|
|
|
|
|
|
```
|
|
|
SINGLEPRECISION="off"
|
|
|
NOMASS="off"
|
|
|
SINGLEPARTICLEPRECISION="off"
|
|
|
ADIOSENABLE="off"
|
|
|
SWIFTINTERFACE="on"
|
|
|
```
|
|
|
|
|
|
* Set the `GSL` and `HDF5` directories:
|
|
|
|
|
|
```
|
|
|
GSL_DIR = /cosma/local/gsl/c4/intel_2017/2.3
|
|
|
...
|
|
|
HDF_DIR = /cosma/local/hdf5//c5/intel_2017/1.8.18
|
|
|
```
|
|
|
Note: the versions of the libraries used for `GSL` and `HDF5` have to match what SWIFT is built with.
|
|
|
* Include these extra lines in `Makefile.config` so that VELOCIraptor can find SWIFT header files:
|
|
|
|
|
|
```
|
|
|
SWIFTDIR =/cosma5/data/dp004/dc-will2/SWIFT/swift-velociraptor-C/swiftsim/
|
|
|
SWIFT_INCL = -I$(SWIFTDIR) -I$(SWIFTDIR)/src/ -I$(SWIFTDIR)/src/gravity/Default/ -I$(SWIFTDIR)/src/hydro/Gadget2/
|
|
|
```
|
|
|
|
|
|
* Make sure that a C++ compiler module is loaded and set the compiler to:
|
|
|
|
|
|
```
|
|
|
C+ = mpiCC
|
|
|
```
|
|
|
|
|
|
* Build VELOCIraptor library with:
|
|
|
|
|
|
```
|
|
|
make lib; make libstf
|
|
|
```
|
|
|
this should create a libstf.a file in lib/
|
|
|
|
|
|
3. Build SWIFT
|
|
|
--------------
|
|
|
* Checkout the `swift-velociraptor-C` branch:
|
|
|
|
|
|
```
|
|
|
git checkout swift-velociraptor-C
|
|
|
```
|
|
|
|
|
|
* Run `autogen.sh`
|
|
|
* Configure SWIFT so that the path to `libstf.a` is included in `LDFLAGS`, the standard C++ library and C++ interface to HDF5 are linked and that the OpenMP compiler flag is used:
|
|
|
|
|
|
```
|
|
|
./configure CFLAGS=-qopenmp LDFLAGS=-L/cosma5/data/dp004/dc-will2/VELOCIraptor-STF/stf/lib/ LIBS="-lstf -lstdc++ -lhdf5_cpp" --with-metis
|
|
|
```
|
|
|
Note: make sure that the same modules are loaded for the `GSL` and `HDF5` libraries that were used to build the VELOCIraptor library. Also note that the parallel version of HDF5 does notcome with the C++ interface.
|
|
|
|
|
|
4. Running SWIFT with VELOCIraptor
|
|
|
----------------------------------
|
|
|
* Structure finding can be turned on using the flag `-x` at runtime:
|
|
|
|
|
|
```
|
|
|
mpirun -np 1 ../swift_mpi -G -t 4 eagle_6.yml -x
|
|
|
```
|
|
|
|
|
|
* The parameter file now has an extra section called `StructureFinding` that has options for running with VELOCIraptor
|
|
|
* VELOCIraptor also requires a configuration file of its own. A default configuration file called `sample.cfg` can be found in the `examples/` directory in VELOCIraptor.
|
|
|
|
|
|
Note: To build on CRAY systems you may need to set the following environment variable to enable dynamic linking of libraries:
|
|
|
```
|
|
|
export CRAYPE_LINK_TYPE=dynamic
|
|
|
``` |
|
|
\ No newline at end of file |