forked from ukri-excalibur/excalibur-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2780686
commit 36fe061
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import os | ||
|
||
from spack.package import * | ||
|
||
class Arepo(MakefilePackage): | ||
"""Arepo is a massively parallel gravity and hydrodynamics code for astrophysical simulations.""" | ||
homepage = "https://gitlab.mpcdf.mpg.de/vrs/arepo.git" | ||
git = "https://gitlab.mpcdf.mpg.de/vrs/arepo.git" | ||
|
||
|
||
version("master", branch="master") | ||
|
||
|
||
depends_on('mpi') | ||
depends_on('gsl') | ||
depends_on('hdf5') | ||
|
||
variant('fftw', default=False, description='FFTW support') | ||
variant('hdf5', default=True, description='HDF5 support') | ||
variant('hwloc', default=False, description='HWLOC support') | ||
|
||
depends_on('fftw', when='+fftw') | ||
depends_on('hwloc', when='+hwloc') | ||
depends_on("mpich", when='^mpich') | ||
depends_on("openmpi", when='^openmpi') | ||
|
||
def edit(self, spec, prefix): | ||
|
||
copy('Template-Makefile.systype', 'Makefile.systype') | ||
copy('Template-Config.sh', 'Config.sh') | ||
|
||
specific_config_path = 'examples/yee_2d/Config.sh' | ||
|
||
self.config_file = specific_config_path | ||
|
||
with open('Makefile.systype', 'w') as f: | ||
f.write('SYSTYPE="Darwin"\n') | ||
|
||
env["CC"] = spec["mpi"].mpicc | ||
env["CXX"] = spec["mpi"].mpicxx | ||
env["FC"] = spec["mpi"].mpifc | ||
env["F77"] = spec["mpi"].mpif77 | ||
|
||
def build(self, spec, prefix): | ||
|
||
make('CONFIG={}'.format(self.config_file), 'BUILD_DIR=./build', 'EXEC=./Arepo') | ||
|
||
def install(self, spec, prefix): | ||
|
||
mkdirp(prefix.bin) | ||
install('./Arepo', prefix.bin) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|