dealii: switch to CMakePackage and minor cleanup (#2237)

This commit is contained in:
Denis Davydov 2016-11-04 09:46:39 +01:00 committed by Todd Gamblin
parent 1eeef97c78
commit 453331dba0

View File

@ -23,10 +23,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## ##############################################################################
from spack import * from spack import *
import sys
class Dealii(Package): class Dealii(CMakePackage):
"""C++ software library providing well-documented tools to build finite """C++ software library providing well-documented tools to build finite
element codes for a broad variety of PDEs.""" element codes for a broad variety of PDEs."""
homepage = "https://www.dealii.org" homepage = "https://www.dealii.org"
@ -118,7 +117,8 @@ class Dealii(Package):
depends_on("numdiff", when='@develop') depends_on("numdiff", when='@develop')
depends_on("astyle@2.04", when='@develop') depends_on("astyle@2.04", when='@develop')
def install(self, spec, prefix): def cmake_args(self):
spec = self.spec
options = [] options = []
options.extend(std_cmake_args) options.extend(std_cmake_args)
@ -127,7 +127,6 @@ def install(self, spec, prefix):
if word.startswith('-DCMAKE_BUILD_TYPE'): if word.startswith('-DCMAKE_BUILD_TYPE'):
options.remove(word) options.remove(word)
dsuf = 'dylib' if sys.platform == 'darwin' else 'so'
lapack_blas = spec['lapack'].lapack_libs + spec['blas'].blas_libs lapack_blas = spec['lapack'].lapack_libs + spec['blas'].blas_libs
options.extend([ options.extend([
'-DCMAKE_BUILD_TYPE=DebugRelease', '-DCMAKE_BUILD_TYPE=DebugRelease',
@ -215,9 +214,9 @@ def install(self, spec, prefix):
'-DNETCDF_FOUND=true', '-DNETCDF_FOUND=true',
'-DNETCDF_LIBRARIES=%s;%s' % ( '-DNETCDF_LIBRARIES=%s;%s' % (
join_path(spec['netcdf-cxx'].prefix.lib, join_path(spec['netcdf-cxx'].prefix.lib,
'libnetcdf_c++.%s' % dsuf), 'libnetcdf_c++.%s' % dso_suffix),
join_path(spec['netcdf'].prefix.lib, join_path(spec['netcdf'].prefix.lib,
'libnetcdf.%s' % dsuf)), 'libnetcdf.%s' % dso_suffix)),
'-DNETCDF_INCLUDE_DIRS=%s;%s' % ( '-DNETCDF_INCLUDE_DIRS=%s;%s' % (
spec['netcdf-cxx'].prefix.include, spec['netcdf-cxx'].prefix.include,
spec['netcdf'].prefix.include), spec['netcdf'].prefix.include),
@ -238,11 +237,7 @@ def install(self, spec, prefix):
'-DDEAL_II_WITH_OPENCASCADE=OFF' '-DDEAL_II_WITH_OPENCASCADE=OFF'
]) ])
cmake('.', *options) return options
make()
if self.run_tests:
make("test")
make("install")
def setup_environment(self, spack_env, env): def setup_environment(self, spack_env, env):
env.set('DEAL_II_DIR', self.prefix) env.set('DEAL_II_DIR', self.prefix)