From 3508909f069413f0400f92e76078ab5aa671e0c4 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Thu, 8 Jun 2017 16:54:26 -0600 Subject: Adding Nalu package. (#4428) * Adding Nalu package. * Fixing flake8 stuff. * Fixing flake8 stuff. * Reorganizing trilinos package file a little to make it less verbose. * Reorganizing trilinos package file for more general use as well as use as a dependency of the Nalu package. Setting fpic as default for yaml-cpp and superlu. * Explicitly stating fpic variants in dependent packages. * Updating nalu and trilinos package files with suggested changes. * Fixing formatting issues. Making suggested changes. * Fixing formatting. * Reducing amount of explicit variants in Nalu. Adding suggested changes to Trilinos package file. * Making suggested changes to Nalu package. * Turning off superlu-dist variant. * Cleaning up yaml-cpp file. * Fixing pnetcdf requirements in trilinos. --- var/spack/repos/builtin/packages/nalu/package.py | 64 ++++ .../repos/builtin/packages/superlu/package.py | 6 +- .../repos/builtin/packages/trilinos/package.py | 338 +++++++++++++++------ .../repos/builtin/packages/yaml-cpp/package.py | 16 +- 4 files changed, 315 insertions(+), 109 deletions(-) create mode 100644 var/spack/repos/builtin/packages/nalu/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/nalu/package.py b/var/spack/repos/builtin/packages/nalu/package.py new file mode 100644 index 0000000000..f485b5cb17 --- /dev/null +++ b/var/spack/repos/builtin/packages/nalu/package.py @@ -0,0 +1,64 @@ +############################################################################## +# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. +# Produced at the Lawrence Livermore National Laboratory. +# +# This file is part of Spack. +# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. +# LLNL-CODE-647188 +# +# For details, see https://github.com/llnl/spack +# Please also see the LICENSE file for our notice and the LGPL. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License (as +# published by the Free Software Foundation) version 2.1, February 1999. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and +# conditions of the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +############################################################################## +from spack import * + + +class Nalu(CMakePackage): + """Nalu: a generalized unstructured massively parallel low Mach flow code + designed to support a variety of energy applications of interest (most + notably Wind ECP) built on the Sierra Toolkit and Trilinos solver + Tpetra/Epetra stack + """ + + homepage = "https://github.com/NaluCFD/Nalu" + url = "https://github.com/NaluCFD/Nalu.git" + + version('master', + git='https://github.com/NaluCFD/Nalu.git', branch='master') + + variant('debug', default=False, + description='Builds a debug version') + + # Currently Nalu only builds static libraries; To be fixed soon + depends_on('yaml-cpp+fpic~shared') + depends_on('trilinos~shared+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf@master') + + def build_type(self): + if '+debug' in self.spec: + return 'Debug' + else: + return 'Release' + + def cmake_args(self): + spec = self.spec + options = [] + + options.extend([ + '-DTrilinos_DIR:PATH=%s' % spec['trilinos'].prefix, + '-DYAML_DIR:PATH=%s' % spec['yaml-cpp'].prefix, + '-DENABLE_INSTALL:BOOL=ON' + ]) + + return options diff --git a/var/spack/repos/builtin/packages/superlu/package.py b/var/spack/repos/builtin/packages/superlu/package.py index 13c11b66b9..8e7303d6c8 100644 --- a/var/spack/repos/builtin/packages/superlu/package.py +++ b/var/spack/repos/builtin/packages/superlu/package.py @@ -38,8 +38,8 @@ class Superlu(Package): version('5.2.1', '3a1a9bff20cb06b7d97c46d337504447') version('4.3', 'b72c6309f25e9660133007b82621ba7c') - variant('fpic', default=False, - description='Build with position independent code') + variant('fpic', default=True, + description='Build with position independent code') depends_on('cmake', when='@5.2.1:', type='build') depends_on('blas') @@ -117,4 +117,4 @@ class Superlu(Package): headers = glob.glob(join_path('SRC', '*.h')) mkdir(prefix.include) for h in headers: - install(h, prefix.include) + install(h, prefix.include) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 66dc4f0e64..40929499de 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -46,6 +46,8 @@ class Trilinos(CMakePackage): homepage = "https://trilinos.org/" url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-12-10-1.tar.gz" + # ###################### Versions ########################## + version('xsdk-0.2.0', git='https://github.com/trilinos/Trilinos.git', tag='xsdk-0.2.0') version('develop', @@ -65,7 +67,11 @@ class Trilinos(CMakePackage): version('11.14.2', 'e7c3cdbbfe3279a8a68838b873ad6d51') version('11.14.1', 'b7760b142eef66c79ed13de7c9560f81') - variant('xsdkflags', default=False, + # ###################### Variants ########################## + + variant('alloptpkgs', default=False, + description='Compile with all optional packages') + variant('xsdkflags', default=False, description='Compile using the default xSDK configuration') variant('metis', default=True, description='Compile with METIS and ParMETIS') @@ -73,25 +79,72 @@ class Trilinos(CMakePackage): description='Compile with support for MUMPS solvers') variant('superlu-dist', default=True, description='Compile with SuperluDist solvers') - variant('superlu', default=False, + variant('superlu', default=False, description='Compile with SuperLU solvers') variant('hypre', default=True, description='Compile with Hypre preconditioner') - variant('hdf5', default=True, description='Compile with HDF5') + variant('hdf5', default=True, + description='Compile with HDF5') variant('suite-sparse', default=True, description='Compile with SuiteSparse solvers') # not everyone has py-numpy activated, keep it disabled by default to avoid # configure errors - variant('python', default=False, description='Build python wrappers') + variant('python', default=False, + description='Build python wrappers') variant('shared', default=True, description='Enables the build of shared libraries') variant('debug', default=False, description='Builds a debug version of the libraries') - variant('boost', default=True, description='Compile with Boost') - variant('tpetra', default=True, description='Compile with Tpetra') - variant('exodus', default=False, description='Compile with Exodus from SEACAS') - - variant('dtk', default=False, description='Enable DataTransferKit') + variant('boost', default=True, + description='Compile with Boost') + variant('tpetra', default=True, + description='Compile with Tpetra') + variant('epetra', default=True, + description='Compile with Epetra') + variant('epetraext', default=True, + description='Compile with EpetraExt') + variant('exodus', default=True, + description='Compile with Exodus from SEACAS') + variant('pnetcdf', default=False, + description='Compile with parallel-netcdf') + variant('zlib', default=False, + description='Compile with zlib') + variant('stk', default=False, + description='Compile with STK') + variant('belos', default=True, + description='Compile with Belos') + variant('zoltan', default=True, + description='Compile with Zoltan') + variant('zoltan2', default=True, + description='Compile with Zoltan2') + variant('amesos', default=True, + description='Compile with Amesos') + variant('amesos2', default=True, + description='Compile with Amesos2') + variant('ifpack', default=True, + description='Compile with Ifpack') + variant('ifpack2', default=True, + description='Compile with Ifpack2') + variant('muelu', default=True, + description='Compile with Muelu') + variant('fortran', default=True, + description='Compile with Fortran support') + variant('ml', default=True, + description='Compile with ML') + variant('gtest', default=True, + description='Compile with Gtest') + variant('aztec', default=True, + description='Compile with Aztec') + variant('sacado', default=True, + description='Compile with Sacado') + variant('x11', default=False, + description='Compile with X11') + variant('instantiate', default=True, + description='Compile with explicit instantiation') + variant('instantiate_cmplx', default=False, + description='Compile with explicit instantiation for complex') + variant('dtk', default=False, + description='Enable DataTransferKit') resource(name='dtk', git='https://github.com/ornl-cees/DataTransferKit', tag='master', @@ -99,6 +152,8 @@ class Trilinos(CMakePackage): when='+dtk') conflicts('+dtk', when='~tpetra') + # ###################### Dependencies ########################## + # Everything should be compiled with -fpic depends_on('blas') depends_on('lapack') @@ -108,10 +163,13 @@ class Trilinos(CMakePackage): depends_on('glm') depends_on('metis@5:', when='+metis') depends_on('suite-sparse', when='+suite-sparse') + depends_on('zlib', when="+zlib") # MPI related dependencies depends_on('mpi') depends_on('netcdf+mpi') + depends_on('parallel-netcdf', when="+pnetcdf@master") + depends_on('parallel-netcdf', when="+pnetcdf@12.10.2:") depends_on('parmetis', when='+metis') # Trilinos' Tribits config system is limited which makes it very tricky to # link Amesos with static MUMPS, see @@ -163,53 +221,137 @@ class Trilinos(CMakePackage): cxx_flags = [] options = [] + # #################### Base Settings ####################### + mpi_bin = spec['mpi'].prefix.bin - # Note: -DXYZ_LIBRARY_NAMES= needs semicolon separated list of names - blas = spec['blas'].libs - lapack = spec['lapack'].libs options.extend([ - '-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON', - '-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON', '-DTrilinos_VERBOSE_CONFIGURE:BOOL=OFF', '-DTrilinos_ENABLE_TESTS:BOOL=OFF', '-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF', + '-DTrilinos_ENABLE_CXX11:BOOL=ON', '-DCMAKE_BUILD_TYPE:STRING=%s' % ( 'DEBUG' if '+debug' in spec else 'RELEASE'), '-DBUILD_SHARED_LIBS:BOOL=%s' % ( 'ON' if '+shared' in spec else 'OFF'), - '-DTPL_FIND_SHARED_LIBS:BOOL=%s' % ( - 'ON' if '+shared' in spec else 'OFF'), - '-DTrilinos_LINK_SEARCH_START_STATIC:BOOL=%s' % ( - 'OFF' if '+shared' in spec else 'ON'), + + # The following can cause problems on systems that don't have + # static libraries available for things like dl and pthreads + # for example when trying to build static libs + # '-DTPL_FIND_SHARED_LIBS:BOOL=%s' % ( + # 'ON' if '+shared' in spec else 'OFF'), + # '-DTrilinos_LINK_SEARCH_START_STATIC:BOOL=%s' % ( + # 'OFF' if '+shared' in spec else 'ON'), + + # Force Trilinos to use the MPI wrappers instead of raw compilers + # this is needed on Apple systems that require full resolution of + # all symbols when linking shared libraries '-DTPL_ENABLE_MPI:BOOL=ON', - '-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix, + '-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc, + '-DCMAKE_CXX_COMPILER=%s' % spec['mpi'].mpicxx, + '-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc, + '-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix + ]) + + # ################## Trilinos Packages ##################### + + options.extend([ + '-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=%s' % ( + 'ON' if '+alloptpkgs' in spec else 'OFF'), + '-DTrilinos_ENABLE_Tpetra:BOOL=%s' % ( + 'ON' if '+tpetra' in spec else 'OFF'), + '-DTrilinos_ENABLE_Epetra:BOOL=%s' % ( + 'ON' if '+epetra' in spec else 'OFF'), + '-DTrilinos_ENABLE_EpetraExt:BOOL=%s' % ( + 'ON' if '+epetraext' in spec else 'OFF'), + '-DTrilinos_ENABLE_ML:BOOL=%s' % ( + 'ON' if '+ml' in spec else 'OFF'), + '-DTrilinos_ENABLE_AztecOO:BOOL=%s' % ( + 'ON' if '+aztec' in spec else 'OFF'), + '-DTrilinos_ENABLE_Sacado:BOOL=%s' % ( + 'ON' if '+sacado' in spec else 'OFF'), + '-DTrilinos_ENABLE_Belos:BOOL=%s' % ( + 'ON' if '+belos' in spec else 'OFF'), + '-DTrilinos_ENABLE_Zoltan:BOOL=%s' % ( + 'ON' if '+zoltan' in spec else 'OFF'), + '-DTrilinos_ENABLE_Zoltan2:BOOL=%s' % ( + 'ON' if '+zoltan2' in spec else 'OFF'), + '-DTrilinos_ENABLE_Amesos:BOOL=%s' % ( + 'ON' if '+amesos' in spec else 'OFF'), + '-DTrilinos_ENABLE_Amesos2:BOOL=%s' % ( + 'ON' if '+amesos2' in spec else 'OFF'), + '-DTrilinos_ENABLE_MueLu:BOOL=%s' % ( + 'ON' if '+muelu' in spec else 'OFF'), + '-DTrilinos_ENABLE_Ifpack:BOOL=%s' % ( + 'ON' if '+ifpack' in spec else 'OFF'), + '-DTrilinos_ENABLE_Ifpack2:BOOL=%s' % ( + 'ON' if '+ifpack2' in spec else 'OFF'), + '-DTrilinos_ENABLE_Gtest:BOOL=%s' % ( + 'ON' if '+gtest' in spec else 'OFF'), + ]) + + if '+xsdkflags' in spec: + options.extend(['-DUSE_XSDK_DEFAULTS=YES']) + + if '+stk' in spec: + # Currently these are fairly specific to the Nalu package + # They can likely change when necessary in the future + options.extend([ + '-DTrilinos_ENABLE_STKMesh:BOOL=ON', + '-DTrilinos_ENABLE_STKSimd:BOOL=ON', + '-DTrilinos_ENABLE_STKIO:BOOL=ON', + '-DTrilinos_ENABLE_STKTransfer:BOOL=ON', + '-DTrilinos_ENABLE_STKSearch:BOOL=ON', + '-DTrilinos_ENABLE_STKUtil:BOOL=ON', + '-DTrilinos_ENABLE_STKTopology:BOOL=ON', + '-DTrilinos_ENABLE_STKUnit_tests:BOOL=ON', + '-DTrilinos_ENABLE_STKUnit_test_utils:BOOL=ON', + '-DTrilinos_ENABLE_STKClassic:BOOL=OFF' + ]) + + if '+dtk' in spec: + options.extend([ + '-DTrilinos_EXTRA_REPOSITORIES:STRING=DataTransferKit', + '-DTpetra_INST_INT_UNSIGNED_LONG:BOOL=ON', + '-DTrilinos_ENABLE_DataTransferKit:BOOL=ON' + ]) + + if '+exodus' in spec: + # Currently these are fairly specific to the Nalu package + # They can likely change when necessary in the future + options.extend([ + '-DTrilinos_ENABLE_SEACAS:BOOL=ON', + '-DTrilinos_ENABLE_SEACASExodus:BOOL=ON', + '-DTrilinos_ENABLE_SEACASEpu:BOOL=ON', + '-DTrilinos_ENABLE_SEACASExodiff:BOOL=ON', + '-DTrilinos_ENABLE_SEACASNemspread:BOOL=ON', + '-DTrilinos_ENABLE_SEACASNemslice:BOOL=ON' + ]) + else: + options.extend([ + '-DTrilinos_ENABLE_SEACAS:BOOL=OFF', + '-DTrilinos_ENABLE_SEACASExodus:BOOL=OFF' + ]) + + # ######################### TPLs ############################# + + blas = spec['blas'].libs + lapack = spec['lapack'].libs + # Note: -DXYZ_LIBRARY_NAMES= needs semicolon separated list of names + options.extend([ '-DTPL_ENABLE_BLAS=ON', '-DBLAS_LIBRARY_NAMES=%s' % ';'.join(blas.names), '-DBLAS_LIBRARY_DIRS=%s' % ';'.join(blas.directories), '-DTPL_ENABLE_LAPACK=ON', '-DLAPACK_LIBRARY_NAMES=%s' % ';'.join(lapack.names), '-DLAPACK_LIBRARY_DIRS=%s' % ';'.join(lapack.directories), - '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', - '-DTrilinos_ENABLE_CXX11:BOOL=ON', '-DTPL_ENABLE_Netcdf:BOOL=ON', - '-DTrilinos_ENABLE_Tpetra:BOOL=%s' % ( - 'ON' if '+tpetra' in spec else 'OFF') + '-DNetCDF_ROOT:PATH=%s' % spec['netcdf'].prefix, + '-DTPL_ENABLE_X11:BOOL=%s' % ( + 'ON' if '+x11' in spec else 'OFF'), + '-DTrilinos_ENABLE_PyTrilinos:BOOL=%s' % ( + 'ON' if '+python' in spec else 'OFF'), ]) - if '.'.join(platform.mac_ver()[0].split('.')[:2]) == '10.12': - # use @rpath on Sierra due to limit of dynamic loader - options.append('-DCMAKE_MACOSX_RPATH=ON') - else: - options.append('-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib' % prefix) - - # Force Trilinos to use the MPI wrappers instead of raw compilers - # this is needed on Apple systems that require full resolution of - # all symbols when linking shared libraries - options.extend([ - '-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc, - '-DCMAKE_CXX_COMPILER=%s' % spec['mpi'].mpicxx, - '-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc - ]) if '+hypre' in spec: options.extend([ '-DTPL_ENABLE_HYPRE:BOOL=ON', @@ -217,25 +359,6 @@ class Trilinos(CMakePackage): '-DHYPRE_LIBRARY_DIRS:PATH=%s' % spec['hypre'].prefix.lib ]) - if spec.satisfies('%intel') and spec.satisfies('@12.6.2'): - # Panzer uses some std:chrono that is not recognized by Intel - # Don't know which (maybe all) Trilinos versions this applies to - # Don't know which (maybe all) Intel versions this applies to - options.extend([ - '-DTrilinos_ENABLE_Panzer:BOOL=OFF' - ]) - - if '+xsdkflags' in spec: - options.extend(['-DUSE_XSDK_DEFAULTS=YES']) - if '+hdf5' in spec: - options.extend([ - '-DTPL_ENABLE_HDF5:BOOL=ON', - '-DHDF5_INCLUDE_DIRS:PATH=%s' % spec['hdf5'].prefix.include, - '-DHDF5_LIBRARY_DIRS:PATH=%s' % spec['hdf5'].prefix.lib - ]) - else: - options.extend(['-DTPL_ENABLE_HDF5:BOOL=OFF']) - if '+boost' in spec: options.extend([ '-DTPL_ENABLE_Boost:BOOL=ON', @@ -254,18 +377,6 @@ class Trilinos(CMakePackage): else: options.extend(['-DTPL_ENABLE_HDF5:BOOL=OFF']) - # Fortran lib - if spec.satisfies('%gcc') or spec.satisfies('%clang'): - libgfortran = os.path.dirname(os.popen( - '%s --print-file-name libgfortran.a' % - join_path(mpi_bin, 'mpif90')).read()) - options.extend([ - '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-L%s/ -lgfortran' % ( - libgfortran), - '-DTrilinos_ENABLE_Fortran=ON' - ]) - - # suite-sparse related if '+suite-sparse' in spec: options.extend([ # FIXME: Trilinos seems to be looking for static libs only, @@ -290,7 +401,6 @@ class Trilinos(CMakePackage): '-DTPL_ENABLE_UMFPACK:BOOL=OFF', ]) - # metis / parmetis if '+metis' in spec: options.extend([ '-DTPL_ENABLE_METIS:BOOL=ON', @@ -310,7 +420,6 @@ class Trilinos(CMakePackage): '-DTPL_ENABLE_ParMETIS:BOOL=OFF', ]) - # mumps / scalapack if '+mumps' in spec: scalapack = spec['scalapack'].libs options.extend([ @@ -333,7 +442,6 @@ class Trilinos(CMakePackage): '-DTPL_ENABLE_SCALAPACK:BOOL=OFF', ]) - # superlu-dist: if '+superlu-dist' in spec: # Amesos, conflicting types of double and complex SLU_D # see @@ -360,7 +468,6 @@ class Trilinos(CMakePackage): '-DTPL_ENABLE_SuperLUDist:BOOL=OFF', ]) - # superlu: if '+superlu' in spec: options.extend([ '-DTPL_ENABLE_SuperLU:BOOL=ON', @@ -374,43 +481,55 @@ class Trilinos(CMakePackage): '-DTPL_ENABLE_SuperLU:BOOL=OFF', ]) - # python - if '+python' in spec: + if '+pnetcdf' in spec: options.extend([ - '-DTrilinos_ENABLE_PyTrilinos:BOOL=ON' + '-DTPL_ENABLE_Pnetcdf:BOOL=ON', + '-DTPL_Netcdf_Enables_Netcdf4:BOOL=ON', + '-DTPL_Netcdf_PARALLEL:BOOL=ON', + '-DPNetCDF_ROOT:PATH=%s' % spec['parallel-netcdf'].prefix ]) else: options.extend([ - '-DTrilinos_ENABLE_PyTrilinos:BOOL=OFF' + '-DTPL_ENABLE_Pnetcdf:BOOL=OFF' ]) - # collect CXX flags: - options.extend([ - '-DCMAKE_CXX_FLAGS:STRING=%s' % (' '.join(cxx_flags)), - ]) - - # disable due to compiler / config errors: - options.extend([ - '-DTrilinos_ENABLE_Pike=OFF', - '-DTrilinos_ENABLE_STK=OFF' - ]) - - if '+dtk' in spec: + if '+zlib' in spec: options.extend([ - '-DTrilinos_EXTRA_REPOSITORIES:STRING=DataTransferKit', - '-DTpetra_INST_INT_UNSIGNED_LONG:BOOL=ON', - '-DTrilinos_ENABLE_DataTransferKit:BOOL=ON' + '-DTPL_ENABLE_Zlib:BOOL=ON', + '-DZlib_ROOT:PATH=%s' % spec['zlib'].prefix, ]) - - # exodus - if '+exodus' in spec: + else: options.extend([ - '-DTrilinos_ENABLE_SEACAS:BOOL=ON' + '-DTPL_ENABLE_Zlib:BOOL=OFF' ]) - else: + + # ################# Miscellaneous Stuff ###################### + + # Fortran lib + if '+fortran' in spec: + if spec.satisfies('%gcc') or spec.satisfies('%clang'): + libgfortran = os.path.dirname(os.popen( + '%s --print-file-name libgfortran.a' % + join_path(mpi_bin, 'mpif90')).read()) + options.extend([ + '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-L%s/ -lgfortran' % ( + libgfortran), + '-DTrilinos_ENABLE_Fortran=ON' + ]) + + # Explicit instantiation + if '+instantiate' in spec: options.extend([ - '-DTrilinos_ENABLE_SEACAS:BOOL=OFF' + '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON' ]) + if '+tpetra' in spec: + options.extend([ + '-DTpetra_INST_DOUBLE:BOOL=ON', + '-DTpetra_INST_INT_LONG:BOOL=ON' + '-DTpetra_INST_COMPLEX_DOUBLE=%s' % ( + 'ON' if '+instantiate_cmplx' in spec else 'OFF' + ) + ]) # disable due to compiler / config errors: if spec.satisfies('%xl') or spec.satisfies('%xl_r'): @@ -423,6 +542,31 @@ class Trilinos(CMakePackage): options.extend([ '-DTrilinos_ENABLE_FEI=OFF' ]) + + if '.'.join(platform.mac_ver()[0].split('.')[:2]) == '10.12': + # use @rpath on Sierra due to limit of dynamic loader + options.append('-DCMAKE_MACOSX_RPATH=ON') + else: + options.append('-DCMAKE_INSTALL_NAME_DIR:PATH=%s' % prefix.lib) + + if spec.satisfies('%intel') and spec.satisfies('@12.6.2'): + # Panzer uses some std:chrono that is not recognized by Intel + # Don't know which (maybe all) Trilinos versions this applies to + # Don't know which (maybe all) Intel versions this applies to + options.extend([ + '-DTrilinos_ENABLE_Panzer:BOOL=OFF' + ]) + + # collect CXX flags: + options.extend([ + '-DCMAKE_CXX_FLAGS:STRING=%s' % (' '.join(cxx_flags)), + ]) + + # disable due to compiler / config errors: + options.extend([ + '-DTrilinos_ENABLE_Pike=OFF' + ]) + return options @run_after('install') diff --git a/var/spack/repos/builtin/packages/yaml-cpp/package.py b/var/spack/repos/builtin/packages/yaml-cpp/package.py index cc22b3420d..21400c2cfd 100644 --- a/var/spack/repos/builtin/packages/yaml-cpp/package.py +++ b/var/spack/repos/builtin/packages/yaml-cpp/package.py @@ -36,7 +36,7 @@ class YamlCpp(CMakePackage): variant('shared', default=True, description='Enable build of shared libraries') - variant('fpic', default=False, + variant('fpic', default=True, description='Build with position independent code') depends_on('boost', when='@:0.5.3') @@ -45,13 +45,11 @@ class YamlCpp(CMakePackage): spec = self.spec options = [] - if '+fpic' in spec: - options.extend([ - '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true' - ]) - if '+shared' in spec: - options.append('-DBUILD_SHARED_LIBS=ON') - else: - options.append('-DBUILD_SHARED_LIBS=OFF') + options.extend([ + '-DBUILD_SHARED_LIBS:BOOL=%s' % ( + 'ON' if '+shared' in spec else 'OFF'), + '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=%s' % ( + 'ON' if '+fpic' in spec else 'OFF'), + ]) return options -- cgit v1.2.3-60-g2f50