the Kinetic Orbit Runaway electrons Code (KORC) follows relativistic electrons in general electric and magnetic fields under the full Lorentz force, collisions, and radiation losses.
Spack provides an easy way to setup the gfortran compiler toolchain and other dependencies without the headache of managing them through the OS. Here's how to build KORC on a Linux workstation using Spack:
- Grab the spack software using git, and source the
setup-env.sh
script from within the spack installation.
[user@localhost KORC]$ git clone --depth=100 --branch=releases/v0.21 https://github.com/spack/spack.git ~/spack
[user@localhost KORC]$ . ~/spack/share/spack/setup-env.sh
- Create and activate a new spack environment
[KORC] [user@localhost KORC]$ spack env create -d .
[KORC] [user@localhost KORC]$ spack env activate -p -d .
- Configure spack and bootstrap the compiler
[KORC] [user@localhost KORC]$ spack config add "config:install_tree:padded_length:128"
[KORC] [user@localhost KORC]$ spack install --no-cache --add [email protected]
[KORC] [user@localhost KORC]$ spack load [email protected]
[KORC] [user@localhost KORC]$ spack compiler find
[KORC] [user@localhost KORC]$ spack install --no-cache --add cmake %[email protected]
[KORC] [user@localhost KORC]$ spack load cmake %[email protected]
[KORC] [user@localhost KORC]$ spack concretize -f
[KORC] [user@localhost KORC]$ spack install --no-cache --add hdf5+fortran+mpi %[email protected]
[KORC] [user@localhost KORC]$ spack load hdf5+fortran+mpi %[email protected]
- Verify gfortan, cmake and Build KORC
[KORC] [user@localhost KORC]$ which cmake
[KORC] [user@localhost KORC]$ which gfortran
[KORC] [user@localhost KORC]$ gfortran --version
[KORC] [user@localhost KORC]$ ./build.sh
- Exit the spack environment
[KORC] [user@localhost KORC]$ spack env deactivate