From 4f9aa6004b4324bc819fcb25f4ed9acaa6cf11bc Mon Sep 17 00:00:00 2001 From: kwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:37:56 -0600 Subject: [PATCH] visit: add v3.4.0, v3.4.1 (#47161) * Visit: Add new versions 3.4.0 and 3.4.1 * Adios2: Restrict python, 3.11 doesn't not work for older Adios2 * VisIt: Set the VTK_VERSION for @3.4: Older versions of VTK used the VTK_{MAJOR, MINOR}_VERSION variables for VTK detection. VisIt >= 3.4 uses the full string VTK_VERSION. * CI: Don't build llvm-amdgpu for non-HIP stack * VisIt: v3.4.1 handles newer Adios2 correctly * Visit: Add missing links in HDF5, set correct VTK version configuration parameter * VisIt: Add py-pip requirement and patch visit with configuration changes * HDF5 symlinks move when inside of callback * VisIt ninja install fails with python module. Using make does not * VisIt 3.4 has a high minimum cmake requirement * HDF5: Early return when not mpi for mpi symlinks * HDF5: Use platform agnostic method for creating legacy compatible MPI symlinks * Fix VISIT_VTK_VERSION handling for 8.2.1a hack --- .../stacks/data-vis-sdk/spack.yaml | 30 ++++++---- .../repos/builtin/packages/adios2/package.py | 12 ++-- .../repos/builtin/packages/hdf5/package.py | 18 ++++++ .../19958-enable-python-and-check-pip.patch | 60 +++++++++++++++++++ .../repos/builtin/packages/visit/package.py | 37 +++++++++--- 5 files changed, 136 insertions(+), 21 deletions(-) create mode 100644 var/spack/repos/builtin/packages/visit/19958-enable-python-and-check-pip.patch diff --git a/share/spack/gitlab/cloud_pipelines/stacks/data-vis-sdk/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/data-vis-sdk/spack.yaml index 17b67bb268112e..02594f3b611e34 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/data-vis-sdk/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/data-vis-sdk/spack.yaml @@ -6,20 +6,31 @@ spack: cmake: variants: ~ownlibs ecp-data-vis-sdk: - require: "+ascent +adios2 +cinema +darshan +faodel +hdf5 +pnetcdf +sensei +sz +unifyfs +veloc +vtkm +zfp" + require: + - "+ascent +adios2 +cinema +darshan +faodel +hdf5 +pnetcdf +sensei +sz +unifyfs +veloc +vtkm +zfp" hdf5: require: - - one_of: ['@1.14', '@1.12'] + - "@1.14" mesa: - require: "+glx +osmesa +opengl ~opengles +llvm" + require: + - "+glx +osmesa +opengl ~opengles +llvm" libglx: require: "mesa +glx" ospray: - require: '@2.8.0 +denoiser +mpi' + require: + - "@2.8.0" + - "+denoiser +mpi" llvm: - require: '@14:' + require: ["@14:"] # Minimize LLVM variants: ~lldb~lld~libomptarget~polly~gold libunwind=none compiler-rt=none + libllvm: + require: ["^llvm"] + visit: + require: ["@3.4.1"] + + concretizer: + unify: when_possible definitions: - paraview_specs: @@ -30,11 +41,10 @@ spack: - ^[virtuals=gl] osmesa # OSMesa Rendering - visit_specs: - matrix: - - - visit~gui - - - ^[virtuals=gl] glx # GLX Rendering - - ^[virtuals=gl] osmesa # OSMesa Rendering - # VisIt GUI does not work with Qt 5.14.2 - # - +gui ^[virtuals=gl] glx # GUI Support w/ GLX Rendering + - - visit + - - ~gui ^[virtuals=gl] glx + - ~gui ^[virtuals=gl] osmesa + - +gui ^[virtuals=gl] glx # GUI Support w/ GLX Rendering - sdk_base_spec: - matrix: - - ecp-data-vis-sdk +ascent +adios2 +cinema +darshan +faodel +hdf5 +pnetcdf diff --git a/var/spack/repos/builtin/packages/adios2/package.py b/var/spack/repos/builtin/packages/adios2/package.py index b3a966110c5745..8d9a0425faba61 100644 --- a/var/spack/repos/builtin/packages/adios2/package.py +++ b/var/spack/repos/builtin/packages/adios2/package.py @@ -192,10 +192,14 @@ class Adios2(CMakePackage, CudaPackage, ROCmPackage): depends_on("mgard@2023-01-10:", when="@2.9: +mgard") extends("python", when="+python") - depends_on("python@2.7:2.8,3.5:", when="@:2.4.0 +python", type=("build", "run")) - depends_on("python@2.7:2.8,3.5:", when="@:2.4.0", type="test") - depends_on("python@3.5:", when="@2.5.0: +python", type=("build", "run")) - depends_on("python@3.5:", when="@2.5.0:", type="test") + depends_on("python", when="+python", type=("build", "run")) + depends_on("python@2.7:2.8,3.5:3.10", when="@:2.4.0 +python", type=("build", "run")) + depends_on("python@3.5:3.10", when="@2.5.0:2.7 +python", type=("build", "run")) + + depends_on("python", type="test") + depends_on("python@2.7:2.8,3.5:3.10", when="@:2.4.0", type="test") + depends_on("python@3.5:3.10", when="@2.5.0:2.7", type="test") + depends_on("py-numpy@1.6.1:", when="+python", type=("build", "run")) depends_on("py-mpi4py@2.0.0:", when="+mpi +python", type=("build", "run")) depends_on("aws-sdk-cpp", when="+aws") diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 12e99d9bf61dbd..d0132ae2bcbb64 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -674,6 +674,24 @@ def symlink_to_h5hl_wrappers(self): os.remove(old) symlink(new, old) + @run_after("install") + def symlink_mpi_libs(self): + """Compatibility layer to support projects looking for the MPI suffix""" + if not self.spec.satisfies("+mpi"): + return + + mpi_libs = ["libhdf5{mpi_suffix}", "libhdf5{mpi_suffix}_hl"] + for lib_f in mpi_libs: + src_name = lib_f.format(mpi_suffix="") + dst_name = lib_f.format(mpi_suffix="_mpi") + libs = find_libraries(src_name, root=self.prefix, recursive=True) + for lib_path in libs: + prefix = os.path.dirname(lib_path) + src_lib = os.path.basename(lib_path) + dst_lib = dst_name.join(src_lib.rsplit(src_name, 1)) + with working_dir(prefix): + symlink(src_lib, dst_lib) + @property @llnl.util.lang.memoized def _output_version(self): diff --git a/var/spack/repos/builtin/packages/visit/19958-enable-python-and-check-pip.patch b/var/spack/repos/builtin/packages/visit/19958-enable-python-and-check-pip.patch new file mode 100644 index 00000000000000..a4f0f2dd471750 --- /dev/null +++ b/var/spack/repos/builtin/packages/visit/19958-enable-python-and-check-pip.patch @@ -0,0 +1,60 @@ +diff --git a/src/CMake/FindVisItPython.cmake b/src/CMake/FindVisItPython.cmake +index f8fca9f730..76ab1f54ca 100644 +--- a/src/CMake/FindVisItPython.cmake ++++ b/src/CMake/FindVisItPython.cmake +@@ -280,6 +280,13 @@ if(PYTHONINTERP_FOUND) + endif() + endif() + ++ # Ensure pip module is avaiable ++ execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import sys; import pip; sys.stdout.write(pip.__version__)" ++ OUTPUT_VARIABLE PYTHON_PIP_VERSION ++ ERROR_VARIABLE ERROR_FINDING_PYTHON_PIP_MODULE ++ COMMAND_ERROR_IS_FATAL ANY) ++ message(STATUS "PYTHON_PIP_VERSION: ${PYTHON_PIP_VERSION}") ++ + if(NOT EXISTS ${PYTHON_LIBRARY}) + message(FATAL_ERROR "Failed to find main library using PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}") + endif() +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 422bef895f..dacbaf0552 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -1226,15 +1226,17 @@ if(NOT VISIT_DBIO_ONLY) + endif() + endif() + ++# Configure python CLI extensions ++if(VISIT_PYTHON_SCRIPTING AND PYTHONLIBS_FOUND) ++ if(NOT VISIT_STATIC) ++ add_subdirectory(visitpy) ++ endif() ++endif() ++ + if(NOT VISIT_SERVER_COMPONENTS_ONLY AND NOT VISIT_ENGINE_ONLY AND NOT VISIT_DBIO_ONLY) + add_subdirectory(vtkqt) + add_subdirectory(winutil) + add_subdirectory(gui) +- if(VISIT_PYTHON_SCRIPTING AND PYTHONLIBS_FOUND) +- if(NOT VISIT_STATIC) +- add_subdirectory(visitpy) +- endif() +- endif() + # always add java subdir, so code gen targets can be active even + # if java is not enabled + add_subdirectory(java) +diff --git a/src/viewer/CMakeLists.txt b/src/viewer/CMakeLists.txt +index e47b0f271a..be9b2486ca 100644 +--- a/src/viewer/CMakeLists.txt ++++ b/src/viewer/CMakeLists.txt +@@ -11,9 +11,9 @@ + + ADD_SUBDIRECTORY(rpc) + ADD_SUBDIRECTORY(core) ++ADD_SUBDIRECTORY(proxy) + + IF(NOT VISIT_SERVER_COMPONENTS_ONLY AND NOT VISIT_ENGINE_ONLY AND NOT VISIT_DBIO_ONLY) +- ADD_SUBDIRECTORY(proxy) + ADD_SUBDIRECTORY(subjectproxy) + IF(NOT VISIT_STATIC) + # "main" is handled from the top level in the static case so it can be diff --git a/var/spack/repos/builtin/packages/visit/package.py b/var/spack/repos/builtin/packages/visit/package.py index ab24314e357bf1..a95b9943b47879 100644 --- a/var/spack/repos/builtin/packages/visit/package.py +++ b/var/spack/repos/builtin/packages/visit/package.py @@ -58,6 +58,12 @@ class Visit(CMakePackage): executables = ["^visit$"] version("develop", branch="develop") + version("3.4.1", sha256="942108cb294f4c9584a1628225b0be39c114c7e9e01805fb335d9c0b507689f5") + version( + "3.4.0", + sha256="6cfb8b190045439e39fa6014dfa797de189bd40bbb9aa6facf711ebd908229e3", + deprecated=True, + ) version("3.3.3", sha256="cc67abb7585e23b51ad576e797df4108641ae6c8c5e80e5359a279c729769187") version("3.3.2", sha256="0ae7c38287598e8d7d238cf284ea8be1096dcf13f58a7e9e444a28a32c085b56") version("3.3.1", sha256="2e969d3146b559fb833e4cdfaefa72f303d8ad368ef325f68506003f7bc317b9") @@ -76,7 +82,9 @@ class Visit(CMakePackage): depends_on("fortran", type="build") # generated root_cmakelists_dir = "src" - generator("ninja") + generator("ninja", "make") + # Temporary fix for now due to issue installing with ninja generator + conflicts("generator=ninja", when="+python") variant("gui", default=True, description="Enable VisIt's GUI") variant("adios2", default=True, description="Enable ADIOS2 file format") @@ -94,7 +102,7 @@ class Visit(CMakePackage): patch("spack-changes-3.0.1.patch", when="@3.0.1") patch("nonframework-qwt.patch", when="^qt~framework platform=darwin") patch("parallel-hdf5.patch", when="@3.0.1:3.2.2+hdf5+mpi") - patch("parallel-hdf5-3.3.patch", when="@3.3.0:+hdf5+mpi") + patch("parallel-hdf5-3.3.patch", when="@3.3.0:3.3+hdf5+mpi") patch("cmake-findvtkh-3.3.patch", when="@3.3.0:3.3.2+vtkm") patch("cmake-findjpeg.patch", when="@3.1.0:3.2.2") patch("cmake-findjpeg-3.3.patch", when="@3.3.0") @@ -108,15 +116,22 @@ class Visit(CMakePackage): # Fix const-correctness in VTK interface patch("vtk-8.2-constcorrect.patch", when="@3.3.3 ^vtk@8.2.1a") + # Add dectection for py-pip and enable python extensions with building with GUI + patch("19958-enable-python-and-check-pip.patch", when="@3.4:3.4.1 +python") + conflicts( "+gui", when="^[virtuals=gl] osmesa", msg="GUI cannot be activated with OSMesa front-end" ) depends_on("cmake@3.14.7:", type="build") + depends_on("cmake@3.24:", type="build", when="@3.4:") depends_on("mpi", when="+mpi") + conflicts("mpi", when="~mpi") # VTK flavors - depends_on("vtk@8.1:8 +opengl2") + depends_on("vtk +opengl2") + depends_on("vtk@8.1:8", when="@:3.3") + depends_on("vtk@9.2.6", when="@3.4:") depends_on("vtk +qt", when="+gui") depends_on("vtk +python", when="+python") depends_on("vtk +mpi", when="+mpi") @@ -135,12 +150,14 @@ class Visit(CMakePackage): depends_on("gl") # VisIt doesn't work with later versions of qt. - depends_on("qt+gui+opengl@5:5.14", when="+gui") + depends_on("qt+gui+opengl", when="+gui") + depends_on("qt@5:5.14", when="+gui") depends_on("qwt+opengl", when="+gui") - # python@3.8 doesn't work with VisIt. + # python@3.8 doesn't work with older VisIt. depends_on("python@3.2:3.7,3.9:", when="@:3.2 +python") depends_on("python@3.2:", when="@3.3: +python") + depends_on("py-pip", when="+python") extends("python", when="+python") # VisIt uses the hdf5 1.8 api @@ -177,13 +194,13 @@ class Visit(CMakePackage): with when("+adios2"): depends_on("adios2") # adios 2.8 removed adios2_taustubs (https://github.com/visit-dav/visit/issues/19209) - depends_on("adios2@:2.7.1") + # Fixed in 3.4.1 + depends_on("adios2@:2.7.1", when="@:3.4.0") depends_on("adios2+hdf5", when="+hdf5") depends_on("adios2~hdf5", when="~hdf5") depends_on("adios2+mpi", when="+mpi") depends_on("adios2~mpi", when="~mpi") depends_on("adios2+python", when="+python") - depends_on("adios2~python", when="~python") # For version 3.3.0 through 3.3.2, we used vtk-h to utilize vtk-m. # For version starting with 3.3.3 we use vtk-m directly. @@ -243,6 +260,12 @@ def cmake_args(self): self.define("VISIT_CONFIG_SITE", "NONE"), ] + # TODO: Remove this hack when VTK 8.2.1a is removed + if spec["vtk"].satisfies("@8.2.1a"): + args.append(self.define("VISIT_VTK_VERSION", "8.2.1")) + else: + args.append(self.define("VISIT_VTK_VERSION", str(spec["vtk"].version))) + # Provide the plugin compilation environment so as to extend VisIt args.append(self.define_from_variant("VISIT_INSTALL_THIRD_PARTY", "plugins"))