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

@@ -25,7 +25,7 @@
from spack import *
class Dakota(Package):
class Dakota(CMakePackage):
"""The Dakota toolkit provides a flexible, extensible interface between
analysis codes and iterative systems analysis methods. Dakota
contains algorithms for:
@@ -49,8 +49,6 @@ class Dakota(Package):
version('6.3', '05a58d209fae604af234c894c3f73f6d')
variant('debug', default=False,
description='Builds a debug version of the libraries')
variant('shared', default=True,
description='Enables the build of shared libraries')
variant('mpi', default=True, description='Activates MPI support')
@@ -61,28 +59,20 @@ class Dakota(Package):
depends_on('python')
depends_on('boost')
depends_on('cmake', type='build')
depends_on('cmake@2.8.9:', type='build')
def install(self, spec, prefix):
options = []
options.extend(std_cmake_args)
def cmake_args(self):
spec = self.spec
options.extend([
'-DCMAKE_BUILD_TYPE:STRING=%s' % (
'Debug' if '+debug' in spec else 'Release'),
args = [
'-DBUILD_SHARED_LIBS:BOOL=%s' % (
'ON' if '+shared' in spec else 'OFF')])
'ON' if '+shared' in spec else 'OFF'),
]
if '+mpi' in spec:
options.extend([
args.extend([
'-DDAKOTA_HAVE_MPI:BOOL=ON',
'-DMPI_CXX_COMPILER:STRING=%s' % join_path(
spec['mpi'].prefix.bin, 'mpicxx')])
'-DMPI_CXX_COMPILER:STRING=%s' % join_path(spec['mpi'].mpicxx),
])
build_directory = join_path(self.stage.path, 'spack-build')
source_directory = self.stage.source_path
with working_dir(build_directory, create=True):
cmake(source_directory, *options)
make()
make("install")
return args