med: add HDF5 support and other variants (#23555)
Enhancing package med enlarged HDF5 compatibility, more options, new version
This commit is contained in:
parent
aacba57e0a
commit
fee5cf4e49
@ -3,7 +3,6 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
@ -11,28 +10,43 @@ class Med(CMakePackage):
|
|||||||
"""The MED file format is a specialization of the HDF5 standard."""
|
"""The MED file format is a specialization of the HDF5 standard."""
|
||||||
|
|
||||||
homepage = "http://docs.salome-platform.org/latest/dev/MEDCoupling/med-file.html"
|
homepage = "http://docs.salome-platform.org/latest/dev/MEDCoupling/med-file.html"
|
||||||
url = "http://files.salome-platform.org/Salome/other/med-3.2.0.tar.gz"
|
url = "https://files.salome-platform.org/Salome/other/med-3.2.0.tar.gz"
|
||||||
|
|
||||||
maintainers = ['likask']
|
maintainers = ['likask']
|
||||||
|
|
||||||
version('4.0.0', sha256='a474e90b5882ce69c5e9f66f6359c53b8b73eb448c5f631fa96e8cd2c14df004')
|
# 4.1.0 does not compile in static mode
|
||||||
|
version('4.1.0', sha256='847db5d6fbc9ce6924cb4aea86362812c9a5ef6b9684377e4dd6879627651fce')
|
||||||
|
version('4.0.0', sha256='a474e90b5882ce69c5e9f66f6359c53b8b73eb448c5f631fa96e8cd2c14df004', preferred=True)
|
||||||
version('3.2.0', sha256='d52e9a1bdd10f31aa154c34a5799b48d4266dc6b4a5ee05a9ceda525f2c6c138')
|
version('3.2.0', sha256='d52e9a1bdd10f31aa154c34a5799b48d4266dc6b4a5ee05a9ceda525f2c6c138')
|
||||||
|
|
||||||
variant('api23', default=True, description='Enable API2.3')
|
variant('api23', default=True, description='Enable API2.3')
|
||||||
|
variant('mpi', default=True, description='Enable MPI')
|
||||||
|
variant('shared', default=False,
|
||||||
|
description='Builds a shared version of the library')
|
||||||
|
variant('fortran', default=False, description='Enable Fortran support')
|
||||||
|
|
||||||
depends_on('mpi')
|
depends_on('mpi', when='+mpi')
|
||||||
depends_on('hdf5@:1.8.19+mpi', when='@3.2.0')
|
depends_on('hdf5@:1.8.22+mpi', when='@3.2.0+mpi')
|
||||||
depends_on('hdf5@:1.10.2+mpi', when='@4.0.0')
|
depends_on('hdf5@1.10.2:1.10.7+mpi', when='@4.0.0:+mpi')
|
||||||
|
depends_on('hdf5@:1.8.22~mpi', when='@3.2.0~mpi')
|
||||||
|
depends_on('hdf5@1.10.2:1.10.7~mpi', when='@4.0.0:~mpi')
|
||||||
|
|
||||||
|
conflicts("@4.1.0", when="~shared", msg="Link error when static")
|
||||||
|
|
||||||
# C++11 requires a space between literal and identifier
|
# C++11 requires a space between literal and identifier
|
||||||
patch('add_space.patch', when='@3.2.0')
|
patch('add_space.patch', when='@3.2.0')
|
||||||
|
|
||||||
# FIXME This is minimal installation.
|
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
|
|
||||||
options = []
|
options = [
|
||||||
|
self.define('HDF5_ROOT_DIR', spec['hdf5'].prefix),
|
||||||
|
self.define('MEDFILE_BUILD_TESTS', self.run_tests),
|
||||||
|
self.define('MEDFILE_BUILD_PYTHON', False),
|
||||||
|
self.define('MEDFILE_INSTALL_DOC', False),
|
||||||
|
]
|
||||||
|
if '~fortran' in spec:
|
||||||
|
options.append('-DCMAKE_Fortran_COMPILER=')
|
||||||
|
|
||||||
if '+api23' in spec:
|
if '+api23' in spec:
|
||||||
options.extend([
|
options.extend([
|
||||||
@ -40,18 +54,19 @@ def cmake_args(self):
|
|||||||
'-DCMAKE_C_FLAGS:STRING=-DMED_API_23=1',
|
'-DCMAKE_C_FLAGS:STRING=-DMED_API_23=1',
|
||||||
'-DMED_API_23=1'])
|
'-DMED_API_23=1'])
|
||||||
|
|
||||||
options.extend([
|
if '+shared' in spec:
|
||||||
'-DMEDFILE_USE_MPI=YES'
|
options.extend([
|
||||||
'-DMEDFILE_BUILD_TESTS={0}'.format(
|
'-DMEDFILE_BUILD_SHARED_LIBS=ON',
|
||||||
'ON' if self.run_tests else 'OFF'),
|
'-DMEDFILE_BUILD_STATIC_LIBS=OFF',
|
||||||
'-DMEDFILE_BUILD_PYTHON=OFF',
|
])
|
||||||
'-DMEDFILE_INSTALL_DOC=OFF',
|
else:
|
||||||
'-DMEDFILE_BUILD_SHARED_LIBS=OFF',
|
options.extend([
|
||||||
'-DMEDFILE_BUILD_STATIC_LIBS=ON',
|
'-DMEDFILE_BUILD_SHARED_LIBS=OFF',
|
||||||
'-DCMAKE_Fortran_COMPILER='])
|
'-DMEDFILE_BUILD_STATIC_LIBS=ON',
|
||||||
|
])
|
||||||
|
|
||||||
options.extend([
|
if '+mpi' in spec:
|
||||||
'-DHDF5_ROOT_DIR=%s' % spec['hdf5'].prefix,
|
options.extend(['-DMEDFILE_USE_MPI=YES',
|
||||||
'-DMPI_ROOT_DIR=%s' % spec['mpi'].prefix])
|
'-DMPI_ROOT_DIR=%s' % spec['mpi'].prefix])
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
Loading…
Reference in New Issue
Block a user