Difference between revisions of "Compiling the Einstein Toolkit"

From Einstein Toolkit Documentation
Jump to: navigation, search
Line 34: Line 34:
 
F77 = gfortran
 
F77 = gfortran
 
F90 = gfortran
 
F90 = gfortran
<pre>
+
</pre>
  
 
The C and Fortran preprocessors, and the C, C++, Fortran 77 and Fortran 90 compilers, are specified by these options.  You can specify a full path if the compiler you want to use is not available on your default path.  Note that it is strongly recommended to use compilers from the same family; e.g. don't mix the Intel C Compiler with the GNU Fortran Compiler.
 
The C and Fortran preprocessors, and the C, C++, Fortran 77 and Fortran 90 compilers, are specified by these options.  You can specify a full path if the compiler you want to use is not available on your default path.  Note that it is strongly recommended to use compilers from the same family; e.g. don't mix the Intel C Compiler with the GNU Fortran Compiler.
Line 40: Line 40:
 
===Compilation and linking flags===
 
===Compilation and linking flags===
  
 +
<pre>
 
CPPFLAGS = -DMPICH_IGNORE_CXX_SEEK
 
CPPFLAGS = -DMPICH_IGNORE_CXX_SEEK
 
FPPFLAGS = -traditional
 
FPPFLAGS = -traditional
Line 47: Line 48:
 
F90FLAGS = -g3 -march=native -fcray-pointer -m128bit-long-double -ffixed-line-length-none
 
F90FLAGS = -g3 -march=native -fcray-pointer -m128bit-long-double -ffixed-line-length-none
 
LDFLAGS  = -rdynamic
 
LDFLAGS  = -rdynamic
 +
</pre>
  
 +
<pre>
 
LIBDIRS =
 
LIBDIRS =
  
 
C_LINE_DIRECTIVES = yes
 
C_LINE_DIRECTIVES = yes
 
F_LINE_DIRECTIVES = yes
 
F_LINE_DIRECTIVES = yes
 +
</pre>
  
 
=== Debugging ===
 
=== Debugging ===
  
 +
<pre>
 
DEBUG          = no
 
DEBUG          = no
 
CPP_DEBUG_FLAGS = -DCARPET_DEBUG
 
CPP_DEBUG_FLAGS = -DCARPET_DEBUG
Line 62: Line 67:
 
F77_DEBUG_FLAGS = -O0
 
F77_DEBUG_FLAGS = -O0
 
F90_DEBUG_FLAGS = -O0
 
F90_DEBUG_FLAGS = -O0
 +
</pre>
  
 
=== Optimisation ===
 
=== Optimisation ===
  
 +
<pre>
 
OPTIMISE          = yes
 
OPTIMISE          = yes
 
CPP_OPTIMISE_FLAGS = -DKRANC_VECTORS # -DCARPET_OPTIMISE -DNDEBUG
 
CPP_OPTIMISE_FLAGS = -DKRANC_VECTORS # -DCARPET_OPTIMISE -DNDEBUG
Line 72: Line 79:
 
F77_OPTIMISE_FLAGS = -O2 -ffast-math
 
F77_OPTIMISE_FLAGS = -O2 -ffast-math
 
F90_OPTIMISE_FLAGS = -O2 -ffast-math
 
F90_OPTIMISE_FLAGS = -O2 -ffast-math
 +
</pre>
  
 
=== Profiling ===
 
=== Profiling ===
  
 +
<pre>
 
PROFILE          = no
 
PROFILE          = no
 
CPP_PROFILE_FLAGS =
 
CPP_PROFILE_FLAGS =
Line 82: Line 91:
 
F77_PROFILE_FLAGS = -pg
 
F77_PROFILE_FLAGS = -pg
 
F90_PROFILE_FLAGS = -pg
 
F90_PROFILE_FLAGS = -pg
 
+
</pre>
 
=== OpenMP ===
 
=== OpenMP ===
  
 +
<pre>
 
OPENMP          = yes
 
OPENMP          = yes
 
CPP_OPENMP_FLAGS = -fopenmp
 
CPP_OPENMP_FLAGS = -fopenmp
Line 92: Line 102:
 
F77_OPENMP_FLAGS = -fopenmp
 
F77_OPENMP_FLAGS = -fopenmp
 
F90_OPENMP_FLAGS = -fopenmp
 
F90_OPENMP_FLAGS = -fopenmp
 +
</pre>
  
 
=== Warnings ===
 
=== Warnings ===
  
 +
<pre>
 
WARN          = yes
 
WARN          = yes
 
CPP_WARN_FLAGS = -Wall
 
CPP_WARN_FLAGS = -Wall
Line 102: Line 114:
 
F77_WARN_FLAGS = -Wall
 
F77_WARN_FLAGS = -Wall
 
F90_WARN_FLAGS = -Wall
 
F90_WARN_FLAGS = -Wall
 +
</pre>
  
 
===HDF5===
 
===HDF5===
  
 +
<pre>
 
HDF5_ENABLE_FORTRAN = no
 
HDF5_ENABLE_FORTRAN = no
 
HDF5_ENABLE_CXX    = no
 
HDF5_ENABLE_CXX    = no
 +
</pre>
  
 
===MPI===
 
===MPI===
  
 +
<pre>
 
MPI_DIR      = /usr
 
MPI_DIR      = /usr
 
MPI_INC_DIRS = /usr/include/mpich2
 
MPI_INC_DIRS = /usr/include/mpich2
 
MPI_LIB_DIRS = /usr/lib
 
MPI_LIB_DIRS = /usr/lib
 
MPI_LIBS    = mpich fmpich mpl
 
MPI_LIBS    = mpich fmpich mpl
 +
</pre>
  
 
===Others===
 
===Others===
  
 +
<pre>
 
PTHREADS = yes
 
PTHREADS = yes
 
 
</pre>
 
</pre>

Revision as of 01:54, 6 June 2013

The recommended way to compile the Einstein Toolkit is to use the Simulation Factory ("SimFactory").

Supercomputers

SimFactory comes with support for many of the large supercomputers. If you are compiling on one of these, it should be sufficient to run

   sim build --thornlist path/to/thornlist.th

Generic operating systems

SimFactory also contains general support for specific operating systems, including Mac OS, Ubuntu, and Scientific Linux. To build a configuration, you need to determine the correct optionlist to use from simfactory/mdb/optionlists. You can then choose the optionlist to use on the "sim build" command line:

   sim build --thornlist path/to/thornlist.th --optionlist <optionlist-name>

Writing your own optionlist

If your operating system is not supported, you will need to write your own optionlist. The options provided by Cactus are described in the Cactus documentation. This page provides additional information and recommendations.

The following is based on the ubuntu.cfg optionlist.

VERSION = 2012-09-28

Cactus will reconfigure when the VERSION string changes.

Compilers

CPP = cpp
FPP = cpp
CC  = gcc
CXX = g++
F77 = gfortran
F90 = gfortran

The C and Fortran preprocessors, and the C, C++, Fortran 77 and Fortran 90 compilers, are specified by these options. You can specify a full path if the compiler you want to use is not available on your default path. Note that it is strongly recommended to use compilers from the same family; e.g. don't mix the Intel C Compiler with the GNU Fortran Compiler.

Compilation and linking flags

CPPFLAGS = -DMPICH_IGNORE_CXX_SEEK
FPPFLAGS = -traditional
CFLAGS   = -g3 -march=native -std=gnu99
CXXFLAGS = -g3 -march=native -std=gnu++0x
F77FLAGS = -g3 -march=native -fcray-pointer -m128bit-long-double -ffixed-line-length-none
F90FLAGS = -g3 -march=native -fcray-pointer -m128bit-long-double -ffixed-line-length-none
LDFLAGS  = -rdynamic
LIBDIRS =

C_LINE_DIRECTIVES = yes
F_LINE_DIRECTIVES = yes

Debugging

DEBUG           = no
CPP_DEBUG_FLAGS = -DCARPET_DEBUG
FPP_DEBUG_FLAGS = -DCARPET_DEBUG
C_DEBUG_FLAGS   = -O0 
CXX_DEBUG_FLAGS = -O0 
F77_DEBUG_FLAGS = -O0
F90_DEBUG_FLAGS = -O0

Optimisation

OPTIMISE           = yes
CPP_OPTIMISE_FLAGS = -DKRANC_VECTORS # -DCARPET_OPTIMISE -DNDEBUG
FPP_OPTIMISE_FLAGS = # -DCARPET_OPTIMISE -DNDEBUG
C_OPTIMISE_FLAGS   = -O2 -ffast-math
CXX_OPTIMISE_FLAGS = -O2 -ffast-math
F77_OPTIMISE_FLAGS = -O2 -ffast-math
F90_OPTIMISE_FLAGS = -O2 -ffast-math

Profiling

PROFILE           = no
CPP_PROFILE_FLAGS =
FPP_PROFILE_FLAGS =
C_PROFILE_FLAGS   = -pg
CXX_PROFILE_FLAGS = -pg
F77_PROFILE_FLAGS = -pg
F90_PROFILE_FLAGS = -pg

OpenMP

OPENMP           = yes
CPP_OPENMP_FLAGS = -fopenmp
FPP_OPENMP_FLAGS = -fopenmp
C_OPENMP_FLAGS   = -fopenmp
CXX_OPENMP_FLAGS = -fopenmp
F77_OPENMP_FLAGS = -fopenmp
F90_OPENMP_FLAGS = -fopenmp

Warnings

WARN           = yes
CPP_WARN_FLAGS = -Wall
FPP_WARN_FLAGS = -Wall
C_WARN_FLAGS   = -Wall
CXX_WARN_FLAGS = -Wall
F77_WARN_FLAGS = -Wall
F90_WARN_FLAGS = -Wall

HDF5

HDF5_ENABLE_FORTRAN = no
HDF5_ENABLE_CXX     = no

MPI

MPI_DIR      = /usr
MPI_INC_DIRS = /usr/include/mpich2
MPI_LIB_DIRS = /usr/lib
MPI_LIBS     = mpich fmpich mpl

Others

PTHREADS = yes