Update Nalu-Wind and dependencies (#10204)

* Updating nalu-wind, nalu, openfast, and tioga packages. Includes
  improved handling of +shared variant.
* Add fftw and catalyst support to nalu-wind.
* Restrict ParaView to use matplotlib versions before 3 (which
  require Python 3)
This commit is contained in:
Jon Rood 2019-01-18 17:43:59 -07:00 committed by Peter Scheibel
parent 7a2315aa38
commit e896ce7457
7 changed files with 131 additions and 44 deletions

View file

@ -19,26 +19,42 @@ class NaluWind(CMakePackage):
version('master', branch='master')
# Options
variant('shared', default=(sys.platform != 'darwin'),
description='Build dependencies as shared libraries')
variant('pic', default=True,
description='Position independent code')
# Third party libraries
variant('openfast', default=False,
description='Compile with OpenFAST support')
variant('tioga', default=False,
description='Compile with Tioga support')
variant('hypre', default=False,
description='Compile with Hypre support')
variant('shared', default=(sys.platform != 'darwin'),
description='Build Trilinos as shared library')
variant('pic', default=True,
description='Position independent code')
variant('catalyst', default=False,
description='Compile with Catalyst support')
variant('fftw', default=False,
description='Compile with FFTW support')
# Required dependencies
depends_on('mpi')
depends_on('yaml-cpp@0.5.3:')
depends_on('trilinos+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+shards~hypre@master,develop', when='+shared')
depends_on('yaml-cpp@0.5.3:', when='+shared')
depends_on('yaml-cpp~shared@0.5.3:', when='~shared')
# Cannot build Trilinos as a shared library with STK on Darwin
# which is why we have a 'shared' variant for Nalu-Wind
# https://github.com/trilinos/Trilinos/issues/2994
depends_on('trilinos+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+shards~hypre@master,develop', when='+shared')
depends_on('trilinos~shared+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+shards~hypre@master,develop', when='~shared')
depends_on('openfast+cxx', when='+openfast')
depends_on('tioga', when='+tioga')
depends_on('hypre+mpi+int64', when='+hypre')
# Optional dependencies
depends_on('openfast+cxx', when='+openfast+shared')
depends_on('openfast+cxx~shared', when='+openfast~shared')
depends_on('tioga', when='+tioga+shared')
depends_on('tioga~shared', when='+tioga~shared')
depends_on('hypre+mpi+int64', when='+hypre+shared')
depends_on('hypre+mpi+int64~shared', when='+hypre~shared')
depends_on('trilinos-catalyst-ioss-adapter', when='+catalyst')
# FFTW doesn't have a 'shared' variant at this moment
depends_on('fftw+mpi', when='+fftw')
def cmake_args(self):
spec = self.spec
@ -81,4 +97,24 @@ def cmake_args(self):
else:
options.append('-DENABLE_HYPRE:BOOL=OFF')
if '+catalyst' in spec:
options.extend([
'-DENABLE_PARAVIEW_CATALYST:BOOL=ON',
'-DPARAVIEW_CATALYST_INSTALL_PATH:PATH=%s' %
spec['trilinos-catalyst-ioss-adapter'].prefix
])
else:
options.append('-DENABLE_PARAVIEW_CATALYST:BOOL=OFF')
if '+fftw' in spec:
options.extend([
'-DENABLE_FFTW:BOOL=ON',
'-DFFTW_DIR:PATH=%s' % spec['fftw'].prefix
])
else:
options.append('-DENABLE_FFTW:BOOL=OFF')
if 'darwin' in spec.architecture:
options.append('-DCMAKE_MACOSX_RPATH:BOOL=ON')
return options

View file

@ -18,26 +18,27 @@ class Nalu(CMakePackage):
version('master', branch='master')
variant('openfast', default=False,
description='Compile with OpenFAST support')
variant('tioga', default=False,
description='Compile with Tioga support')
variant('hypre', default=False,
description='Compile with Hypre support')
# Options
variant('shared', default=(sys.platform != 'darwin'),
description='Build Trilinos as shared library')
description='Build dependencies as shared libraries')
variant('pic', default=True,
description='Position independent code')
# Third party libraries
variant('tioga', default=False,
description='Compile with Tioga support')
# Required dependencies
depends_on('mpi')
depends_on('yaml-cpp@0.5.3:')
depends_on('trilinos+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+shards~hypre@master,develop', when='+shared')
depends_on('yaml-cpp@0.5.3:', when='+shared')
depends_on('yaml-cpp~shared@0.5.3:', when='~shared')
# Cannot build Trilinos as a shared library with STK on Darwin
# which is why we have a 'shared' variant for Nalu
# https://github.com/trilinos/Trilinos/issues/2994
depends_on('trilinos+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+shards~hypre@master,develop', when='+shared')
depends_on('trilinos~shared+exodus+tpetra+muelu+belos+ifpack2+amesos2+zoltan+stk+boost~superlu-dist+superlu+hdf5+zlib+pnetcdf+shards~hypre@master,develop', when='~shared')
depends_on('openfast+cxx', when='+openfast')
depends_on('tioga', when='+tioga')
depends_on('hypre+mpi+int64', when='+hypre')
# Optional dependencies
depends_on('tioga', when='+tioga+shared')
depends_on('tioga~shared', when='+tioga~shared')
def cmake_args(self):
spec = self.spec
@ -46,18 +47,16 @@ def cmake_args(self):
options.extend([
'-DTrilinos_DIR:PATH=%s' % spec['trilinos'].prefix,
'-DYAML_DIR:PATH=%s' % spec['yaml-cpp'].prefix,
'-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc,
'-DCMAKE_CXX_COMPILER=%s' % spec['mpi'].mpicxx,
'-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc,
'-DMPI_C_COMPILER=%s' % spec['mpi'].mpicc,
'-DMPI_CXX_COMPILER=%s' % spec['mpi'].mpicxx,
'-DMPI_Fortran_COMPILER=%s' % spec['mpi'].mpifc,
'-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=%s' % (
'ON' if '+pic' in spec else 'OFF'),
])
if '+openfast' in spec:
options.extend([
'-DENABLE_OPENFAST:BOOL=ON',
'-DOpenFAST_DIR:PATH=%s' % spec['openfast'].prefix
])
else:
options.append('-DENABLE_OPENFAST:BOOL=OFF')
if '+tioga' in spec:
options.extend([
'-DENABLE_TIOGA:BOOL=ON',
@ -66,12 +65,7 @@ def cmake_args(self):
else:
options.append('-DENABLE_TIOGA:BOOL=OFF')
if '+hypre' in spec:
options.extend([
'-DENABLE_HYPRE:BOOL=ON',
'-DHYPRE_DIR:PATH=%s' % spec['hypre'].prefix
])
else:
options.append('-DENABLE_HYPRE:BOOL=OFF')
if 'darwin' in spec.architecture:
options.append('-DCMAKE_MACOSX_RPATH:BOOL=ON')
return options

View file

@ -39,22 +39,21 @@ class Openfast(CMakePackage):
depends_on('zlib', when='+cxx')
depends_on('libxml2', when='+cxx')
# Disable parallel builds because of OpenFOAM Types modules dependencies
parallel = False
def cmake_args(self):
spec = self.spec
options = []
options.extend([
'-DBUILD_DOCUMENTATION:BOOL=OFF',
'-DBUILD_TESTING:BOOL=OFF',
'-DBUILD_SHARED_LIBS:BOOL=%s' % (
'ON' if '+shared' in spec else 'OFF'),
'-DDOUBLE_PRECISION:BOOL=%s' % (
'ON' if '+double-precision' in spec else 'OFF'),
'-DUSE_DLL_INTERFACE:BOOL=%s' % (
'ON' if '+dll-interface' in spec else 'OFF'),
'-DBUILD_FAST_CPP_API:BOOL=%s' % (
'-DBUILD_OPENFAST_CPP_API:BOOL=%s' % (
'ON' if '+cxx' in spec else 'OFF'),
'-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=%s' % (
'ON' if '+pic' in spec else 'OFF'),
@ -69,6 +68,9 @@ def cmake_args(self):
if '+cxx' in spec:
options.extend([
'-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc,
'-DCMAKE_CXX_COMPILER=%s' % spec['mpi'].mpicxx,
'-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc,
'-DMPI_CXX_COMPILER:PATH=%s' % spec['mpi'].mpicxx,
'-DMPI_C_COMPILER:PATH=%s' % spec['mpi'].mpicc,
'-DMPI_Fortran_COMPILER:PATH=%s' % spec['mpi'].mpifc,
@ -81,4 +83,7 @@ def cmake_args(self):
'-DHDF5_USE_STATIC_LIBRARIES=ON',
])
if 'darwin' in spec.architecture:
options.append('-DCMAKE_MACOSX_RPATH:BOOL=ON')
return options

View file

@ -39,7 +39,8 @@ class Paraview(CMakePackage):
depends_on('python@2:2.8', when='+python')
depends_on('py-numpy', when='+python', type='run')
depends_on('py-matplotlib', when='+python', type='run')
# Matplotlib >2.x requires Python 3
depends_on('py-matplotlib@:2.99', when='+python', type='run')
depends_on('mpi', when='+mpi')
depends_on('qt+opengl', when='@5.3.0:+qt+opengl2')
depends_on('qt~opengl', when='@5.3.0:+qt~opengl2')

View file

@ -18,7 +18,7 @@ class Percept(CMakePackage):
# commit dc1c8ec0175213146ac139946beca185a84c22e8
version('develop', branch='master')
depends_on('googletest~shared')
depends_on('googletest~shared@:1.8.0')
depends_on('opennurbs@percept')
depends_on('boost+graph+mpi')
depends_on('yaml-cpp+pic~shared@0.5.3:')

View file

@ -12,8 +12,7 @@ class Tioga(CMakePackage):
homepage = "https://github.com/jsitaraman/tioga"
git = "https://github.com/jsitaraman/tioga.git"
# The master branch doesn't support CMake
version('develop', branch='nalu-api')
version('master', branch='master')
variant('shared', default=True,
description="Enable building shared libraries")
@ -33,9 +32,15 @@ def cmake_args(self):
'ON' if '+shared' in spec else 'OFF'),
'-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=%s' % (
'ON' if '+pic' in spec else 'OFF'),
'-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc,
'-DCMAKE_CXX_COMPILER=%s' % spec['mpi'].mpicxx,
'-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc,
'-DMPI_CXX_COMPILER:PATH=%s' % spec['mpi'].mpicxx,
'-DMPI_C_COMPILER:PATH=%s' % spec['mpi'].mpicc,
'-DMPI_Fortran_COMPILER:PATH=%s' % spec['mpi'].mpifc
]
if 'darwin' in spec.architecture:
options.append('-DCMAKE_MACOSX_RPATH:BOOL=ON')
return options

View file

@ -0,0 +1,46 @@
# Copyright 2013-2018 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 TrilinosCatalystIossAdapter(CMakePackage):
"""Adapter for Trilinos Seacas Ioss and Paraview Catalyst"""
homepage = "https://trilinos.org/"
url = "https://github.com/trilinos/Trilinos/archive/trilinos-release-12-12-1.tar.gz"
git = "https://github.com/trilinos/Trilinos.git"
version('develop', branch='develop')
version('master', branch='master')
depends_on('bison', type='build')
depends_on('flex', type='build')
depends_on('paraview+mpi+python+osmesa')
depends_on('py-numpy', type=('build', 'run'))
# Here we avoid paraview trying to use netcdf~parallel-netcdf
# which is netcdf's default, even though paraview depends on 'netcdf'
# without any variants. Concretizer bug?
depends_on('netcdf+parallel-netcdf')
root_cmakelists_dir = join_path('packages', 'seacas', 'libraries',
'ioss', 'src', 'visualization',
'ParaViewCatalystIossAdapter')
def setup_environment(self, spack_env, run_env):
run_env.prepend_path('PYTHONPATH', self.prefix.python)
def cmake_args(self):
spec = self.spec
options = []
paraview_version = 'paraview-%s' % spec['paraview'].version.up_to(2)
options.extend([
'-DParaView_DIR:PATH=%s' %
spec['paraview'].prefix + '/lib/cmake/' + paraview_version
])
return options