Repository: spack/spack

Issue:
Installation issue: Paraview - Needs Updated configure args for @5.8.0:
From @chuckatkins, The `package.py` for `paraview` unconditionally sets a number of `configure_args` for paraview to use various dependencies from other Spack packages (e.g.: `USE_SYSTEM_...`).  These arguments have been change in paraview since version 5.8.0 and need an appropriate code path in Spack's `package.py` file.

/cc @danlipsa 


Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py
--- a/var/spack/repos/builtin/packages/paraview/package.py
+++ b/var/spack/repos/builtin/packages/paraview/package.py
@@ -60,6 +60,8 @@ class Paraview(CMakePackage, CudaPackage):
     # See commit: https://gitlab.kitware.com/paraview/paraview/-/commit/798d328c
     conflicts('~opengl2', when='@5.5:')
 
+    depends_on('cmake@3.3:', type='build')
+
     # Workaround for
     # adding the following to your packages.yaml
     # packages:
@@ -73,12 +75,12 @@ class Paraview(CMakePackage, CudaPackage):
     extends('python', when='+python3')
 
     depends_on('python@2.7:2.8', when='+python', type=('build', 'run'))
-    depends_on('python@3:', when='+python3', type=('build', 'run'))
 
     # VTK < 8.2.1 can't handle Python 3.8
-    # This affects Paraview 5.6.2 (VTK 8.2.0)
+    # This affects Paraview <= 5.7 (VTK 8.2.0)
     # https://gitlab.kitware.com/vtk/vtk/-/issues/17670
-    depends_on('python@3:3.7', when='@5.6.2 +python3', type=('build', 'run'))
+    depends_on('python@3:3.7', when='@:5.7 +python3', type=('build', 'run'))
+    depends_on('python@3:', when='@5.8:+python3', type=('build', 'run'))
 
     depends_on('py-numpy@:1.15.4', when='+python', type=('build', 'run'))
     depends_on('py-numpy', when='+python3', type=('build', 'run'))
@@ -100,22 +102,28 @@ class Paraview(CMakePackage, CudaPackage):
     conflicts('+qt', when='+osmesa')
 
     depends_on('bzip2')
+    depends_on('double-conversion')
+    depends_on('expat')
+    depends_on('eigen@3:')
     depends_on('freetype')
     # depends_on('hdf5+mpi', when='+mpi')
     # depends_on('hdf5~mpi', when='~mpi')
     depends_on('hdf5+hl+mpi', when='+hdf5+mpi')
     depends_on('hdf5+hl~mpi', when='+hdf5~mpi')
     depends_on('jpeg')
+    depends_on('jsoncpp')
+    depends_on('libogg')
     depends_on('libpng')
+    depends_on('libtheora')
     depends_on('libtiff')
-    depends_on('libxml2')
     depends_on('netcdf-c')
-    depends_on('expat')
-    # depends_on('netcdf-cxx')
-    # depends_on('protobuf') # version mismatches?
-    # depends_on('sqlite') # external version not supported
+    depends_on('pegtl')
+    depends_on('protobuf@3.4:')
+    depends_on('pugixml')
+    depends_on('libxml2')
+    depends_on('lz4')
+    depends_on('lzma')
     depends_on('zlib')
-    depends_on('cmake@3.3:', type='build')
 
     # Can't contretize with python2 and py-setuptools@45.0.0:
     depends_on('py-setuptools@:44.99.99', when='+python')
@@ -133,6 +141,9 @@ class Paraview(CMakePackage, CudaPackage):
     # Broken vtk-m config. Upstream catalyst changes
     patch('vtkm-catalyst-pv551.patch', when='@5.5.0:5.5.2')
 
+    # Broken H5Part with external parallel HDF5
+    patch('h5part-parallel.patch', when='@5.7:5.7.999')
+
     def url_for_version(self, version):
         _urlfmt  = 'http://www.paraview.org/files/v{0}/ParaView-v{1}{2}.tar.{3}'
         """Handle ParaView version-based custom URLs."""
@@ -218,24 +229,50 @@ def nvariant_bool(feature):
         includes  = variant_bool('+plugins')
 
         cmake_args = [
-            '-DPARAVIEW_BUILD_QT_GUI:BOOL=%s' % variant_bool('+qt'),
             '-DVTK_OPENGL_HAS_OSMESA:BOOL=%s' % variant_bool('+osmesa'),
             '-DVTK_USE_X:BOOL=%s' % nvariant_bool('+osmesa'),
-            '-DVTK_RENDERING_BACKEND:STRING=%s' % rendering,
             '-DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=%s' % includes,
             '-DBUILD_TESTING:BOOL=OFF',
-            '-DBUILD_EXAMPLES:BOOL=%s' % variant_bool('+examples'),
-            '-DVTK_USE_SYSTEM_FREETYPE:BOOL=ON',
-            '-DVTK_USE_SYSTEM_HDF5:BOOL=%s' % variant_bool('+hdf5'),
-            '-DVTK_USE_SYSTEM_JPEG:BOOL=ON',
-            '-DVTK_USE_SYSTEM_LIBXML2:BOOL=ON',
-            '-DVTK_USE_SYSTEM_NETCDF:BOOL=ON',
-            '-DVTK_USE_SYSTEM_EXPAT:BOOL=ON',
-            '-DVTK_USE_SYSTEM_TIFF:BOOL=ON',
-            '-DVTK_USE_SYSTEM_ZLIB:BOOL=ON',
-            '-DVTK_USE_SYSTEM_PNG:BOOL=ON',
-            '-DOpenGL_GL_PREFERENCE:STRING=LEGACY'
-        ]
+            '-DOpenGL_GL_PREFERENCE:STRING=LEGACY']
+
+        if spec.satisfies('@:5.7') and spec['cmake'].satisfies('@3.17:'):
+            cmake_args.append('-DFPHSA_NAME_MISMATCHED:BOOL=ON')
+
+        if spec.satisfies('@5.7:'):
+            if spec.satisfies('@5.8:'):
+                cmake_args.extend([
+                    '-DPARAVIEW_USE_QT:BOOL=%s' % variant_bool('+qt'),
+                    '-DPARAVIEW_BUILD_WITH_EXTERNAL=ON'])
+            else:  # @5.7:
+                cmake_args.extend([
+                    '-DPARAVIEW_BUILD_QT_GUI:BOOL=%s' % variant_bool('+qt'),
+                    '-DPARAVIEW_USE_EXTERNAL:BOOL=ON'])
+
+            cmake_args.extend([
+                '-DPARAVIEW_ENABLE_EXAMPLES:BOOL=%s' % variant_bool(
+                    '+examples'),
+                '-DVTK_MODULE_USE_EXTERNAL_ParaView_cgns=OFF',
+                '-DVTK_MODULE_USE_EXTERNAL_VTK_glew=OFF',
+                '-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=OFF',
+                '-DVTK_MODULE_USE_EXTERNAL_VTK_libharu=OFF',
+                '-DVTK_MODULE_USE_EXTERNAL_VTK_utf8=OFF'])
+        else:
+            cmake_args.extend([
+                '-DPARAVIEW_BUILD_EXAMPLES:BOOL=%s' % variant_bool(
+                    '+examples'),
+                '-DVTK_RENDERING_BACKEND:STRING=%s' % rendering,
+                '-DPARAVIEW_BUILD_QT_GUI:BOOL=%s' % variant_bool('+qt'),
+                '-DVTK_USE_SYSTEM_LIBRARIES:BOOL=ON',
+                '-DVTK_USE_SYSTEM_CGNS:BOOL=OFF',
+                '-DVTK_USE_SYSTEM_DIY2:BOOL=OFF',
+                '-DVTK_USE_SYSTEM_GLEW:BOOL=OFF',
+                '-DVTK_USE_SYSTEM_GL2PS:BOOL=OFF',
+                '-DVTK_USE_SYSTEM_ICET:BOOL=OFF',
+                '-DVTK_USE_SYSTEM_LIBHARU:BOOL=OFF',
+                '-DVTK_USE_SYSTEM_NETCDFCPP:BOOL=OFF',
+                '-DVTK_USE_SYSTEM_UTF8:BOOL=OFF',
+                '-DVTK_USE_SYSTEM_XDMF2:BOOL=OFF',
+                '-DVTK_USE_SYSTEM_XDMF3:BOOL=OFF'])
 
         # The assumed qt version changed to QT5 (as of paraview 5.2.1),
         # so explicitly specify which QT major version is actually being used
@@ -254,9 +291,11 @@ def nvariant_bool(feature):
                 '-DPARAVIEW_%s_PYTHON:BOOL=ON' % py_use_opt,
                 '-DPYTHON_EXECUTABLE:FILEPATH=%s' %
                 spec['python'].command.path,
-                '-DVTK_USE_SYSTEM_MPI4PY:BOOL=%s' % variant_bool('+mpi'),
                 '-D%s_PYTHON_VERSION:STRING=%d' % (py_ver_opt, py_ver_val)
             ])
+            if spec.satisfies('@:5.6'):
+                cmake_args.append(
+                    '-DVTK_USE_SYSTEM_MPI4PY:BOOL=%s' % variant_bool('+mpi'))
 
         else:
             cmake_args.append('-DPARAVIEW_ENABLE_PYTHON:BOOL=OFF')
@@ -270,24 +309,17 @@ def nvariant_bool(feature):
                 '-DMPI_Fortran_COMPILER:PATH=%s' % spec['mpi'].mpifc
             ])
 
-        if '+shared' in spec:
-            cmake_args.append(
-                '-DPARAVIEW_BUILD_SHARED_LIBS:BOOL=ON'
-            )
-        else:
-            cmake_args.append(
-                '-DPARAVIEW_BUILD_SHARED_LIBS:BOOL=OFF'
-            )
+        cmake_args.append(
+            '-DPARAVIEW_BUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'))
 
-        if '+cuda' in spec:
-            cmake_args.extend([
-                '-DPARAVIEW_USE_CUDA:BOOL=ON',
-                '-DPARAVIEW_BUILD_SHARED_LIBS:BOOL=OFF'
-            ])
+        if spec.satisfies('@5.8:'):
+            cmake_args.append('-DPARAVIEW_USE_CUDA:BOOL=%s' %
+                              variant_bool('+cuda'))
+        elif spec.satisfies('@5.7:'):
+            cmake_args.append('-DVTK_USE_CUDA:BOOL=%s' % variant_bool('+cuda'))
         else:
-            cmake_args.extend([
-                '-DPARAVIEW_USE_CUDA:BOOL=OFF',
-            ])
+            cmake_args.append('-DVTKm_ENABLE_CUDA:BOOL=%s' %
+                              variant_bool('+cuda'))
 
         if 'darwin' in spec.architecture:
             cmake_args.extend([
@@ -300,11 +332,11 @@ def nvariant_bool(feature):
                 cmake_args.append(
                     '-DVTK_ENABLE_KITS:BOOL=ON')
             elif spec.satisfies('@5.7'):
-                cmake_args.append(
-                    '-DPARAVIEW_ENABLE_KITS:BOOL=ON')
+                # cmake_args.append('-DPARAVIEW_ENABLE_KITS:BOOL=ON')
+                # Kits are broken with 5.7
+                cmake_args.append('-DPARAVIEW_ENABLE_KITS:BOOL=OFF')
             else:
-                cmake_args.append(
-                    '-DPARAVIEW_BUILD_WITH_KITS:BOOL=ON')
+                cmake_args.append('-DPARAVIEW_BUILD_WITH_KITS:BOOL=ON')
 
         # Hide git from Paraview so it will not use `git describe`
         # to find its own version number
diff --git a/var/spack/repos/builtin/packages/pegtl/package.py b/var/spack/repos/builtin/packages/pegtl/package.py
--- a/var/spack/repos/builtin/packages/pegtl/package.py
+++ b/var/spack/repos/builtin/packages/pegtl/package.py
@@ -19,6 +19,7 @@ class Pegtl(CMakePackage):
     git      = "https://github.com/taocpp/PEGTL.git"
 
     version('master', branch='master')
+    version('2.8.3', sha256='370afd0fbe6d73c448a33c10fbe4a7254f92077f5a217317d0a32a9231293015')
     version('2.1.4', sha256='d990dccc07b4d9ba548326d11c5c5e34fa88b34fe113cb5377da03dda29f23f2')
     version('2.0.0', sha256='5aae0505077e051cae4d855c38049cc6cf71103a6cc8d0ddef01a576e8a60cc0')
 


Test patch: