Massive conversion from Package to CMakePackage (#4975)

This commit is contained in:
Adam J. Stewart
2017-08-05 10:15:18 -05:00
committed by GitHub
parent 17cdb73be7
commit c7df12f698
57 changed files with 410 additions and 677 deletions

View File

@@ -26,7 +26,7 @@
import os
class Psi4(Package):
class Psi4(CMakePackage):
"""Psi4 is an open-source suite of ab initio quantum chemistry
programs designed for efficient, high-accuracy simulations of
a variety of molecular properties."""
@@ -36,20 +36,16 @@ class Psi4(Package):
version('0.5', '53041b8a9be3958384171d0d22f9fdd0')
variant('build_type', default='Release',
description='The build type to build',
values=('Debug', 'Release'))
# Required dependencies
depends_on('blas')
depends_on('lapack')
depends_on('boost'
'+chrono'
'+filesystem'
'+python'
'+regex'
'+serialization'
'+system'
'+timer'
'+thread')
depends_on('boost+chrono+filesystem+python+regex+serialization+system+timer+thread')
depends_on('python')
depends_on('cmake', type='build')
depends_on('cmake@3.3:', type='build')
depends_on('py-numpy', type=('build', 'run'))
# Optional dependencies
@@ -59,8 +55,10 @@ class Psi4(Package):
# depends_on('pcm-solver')
# depends_on('chemps2')
def install(self, spec, prefix):
cmake_args = [
def cmake_args(self):
spec = self.spec
return [
'-DBLAS_TYPE={0}'.format(spec['blas'].name.upper()),
'-DBLAS_LIBRARIES={0}'.format(spec['blas'].libs.joined()),
'-DLAPACK_TYPE={0}'.format(spec['lapack'].name.upper()),
@@ -71,16 +69,7 @@ def install(self, spec, prefix):
'-DENABLE_CHEMPS2=OFF'
]
cmake_args.extend(std_cmake_args)
with working_dir('spack-build', create=True):
cmake('..', *cmake_args)
make()
make('install')
self.filter_compilers(spec, prefix)
@run_after('install')
def filter_compilers(self, spec, prefix):
"""Run after install to tell the configuration files to
use the compilers that Spack built the package with.