diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/openturns/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/openturns/package.py | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/openturns/package.py b/var/spack/repos/builtin/packages/openturns/package.py new file mode 100644 index 0000000000..7ab5405052 --- /dev/null +++ b/var/spack/repos/builtin/packages/openturns/package.py @@ -0,0 +1,59 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Openturns(CMakePackage): + """OpenTURNS is a scientific C++ and Python library featuring an + internal data model and algorithms dedicated to the treatment of + uncertainties. The main goal of this library is to provide all + functionalities needed to treat uncertainties in studies with + industrial applications. Targeted users are all engineers who want + to introduce the probabilistic dimension in their so far + deterministic studies.""" + + homepage = "https://openturns.github.io/www/" + git = "https://github.com/openturns/openturns.git" + maintainers = ['liuyangzhuan'] + + version('master', branch='master') + + variant('python', default=True, description='Build Python bindings') + + extends('python', when='+python') + + depends_on('mpi', type=('build', 'run')) + depends_on('lapack', type=('build', 'run')) + depends_on('cmake@2.8:', type='build') + depends_on('swig', type=('build', 'run')) + depends_on('py-numpy@1.7:', type=('build', 'run')) + depends_on('py-pandas', type=('build', 'run')) + depends_on('py-matplotlib', type=('build', 'run')) + depends_on('boost+system+serialization+thread', type=('build', 'run')) + depends_on('intel-tbb', type=('build', 'run')) + depends_on('py-cloudpickle', type=('build', 'run')) + depends_on('py-urllib3', type=('build', 'run')) + + def cmake_args(self): + spec = self.spec + + args = [ + '-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc, + '-DCMAKE_CXX_COMPILER=%s' % spec['mpi'].mpicxx, + '-DCMAKE_INSTALL_LIBDIR:STRING=%s' % self.prefix.lib, + '-DCMAKE_INSTALL_BINDIR:STRING=%s' % self.prefix.bin, + '-DLAPACK_LIBRARIES=%s' % spec['lapack'].libs.joined(";"), + ] + + if '+python' in spec: + args.extend([ + # By default picks up the system python not the Spack build + '-DPYTHON_EXECUTABLE={0}'.format(spec['python'].command.path), + # By default installs to the python prefix + '-DPYTHON_SITE_PACKAGES={0}'.format(site_packages_dir), + ]) + + return args |