TDEP
is written in modern Fortran, and requires a working Fortran environment. All system-specific settings are saved in a file called important_settings
. There are some example important_settings.target
template files in the examples/build
folder. We advise to pick the one closest to your target system and adjust the respective fields.
- Fortran compiler. Several f2003/2008 features are extensively used, so the compiler should not be super ancient.
- BLAS and LAPACK need to be installed
- FFTW needs to be installed
- MPI needs to be installed
- HDF5 needs to be installed with Fortran support.
- python should be installed
- gnuplot should be installed
Note: The build_things.sh
script assumes that TDEP was cloned and lives in a git repository. If you wish obtain TDEP in another you have to adjust the script.
If you have a package manager, homebrew
, apt-get
, yay
, pacman
, you name it, getting these dependencies should be straightforward.
For example, you would run
sudo apt-get install lapack blas hdf5
and confirm that libraries and include files add up at a place where you find them, e.g., /usr/lib
or /usr/local/lib
. This will be the paths you specify in the important settings.
- Pick e.g. the
./examples/build/important_settings.gfortran
and copy it toimportant_settings
:
cp examples/build/important_settings.gfortran important_settings
-
adjust:
-
FORTRAN_COMPILER
: your fortran compiler -
FCFLAGS
: compiler settings to makegfortran
(or whatever other compiler you are using) work -
PATH_TO_BLASLAPACK_LIB
: Path to your BLAS and LAPACK installation. Probably/usr/local
or similar – when in doubt find it viafind /usr | grep lapack
and see where your LAPACK library is actually located on your computer
-
PATH_TO_BLASLAPACK_INC
: Same but for the INCLUDE files. -
PATH_TO_FFTW_LIB
,PATH_TO_MPI_LIB
,PATH_TO_HDF5_LIB
same for FFTW, MPI, HDF5 -
optionally:
GNUPLOTTERMINAL
, which can beaqua
(on macOS),qt
orwxt
on linux
-
Then run the build script via
bash build_things.sh --nthreads_make 4
If everything works find, the last lines of the output should be something like:
...
Printing bashrc_tdep, append these lines to your .bashrc for stuff to work nicely
MANPATH=$MANPATH:/path/to/tdep/man
PATH=$PATH:/path/to/tdep/bin
export MANPATH
export PATH
alias gnuplot='gnuplot -persist'
Everything should be set up and good to go!
i.e., add the respective lines to your .bashrc
and you are all set up!
If problems occur, please look at the Troubleshooting section below. If you cannot fix the error, please reach out, e.g., via the issue tracker.
We advise to run the tests in ./tests
to check your installation.
If you need to install HDF5 manually, it can be downloaded here. Installing it should go like
./configure FC=FC CC=CC --enable-fortran --prefix=XX
make
make install
where FC
and CC
should point to the same Fortran/C compilers you are using to install TDEP.
If you are using Homebrew
, you can install all dependencies via brew install
, e.g., something like
brew install gcc openmpi gnuplot hdf5
Then proceed as in the example above. Check out the important_settings.osx_gfortran_accelerate
file as well for reference.
This will depend on the supercomputer you work with, but there should be no big problem per se since the requirements are standard software.
There are two template settings files you can look into:
important_settings.sigma
is a template file for a supercomputer with traditional Intel architecture and Intel compilers + MKL math library.important_settings.dardel
is for a Cray supercomputer with AMD CPUs wheregfortran
is used to compile.
One convenient, (mostly) platform-agnostic way to install TDEP is to use Anaconda.
Create a conda
environment with
conda create --prefix /path/to/where/you/want/to/create/the/conda_env python=3.10
Activate:
conda activate /path/to/where/you/want/to/create/the/conda_env/
Install dependencies
conda install -c conda-forge gfortran openmpi-mpifort scalapack fftw hdf5
Copy ./examples/build/important_settings.conda
to important_settings
and adjust the PREFIX
, i.e.,
...
PREFIX=/path/to/where/you/want/to/create/the/conda_env
...
Note: On some apple-silicon devices you need to point to the libm
library in /Library/Developer/CommandLineTools
, see troubleshooting section below.
Run
./build_things.sh --nthreads_make 4
This should be it.
If you see the error
...
ld: library not found for -lm
collect2: error: ld returned 1 exit status
on an Apple device with silicon chip (M1, M2, etc.), try adding the following to your important_settings
:
FCFLAGS_EXTRA="-L/Library/Developer/CommandLineTools//SDKs/MacOSX13.3.sdk/usr/lib/"
where the given path should point to you MacOS xcode installation lib
path.
If you see the error
fatal: not a git repository (or any of the parent directories): .git
it means you did not clone TDEP from github. In that case, either clone it or adjust the build_things.sh
script.
"error: unrecognized command line option '-fallow-argument-mismatch'; did you mean '-Wno-argument-mismatch'?"
If you see the error
... error: unrecognized command line option '-fallow-argument-mismatch'; did you mean '-Wno-argument-mismatch'?
it likely means that you are using an older Fortran version, and should replace -fallow-argument-mismatch
with -Wno-argument-mismatch
in your important_settings
as suggested.