visit: Overhaul to build in the DAV SDK (#30594)

* mesa-glu and mesa-demos: Fix conflicts with glu and osmesa

* visit: Update visit dependencies

* ecp-data-vis-sdk: Enable +visit

* ci[data-vis-sdk]: Enable +visit
This commit is contained in:
Chuck Atkins 2022-05-20 19:17:30 -04:00 committed by GitHub
parent f86c481280
commit 4fbb822072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 186 additions and 138 deletions

View File

@ -15,33 +15,32 @@ spack:
packages: packages:
cmake: cmake:
variants: ~ownlibs variants: ~ownlibs
curl:
variants: tls=mbedtls
mesa: mesa:
variants: +glx ~osmesa +opengl ~opengles +llvm variants: +glx ~osmesa +opengl ~opengles +llvm
paraview: paraview:
variants: +qt variants: +qt
visit:
variants: +gui
all: all:
target: [x86_64] target: [x86_64]
# The spec will be gradually expanded to enable all the SDK components. # Currently disabled: sensei
# Currently disabled: ascent, catalyst, visit
specs: specs:
- matrix: - ecp-data-vis-sdk ~cuda ~rocm ~sensei
- - ecp-data-vis-sdk +adios2
+adios2 +ascent
+ascent +cinema
+cinema +darshan
+darshan +faodel
+faodel +hdf5
+hdf5 +paraview
+paraview +pnetcdf
+pnetcdf +sz
+sz +unifyfs
+unifyfs +veloc
+veloc +vtkm
+vtkm +zfp
+zfp +visit
mirrors: { "mirror": "s3://spack-binaries/data-vis-sdk" } mirrors: { "mirror": "s3://spack-binaries/data-vis-sdk" }

View File

@ -31,19 +31,16 @@ class EcpDataVisSdk(BundlePackage, CudaPackage, ROCmPackage):
# Vis # Vis
variant('ascent', default=False, description="Enable Ascent") variant('ascent', default=False, description="Enable Ascent")
variant('cinema', default=False, description="Enable Cinema")
variant('paraview', default=False, description="Enable ParaView") variant('paraview', default=False, description="Enable ParaView")
variant('sz', default=False, description="Enable SZ") variant('sz', default=False, description="Enable SZ")
variant('visit', default=False, description="Enable VisIt")
variant('vtkm', default=False, description="Enable VTK-m") variant('vtkm', default=False, description="Enable VTK-m")
variant('zfp', default=False, description="Enable ZFP") variant('zfp', default=False, description="Enable ZFP")
# Cinema
variant('cinema', default=False, description="Enable Cinema")
# Outstanding build issues # Outstanding build issues
variant('sensei', default=False, description="Enable Sensei") variant('sensei', default=False, description="Enable Sensei")
conflicts('+sensei') conflicts('+sensei')
variant('visit', default=False, description="Enable VisIt")
conflicts('+visit')
# Wrapper around depends_on to propagate dependency variants # Wrapper around depends_on to propagate dependency variants
def dav_sdk_depends_on(spec, when=None, propagate=None): def dav_sdk_depends_on(spec, when=None, propagate=None):
@ -130,6 +127,7 @@ def exclude_variants(variants, exclude):
dav_sdk_depends_on('ascent+mpi~fortran+openmp+python+shared+vtkh+dray~test', dav_sdk_depends_on('ascent+mpi~fortran+openmp+python+shared+vtkh+dray~test',
when='+ascent', when='+ascent',
propagate=['adios2', 'cuda'] + cuda_arch_variants) propagate=['adios2', 'cuda'] + cuda_arch_variants)
# Need to explicitly turn off conduit hdf5_compat in order to build # Need to explicitly turn off conduit hdf5_compat in order to build
# hdf5@1.12 which is required for SDK # hdf5@1.12 which is required for SDK
depends_on('ascent ^conduit ~hdf5_compat', when='+ascent +hdf5') depends_on('ascent ^conduit ~hdf5_compat', when='+ascent +hdf5')
@ -151,7 +149,9 @@ def exclude_variants(variants, exclude):
depends_on('paraview ~cuda', when='+paraview ~cuda') depends_on('paraview ~cuda', when='+paraview ~cuda')
conflicts('paraview@master', when='+paraview') conflicts('paraview@master', when='+paraview')
dav_sdk_depends_on('visit', when='+visit') dav_sdk_depends_on('visit+mpi+python+silo',
when='+visit',
propagate=['hdf5', 'adios2'])
dav_sdk_depends_on('vtk-m@1.7:+shared+mpi+openmp+rendering', dav_sdk_depends_on('vtk-m@1.7:+shared+mpi+openmp+rendering',
when='+vtkm', when='+vtkm',

View File

@ -3,6 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
from spack import * from spack import *
@ -16,13 +18,43 @@ class MesaDemos(AutotoolsPackage):
version('8.2.0', sha256='5a9f71b815d968d0c3b77edfcc3782d0211f8520b00da9e554ccfed80c8889f6') version('8.2.0', sha256='5a9f71b815d968d0c3b77edfcc3782d0211f8520b00da9e554ccfed80c8889f6')
version('8.1.0', sha256='cc5826105355830208c90047fc38c5b09fa3ab0045366e7e859104935b00b76d') version('8.1.0', sha256='cc5826105355830208c90047fc38c5b09fa3ab0045366e7e859104935b00b76d')
variant('osmesa', default=False, description="Enable the OSMesa frontend.")
is_linux = sys.platform.startswith('linux')
variant('glx', default=is_linux, description="Enable the GLX frontend.")
conflicts('+osmesa', when='+glx')
depends_on('autoconf', type='build') depends_on('autoconf', type='build')
depends_on('automake', type='build') depends_on('automake', type='build')
depends_on('libtool', type='build') depends_on('libtool', type='build')
depends_on('m4', type='build') depends_on('m4', type='build')
depends_on('pkgconfig', type='build') depends_on('pkgconfig', type='build')
depends_on('mesa')
depends_on('mesa-glu') depends_on('gl')
depends_on('freetype') depends_on('glx', when='+glx')
depends_on('libx11', when='+glx')
depends_on('libxext', when='+glx')
depends_on('osmesa', when='+osmesa')
depends_on('glu', when='~osmesa')
depends_on('mesa-glu+osmesa', when='+osmesa')
depends_on('freeglut') depends_on('freeglut')
depends_on('glew@1.5.4:') depends_on('glew@1.5.4:')
def configure_args(self):
args = [
'--disable-egl',
'--disable-gles1',
'--disable-gles2',
'--disable-vg',
'--disable-libdrm',
'--disable-wayland',
'--disable-gbm',
'--disable-freetype2',
'--disable-rbug',
self.enable_or_disable('osmesa'),
self.enable_or_disable('x11', variant='glx'),
]
return args

View File

@ -12,17 +12,23 @@ class MesaGlu(AutotoolsPackage):
homepage = "https://www.mesa3d.org" homepage = "https://www.mesa3d.org"
url = "https://www.mesa3d.org/archive/glu/glu-9.0.0.tar.gz" url = "https://www.mesa3d.org/archive/glu/glu-9.0.0.tar.gz"
version('9.0.2', sha256='24effdfb952453cc00e275e1c82ca9787506aba0282145fff054498e60e19a65')
version('9.0.1', sha256='f6f484cfcd51e489afe88031afdea1e173aa652697e4c19ddbcb8260579a10f7') version('9.0.1', sha256='f6f484cfcd51e489afe88031afdea1e173aa652697e4c19ddbcb8260579a10f7')
version('9.0.0', sha256='4387476a1933f36fec1531178ea204057bbeb04cc2d8396c9ea32720a1f7e264') version('9.0.0', sha256='4387476a1933f36fec1531178ea204057bbeb04cc2d8396c9ea32720a1f7e264')
depends_on('gl@3:') variant('osmesa', default=False, description='Enable OSMesa instead of libGL')
provides('glu@1.3') depends_on('gl@3:')
depends_on('osmesa', when='+osmesa')
# Since pacakges like mesa provide both gl and osmesa this will prevent
# consuming packages from getting a glu tied to a differnt gl library
provides('glu@1.3', when='~osmesa')
def configure_args(self): def configure_args(self):
args = [] args = []
if self.spec['gl'].satisfies('mesa'): args.extend(self.enable_or_disable('osmesa'))
args.append('--enable-osmesa')
return args return args
@property @property

View File

@ -3,6 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import * from spack import *
@ -67,29 +69,31 @@ class Visit(CMakePackage):
executables = ['^visit$'] executables = ['^visit$']
version('develop', branch='develop') version('develop', branch='develop')
version('3.2.2', sha256='d19ac24c622a3bc0a71bc9cd6e5c9860e43f39e3279672129278b6ebce8d0ead')
version('3.2.1', sha256='779d59564c63f31fcbfeff24b14ddd6ac941b3bb7d671d31765a770d193f02e8') version('3.2.1', sha256='779d59564c63f31fcbfeff24b14ddd6ac941b3bb7d671d31765a770d193f02e8')
version('3.1.1', sha256='0b60ac52fd00aff3cf212a310e36e32e13ae3ca0ddd1ea3f54f75e4d9b6c6cf0') version('3.1.1', sha256='0b60ac52fd00aff3cf212a310e36e32e13ae3ca0ddd1ea3f54f75e4d9b6c6cf0')
version('3.0.1', sha256='a506d4d83b8973829e68787d8d721199523ce7ec73e7594e93333c214c2c12bd') version('3.0.1', sha256='a506d4d83b8973829e68787d8d721199523ce7ec73e7594e93333c214c2c12bd')
version('2.13.3', sha256='cf0b3d2e39e1cd102dd886d3ef6da892733445e362fc28f24d9682012cccf2e5')
version('2.13.0', sha256='716644b8e78a00ff82691619d4d1e7a914965b6535884890b667b97ba08d6a0f') root_cmakelists_dir = 'src'
version('2.12.3', sha256='2dd351a291ee3e79926bc00391ca89b202cfa4751331b0fdee1b960c7922161f') generator = "Ninja"
version('2.12.2', sha256='55897d656ac2ea4eb87a30118b2e3963d6c8a391dda0790268426a73e4b06943')
version('2.10.3', sha256='05018215c4727eb42d47bb5cc4ff937b2a2ccaca90d141bc7fa426a0843a5dbc')
version('2.10.2', sha256='89ecdfaf197ef431685e31b75628774deb6cd75d3e332ef26505774403e8beff')
version('2.10.1', sha256='6b53dea89a241fd03300a7a3a50c0f773e2fb8458cd3ad06816e9bd2f0337cd8')
variant('gui', default=True, description='Enable VisIt\'s GUI') variant('gui', default=True, description='Enable VisIt\'s GUI')
variant('adios2', default=False, description='Enable ADIOS2 file format') variant('osmesa', default=False, description='Use OSMesa for off-screen CPU rendering')
variant('adios2', default=True, description='Enable ADIOS2 file format')
variant('hdf5', default=True, description='Enable HDF5 file format') variant('hdf5', default=True, description='Enable HDF5 file format')
variant('silo', default=True, description='Enable Silo file format') variant('silo', default=True, description='Enable Silo file format')
variant('python', default=True, description='Enable Python support') variant('python', default=True, description='Enable Python support')
variant('mpi', default=False, description='Enable parallel engine') variant('mpi', default=True, description='Enable parallel engine')
patch('spack-changes-3.1.patch', when="@3.1.0:,develop") patch('spack-changes-3.1.patch', when="@3.1.0:,develop")
patch('spack-changes-3.0.1.patch', when="@3.0.1") patch('spack-changes-3.0.1.patch', when="@3.0.1")
patch('nonframework-qwt.patch', when='^qt~framework platform=darwin') patch('nonframework-qwt.patch', when='^qt~framework platform=darwin')
patch('parallel-hdf5.patch', when='+hdf5+mpi') patch('parallel-hdf5.patch', when='+hdf5+mpi')
# Exactly one of 'gui' or 'osmesa' has to be enabled
conflicts('+gui', when='+osmesa')
conflicts('~gui', when='~osmesa')
############################################# #############################################
# Full List of dependencies from build_visit # Full List of dependencies from build_visit
############################################# #############################################
@ -178,60 +182,62 @@ class Visit(CMakePackage):
# #
# ===================================== # =====================================
depends_on('cmake@3.14.7', type='build') depends_on('cmake@3.14.7:', type='build')
# https://github.com/visit-dav/visit/issues/3498 depends_on('ninja', type='build')
# The vtk_compiler_visibility patch fixes a bug where
# VTKGenerateExportHeader.cmake fails to recognize gcc versions 10.0 depends_on('mpi', when='+mpi')
# or greater.
# The vtk_rendering_opengl2_x11 patch adds include directories to # VTK flavors
# Rendering/OpenGL2/CMakeLists.txt for systems that don't have the depends_on('vtk@8.1:8 +opengl2')
# system X libraries and include files installed. depends_on('vtk +osmesa', when='+osmesa')
# The vtk_wrapping_python_x11 patch adds include directories to depends_on('vtk +qt', when='+gui')
# Wrapping/Python/CMakelists.txt for systems that don't have the depends_on('vtk +python', when='+python')
# system X libraries and include files installed. depends_on('vtk +mpi', when='+mpi')
depends_on('vtk@8.1.0+opengl2+osmesa~python', depends_on('vtk ~mpi', when='~mpi')
patches=[patch('vtk_compiler_visibility.patch'),
patch('vtk_rendering_opengl2_x11.patch'), # Necessary VTK patches
patch('vtk_wrapping_python_x11.patch'), depends_on('vtk', patches=[patch('vtk_compiler_visibility.patch')])
], depends_on('vtk', patches=[patch('vtk_rendering_opengl2_x11.patch')],
when='~python @3.2:,develop') when='~osmesa platform=linux')
depends_on('vtk@8.1.0+opengl2+osmesa+python', depends_on('vtk', patches=[patch('vtk_wrapping_python_x11.patch')],
patches=[patch('vtk_compiler_visibility.patch'), when='+python')
patch('vtk_rendering_opengl2_x11.patch'),
patch('vtk_wrapping_python_x11.patch'), depends_on('glu', when='~osmesa')
], depends_on('mesa-glu+osmesa', when='+osmesa')
when='+python @3.2:,develop')
depends_on('glu', when='platform=linux')
depends_on('vtk+python', when='+python @3.2:,develop')
depends_on('vtk~mpi', when='~mpi')
depends_on('vtk+qt', when='+gui')
# VisIt doesn't work with later versions of qt. # VisIt doesn't work with later versions of qt.
depends_on('qt+gui@5.14.2:', when='+gui @3.2:,develop') depends_on('qt+gui+opengl@5:5.14', when='+gui')
depends_on('qwt', when='+gui') depends_on('qwt', when='+gui')
# python@3.8 doesn't work with VisIt. # python@3.8 doesn't work with VisIt.
depends_on('python@3.7', when='+python') depends_on('python@3.2:3.7', when='+python')
# llvm@12.0.1, @11.1.0, @10.0.1 fail in build phase with gcc 6.1.0. extends('python', when='+python')
# llvm@9.0.1 fails in cmake phase with gcc 6.1.0.
# llvm@12.0.1, llvm@8.0.1 fail in build phase with gcc 11.2.0 # VisIt uses the hdf5 1.8 api
depends_on('llvm@6:', when='^mesa') # set the API version later on down in setup_build_environment
depends_on('mesa+glx', when='^mesa') depends_on('hdf5@1.8:', when='+hdf5')
depends_on('mesa-glu', when='^mesa') depends_on('hdf5+mpi', when='+hdf5+mpi')
# VisIt doesn't build with hdf5@1.12 and hdf5@1.10 produces files that depends_on('hdf5~mpi', when='+hdf5~mpi')
# are incompatible with hdf5@1.8.
depends_on('hdf5@1.8', when='+hdf5')
# VisIt uses Silo's 'ghost zone' data structures, which are only available # VisIt uses Silo's 'ghost zone' data structures, which are only available
# in v4.10+ releases: https://wci.llnl.gov/simulation/computer-codes/silo/releases/release-notes-4.10 # in v4.10+ releases: https://wci.llnl.gov/simulation/computer-codes/silo/releases/release-notes-4.10
depends_on('silo@4.10:+shared', when='+silo') depends_on('silo@4.10: +shared', when='+silo')
depends_on('silo~mpi', when='+silo~mpi') depends_on('silo+hdf5', when='+silo+hdf5')
depends_on('silo~hdf5', when='+silo~hdf5')
depends_on('silo+mpi', when='+silo+mpi') depends_on('silo+mpi', when='+silo+mpi')
depends_on('hdf5~mpi', when='+hdf5~mpi') depends_on('silo~mpi', when='+silo~mpi')
depends_on('hdf5+mpi', when='+hdf5+mpi')
depends_on('mpi', when='+mpi')
depends_on('adios2', when='+adios2')
root_cmakelists_dir = 'src' depends_on('adios2@2.6:', when='+adios2')
depends_on('adios2+hdf5', when='+adios2+hdf5')
depends_on('adios2~hdf5', when='+adios2~hdf5')
depends_on('adios2+mpi', when='+adios2+mpi')
depends_on('adios2~mpi', when='+adios2~mpi')
depends_on('adios2+python', when='+adios2+python')
depends_on('adios2~python', when='+adios2~python')
@when('@3.0.0:,develop') depends_on('zlib')
@when('@3:,develop')
def patch(self): def patch(self):
# Some of VTK's targets don't create explicit libraries, so there is no # Some of VTK's targets don't create explicit libraries, so there is no
# 'vtktiff'. Instead, replace with the library variable defined from # 'vtktiff'. Instead, replace with the library variable defined from
@ -240,80 +246,85 @@ def patch(self):
filter_file(r'\bvtk(tiff|jpeg|png)', r'${vtk\1_LIBRARIES}', filter_file(r'\bvtk(tiff|jpeg|png)', r'${vtk\1_LIBRARIES}',
filename) filename)
def flag_handler(self, name, flags):
if name in ('cflags', 'cxxflags'):
# NOTE: This is necessary in order to allow VisIt to compile a couple
# of lines of code with 'const char*' to/from 'char*' conversions.
if '@3:%gcc' in self.spec:
flags.append('-fpermissive')
# VisIt still uses the hdf5 1.8 api
if '+hdf5' in self.spec and '@1.10:' in self.spec['hdf5']:
flags.append('-DH5_USE_18_API')
return (flags, None, None)
def cmake_args(self): def cmake_args(self):
spec = self.spec spec = self.spec
cxx_flags = [self.compiler.cxx_pic_flag]
cc_flags = [self.compiler.cc_pic_flag]
# NOTE: This is necessary in order to allow VisIt to compile a couple
# of lines of code with 'const char*' to/from 'char*' conversions.
if spec.satisfies('@3:%gcc'):
cxx_flags.append('-fpermissive')
cc_flags.append('-fpermissive')
args = [ args = [
'-DVTK_MAJOR_VERSION=' + str(spec['vtk'].version[0]), self.define('CMAKE_POSITION_INDEPENDENT_CODE', True),
'-DVTK_MINOR_VERSION=' + str(spec['vtk'].version[1]), self.define('VTK_MAJOR_VERSION', spec['vtk'].version[0]),
'-DVISIT_VTK_DIR:PATH=' + spec['vtk'].prefix, self.define('VTK_MINOR_VERSION', spec['vtk'].version[1]),
'-DVISIT_ZLIB_DIR:PATH=' + spec['zlib'].prefix, self.define('VISIT_VTK_DIR', spec['vtk'].prefix),
'-DVISIT_USE_GLEW=OFF', self.define('VISIT_ZLIB_DIR', spec['zlib'].prefix),
'-DCMAKE_CXX_FLAGS=' + ' '.join(cxx_flags), self.define('VISIT_USE_GLEW', False),
'-DCMAKE_C_FLAGS=' + ' '.join(cc_flags), self.define('VISIT_CONFIG_SITE', 'NONE'),
'-DVISIT_CONFIG_SITE=NONE', self.define('VISIT_INSTALL_THIRD_PARTY', True),
] ]
# Provide the plugin compilation environment so as to extend VisIt if '@3.1: platform=darwin' in spec:
args.append('-DVISIT_INSTALL_THIRD_PARTY=ON') args.append(self.define('FIXUP_OSX', False))
if spec.satisfies('@3.1:'):
args.append('-DFIXUP_OSX=OFF')
if '+python' in spec: if '+python' in spec:
args.append('-DVISIT_PYTHON_SCRIPTING=ON') args.extend([
# keep this off, we have an openssl + python linking issue self.define('VISIT_PYTHON_FILTERS', True),
# that appears in spack self.define('VISIT_PYTHON_SCRIPTING', True),
args.append('-DVISIT_PYTHON_FILTERS=OFF') self.define('PYTHON_DIR', spec['python'].home),
args.append('-DPYTHON_DIR:PATH={0}'.format(spec['python'].home)) ])
else: else:
args.append('-DVISIT_PYTHON_SCRIPTING=OFF') args.extend([
# keep this off, we have an openssl + python linking issue self.define('VISIT_PYTHON_FILTERS', False),
# that appears in spack self.define('VISIT_PYTHON_SCRIPTING', False),
args.append('-DVISIT_PYTHON_FILTERS=OFF') ])
if '+gui' in spec: if '+gui' in spec:
qt_bin = spec['qt'].prefix.bin qt_bin = spec['qt'].prefix.bin
qmake_exe = os.path.join(qt_bin, 'qmake')
args.extend([ args.extend([
'-DVISIT_LOC_QMAKE_EXE:FILEPATH={0}/qmake'.format(qt_bin), self.define('VISIT_SERVER_COMPONENTS_ONLY', False),
'-DVISIT_QT_DIR:PATH=' + spec['qt'].prefix, self.define('VISIT_ENGINE_ONLY', False),
'-DVISIT_QWT_DIR:PATH=' + spec['qwt'].prefix self.define('VISIT_LOC_QMAKE_EXE', qmake_exe),
self.define('VISIT_QT_DIR', spec['qt'].prefix),
self.define('VISIT_QWT_DIR', spec['qwt'].prefix),
]) ])
else: else:
args.append('-DVISIT_SERVER_COMPONENTS_ONLY=ON') args.extend([
args.append('-DVISIT_ENGINE_ONLY=ON') self.define('VISIT_SERVER_COMPONENTS_ONLY', True),
self.define('VISIT_ENGINE_ONLY', True),
])
# No idea why this is actually needed
if '^mesa' in spec: if '^mesa' in spec:
args.append( args.append(self.define('VISIT_MESAGL_DIR', spec['mesa'].prefix))
'-DVISIT_LLVM_DIR:PATH={0}'.format(spec['llvm'].prefix)) if '+llvm' in spec['mesa']:
args.append( args.append(self.define('VISIT_LLVM_DIR', spec['libllvm'].prefix))
'-DVISIT_MESAGL_DIR:PATH={0}'.format(spec['mesa'].prefix))
if '+hdf5' in spec: if '+hdf5' in spec:
args.append( args.append(self.define('VISIT_HDF5_DIR', spec['hdf5'].prefix))
'-DVISIT_HDF5_DIR:PATH={0}'.format(spec['hdf5'].prefix)) if '+mpi' in spec and '+mpi' in spec['hdf5']:
if '+mpi' in spec: args.append(self.define('VISIT_HDF5_MPI_DIR', spec['hdf5'].prefix))
args.append('-DVISIT_HDF5_MPI_DIR:PATH={0}'.format(
spec['hdf5'].prefix))
if '+silo' in spec: if '+silo' in spec:
args.append( args.append(self.define('VISIT_SILO_DIR', spec['silo'].prefix))
'-DVISIT_SILO_DIR:PATH={0}'.format(spec['silo'].prefix))
if '+mpi' in spec: if '+mpi' in spec:
args.append('-DVISIT_PARALLEL=ON') args.extend([
args.append('-DVISIT_C_COMPILER={0}'.format(spec['mpi'].mpicc)) self.define('VISIT_PARALLEL', True),
args.append('-DVISIT_CXX_COMPILER={0}'.format(spec['mpi'].mpicxx)) self.define('VISIT_MPI_COMPILER', spec['mpi'].mpicxx),
args.append('-DVISIT_MPI_COMPILER={0}'.format(spec['mpi'].mpicxx)) ])
else:
args.append(self.define('VISIT_PARALLEL', False))
return args return args