diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/openmc/package.py | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/openmc/package.py b/var/spack/repos/builtin/packages/openmc/package.py index 1eecf5725e..1088aeec60 100644 --- a/var/spack/repos/builtin/packages/openmc/package.py +++ b/var/spack/repos/builtin/packages/openmc/package.py @@ -18,12 +18,37 @@ class Openmc(CMakePackage): url = "https://github.com/openmc-dev/openmc/tarball/v0.10.0" git = "https://github.com/openmc-dev/openmc.git" + version('develop', branch='develop', submodules=True) + version('master', branch='master', submodules=True) + version('0.12.0', tag='v0.12.0', submodules=True) + version('0.11.0', sha256='19a9d8e9c3b581e9060fbd96d30f1098312d217cb5c925eb6372a5786d9175af') version('0.10.0', sha256='47650cb45e2c326ae439208d6f137d75ad3e5c657055912d989592c6e216178f') - version('develop') - depends_on("hdf5+hl") + variant('mpi', default=False, description='Enable MPI support') + variant('openmp', default=True, description='Enable OpenMP support') + variant('optimize', default=False, description='Enable optimization flags') + variant('debug', default=False, description='Enable debug flags') + + depends_on('git', type='build') + depends_on('hdf5+hl~mpi', when='~mpi') + depends_on('mpi', when='+mpi') + depends_on('hdf5+hl+mpi', when='+mpi') def cmake_args(self): - options = ['-DHDF5_ROOT:PATH=%s' % self.spec['hdf5'].prefix] + options = ['-DCMAKE_INSTALL_LIBDIR=lib'] # forcing bc sometimes goes to lib64 + + if '+mpi' in self.spec: + options += ['-DCMAKE_C_COMPILER=%s' % self.spec['mpi'].mpicc, + '-DCMAKE_CXX_COMPILER=%s' % self.spec['mpi'].mpicxx] + + options += [self.define_from_variant('openmp')] + options += [self.define_from_variant('optimize')] + options += [self.define_from_variant('debug')] + + if '+optimize' in self.spec: + self.spec.variants['build_type'].value = 'Release' + + if '+debug' in self.spec: + self.spec.variants['build_type'].value = 'Debug' return options |