diff --git a/.ci/gitlab/.gitlab-ci.yml b/.ci/gitlab/.gitlab-ci.yml index b0e277d2e63..9f9aac3487d 100644 --- a/.ci/gitlab/.gitlab-ci.yml +++ b/.ci/gitlab/.gitlab-ci.yml @@ -2,7 +2,9 @@ stages: [ "generate", "build" ] variables: SPACK_DISABLE_LOCAL_CONFIG: "1" - SPACK_USER_CACHE_PATH: "${CI_PROJECT_DIR}/tmp/_user_cache/" + SPACK_USER_CACHE_PATH: "/tmp/spack/_user_cache/" + SPACK_USER_CONFIG_PATH: "/tmp/spack/_config_dir/" + SPACK_PROJECT_CI_DIR: "/home/tipi" # PR_MIRROR_FETCH_DOMAIN: "https://binaries-prs.spack.io" PR_MIRROR_FETCH_DOMAIN: "s3://spack-binaries-prs" PR_MIRROR_PUSH_DOMAIN: "s3://spack-binaries-prs" @@ -12,23 +14,24 @@ variables: # SPACK_CI_DISABLE_STACKS: # value: /^.*(cray).*$/ # expand: false - # SPACK_CI_ENABLE_STACKS: - # value: /^.*(cray).*$/ - # expand: false + SPACK_CI_ENABLE_STACKS: + value: /^.*(engflow).*$/ + expand: false + default: image: { "name": "ghcr.io/spack/e4s-ubuntu-18.04:v2021-10-18", "entrypoint": [""] } .clone_spack: &clone_spack - - mkdir .ci/tmp - - mkdir .ci/tmp/spack - - cd .ci/tmp/spack + - mkdir -p /.ci/tmp + - mkdir -p /.ci/tmp/spack + - cd /.ci/tmp/spack - git init - git remote add origin https://github.com/${SPACK_CHECKOUT_REPO}.git - echo ${SPACK_CHECKOUT_VERSION} - git fetch --depth 1 origin ${SPACK_CHECKOUT_VERSION} - git checkout FETCH_HEAD - - cd ${CI_PROJECT_DIR} + - cd ~/tipi .trigger_build: &trigger_build strategy: depend @@ -112,26 +115,26 @@ default: "${SPACK_CI_CONFIG_ROOT}/${PIPELINE_MIRROR_TEMPLATE}" "${SPACK_CI_CONFIG_ROOT}/mirrors.yaml" - spack config add -f "${SPACK_CI_CONFIG_ROOT}/mirrors.yaml" - - mkdir "${CI_PROJECT_DIR}/jobs_scratch_dir" - - mkdir "${CI_PROJECT_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}" + - mkdir "${SPACK_PROJECT_CI_DIR}/jobs_scratch_dir" + - mkdir "${SPACK_PROJECT_CI_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}" - spack - config blame > "${CI_PROJECT_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}/spack.yaml.blame" + config blame > "${SPACK_PROJECT_CI_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}/spack.yaml.blame" - spack -v --color=always ci generate --check-index-only -j ${SPACK_CONCRETIZE_JOBS} --forward-variable SPACK_CHECKOUT_VERSION --forward-variable SPACK_CHECKOUT_REPO --forward-variable SPACK_CI_PACKAGES_ROOT --forward-variable SPACK_CI_SPACK_ROOT - --artifacts-root "${CI_PROJECT_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}" - --output-file "${CI_PROJECT_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}/cloud-ci-pipeline.yml" + --artifacts-root "${SPACK_PROJECT_CI_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}" + --output-file "${SPACK_PROJECT_CI_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}/cloud-ci-pipeline.yml" artifacts: when: always paths: - - "${CI_PROJECT_DIR}/jobs_scratch_dir" - - "${CI_PROJECT_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}" - - "${CI_PROJECT_DIR}/tmp/_user_cache/cache/patches" - - "${CI_PROJECT_DIR}/tmp/_user_cache/cache/providers" - - "${CI_PROJECT_DIR}/tmp/_user_cache/cache/tags" + - "${SPACK_PROJECT_CI_DIR}/jobs_scratch_dir" + - "${SPACK_PROJECT_CI_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}" + - "${SPACK_PROJECT_CI_DIR}/tmp/_user_cache/cache/patches" + - "${SPACK_PROJECT_CI_DIR}/tmp/_user_cache/cache/providers" + - "${SPACK_PROJECT_CI_DIR}/tmp/_user_cache/cache/tags" variables: SPACK_CI_GENERATE: "generate" SPACK_CONCRETIZE_JOBS: 8 @@ -167,7 +170,7 @@ default: - | [ ! -z ${NOOP_JOB} ] && \ python3 ${SPACK_CI_SCRIPTS_ROOT}/common/noop_job.py \ - "${CI_PROJECT_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}/cloud-ci-pipeline.yml" + "${SPACK_PROJECT_CI_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}/cloud-ci-pipeline.yml" - | [ ! -z ${NOOP_JOB} ] && exit 0 - uname -a || true @@ -214,7 +217,7 @@ default: - | If ( $NOOP_JOB ) { - python ${SPACK_CI_SCRIPTS_ROOT}/common/noop_job.py "${CI_PROJECT_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}/cloud-ci-pipeline.yml" + python ${SPACK_CI_SCRIPTS_ROOT}/common/noop_job.py "${SPACK_PROJECT_CI_DIR}/jobs_scratch_dir/${SPACK_CI_STACK_NAME}/cloud-ci-pipeline.yml" } - | If ( $NOOP_JOB ) { exit 0 } @@ -237,6 +240,17 @@ default: entrypoint: [""] } + +.generate-engflow: + variables: + SPACK_CI_TARGET: "x86_64_v3" + extends: [ ".generate-base" ] + tags: ["spack", "public", "medium", "x86_64_v3"] + image: { + name: "tipibuild/linux-kitware-paraview@sha256:e0417824c4d417eb4d363f08954d11b94f9e6eb4ec76cee391db72e1e281fb18", + entrypoint: [""] + } + .build: extends: [ ".base-job" ] stage: build @@ -856,6 +870,36 @@ windows-vis-build: - artifacts: True job: windows-vis-generate +####################################### +# EngFlow Cache Testing Stack +####################################### + +.engflow: + variables: + SPACK_CI_STACK_NAME: engflow + RBE_service: kernite.cluster.engflow.com:443 + RBE_tls_client_auth_key: ${ENGFLOW_MTLS_KEY} + RBE_tls_client_auth_cert: ${ENGFLOW_MTLS_CERT} + TIPI_DISABLE_AR_RANLIB_DRIVER: "ON" + TIPI_CACHE_CONSUME_ONLY: "ON" + TIPI_CACHE_FORCE_ENABLE: "OFF" + + +engflow-generate: + extends: [".generate-engflow", ".engflow"] + +engflow-build: + extends: [".build", ".engflow"] + trigger: + << : *trigger_build + include: + - artifact: jobs_scratch_dir/engflow/cloud-ci-pipeline.yml + job: engflow-generate + needs: + - artifacts: True + job: engflow-generate + + ####################################### # Bootstrap x86_64-linux-gnu ####################################### diff --git a/.ci/gitlab/scripts/common/write_dotenv.py b/.ci/gitlab/scripts/common/write_dotenv.py index d0013dd72a9..163cefdf04f 100644 --- a/.ci/gitlab/scripts/common/write_dotenv.py +++ b/.ci/gitlab/scripts/common/write_dotenv.py @@ -1,8 +1,8 @@ import os import sys -CI_PROJECT_DIR = "." -CI_AUX_DIR = os.path.join(".ci", "tmp", "spack") +CI_PROJECT_DIR = os.path.join("/tmp", "spack") +CI_AUX_DIR = os.path.join("/.ci", "tmp", "spack") def configure_packages_repo(dotenv): diff --git a/repos/spack_repo/builtin/build_systems/cmake_re.py b/repos/spack_repo/builtin/build_systems/cmake_re.py new file mode 100644 index 00000000000..a276ad8db32 --- /dev/null +++ b/repos/spack_repo/builtin/build_systems/cmake_re.py @@ -0,0 +1,633 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +import collections.abc +import os +import pathlib +import platform +import re +import sys +from typing import Any, List, Optional, Tuple + +from spack.package import ( + BuilderWithDefaults, + InstallError, + PackageBase, + Prefix, + Spec, + build_system, + conflicts, + depends_on, + get_cmake_prefix_path, + memoized, + register_builder, + run_after, + tty, + variant, + when, + working_dir, +) + +from ._checks import execute_build_time_tests + +# Regex to extract the primary generator from the CMake generator +# string. +_primary_generator_extractor = re.compile(r"(?:.* - )?(.*)") + + +def _extract_primary_generator(generator): + """Use the compiled regex _primary_generator_extractor to extract the + primary generator from the generator string which may contain an + optional secondary generator. + """ + return _primary_generator_extractor.match(generator).group(1) + + +def _supports_compilation_databases(pkg: PackageBase) -> bool: + """Check if this package (and CMake) can support compilation databases.""" + + # CMAKE_EXPORT_COMPILE_COMMANDS only exists for CMake >= 3.5 + if not pkg.spec.satisfies("%cmake@3.5:"): + return False + + # CMAKE_EXPORT_COMPILE_COMMANDS is only implemented for Makefile and Ninja generators + if not (pkg.spec.satisfies("generator=make") or pkg.spec.satisfies("generator=ninja")): + return False + + return True + + +def _conditional_cmake_defaults(pkg: PackageBase, args: List[str]) -> None: + """Set a few default defines for CMake, depending on its version.""" + cmakes = pkg.spec.dependencies("cmake", deptype="build") + + if len(cmakes) != 1: + return + + cmake = cmakes[0] + + # CMAKE_INTERPROCEDURAL_OPTIMIZATION only exists for CMake >= 3.9 + try: + ipo = pkg.spec.variants["ipo"].value + except KeyError: + ipo = False + + if cmake.satisfies("@3.9:"): + args.append(define("CMAKE_INTERPROCEDURAL_OPTIMIZATION", ipo)) + + # Disable Package Registry: export(PACKAGE) may put files in the user's home directory, and + # find_package may search there. This is not what we want. + + # Do not populate CMake User Package Registry + if cmake.satisfies("@3.15:"): + # see https://cmake.org/cmake/help/latest/policy/CMP0090.html + args.append(define("CMAKE_POLICY_DEFAULT_CMP0090", "NEW")) + elif cmake.satisfies("@3.1:"): + # see https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_NO_PACKAGE_REGISTRY.html + args.append(define("CMAKE_EXPORT_NO_PACKAGE_REGISTRY", True)) + + # Do not use CMake User/System Package Registry + # https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#disabling-the-package-registry + if cmake.satisfies("@3.16:"): + args.append(define("CMAKE_FIND_USE_PACKAGE_REGISTRY", False)) + elif cmake.satisfies("@3.1:3.15"): + args.append(define("CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY", False)) + args.append(define("CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY", False)) + + # Export a compilation database if supported. + if _supports_compilation_databases(pkg): + args.append(define("CMAKE_EXPORT_COMPILE_COMMANDS", True)) + + # Enable MACOSX_RPATH by default when cmake_minimum_required < 3 + # https://cmake.org/cmake/help/latest/policy/CMP0042.html + if pkg.spec.satisfies("platform=darwin") and cmake.satisfies("@3:"): + args.append(define("CMAKE_POLICY_DEFAULT_CMP0042", "NEW")) + + # Disable find package's config mode for versions of Boost that + # didn't provide it. See https://github.com/spack/spack/issues/20169 + # and https://cmake.org/cmake/help/latest/module/FindBoost.html + if pkg.spec.satisfies("^boost@:1.69.0"): + args.append(define("Boost_NO_BOOST_CMAKE", True)) + + +def generator(*names: str, default: Optional[str] = None) -> None: + """The build system generator to use. + + See ``cmake --help`` for a list of valid generators. + Currently, "Unix Makefiles" and "Ninja" are the only generators + that Spack supports. Defaults to "Unix Makefiles". + + See https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html + for more information. + + Args: + names: allowed generators for this package + default: default generator + """ + allowed_values = ("make", "ninja") + if any(x not in allowed_values for x in names): + msg = "only 'make' and 'ninja' are allowed for CMake's 'generator' directive" + raise ValueError(msg) + + default = default or names[0] + not_used = [x for x in allowed_values if x not in names] + + def _values(x): + return x in allowed_values + + _values.__doc__ = f"{','.join(names)}" + + variant( + "generator", + default=default, + values=_values, + description="the build system generator to use", + when="build_system=cmake", + ) + for x in not_used: + conflicts(f"generator={x}") + + +class CMakeREPackage(PackageBase): + """Specialized class for packages built using CMake + + For more information on the CMake build system, see: + https://cmake.org/cmake/help/latest/ + """ + + #: List of package names for which CMake argument injection should be disabled + disable_cmake_hints_from: List[str] = [] + + #: This attribute is used in UI queries that need to know the build + #: system base class + build_system_class = "CMakePackage" + + #: Legacy buildsystem attribute used to deserialize and install old specs + default_buildsystem = "cmake-re" + + build_system("cmake-re") + + with when("build_system=cmake-re"): + # https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html + # See https://github.com/spack/spack/pull/36679 and related issues for a + # discussion of the trade-offs between Release and RelWithDebInfo for default + # builds. Release is chosen to maximize performance and reduce disk-space burden, + # at the cost of more difficulty in debugging. + variant( + "build_type", + default="Release", + description="CMake build type", + values=("Debug", "Release", "RelWithDebInfo", "MinSizeRel"), + ) + # CMAKE_INTERPROCEDURAL_OPTIMIZATION only exists for CMake >= 3.9 + # https://cmake.org/cmake/help/latest/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.html + variant( + "ipo", + default=False, + when="%cmake@3.9:", + description="CMake interprocedural optimization", + ) + + generator("ninja", "make", default="ninja") + + depends_on("cmake", type="build") + depends_on("gmake", type="build", when="generator=make") + depends_on("ninja", type="build", when="generator=ninja") + + # CMake earlier than 4.1 improperly handles arguments provided to + # the linker when using msvc as a c/cxx compiler and oneapi as a + # fortran compiler https://gitlab.kitware.com/cmake/cmake/-/issues/26005 + # + # Currently in Spack msvc is modeled as both the fortran/cxx compiler + # due to restrictions w/ oneapi on Windows, but in reality, when msvc + # is the fortran compiler, it is utilizing oneapi, and this + # must conflict. + # this should be updated to reflect a oneapi fortran provider + # once oneapi is usable with fortran on Windows + # NOTE: commented out for now because cmake@3 is used in Spack CI + # successfully with %fortran=msvc. + # depends_on("cmake@4.1:", type="build", when="%cxx=msvc %fortran=msvc") + + def flags_to_build_system_args(self, flags): + """Return a list of all command line arguments to pass the specified + compiler flags to cmake. Note CMAKE does not have a cppflags option, + so cppflags will be added to cflags, cxxflags, and fflags to mimic the + behavior in other tools. + """ + # Has to be dynamic attribute due to caching + setattr(self, "cmake_flag_args", []) + + flag_string = "-DCMAKE_{0}_FLAGS={1}" + langs = {"C": "c", "CXX": "cxx", "Fortran": "f"} + + # Handle language compiler flags + for lang, pre in langs.items(): + flag = pre + "flags" + # cmake has no explicit cppflags support -> add it to all langs + lang_flags = " ".join(flags.get(flag, []) + flags.get("cppflags", [])) + if lang_flags: + self.cmake_flag_args.append(flag_string.format(lang, lang_flags)) + + # Cmake has different linker arguments for different build types. + # We specify for each of them. + if flags["ldflags"]: + ldflags = " ".join(flags["ldflags"]) + # cmake has separate linker arguments for types of builds. + self.cmake_flag_args.append(f"-DCMAKE_EXE_LINKER_FLAGS={ldflags}") + self.cmake_flag_args.append(f"-DCMAKE_MODULE_LINKER_FLAGS={ldflags}") + self.cmake_flag_args.append(f"-DCMAKE_SHARED_LINKER_FLAGS={ldflags}") + + # CMake has libs options separated by language. Apply ours to each. + if flags["ldlibs"]: + libs_flags = " ".join(flags["ldlibs"]) + libs_string = "-DCMAKE_{0}_STANDARD_LIBRARIES={1}" + for lang in langs: + self.cmake_flag_args.append(libs_string.format(lang, libs_flags)) + + # Legacy methods (used by too many packages to change them, + # need to forward to the builder) + def define(self, cmake_var: str, value: Any) -> str: + return define(cmake_var, value) + + def define_from_variant(self, cmake_var: str, variant: Optional[str] = None) -> str: + return define_from_variant(self, cmake_var, variant) + + +@register_builder("cmake-re") +class CMakeREBuilder(BuilderWithDefaults): + """The cmake builder encodes the default way of building software with CMake. IT + has three phases that can be overridden: + + 1. :py:meth:`~.CMakeBuilder.cmake` + 2. :py:meth:`~.CMakeBuilder.build` + 3. :py:meth:`~.CMakeBuilder.install` + + They all have sensible defaults and for many packages the only thing + necessary will be to override :py:meth:`~.CMakeBuilder.cmake_args`. + + For a finer tuning you may also override: + + +-----------------------------------------------+--------------------+ + | **Method** | **Purpose** | + +===============================================+====================+ + | :py:meth:`~.CMakeBuilder.root_cmakelists_dir` | Location of the | + | | root CMakeLists.txt| + +-----------------------------------------------+--------------------+ + | :py:meth:`~.CMakeBuilder.build_directory` | Directory where to | + | | build the package | + +-----------------------------------------------+--------------------+ + """ + + #: Phases of a CMake package + phases: Tuple[str, ...] = ("cmake", "build", "install") + + #: Names associated with package methods in the old build-system format + package_methods: Tuple[str, ...] = ("cmake_args", "check") + + #: Names associated with package attributes in the old build-system format + package_attributes: Tuple[str, ...] = ( + "build_targets", + "install_targets", + "build_time_test_callbacks", + "archive_files", + "root_cmakelists_dir", + "std_cmake_args", + "build_dirname", + "build_directory", + ) + + #: Targets to be used during the build phase + build_targets: List[str] = [] + #: Targets to be used during the install phase + install_targets = ["install"] + #: Callback names for build-time test + build_time_test_callbacks = ["check"] + + @property + def archive_files(self) -> List[str]: + """Files to archive for packages based on CMake""" + files = [os.path.join(self.build_directory, "CMakeCache.txt")] + if _supports_compilation_databases(self.pkg): + files.append(os.path.join(self.build_directory, "compile_commands.json")) + return files + + @property + def root_cmakelists_dir(self) -> str: + """The relative path to the directory containing CMakeLists.txt + + This path is relative to the root of the extracted tarball, + not to the ``build_directory``. Defaults to the current directory. + """ + return self.pkg.stage.source_path + + @property + def generator(self) -> str: + if self.spec.satisfies("generator=make"): + return "Unix Makefiles" + if self.spec.satisfies("generator=ninja"): + return "Ninja" + raise ValueError( + f'{self.spec.format()} has an unsupported value for the "generator" variant' + ) + + @property + def std_cmake_args(self) -> List[str]: + """Standard cmake arguments provided as a property for + convenience of package writers + """ + args = CMakeREBuilder.std_args(self.pkg, generator=self.generator) + args += getattr(self.pkg, "cmake_flag_args", []) + return args + + @memoized + def cmake_re(self): + return Executable("cmake-re") + + @staticmethod + def std_args(pkg: PackageBase, generator: Optional[str] = None) -> List[str]: + """Computes the standard cmake arguments for a generic package""" + default_generator = "Ninja" if sys.platform == "win32" else "Unix Makefiles" + generator = generator or default_generator + valid_primary_generators = ["Unix Makefiles", "Ninja"] + primary_generator = _extract_primary_generator(generator) + if primary_generator not in valid_primary_generators: + msg = "Invalid CMake generator: '{0}'\n".format(generator) + msg += "CMakePackage currently supports the following " + msg += "primary generators: '{0}'".format("', '".join(valid_primary_generators)) + raise InstallError(msg) + + try: + build_type = pkg.spec.variants["build_type"].value + except KeyError: + build_type = "RelWithDebInfo" + + args = [ + "-G", + generator, + define("CMAKE_INSTALL_PREFIX", pathlib.Path(pkg.prefix).as_posix()), + define("CMAKE_INSTALL_RPATH_USE_LINK_PATH", True), + # only include the install prefix lib dirs; rpaths for deps are added by USE_LINK_PATH + define( + "CMAKE_INSTALL_RPATH", + [ + pathlib.Path(pkg.prefix, "lib").as_posix(), + pathlib.Path(pkg.prefix, "lib64").as_posix(), + ], + ), + define("CMAKE_PREFIX_PATH", get_cmake_prefix_path(pkg)), + define("CMAKE_BUILD_TYPE", build_type), + ] + + if primary_generator == "Unix Makefiles": + args.append(define("CMAKE_VERBOSE_MAKEFILE", True)) + + if platform.mac_ver()[0]: + args.extend( + [define("CMAKE_FIND_FRAMEWORK", "LAST"), define("CMAKE_FIND_APPBUNDLE", "LAST")] + ) + + _conditional_cmake_defaults(pkg, args) + + # Append extra hint/option arguments from dependencies + # TODO: Consider properties from virtual packages like Mpi + disable_cmake_hints_from = getattr(pkg, "disable_cmake_hints_from", []) + for dep in pkg.spec.edges_to_dependencies(): + # Skip packages without the callback + dep_pkg = dep.spec.package + if not hasattr(dep_pkg, "dependent_cmake_args"): + continue + + # Skip disabled dependency cmake args + if dep_pkg.name in disable_cmake_hints_from: + continue + + # Skip disabled virtual dependency cmake args + if any(v in disable_cmake_hints_from for v in dep.virtuals): + continue + + args.extend(dep_pkg.dependent_cmake_args(pkg.spec)) + + return args + + @staticmethod + def define_cuda_architectures(pkg: PackageBase) -> str: + return define_cuda_architectures(pkg) + + @staticmethod + def define_hip_architectures(pkg: PackageBase) -> str: + return define_hip_architectures(pkg) + + @staticmethod + def define(cmake_var: str, value: Any) -> str: + return define(cmake_var, value) + + def define_from_variant(self, cmake_var: str, variant: Optional[str] = None) -> str: + return define_from_variant(self.pkg, cmake_var, variant) + + @property + def build_dirname(self) -> str: + """Directory name to use when building the package.""" + return f"spack-build-{self.pkg.spec.dag_hash(7)}" + + @property + def build_directory(self) -> str: + """Full-path to the directory to use when building the package.""" + return os.path.join(self.pkg.stage.path, self.build_dirname) + + def cmake_args(self) -> List[str]: + """List of all the arguments that must be passed to cmake, except: + + * CMAKE_INSTALL_PREFIX + * CMAKE_BUILD_TYPE + + which will be set automatically. + """ + return [] + + def cmake(self, pkg: CMakeREPackage, spec: Spec, prefix: Prefix) -> None: + """Runs ``cmake`` in the build directory""" + + if spec.is_develop: + # skip cmake phase if it is an incremental develop build + + # Determine the files that will re-run CMake that are generated from a successful + # configure step based on state + primary_generator = _extract_primary_generator(self.generator) + configure_artifact = "Makefile" + if primary_generator == "Ninja": + configure_artifact = "build.ninja" + + if os.path.isfile(os.path.join(self.build_directory, configure_artifact)): + tty.msg( + "Incremental build criteria satisfied." + "Skipping CMake configure step. To force configuration run" + f" `spack clean {pkg.name}`" + ) + return + + options = self.std_cmake_args + options += self.cmake_args() + options.append(os.path.abspath(self.root_cmakelists_dir)) + with working_dir(self.build_directory, create=True): + self.cmake_re()(*options, "--host", "--distributed") + + def build(self, pkg: CMakeREPackage, spec: Spec, prefix: Prefix) -> None: + """Make the build targets""" + with working_dir(self.build_directory): + if self.generator == "Unix Makefiles": + pkg.module.make(*self.build_targets) + elif self.generator == "Ninja": + self.build_targets.append("-v") + self.cmake_re()( + "--build", self.build_directory, "--host", "--distributed", "--j500" + ) + + def install(self, pkg: CMakeREPackage, spec: Spec, prefix: Prefix) -> None: + """Make the install targets""" + with working_dir(self.build_directory): + if self.generator == "Unix Makefiles": + pkg.module.make(*self.install_targets) + elif self.generator == "Ninja": + pkg.module.ninja(*self.install_targets) + + run_after("build")(execute_build_time_tests) + + def check(self) -> None: + """Search the CMake-generated files for the targets ``test`` and ``check``, + and runs them if found. + """ + with working_dir(self.build_directory): + if self.generator == "Unix Makefiles": + self.pkg._if_make_target_execute("test", jobs_env="CTEST_PARALLEL_LEVEL") + self.pkg._if_make_target_execute("check") + elif self.generator == "Ninja": + self.pkg._if_ninja_target_execute("test", jobs_env="CTEST_PARALLEL_LEVEL") + self.pkg._if_ninja_target_execute("check") + + +def define(cmake_var: str, value: Any) -> str: + """Return a CMake command line argument that defines a variable. + + The resulting argument will convert boolean values to OFF/ON and lists/tuples to CMake + semicolon-separated string lists. All other values will be interpreted as strings. + + Examples: + + .. code-block:: python + + [define("BUILD_SHARED_LIBS", True), + define("CMAKE_CXX_STANDARD", 14), + define("swr", ["avx", "avx2"])] + + will generate the following configuration options: + + .. code-block:: console + + ["-DBUILD_SHARED_LIBS:BOOL=ON", + "-DCMAKE_CXX_STANDARD:STRING=14", + "-DSWR:STRING=avx;avx2] + + """ + # Create a list of pairs. Each pair includes a configuration + # option and whether or not that option is activated + if isinstance(value, bool): + kind = "BOOL" + value = "ON" if value else "OFF" + else: + kind = "STRING" + if isinstance(value, collections.abc.Sequence) and not isinstance(value, str): + value = ";".join(str(v) for v in value) + else: + value = str(value) + + return "".join(["-D", cmake_var, ":", kind, "=", value]) + + +def define_from_variant(pkg: PackageBase, cmake_var: str, variant: Optional[str] = None) -> str: + """Return a CMake command line argument from the given variant's value. + + The optional ``variant`` argument defaults to the lower-case transform + of ``cmake_var``. + + Examples: + + Given a package with: + + .. code-block:: python + + variant("cxxstd", default="11", values=("11", "14"), + multi=False, description="") + variant("shared", default=True, description="") + variant("swr", values=any_combination_of("avx", "avx2"), + description="") + + calling this function like: + + .. code-block:: python + + [ + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("CMAKE_CXX_STANDARD", "cxxstd"), + self.define_from_variant("SWR"), + ] + + will generate the following configuration options: + + .. code-block:: console + + [ + "-DBUILD_SHARED_LIBS:BOOL=ON", + "-DCMAKE_CXX_STANDARD:STRING=14", + "-DSWR:STRING=avx;avx2", + ] + + for `` cxxstd=14 +shared swr=avx,avx2`` + + Note: if the provided variant is conditional, and the condition is not met, this function + returns an empty string. CMake discards empty strings provided on the command line. + """ + if variant is None: + variant = cmake_var.lower() + + if not pkg.has_variant(variant): + raise KeyError('"{0}" is not a variant of "{1}"'.format(variant, pkg.name)) + + if variant not in pkg.spec.variants: + return "" + + value = pkg.spec.variants[variant].value + if isinstance(value, (tuple, list)): + # Sort multi-valued variants for reproducibility + value = sorted(value) + + return define(cmake_var, value) + + +def define_hip_architectures(pkg: PackageBase) -> str: + """Returns the str ``-DCMAKE_HIP_ARCHITECTURES:STRING=(expanded amdgpu_target)``. + + ``amdgpu_target`` is variant composed of a list of the target HIP + architectures and it is declared in the rocm package. + + This method is no-op for cmake<3.18 and when ``amdgpu_target`` variant is + not set. + + """ + if "amdgpu_target" in pkg.spec.variants and pkg.spec.satisfies("%cmake@3.21:"): + return define("CMAKE_HIP_ARCHITECTURES", pkg.spec.variants["amdgpu_target"].value) + + return "" + + +def define_cuda_architectures(pkg: PackageBase) -> str: + """Returns the str ``-DCMAKE_CUDA_ARCHITECTURES:STRING=(expanded cuda_arch)``. + + ``cuda_arch`` is variant composed of a list of target CUDA architectures and + it is declared in the cuda package. + + This method is no-op for cmake<3.18 and when ``cuda_arch`` variant is not set. + + """ + if "cuda_arch" in pkg.spec.variants and pkg.spec.satisfies("%cmake@3.18:"): + return define("CMAKE_CUDA_ARCHITECTURES", pkg.spec.variants["cuda_arch"].value) + return "" diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/FindFreetype.cmake.patch b/repos/spack_repo/builtin/packages/tipi_paraview/FindFreetype.cmake.patch new file mode 100644 index 00000000000..7e20b0a5718 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/FindFreetype.cmake.patch @@ -0,0 +1,38 @@ +Submodule VTK contains modified content +diff --git a/VTK/CMake/FindFreetype.cmake b/VTK/CMake/FindFreetype.cmake +index b4532735c2..51671d4c3c 100644 +--- a/VTK/CMake/FindFreetype.cmake ++++ b/VTK/CMake/FindFreetype.cmake +@@ -63,6 +63,32 @@ directory of a Freetype installation. + # I'm going to attempt to cut out the middleman and hope + # everything still works. + ++find_package(freetype CONFIG) # foward `QUIET`, version, and components here, but not `REQUIRED` ++if (freetype_FOUND) ++ if (NOT TARGET Freetype::Freetype) ++ # make target chain to target from config mode ++ get_target_property(freetype_library_type freetype TYPE) ++ get_target_property(freetype_location freetype LOCATION) ++ if (freetype_library_type STREQUAL STATIC_LIBRARY) ++ set(freetype_library_type STATIC) ++ elseif (freetype_library_type STREQUAL SHARED_LIBRARY) ++ set(freetype_library_type SHARED) ++ endif() ++ get_target_property(freetype_interface_include_directories freetype INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(freetype_interface_link_libraries freetype INTERFACE_LINK_LIBRARIES) ++ add_library(Freetype::Freetype "${freetype_library_type}" IMPORTED) ++ set_target_properties(Freetype::Freetype PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${freetype_interface_include_directories}" ++ INTERFACE_LINK_LIBRARIES "${freetype_interface_link_libraries}" ++ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" ++ IMPORTED_LOCATION "${freetype_location}") ++ endif () ++ set(FREETYPE_INCLUDE_DIRS "${freetype_interface_include_directories}") ++ set(FREETYPE_LIBRARIES "${freetype_interface_link_libraries}") ++ set(Freetype_FOUND 1) # might need to also forward the version found ++ return () ++endif () ++ + set(FREETYPE_FIND_ARGS + HINTS + ENV FREETYPE_DIR diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/adios2-remove-deprecated-functions.patch b/repos/spack_repo/builtin/packages/tipi_paraview/adios2-remove-deprecated-functions.patch new file mode 100644 index 00000000000..d90b8402207 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/adios2-remove-deprecated-functions.patch @@ -0,0 +1,31 @@ +From fdb93d3e9d447b9dd6ce5c77aca18396cf9b6aa3 Mon Sep 17 00:00:00 2001 +From: Vicente Bolea +Date: Mon, 3 Apr 2023 12:58:58 -0400 +Subject: [PATCH] Update /VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx + +--- + VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx b/VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx +index 5d58905a88..3ce039345a 100644 +--- a/VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx ++++ b/VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx +@@ -361,12 +361,12 @@ bool vtkADIOS2CoreImageReader::OpenAndReadMetaData() + vtkMPICommunicator* comm = + static_cast(this->Controller->GetCommunicator()); + +- this->Impl->Adios.reset(new adios2::ADIOS(*comm->GetMPIComm()->GetHandle(), adios2::DebugON)); ++ this->Impl->Adios.reset(new adios2::ADIOS(*comm->GetMPIComm()->GetHandle())); + #else + // Make sure the ADIOS subsystem is initialized before processing any + // sort of request. + +- this->Impl->Adios.reset(new adios2::ADIOS(adios2::DebugON)); ++ this->Impl->Adios.reset(new adios2::ADIOS()); + // Before processing any request, read the meta data first + #endif + } +-- +2.35.3 + diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/catalyst-etc_oneapi_fix.patch b/repos/spack_repo/builtin/packages/tipi_paraview/catalyst-etc_oneapi_fix.patch new file mode 100644 index 00000000000..18f015f5b01 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/catalyst-etc_oneapi_fix.patch @@ -0,0 +1,45 @@ +diff --git a/ThirdParty/catalyst/vtkcatalyst/catalyst/thirdparty/conduit/fmt/conduit_fmt/format.h b/ThirdParty/catalyst/vtkcatalyst/catalyst/thirdparty/conduit/fmt/conduit_fmt/format.h +index f0902169..86eb72e7 100644 +--- a/ThirdParty/catalyst/vtkcatalyst/catalyst/thirdparty/conduit/fmt/conduit_fmt/format.h ++++ b/ThirdParty/catalyst/vtkcatalyst/catalyst/thirdparty/conduit/fmt/conduit_fmt/format.h +@@ -1726,7 +1726,7 @@ OutputIt write_nonfinite(OutputIt out, bool isinf, + auto str = + isinf ? (fspecs.upper ? "INF" : "inf") : (fspecs.upper ? "NAN" : "nan"); + constexpr size_t str_size = 3; +- auto sign = fspecs.sign; ++ auto sign = static_cast(fspecs.sign); + auto size = str_size + (sign ? 1 : 0); + using iterator = remove_reference_t; + return write_padded(out, specs, size, [=](iterator it) { +@@ -1807,7 +1807,7 @@ OutputIt write_float(OutputIt out, const DecimalFP& fp, + auto significand = fp.significand; + int significand_size = get_significand_size(fp); + static const Char zero = static_cast('0'); +- auto sign = fspecs.sign; ++ auto sign = static_cast(fspecs.sign); + size_t size = to_unsigned(significand_size) + (sign ? 1 : 0); + using iterator = remove_reference_t; + + +diff --git a/VTK/ThirdParty/fmt/vtkfmt/vtkfmt/format.h b/VTK/ThirdParty/fmt/vtkfmt/vtkfmt/format.h +index 5398a23a..108b4f90 100644 +--- a/VTK/ThirdParty/fmt/vtkfmt/vtkfmt/format.h ++++ b/VTK/ThirdParty/fmt/vtkfmt/vtkfmt/format.h +@@ -1587,7 +1587,7 @@ auto write_nonfinite(OutputIt out, bool isinf, basic_format_specs specs, + auto str = + isinf ? (fspecs.upper ? "INF" : "inf") : (fspecs.upper ? "NAN" : "nan"); + constexpr size_t str_size = 3; +- auto sign = fspecs.sign; ++ auto sign = static_cast(fspecs.sign); + auto size = str_size + (sign ? 1 : 0); + // Replace '0'-padding with space for non-finite values. + const bool is_zero_fill = +@@ -1673,7 +1673,7 @@ auto write_float(OutputIt out, const DecimalFP& fp, + auto significand = fp.significand; + int significand_size = get_significand_size(fp); + static const Char zero = static_cast('0'); +- auto sign = fspecs.sign; ++ auto sign = static_cast(fspecs.sign); + size_t size = to_unsigned(significand_size) + (sign ? 1 : 0); + using iterator = reserve_iterator; + diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/exodusII-netcdf4.9.0.patch b/repos/spack_repo/builtin/packages/tipi_paraview/exodusII-netcdf4.9.0.patch new file mode 100644 index 00000000000..ec90224277f --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/exodusII-netcdf4.9.0.patch @@ -0,0 +1,14 @@ +*** a/VTK/ThirdParty/exodusII/vtkexodusII/src/ex_utils.c 2023-03-16 16:57:14.172102586 -0400 +--- b/VTK/ThirdParty/exodusII/vtkexodusII/src/ex_utils.c 2023-03-16 11:20:28.230116660 -0400 +*************** +*** 1770,1776 **** +--- 1770,1778 ---- + */ + + /* const int NC_SZIP_EC = 4; */ /* Selects entropy coding method for szip. */ ++ #ifndef NC_SZIP_NN + const int NC_SZIP_NN = 32; /* Selects nearest neighbor coding method for szip. */ ++ #endif + /* Even and between 4 and 32; typical values are 8, 10, 16, 32 */ + const int SZIP_PIXELS_PER_BLOCK = + file->compression_level == 0 ? 32 : file->compression_level; diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/gcc-compiler-pv501.patch b/repos/spack_repo/builtin/packages/tipi_paraview/gcc-compiler-pv501.patch new file mode 100644 index 00000000000..bb3be1832fb --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/gcc-compiler-pv501.patch @@ -0,0 +1,22 @@ +--- ParaView-5.0.1.orig/VTK/CMake/vtkCompilerExtras.cmake 2016-03-28 17:07:10.000000000 +0200 ++++ ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake 2016-12-13 17:21:25.382720945 +0100 +@@ -32,7 +32,7 @@ + OUTPUT_VARIABLE _gcc_version_info + ERROR_VARIABLE _gcc_version_info) + +- string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]*" ++ string (REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]*" + _gcc_version "${_gcc_version_info}") + if(NOT _gcc_version) + string (REGEX REPLACE ".*\\(GCC\\).*([34]\\.[0-9]).*" "\\1.0" +--- ParaView-5.0.1.orig/VTK/CMake/GenerateExportHeader.cmake 2016-03-28 17:07:10.000000000 +0200 ++++ ParaView-5.0.1/VTK/CMake/GenerateExportHeader.cmake 2016-12-13 17:21:25.382720945 +0100 +@@ -166,7 +166,7 @@ + execute_process(COMMAND ${CMAKE_C_COMPILER} ARGS --version + OUTPUT_VARIABLE _gcc_version_info + ERROR_VARIABLE _gcc_version_info) +- string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]*" ++ string(REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]*" + _gcc_version "${_gcc_version_info}") + # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the + # patch level, handle this here: diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/h5part-parallel.patch b/repos/spack_repo/builtin/packages/tipi_paraview/h5part-parallel.patch new file mode 100644 index 00000000000..7146fffc46a --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/h5part-parallel.patch @@ -0,0 +1,11 @@ +--- a/VTK/ThirdParty/h5part/vtkh5part/src/H5PartTypes.h 2020-10-12 17:56:08.942848601 -0400 ++++ b/VTK/ThirdParty/h5part/vtkh5part/src/H5PartTypes.h 2020-10-12 17:56:50.656772295 -0400 +@@ -19,7 +19,7 @@ + #endif + ; + +-#ifndef PARALLEL_IO ++#if !(defined(PARALLEL_IO) || defined(H5_HAVE_PARALLEL)) + typedef unsigned long MPI_Comm; + #endif + diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/kits_with_catalyst_5_12.patch b/repos/spack_repo/builtin/packages/tipi_paraview/kits_with_catalyst_5_12.patch new file mode 100644 index 00000000000..f61767fd64f --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/kits_with_catalyst_5_12.patch @@ -0,0 +1,21 @@ +From 65ec5b0604576474141def0ba7f0c7b94f6b32ee Mon Sep 17 00:00:00 2001 +From: Ryan Krattiger +Date: Fri, 8 Mar 2024 09:17:03 -0600 + +--- + VTK/IO/CatalystConduit/vtk.module | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/VTK/IO/CatalystConduit/vtk.module b/VTK/IO/CatalystConduit/vtk.module +index c67f5a099d5..18e706e8c9f 100644 +--- a/VTK/IO/CatalystConduit/vtk.module ++++ b/VTK/IO/CatalystConduit/vtk.module +@@ -5,7 +5,7 @@ LIBRARY_NAME + DESCRIPTION + Catalyst implementation for VTK, including Conduit to/from VTK conversion. + KIT +- VTK::IO ++ VTK::Parallel + SPDX_LICENSE_IDENTIFIER + BSD-3-Clause + SPDX_COPYRIGHT_TEXT diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/package.py b/repos/spack_repo/builtin/packages/tipi_paraview/package.py new file mode 100644 index 00000000000..e371c1894da --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/package.py @@ -0,0 +1,709 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import itertools +import os +import re +import sys +from subprocess import Popen + +from spack_repo.builtin.build_systems.cmake_re import CMakeREPackage, generator +from spack_repo.builtin.build_systems.cuda import CudaPackage +from spack_repo.builtin.build_systems.rocm import ROCmPackage + +from spack.package import * + +IS_WINDOWS = sys.platform == "win32" + + +# This is (more or less) the mapping hard-coded in VTK-m logic +# see https://gitlab.kitware.com/vtk/vtk-m/-/blob/v2.1.0/CMake/VTKmDeviceAdapters.cmake?ref_type=tags#L221-247 +supported_cuda_archs = { + "20": "fermi", + "21": "fermi", + "30": "kepler", + "32": "kepler", + "35": "kepler", + "37": "kepler", + "50": "maxwel", + "52": "maxwel", + "53": "maxwel", + "60": "pascal", + "61": "pascal", + "62": "pascal", + "70": "volta", + "72": "volta", + "75": "turing", + "80": "ampere", + "86": "ampere", +} + + +# This is a list of paraview variants that require the viskores library. +viskores_dependency_variants = ["+cuda", "+fides", "+rocm"] + + +class TipiParaview(CMakeREPackage, CudaPackage, ROCmPackage): + """ParaView is an open-source, multi-platform data analysis and + visualization application. This package includes the Catalyst + in-situ library for versions 5.7 and greater, otherwise use the + catalyst package. + + """ + + homepage = "https://www.paraview.org" + url = "https://www.paraview.org/files/v5.7/ParaView-v5.7.0.tar.xz" + list_url = "https://www.paraview.org/files" + list_depth = 1 + git = "https://github.com/tipi-build/ParaView.git" + + maintainers("johnwparent") + + license("Apache-2.0") + + version("cmake-re", branch="feature/support-cmake-re", submodules=True) + + variant( + "development_files", + default=True, + description="Install include files for Catalyst or plugins support", + ) + variant("python", default=False, description="Enable Python support") + variant("fortran", default=False, description="Enable Fortran support") + variant("mpi", default=True, description="Enable MPI support") + variant("qt", default=False, description="Enable Qt (gui) support") + variant("opengl2", default=True, description="Enable OpenGL2 backend", when="@5") + variant("osmesa_fallback", default=False, description="Enable OpenGL2 backend", when="@6:") + variant("x", default=True, description="Enable X11 support") + variant("examples", default=False, description="Build examples") + variant("hdf5", default=False, description="Use external HDF5") + variant("shared", default=True, description="Builds a shared version of the library") + variant("kits", default=True, description="Use module kits") + variant("pagosa", default=False, description="Build the pagosa adaptor") + variant("eyedomelighting", default=False, description="Enable Eye Dome Lighting feature") + variant("nvindex", default=False, description="Enable the pvNVIDIAIndeX plugin") + variant("tbb", default=False, description="Enable multi-threaded parallelism with TBB") + variant("adios2", default=False, description="Enable ADIOS2 support") + variant("fides", default=False, description="Enable Fides support") + variant("visitbridge", default=False, description="Enable VisItBridge support") + variant("raytracing", default=False, description="Enable Raytracing support") + variant("cdi", default=False, description="Enable CDI support") + variant( + "openpmd", + default=False, + description="Enable openPMD support (w/ ADIOS2/HDF5)", + when="@5.9: +python", + ) + variant("catalyst", default=False, description="Enable Catalyst 1") + variant( + "libcatalyst", + default=False, + description="Enable Catalyst 2 (libcatalyst) implementation", + ) + + variant( + "advanced_debug", + default=False, + description="Enable all other debug flags beside build_type, such as VTK_DEBUG_LEAK", + ) + variant( + "build_edition", + default="canonical", + multi=False, + values=("canonical", "catalyst_rendering", "catalyst", "rendering", "core"), + description="Build editions include only certain modules. " + "Editions are listed in decreasing order of size.", + ) + variant( + "use_vtkm", + default="default", + when="@5", + multi=False, + values=("default", "on", "off"), + description="Build VTK-m with ParaView." + ' "default" lets the build_edition make the decision.' + ' "on" or "off" will always override the build_edition.', + ) + + conflicts("~hdf5", when="+visitbridge") + conflicts("+fides", when="~adios2", msg="Fides needs ADIOS2") + conflicts("+fides", when="@5 use_vtkm=off", msg="Fides needs VTK-m") + conflicts("+fides", when="@5 use_vtkm=default", msg="Fides needs VTK-m") + conflicts("+openpmd", when="~adios2 ~hdf5", msg="openPMD needs ADIOS2 and/or HDF5") + conflicts("~shared", when="+cuda") + conflicts("+cuda", when="use_vtkm=off") + conflicts("+rocm", when="+cuda") + conflicts("+rocm", when="use_vtkm=off") + # Legacy rendering dropped in 5.5 + # See commit: https://gitlab.kitware.com/paraview/paraview/-/commit/798d328c + conflicts("~opengl2", when="@5") + + depends_on("c", type="build") # generated + depends_on("cxx", type="build") # generated + depends_on("fortran", type="build") # generated + + depends_on("cmake@3.3:", type="build") + depends_on("cmake@3.21:", type="build", when="+rocm") + + extends("python", when="+python") + + depends_on("python@3:", when="+python", type=("build", "run")) + + depends_on("py-numpy", when="+python", type=("build", "run")) + depends_on("py-mpi4py", when="+python+mpi", type=("build", "run")) + + depends_on("py-matplotlib", when="+python", type="run") + depends_on("py-pandas@0.21:", when="+python", type="run") + + # openPMD is implemented as a Python module and provides ADIOS2 and HDF5 backends + depends_on("openpmd-api@0.14.5: +python", when="+python +openpmd", type=("build", "run")) + depends_on("openpmd-api +adios2", when="+openpmd +adios2", type=("build", "run")) + depends_on("openpmd-api +hdf5", when="+openpmd +hdf5", type=("build", "run")) + + depends_on("tbb", when="+tbb") + + depends_on("mpi", when="+mpi") + conflicts("mpi", when="~mpi") + + # Handle X11 dependencies + # X is only used on Unix like platforms + conflicts("glx", when="~x") + # When on linux, X is required for Qt + for plat in ["linux", "freebsd"]: + with when(f"platform={plat}"): + requires("+x", when="+qt", msg="Qt support requires GLX on Linux/FreeBSD") + + with when("+x"): + depends_on("libxt", when="@:5.12") + depends_on("libx11") + depends_on("libxcursor") + # When Qt and X are enabled, GLX is required in the runtime + requires("^[virtuals=gl] glx", when="@5") + depends_on("glx", when="@6:", type=("run")) + + # ParaView@5 support Qt5 and requires a GL provider to be known at + # build/link time. + with when("@5"): + with when("+qt"): + # https://discourse.paraview.org/t/paraview-5-9-and-minimum-recommended-qt-version/5333 + depends_on("qt@5.12:5", when="@5") + depends_on("qt+sql") + depends_on("qt+opengl", when="@5 +opengl2") + depends_on("qt~opengl", when="@5 ~opengl2") + # Headless rendering not supported with Qt + conflicts("osmesa") + conflicts("egl") + + depends_on("gl@3.2:", when="+opengl2") + depends_on("gl@1.2:", when="~opengl2") + depends_on("glew") + + # CUDA ARCH + + # VTK-m and transitively ParaView does not support Tesla Arch + for _arch in ("10", "11", "12", "13"): + conflicts(f"cuda_arch={_arch}", when="+cuda", msg="ParaView requires cuda_arch >= 20") + + # Starting from cmake@3.18, CUDA architecture managament can be delegated to CMake. + # Hence, it is possible to rely on it instead of relying on custom logic updates from + # VTK-m for newer architectures (wrt mapping). + pattern = re.compile(r"\d+") + for _arch in CudaPackage.cuda_arch_values: + _number = re.match(pattern, _arch).group() + if int(_number) > 86: + conflicts("cmake@:3.17", when=f"cuda_arch={_arch}") + + # We only support one single Architecture + for _arch, _other_arch in itertools.permutations(CudaPackage.cuda_arch_values, 2): + conflicts( + "cuda_arch={0}".format(_arch), + when="cuda_arch={0}".format(_other_arch), + msg="Paraview only accepts one architecture value", + ) + + # Dependencies for vendored VTK-m + depends_on("hip@5.2:", when="+rocm") + # CUDA thrust is already include in the CUDA pkg + depends_on("rocthrust", when="@5.13: +rocm ^cmake@3.24:") + for target in ROCmPackage.amdgpu_targets: + depends_on( + "kokkos@:3.7 +rocm amdgpu_target={0}".format(target), + when="+rocm amdgpu_target={0}".format(target), + ) + + with when("@6:"): + # ParaView 6 and later will not support Spack builds with Qt5. + with when("+qt"): + depends_on("qt-base@6.9.0 +accessibility+gui+opengl+sql+network") + depends_on("qt-tools+assistant") + depends_on("qt-5compat") + depends_on("qt-svg") + depends_on("libxslt") + + depends_on("scnlib") + + # ParaView@6: and later will depend on OSMesa as a fallback for + # OpenGL. + # The search order for GL is: + # * the system rendering default (WGL/AGL/GLX) + # * EGL + # * OSMesa (guarenteed to exist and work on all systems) + depends_on("osmesa", type=("link", "run"), when="+osmesa_fallback") + + # Depend on Viskores when it is needed + for vk_variant in viskores_dependency_variants: + depends_on("viskores +vtktypes +64bitids +doubleprecision", when=f"{vk_variant}") + depends_on("viskores +fpic", when=f"+shared {vk_variant}") + + with when("+fides"): + depends_on("fides@1.3:") + depends_on("fides +mpi", when="+mpi") + + with when("+cuda"): + # Kokkos vs Viskores Native CUDA is intentionally left configurable + depends_on("viskores +cuda") + for _arch in CudaPackage.cuda_arch_values: + depends_on(f"viskores cuda_arch={_arch}", when=f"cuda_arch={_arch}") + + with when("+rocm"): + depends_on("viskores +rocm") + for target in ROCmPackage.amdgpu_targets: + depends_on(f"viskores amdgpu_target={target}", when=f"amdgpu_target={target}") + + depends_on("ospray@2.1:2", when="+raytracing") + depends_on("openimagedenoise", when="+raytracing") + depends_on("ospray +mpi", when="+raytracing +mpi") + + depends_on("cdi", when="+cdi") + + depends_on("bzip2") + depends_on("double-conversion") + depends_on("expat") + depends_on("eigen@3") + depends_on("freetype") + depends_on("hdf5+hl+mpi", when="+hdf5+mpi") + depends_on("hdf5+hl~mpi", when="+hdf5~mpi") + depends_on("hdf5@1.10:", when="+hdf5") + depends_on("adios2+mpi", when="+adios2+mpi") + depends_on("adios2~mpi", when="+adios2~mpi") + depends_on("silo", when="+visitbridge") + depends_on("silo+mpi", when="+visitbridge+mpi") + depends_on("silo~mpi", when="+visitbridge~mpi") + depends_on("boost", when="+visitbridge") + depends_on("jpeg") + depends_on("jsoncpp") + depends_on("libogg") + depends_on("libpng") + depends_on("libtheora") + depends_on("libtiff") + depends_on("netcdf-c") + depends_on("netcdf-c+parallel-netcdf", when="+mpi platform=darwin") + depends_on("netcdf-c+parallel-netcdf", when="+mpi platform=freebsd") + depends_on("netcdf-c+parallel-netcdf", when="+mpi platform=linux") + depends_on("netcdf-c@:4.9.2", when="@5") + depends_on("pegtl@2.8.3") + depends_on("protobuf@3.4:") + # protobuf requires newer abseil-cpp, which in turn requires C++14, + # but paraview uses C++11 by default. Use until ParaView updates + # its C++ standard level. + depends_on("protobuf@3.4:21", when="%gcc") + depends_on("protobuf@3.4:21", when="%clang") + depends_on("protobuf@3.4:21", when="@5.11:") + depends_on("protobuf@3.4:21", when="@master") + depends_on("libxml2") + depends_on("lz4") + depends_on("xz") + depends_on("zlib-api") + depends_on("libcatalyst@2:", when="+libcatalyst") + + # Older builds of pugi export their symbols differently, + # and pre-5.9 is unable to handle that. + depends_on("pugixml") + # 5.13 uses 'remove_children': https://github.com/spack/spack/issues/47098 + depends_on("pugixml@1.11:", when="@5.13:") + + # ParaView depends on cli11 due to changes in MR + # https://gitlab.kitware.com/paraview/paraview/-/merge_requests/4951 + depends_on("cli11@1.9.1") + + # ParaView depends on nlohmann-json due to changes in MR + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8550 + depends_on("nlohmann-json", when="@5.11:") + + # ParaView depends on proj@8.1.0 due to changes in MR + # v8.1.0 is required for VTK::GeoVis + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8474 + depends_on("proj@8.1.0", when="@5.11:") + + # Patches to vendored VTK-m are needed for forward compat with CUDA 12 (mr 2972 and 3259) + depends_on("cuda@:11", when="@5:5.12 +cuda") + + # Fix IOADIOS2 module to work with kits + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8653 + patch("vtk-adios2-module-no-kit.patch", when="@5:5.11") + + # Patch for paraview 5.8: ^hdf5@1.13.2: + # Even with ~hdf5, hdf5 is part of the dependency tree due to netcdf-c + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9690 + patch("vtk-xdmf2-hdf51.13.2.patch", when="@5.11.0") + # a patch with the same name is also applied to vtk + # the two patches are the same but for the path to the files they patch + patch("vtk_alias_hdf5.patch") + + # Fix VTK to work with external freetype using CONFIG mode for find_package + patch("FindFreetype.cmake.patch") + + # Fix VTK to remove deprecated ADIOS2 functions + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10113 + patch("adios2-remove-deprecated-functions.patch", when="@5.11 ^adios2@2.9:") + + patch("kits_with_catalyst_5_12.patch", when="@5.12.0") + + # https://github.com/Kitware/VTK-m/commit/c805a6039ea500cb96158cfc11271987c9f67aa4 + patch("vtkm-remove-unused-method-from-mir-tables.patch", when="@5.13.2 %oneapi@2025:") + + # https://github.com/Kitware/VTK-m/commit/48e385af319543800398656645327243a29babfb + patch("vtkm-fix-problems-in-class-member-names.patch", when="@5.13.2 %oneapi@2025:") + + # Vtk's findpegtl's include search is wrong: https://gitlab.kitware.com/vtk/vtk/-/issues/17876 + patch("pegtl_tao_find.patch", when="platform=windows") + + # https://gitlab.kitware.com/paraview/paraview/-/merge_requests/7593 + patch("paraview-cdireader-lazy.patch", when="@:6.0 +cdi") + + # Fix for linking external Fides library + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/13130 + patch("vtk-external-fides-pv61.patch", working_dir="VTK", when="@6.0:6.1") + + # Fixes for linking external Viskores library + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/13094 + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/13127 + patch("vtk-fine-grained-viskores-targets-pv61.patch", working_dir="VTK", when="@6.0:6.1") + patch("vtk-consolidate-viskores-wrapping-pv60.patch", working_dir="VTK", when="@6.0") + patch("vtk-consolidate-viskores-wrapping-pv61.patch", working_dir="VTK", when="@6.1") + + generator("ninja", "make", default="ninja") + # https://gitlab.kitware.com/paraview/paraview/-/issues/21223 + conflicts("generator=ninja", when="%xl") + conflicts("generator=ninja", when="%xl_r") + + # Versions 5.13.0-5.13.2 do not compile with Intel classic compilers + conflicts("%intel", when="@5.13:5.13.2") + + 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 + return _urlfmt.format(version.up_to(2), version, "", "xz") + + @property + def paraview_subdir(self): + """The paraview subdirectory name as paraview-major.minor""" + if self.spec.version == Version("master"): + return "paraview-5.11" + else: + return "paraview-{0}".format(self.spec.version.up_to(2)) + + def setup_dependent_build_environment( + self, env: EnvironmentModifications, dependent_spec: Spec + ) -> None: + if os.path.isdir(self.prefix.lib64): + lib_dir = self.prefix.lib64 + else: + lib_dir = self.prefix.lib + env.set("ParaView_DIR", self.prefix) + + env.set("PARAVIEW_VTK_DIR", join_path(lib_dir, "cmake", self.paraview_subdir, "vtk")) + + def flag_handler(self, name, flags): + if name == "ldflags" and self.spec.satisfies("%intel"): + flags.append("-shared-intel") + return (None, flags, None) + # -no-ipo prevents internal compiler error from multi-file + # optimization (https://github.com/spack/spack/issues/18192) + if (name == "cflags" or name == "cxxflags") and self.spec.satisfies("%intel"): + flags.append("-no-ipo") + return (None, None, flags) + + if name in ("cflags", "cxxflags"): + # Constrain the HDF5 API + if self.spec["hdf5"].satisfies("@1.12:"): + flags.append("-DH5_USE_110_API") + + if self.spec.satisfies("%oneapi@2025:"): + flags.append("-Wno-error=missing-template-arg-list-after-template-kw") + flags.append("-Wno-missing-template-arg-list-after-template-kw") + + return flags, None, None + + def setup_run_environment(self, env: EnvironmentModifications) -> None: + # paraview 5.5 and later + # - cmake under lib/cmake/paraview-5.5 + # - libs under lib + # - python bits under lib/python2.8/site-packages + if os.path.isdir(self.prefix.lib64): + lib_dir = self.prefix.lib64 + else: + lib_dir = self.prefix.lib + + env.set("ParaView_DIR", self.prefix) + + env.set("PARAVIEW_VTK_DIR", join_path(lib_dir, "cmake", self.paraview_subdir, "vtk")) + + env.prepend_path("LIBRARY_PATH", lib_dir) + env.prepend_path("LD_LIBRARY_PATH", lib_dir) + + if "+python" in self.spec: + python_version = self.spec["python"].version.up_to(2) + pv_pydir = join_path(lib_dir, "python{0}".format(python_version), "site-packages") + if "+shared" in self.spec: + env.prepend_path("PYTHONPATH", pv_pydir) + # The Trilinos Catalyst adapter requires + # the vtkmodules directory in PYTHONPATH + env.prepend_path("PYTHONPATH", join_path(pv_pydir, "vtkmodules")) + else: + env.prepend_path("PYTHONPATH", join_path(pv_pydir, "_paraview.zip")) + env.prepend_path("PYTHONPATH", join_path(pv_pydir, "_vtk.zip")) + + def cmake_args(self): + """Populate cmake arguments for ParaView.""" + spec = self.spec + + build_edition = spec.variants["build_edition"].value.upper() + + cmake_args = [ + "-DBUILD_TESTING:BOOL=OFF", + "-DOpenGL_GL_PREFERENCE:STRING=LEGACY", + "-DVTK_MODULE_USE_EXTERNAL_ParaView_vtkcatalyst:BOOL=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_ioss:BOOL=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_exprtk:BOOL=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_fmt:BOOL=OFF", + "-DVTK_MODULE_USE_EXTERNAL_ParaView_cgns:BOOL=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps:BOOL=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_libharu:BOOL=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_utf8:BOOL=OFF", + "-DPARAVIEW_BUILD_WITH_EXTERNAL=ON", + "-DCMAKE_TOOLCHAIN_FILE=toolchains/environments/linux-kitware-paraview-mini.cmake" + f"-DPARAVIEW_BUILD_EDITION:STRING={build_edition}", + self.define_from_variant("PARAVIEW_INSTALL_DEVELOPMENT_FILES", "development_files"), + self.define_from_variant("VTK_USE_X", "x"), + self.define_from_variant("PARAVIEW_ENABLE_VISITBRIDGE", "visitbridge"), + self.define_from_variant("VISIT_BUILD_READER_Silo", "visitbridge"), + self.define_from_variant("PARAVIEW_BUILD_WITH_KITS", "kits"), + self.define_from_variant("PARAVIEW_BUILD_PAGOSA_ADAPTOR", "pagosa"), + self.define_from_variant("PARAVIEW_BUILD_PLUGIN_EyeDomeLighting", "eyedomelighting"), + self.define_from_variant("PARAVIEW_PLUGIN_ENABLE_pvNVIDIAIndeX", "nvindex"), + self.define_from_variant("PARAVIEW_USE_QT", "qt"), + self.define_from_variant("PARAVIEW_ENABLE_EXAMPLES", "examples"), + self.define_from_variant("PARAVIEW_ENABLE_ADIOS2", "adios2"), + self.define_from_variant("PARAVIEW_ENABLE_FIDES", "fides"), + self.define_from_variant("PARAVIEW_USE_FORTRAN", "fortran"), + self.define_from_variant("PARAVIEW_USE_CUDA", "cuda"), + self.define_from_variant("PARAVIEW_USE_MPI", "mpi"), + self.define_from_variant("PARAVIEW_BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("PARAVIEW_ENABLE_RAYTRACING", "raytracing"), + # Currently only support OSPRay ray tracing + self.define_from_variant("VTK_ENABLE_OSPRAY", "raytracing"), + self.define_from_variant("VTKOSPRAY_ENABLE_DENOISER", "raytracing"), + # CDI + self.define_from_variant("PARAVIEW_PLUGIN_ENABLE_CDIReader", "cdi"), + self.define_from_variant("PARAVIEW_PLUGIN_AUTOLOAD_CDIReader", "cdi"), + ] + + # Configure OSMesa + if spec.satisfies("@5"): + if spec.satisfies("^[virtuals=gl] osmesa"): + cmake_args.append("-DVTK_OPENGL_HAS_OSMESA:BOOL=ON") + else: + cmake_args.append("-DVTK_OPENGL_HAS_OSMESA:BOOL=OFF") + else: + cmake_args.append(self.define_from_variant("VTK_OPENGL_HAS_OSMESA", "osmesa_fallback")) + + # Configure EGL + if spec.satisfies("^[virtuals=gl] egl"): + cmake_args.append("-DVTK_OPENGL_HAS_EGL:BOOL=ON") + + # Disable patched externals + if spec.satisfies("@5.12:"): + cmake_args.append("-DVTK_MODULE_USE_EXTERNAL_VTK_fast_float:BOOL=OFF") + cmake_args.append("-DVTK_MODULE_USE_EXTERNAL_VTK_token:BOOL=OFF") + + if spec.satisfies("@5.11:"): + cmake_args.append("-DVTK_MODULE_USE_EXTERNAL_VTK_verdict:BOOL=OFF") + + if spec.satisfies("%cce"): + cmake_args.append("-DVTK_PYTHON_OPTIONAL_LINK: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 + if spec.satisfies("+qt"): + if spec.satisfies("^qt"): + cmake_args.extend(["-DPARAVIEW_QT_VERSION=%s" % spec["qt"].version[0]]) + else: + cmake_args.extend(["-DPARAVIEW_QT_VERSION=%s" % spec["qt-base"].version[0]]) + cmake_args.extend(["-DVTK_QT_VERSION=%s" % spec["qt-base"].version[0]]) + + if IS_WINDOWS: + # Windows does not currently support Qt Quick + cmake_args.append("-DVTK_MODULE_ENABLE_VTK_GUISupportQtQuick:STRING=NO") + + # CMake flags for python have changed with newer ParaView versions + # Make sure Spack uses the right cmake flags + if "+python" in spec: + cmake_args.extend( + [ + "-DPARAVIEW_USE_PYTHON:BOOL=ON", + "-DPARAVIEW_PYTHON_VERSION:STRING=3", + ] + ) + else: + cmake_args.append("-DPARAVIEW_ENABLE_PYTHON:BOOL=OFF") + + if "+mpi" in spec: + mpi_args = ["-DMPIEXEC:FILEPATH=%s/bin/mpiexec" % spec["mpi"].prefix] + if not sys.platform == "win32": + mpi_args.extend( + [ + "-DMPI_CXX_COMPILER:PATH=%s" % spec["mpi"].mpicxx, + "-DMPI_C_COMPILER:PATH=%s" % spec["mpi"].mpicc, + "-DMPI_Fortran_COMPILER:PATH=%s" % spec["mpi"].mpifc, + ] + ) + cmake_args.extend(mpi_args) + + # VTK-m used in ParaView in 5.x + if spec.satisfies("@5") and spec.variants["use_vtkm"].value != "default": + cmake_args.append( + "-DPARAVIEW_USE_VTKM:BOOL=%s" % spec.variants["use_vtkm"].value.upper() + ) + + # Viskores added to ParaView in 6.0.0 and up + if spec.satisfies("@6:"): + use_viskores = False + for variant in viskores_dependency_variants: + use_viskores |= spec.satisfies(variant) + if use_viskores: + cmake_args.append("-DPARAVIEW_USE_VISKORES:BOOL=ON") + cmake_args.append("-DVTK_MODULE_USE_EXTERNAL_VTK_vtkviskores:BOOL=ON") + else: + cmake_args.append("-DPARAVIEW_USE_VISKORES:BOOL=OFF") + + # VTK-m expects cuda_arch to be the arch name vs. the arch version. + if spec.satisfies("@5 +cuda"): + if spec["cmake"].satisfies("@3.18:"): + cmake_args.append( + self.define( + "CMAKE_CUDA_ARCHITECTURES", ";".join(spec.variants["cuda_arch"].value) + ) + ) + else: + # ParaView/VTK-m only accepts one arch, default to first element + requested_arch = spec.variants["cuda_arch"].value[0] + + if requested_arch == "none": + cuda_arch_value = "native" + else: + try: + cuda_arch_value = supported_cuda_archs[requested_arch] + except KeyError: + raise InstallError("Incompatible cuda_arch=" + requested_arch) + + cmake_args.append(self.define("VTKm_CUDA_Architecture", cuda_arch_value)) + + if "darwin" in spec.architecture: + cmake_args.extend( + ["-DVTK_USE_X:BOOL=OFF", "-DPARAVIEW_DO_UNIX_STYLE_INSTALLS:BOOL=ON"] + ) + + if "+tbb" in spec: + cmake_args.append("-DVTK_SMP_IMPLEMENTATION_TYPE=TBB") + + # A bug that has been found in vtk causes an error for + # intel builds for version 5.6. This should be revisited + # with later versions of Paraview to see if the issues still + # arises. + if "%intel" in spec and spec.version >= Version("5.6"): + cmake_args.append("-DPARAVIEW_ENABLE_MOTIONFX:BOOL=OFF") + + # Encourage Paraview to use the correct Python libs + if spec.satisfies("+python"): + pylibdirs = spec["python"].libs.directories + cmake_args.append("-DCMAKE_INSTALL_RPATH={0}".format(":".join(self.rpath + pylibdirs))) + + if "+advanced_debug" in spec: + cmake_args.append("-DVTK_DEBUG_LEAKS:BOOL=ON") + + # Configure ROCM/Kokkos + if spec.satisfies("@5.11:5"): + cmake_args.append(self.define_from_variant("PARAVIEW_USE_HIP", "rocm")) + elif spec.satisfies("@6:"): + cmake_args.append(self.define_from_variant("PARAVIEW_USE_KOKKOS", "rocm")) + + if "+rocm" in spec: + if spec.satisfies("@6:"): + cmake_args.append("-DPARAVIEW_KOKKOS_BACKEND:STRING=HIP") + + archs = spec.variants["amdgpu_target"].value + + if archs != "none": + arch_str = ",".join(archs) + cmake_args.append("-DCMAKE_HIP_ARCHITECTURES=%s" % arch_str) + cmake_args.append("-DKokkos_CXX_COMPILER=%s" % spec["hip"].hipcc) + + if "+catalyst" in spec: + cmake_args.append("-DVTK_MODULE_ENABLE_ParaView_Catalyst=YES") + if "+python" in spec: + cmake_args.append("-DVTK_MODULE_ENABLE_ParaView_PythonCatalyst=YES") + + if "+libcatalyst" in spec: + cmake_args.append("-DVTK_MODULE_ENABLE_ParaView_InSitu=YES") + cmake_args.append("-DPARAVIEW_ENABLE_CATALYST=YES") + + return cmake_args + + def test_smoke_test(self): + """Simple smoke test for ParaView""" + pvserver = Executable(self.prefix.bin.pvserver) + pvserver("--help") + + def test_pvpython(self): + """Test pvpython""" + if "~python" in self.spec: + raise SkipTest("Package must be installed with +python") + + pvpython = Executable(self.prefix.bin.pvpython) + pvpython("-c", "import paraview") + + def test_mpi_ensemble(self): + """Test MPI ParaView Client/Server ensemble""" + spec = self.spec + + if "~mpi" in spec or "~python" in spec: + raise SkipTest("Package must be installed with +mpi and +python") + + mpirun = spec["mpi"].prefix.bin.mpirun + pvserver = self.prefix.bin.pvserver + pvpython = Executable(self.prefix.bin.pvpython) + + with working_dir("smoke_test_build", create=True): + with Popen( + [mpirun, "-np", "3", pvserver, "--mpi", "--force-offscreen-rendering"] + ) as servers: + pvpython( + "--force-offscreen-rendering", + "-c", + "from paraview.simple import *;" + "Connect('127.0.0.1');" + "sphere = Sphere(ThetaResolution=16, PhiResolution=32);" + "sphere_remote = servermanager.Fetch(sphere);" + "Show(sphere);" + "Render()", + ) + servers.terminate() + + @run_after("install") + @on_package_attributes(run_tests=True) + def build_test(self): + self.test_smoke_test() + self.test_pvpython() + self.test_mpi_ensemble() diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/paraview-cdireader-lazy.patch b/repos/spack_repo/builtin/packages/tipi_paraview/paraview-cdireader-lazy.patch new file mode 100644 index 00000000000..2e3132eb8d1 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/paraview-cdireader-lazy.patch @@ -0,0 +1,13 @@ +diff --git a/Plugins/CDIReader/Reader/vtkCDIReader.cxx b/Plugins/CDIReader/Reader/vtkCDIReader.cxx +index 1561f047240ee9efc7dcf7688bf32b2ad43c22e5..89e869b68bc623e81d4315d6aefcf088c5789884 100644 +--- a/Plugins/CDIReader/Reader/vtkCDIReader.cxx ++++ b/Plugins/CDIReader/Reader/vtkCDIReader.cxx +@@ -252,6 +252,8 @@ vtkCDIReader::vtkCDIReader() + + vtkDebugMacro("MAX_VARS:" << MAX_VARS); + vtkDebugMacro("Created vtkCDIReader"); ++ ++ cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); + } + + //---------------------------------------------------------------------------- diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/paraview-gcc11-limits.patch b/repos/spack_repo/builtin/packages/tipi_paraview/paraview-gcc11-limits.patch new file mode 100644 index 00000000000..3010362083f --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/paraview-gcc11-limits.patch @@ -0,0 +1,49 @@ +Index: ParaView-v5.9.1/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h +=================================================================== +--- ParaView-v5.9.1.orig/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h ++++ ParaView-v5.9.1/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h +@@ -25,6 +25,7 @@ + #include "vtkIdList.h" + #include + #include ++#include + #include + #include + +Index: ParaView-v5.9.1/VTK/Rendering/Core/vtkColorTransferFunction.cxx +=================================================================== +--- ParaView-v5.9.1.orig/VTK/Rendering/Core/vtkColorTransferFunction.cxx ++++ ParaView-v5.9.1/VTK/Rendering/Core/vtkColorTransferFunction.cxx +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + +Index: ParaView-v5.9.1/VTK/Common/DataModel/vtkPiecewiseFunction.cxx +=================================================================== +--- ParaView-v5.9.1.orig/VTK/Common/DataModel/vtkPiecewiseFunction.cxx ++++ ParaView-v5.9.1/VTK/Common/DataModel/vtkPiecewiseFunction.cxx +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + +Index: ParaView-v5.9.1/VTK/Filters/HyperTree/vtkHyperTreeGridThreshold.cxx +=================================================================== +--- ParaView-v5.9.1.orig/VTK/Filters/HyperTree/vtkHyperTreeGridThreshold.cxx ++++ ParaView-v5.9.1/VTK/Filters/HyperTree/vtkHyperTreeGridThreshold.cxx +@@ -27,6 +27,7 @@ + #include "vtkHyperTreeGridNonOrientedCursor.h" + + #include ++#include + + vtkStandardNewMacro(vtkHyperTreeGridThreshold); + + diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/pegtl_tao_find.patch b/repos/spack_repo/builtin/packages/tipi_paraview/pegtl_tao_find.patch new file mode 100644 index 00000000000..0382e6f850b --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/pegtl_tao_find.patch @@ -0,0 +1,20 @@ +diff --git a/VTK/CMake/FindPEGTL.cmake b/VTK/CMake/FindPEGTL.cmake +index fbc3e15a..88d995b9 100644 +--- a/VTK/CMake/FindPEGTL.cmake ++++ b/VTK/CMake/FindPEGTL.cmake +@@ -21,13 +21,12 @@ + # PEGTL::PEGTL + + find_path(PEGTL_INCLUDE_DIR +- NAMES pegtl/version.hpp +- PATH_SUFFIXES tao ++ NAMES tao/pegtl/version.hpp + DOC "Path to PEGTL headers") + mark_as_advanced(PEGTL_INCLUDE_DIR) + + if (PEGTL_INCLUDE_DIR) +- file(STRINGS "${PEGTL_INCLUDE_DIR}/pegtl/version.hpp" _pegtl_version_header ++ file(STRINGS "${PEGTL_INCLUDE_DIR}/tao/pegtl/version.hpp" _pegtl_version_header + REGEX "TAO_PEGTL_VERSION") + string(REGEX MATCH "define[ \t]+TAO_PEGTL_VERSION[ \t]+\"([0-9.]+)\"" _pegtl_version_match "${_pegtl_version_header}") + set(PEGTL_VERSION "${CMAKE_MATCH_1}") diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/stl-reader-pv440.patch b/repos/spack_repo/builtin/packages/tipi_paraview/stl-reader-pv440.patch new file mode 100644 index 00000000000..06907fd8959 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/stl-reader-pv440.patch @@ -0,0 +1,11 @@ +--- ParaView-4.4.0.orig/VTK/IO/Geometry/vtkSTLReader.cxx 2015-09-11 19:59:24.000000000 +0200 ++++ ParaView-4.4.0/VTK/IO/Geometry/vtkSTLReader.cxx 2016-06-19 12:59:50.769770143 +0200 +@@ -448,7 +448,7 @@ + done = done || (fscanf(fp,"%s", line)==EOF); + } + } +- if (!done) ++ else if (!done) + { + done = (fgets(line, 255, fp) == 0); + lineCount++; diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/ui_pqExportStateWizard.patch b/repos/spack_repo/builtin/packages/tipi_paraview/ui_pqExportStateWizard.patch new file mode 100644 index 00000000000..2983af56ef3 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/ui_pqExportStateWizard.patch @@ -0,0 +1,11 @@ +--- ParaView-5.0.1.orig/Qt/Components/CMakeLists.txt 2016-03-28 17:07:03.000000000 +0200 ++++ ParaView-5.0.1/Qt/Components/CMakeLists.txt 2016-12-13 17:38:42.713553032 +0100 +@@ -656,7 +656,7 @@ + #the pqSGExportStateWizard has subclasses that directly access + #the UI file, and currently we don't have a clean way to break this hard + #dependency, so for no we install this ui file. +-if(PARAVIEW_INSTALL_DEVELOPMENT_FILES) ++if(PARAVIEW_INSTALL_DEVELOPMENT_FILES AND PARAVIEW_ENABLE_PYTHON) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h" + DESTINATION "${VTK_INSTALL_INCLUDE_DIR}") + endif() diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtk-adios2-module-no-kit.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-adios2-module-no-kit.patch new file mode 100644 index 00000000000..ab30e9f83e0 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-adios2-module-no-kit.patch @@ -0,0 +1,24 @@ +From 19cd0302104e94421813427071351aa5326e4dbb Mon Sep 17 00:00:00 2001 +From: Ryan Krattiger +Date: Thu, 2 Dec 2021 16:58:10 -0600 +Subject: [PATCH] ADIOS2: Move IOADIOS2 to StandAlone kit + +--- + IO/ADIOS2/vtk.module | 2 - + 1 files changed, 0 insertions(+), 2 deletions(-) + +diff --git a/VTK/IO/ADIOS2/vtk.module b/VTK/IO/ADIOS2/vtk.module +index 5ee89b9a65e..b89e54d7683 100644 +--- a/VTK/IO/ADIOS2/vtk.module ++++ b/VTK/IO/ADIOS2/vtk.module +@@ -3,7 +3,5 @@ NAME + LIBRARY_NAME + vtkIOADIOS2 +-KIT +- VTK::IO + DEPENDS + VTK::CommonCore + VTK::CommonExecutionModel +-- +GitLab + diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtk-consolidate-viskores-wrapping-pv60.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-consolidate-viskores-wrapping-pv60.patch new file mode 100644 index 00000000000..07c48fab282 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-consolidate-viskores-wrapping-pv60.patch @@ -0,0 +1,317 @@ +diff --git a/Accelerators/Vtkm/Core/CMakeLists.txt b/Accelerators/Vtkm/Core/CMakeLists.txt +index 26de392719..386beb8ca1 100644 +--- a/Accelerators/Vtkm/Core/CMakeLists.txt ++++ b/Accelerators/Vtkm/Core/CMakeLists.txt +@@ -36,34 +36,7 @@ vtk_module_set_property(VTK::AcceleratorsVTKmCore + VALUE viskores_pool) + + _vtk_module_real_target(vtkm_accel_target VTK::AcceleratorsVTKmCore) +-viskores_add_target_information(${vtkm_accel_target} +- DROP_UNUSED_SYMBOLS +- EXTENDS_VISKORES +- MODIFY_CUDA_FLAGS +- DEVICE_SOURCES ${sources}) +- +-list(TRANSFORM nowrap_classes APPEND ".cxx" OUTPUT_VARIABLE device_sources) +-if(VTK_USE_KOKKOS) +- add_compile_definitions(VTK_USE_KOKKOS) +-endif() +-if (TARGET VTK::vtkviskores_cuda) +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +- set_source_files_properties(${device_sources} PROPERTIES LANGUAGE CUDA) +- vtk_module_set_properties(VTK::AcceleratorsVTKmCore CUDA_SEPARABLE_COMPILATION ON) +- +-elseif (TARGET VTK::vtkviskores_kokkos_cuda) +- set_source_files_properties(${device_sources} PROPERTIES LANGUAGE CUDA) +- kokkos_compilation(SOURCE ${device_sources}) +- +-elseif (TARGET VTK::vtkviskores_kokkos_hip) +- set_source_files_properties(${device_sources} PROPERTIES LANGUAGE HIP) +- kokkos_compilation(SOURCE ${device_sources}) +- +-endif () ++vtk_add_viskores_device_target_information(${vtkm_accel_target}) + + if (MSVC) + set(msvc_warning_flags +diff --git a/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt b/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt +index 1a32f156a7..c0c04adee7 100644 +--- a/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt ++++ b/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt +@@ -6,32 +6,4 @@ vtk_add_test_cxx(vtkAcceleratorsVTKmCoreCxxTests tests + TestVTKMImplicitDataArray.cxx,NO_VALID + ) + +-if (TARGET VTK::vtkviskores_cuda OR TARGET VTK::vtkviskores_kokkos_cuda) +- foreach(src IN LISTS tests) +- string(REPLACE "," ";" src ${src}) +- list(GET src 0 src) +- +- set_source_files_properties(${src} PROPERTIES LANGUAGE CUDA) +- endforeach() +- +- #the tests aren't scoped as a child directory of vtkAcceleratorsVTKmCore +- #so we need to redo this logic +- viskores_get_cuda_flags(CMAKE_CUDA_FLAGS) +- +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +-endif() +- + vtk_test_cxx_executable(vtkAcceleratorsVTKmCoreCxxTests tests) +- +-if (TARGET VTK::vtkviskores_cuda) +- # When cuda is enabled VTK::AcceleratorsVTKmCore is built statically but with fpic +- # enabled so the tests are also built with fpic enabled +- set_target_properties(vtkAcceleratorsVTKmCoreCxxTests PROPERTIES +- CUDA_ARCHITECTURES OFF +- POSITION_INDEPENDENT_CODE ON +- ) +-endif() +diff --git a/Accelerators/Vtkm/Core/vtkmlib/vtkmInitializer.cxx b/Accelerators/Vtkm/Core/vtkmlib/vtkmInitializer.cxx +index 6cecef3bb9..33d787e38b 100644 +--- a/Accelerators/Vtkm/Core/vtkmlib/vtkmInitializer.cxx ++++ b/Accelerators/Vtkm/Core/vtkmlib/vtkmInitializer.cxx +@@ -9,8 +9,6 @@ + VTK_ABI_NAMESPACE_BEGIN + void InitializeVTKm() + { +-// Kokkos enabled devices needs to be initialized +-#ifdef VTK_USE_KOKKOS + static bool isInitialized{ false }; + if (!isInitialized) + { +@@ -19,7 +17,6 @@ void InitializeVTKm() + viskores::cont::Initialize(argc, const_cast(argv)); + isInitialized = true; + } +-#endif + } + + vtkmInitializer::vtkmInitializer() +diff --git a/Accelerators/Vtkm/DataModel/CMakeLists.txt b/Accelerators/Vtkm/DataModel/CMakeLists.txt +index b653c23013..6a71610f4d 100644 +--- a/Accelerators/Vtkm/DataModel/CMakeLists.txt ++++ b/Accelerators/Vtkm/DataModel/CMakeLists.txt +@@ -43,34 +43,7 @@ vtk_module_set_property(VTK::AcceleratorsVTKmDataModel + PROPERTY JOB_POOL_COMPILE + VALUE viskores_pool) + _vtk_module_real_target(vtkm_accel_target VTK::AcceleratorsVTKmDataModel) +-viskores_add_target_information(${vtkm_accel_target} +- EXTENDS_VISKORES +- MODIFY_CUDA_FLAGS +- DEVICE_SOURCES ${sources}) +- +-if (TARGET VTK::vtkviskores_cuda) +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +- +- list(TRANSFORM nowrap_classes APPEND ".cxx" OUTPUT_VARIABLE nowrap_sources) +- set(cuda_impl ${nowrap_sources} vtkmDataSet.cxx) +- set_source_files_properties(${cuda_impl} PROPERTIES LANGUAGE CUDA) +- +- vtk_module_set_properties(VTK::AcceleratorsVTKmDataModel CUDA_SEPARABLE_COMPILATION ON) +- +- vtk_module_compile_options(VTK::AcceleratorsVTKmDataModel +- PUBLIC $<$:-Xcudafe --diag_suppress=extra_semicolon>) +- +-elseif (TARGET VTK::vtkviskores_kokkos_cuda) +- list(TRANSFORM nowrap_classes APPEND ".cxx" OUTPUT_VARIABLE nowrap_sources) +- set(cuda_impl ${nowrap_sources} vtkmDataSet.cxx) +- set_source_files_properties(${cuda_impl} PROPERTIES LANGUAGE CUDA) +- kokkos_compilation(SOURCE ${cuda_impl}) +- +-endif() ++vtk_add_viskores_device_target_information(${vtkm_accel_target}) + + if (MSVC) + set(msvc_warning_flags +diff --git a/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt b/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt +index a105aaa49e..fdf8bc4580 100644 +--- a/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt ++++ b/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt +@@ -15,34 +15,6 @@ vtk_add_test_cxx(vtkAcceleratorsVTKmDataModelCxxTests tests + TestVTKMDataSet.cxx,NO_VALID + ) + +-if (TARGET VTK::vtkviskores_cuda) +- foreach(src IN LISTS tests) +- string(REPLACE "," ";" src ${src}) +- list(GET src 0 src) +- +- set_source_files_properties(${src} PROPERTIES LANGUAGE CUDA) +- endforeach() +- +- #the tests aren't scoped as a child directory of vtkAcceleratorsVTKmDataModel +- #so we need to redo this logic +- viskores_get_cuda_flags(CMAKE_CUDA_FLAGS) +- +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +-endif() +- + vtk_test_cxx_executable(vtkAcceleratorsVTKmDataModelCxxTests tests + RENDERING_FACTORY + ) +- +-if (TARGET VTK::vtkviskores_cuda) +- # When cuda is enabled VTK::AcceleratorsVTKmDataModel is built statically but with fpic +- # enabled so the tests are also built with fpic enabled +- set_target_properties(vtkAcceleratorsVTKmDataModelCxxTests PROPERTIES +- CUDA_ARCHITECTURES OFF +- POSITION_INDEPENDENT_CODE ON +- ) +-endif() +diff --git a/Accelerators/Vtkm/Filters/CMakeLists.txt b/Accelerators/Vtkm/Filters/CMakeLists.txt +index cd16f6d946..19b41df693 100644 +--- a/Accelerators/Vtkm/Filters/CMakeLists.txt ++++ b/Accelerators/Vtkm/Filters/CMakeLists.txt +@@ -104,31 +104,7 @@ vtk_module_definitions(VTK::AcceleratorsVTKmFilters + PUBLIC "VTK_ENABLE_VISKORES_OVERRIDES=$") + + _vtk_module_real_target(vtkm_accel_target VTK::AcceleratorsVTKmFilters) +-viskores_add_target_information(${vtkm_accel_target} +- EXTENDS_VISKORES +- MODIFY_CUDA_FLAGS +- DEVICE_SOURCES ${sources}) +- +-if (TARGET VTK::vtkviskores_cuda) +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +- +- list(TRANSFORM classes APPEND ".cxx" OUTPUT_VARIABLE cuda_impl) +- set_source_files_properties(${cuda_impl} PROPERTIES LANGUAGE CUDA) +- vtk_module_set_properties(VTK::AcceleratorsVTKmFilters CUDA_SEPARABLE_COMPILATION ON) +- +- vtk_module_compile_options(VTK::AcceleratorsVTKmFilters +- PUBLIC $<$:-Xcudafe --diag_suppress=extra_semicolon>) +-elseif (TARGET VTK::vtkviskores_kokkos_cuda) +- +- list(TRANSFORM classes APPEND ".cxx" OUTPUT_VARIABLE cuda_impl) +- set_source_files_properties(${cuda_impl} PROPERTIES LANGUAGE CUDA) +- kokkos_compilation(SOURCE ${cuda_impl}) +- +-endif() ++vtk_add_viskores_device_target_information(${vtkm_accel_target}) + + if (MSVC) + set(msvc_warning_flags +diff --git a/Accelerators/Vtkm/Filters/Testing/Cxx/CMakeLists.txt b/Accelerators/Vtkm/Filters/Testing/Cxx/CMakeLists.txt +index 955747836f..8b8085026a 100644 +--- a/Accelerators/Vtkm/Filters/Testing/Cxx/CMakeLists.txt ++++ b/Accelerators/Vtkm/Filters/Testing/Cxx/CMakeLists.txt +@@ -27,32 +27,6 @@ vtk_add_test_cxx(vtkAcceleratorsVTKmFiltersCxxTests tests + TestVTKMWarpVector.cxx + ) + +-if (TARGET VTK::vtkviskores_cuda) +- foreach(src IN LISTS tests) +- string(REPLACE "," ";" src ${src}) +- list(GET src 0 src) +- +- set_source_files_properties(${src} PROPERTIES LANGUAGE CUDA) +- endforeach() +- +- #the tests aren't scoped as a child directory of vtkAcceleratorsVTKmFilters +- #so we need to redo this logic +- viskores_get_cuda_flags(CMAKE_CUDA_FLAGS) +- +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +- +-endif() +- +- + vtk_test_cxx_executable(vtkAcceleratorsVTKmFiltersCxxTests tests + RENDERING_FACTORY + ) +- +-if (TARGET VTK::vtkviskores_cuda) +- set_target_properties(vtkAcceleratorsVTKmFiltersCxxTests PROPERTIES +- CUDA_ARCHITECTURES OFF) +-endif() +diff --git a/IO/CatalystConduit/CMakeLists.txt b/IO/CatalystConduit/CMakeLists.txt +index f54368c4af..be201a912f 100644 +--- a/IO/CatalystConduit/CMakeLists.txt ++++ b/IO/CatalystConduit/CMakeLists.txt +@@ -36,26 +36,8 @@ configure_file( + "${CMAKE_CURRENT_BINARY_DIR}/vtkDeviceMemoryType.h" + @ONLY) + +- +-if (TARGET VTK::vtkviskores_cuda) +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +- +- set_source_files_properties(${classes_cuda} PROPERTIES LANGUAGE CUDA) +- +- vtk_module_set_properties(VTK::IOCatalystConduit +- CUDA_SEPARABLE_COMPILATION ON) +- +- vtk_module_compile_options(VTK::IOCatalystConduit +- PUBLIC $<$:-Xcudafe --diag_suppress=extra_semicolon>) +- +- find_package(CUDAToolkit REQUIRED) +- vtk_module_link(VTK::IOCatalystConduit PRIVATE CUDA::cudart) +-endif () +- ++_vtk_module_real_target(vtkm_accel_target VTK::IOCatalystConduit) ++vtk_add_viskores_device_target_information(${vtkm_accel_target}) + + vtk_add_test_mangling(VTK::IOCatalystConduit) + add_subdirectory(Catalyst) +diff --git a/ThirdParty/viskores/CMakeLists.txt b/ThirdParty/viskores/CMakeLists.txt +index dd57459345..d85153c679 100644 +--- a/ThirdParty/viskores/CMakeLists.txt ++++ b/ThirdParty/viskores/CMakeLists.txt +@@ -16,7 +16,7 @@ vtk_module_third_party( + STANDARD_INCLUDE_DIRS + EXTERNAL + PACKAGE Viskores +- TARGETS viskores::cont viskores::cont_testing viskores::filter viskores::worklet ++ TARGETS viskores::cont viskores::cont_testing viskores::filter + VERSION "1.0.0" + STANDARD_INCLUDE_DIRS) + +@@ -47,3 +47,19 @@ foreach (viskores_target IN LISTS viskores_specific_targets) + _vtk_module_install("vtkviskores_${viskores_target}") + add_library("VTK::vtkviskores_${viskores_target}" ALIAS "vtkviskores_${viskores_target}") + endforeach () ++ ++# If a VTK library contains Viskores worklets or other Viskores device code, the files must be ++# declared as the proper language and the library must link to VTK::vtkviskores_worklet. This ++# function sets this up. Use this function by giving it the name of a target. ++function(vtk_add_viskores_device_target_information target) ++ target_link_libraries(${target} PRIVATE VTK::vtkviskores_worklet) ++ get_target_property(sources ${target} SOURCES) ++ list(FILTER sources INCLUDE REGEX "\\.(cpp|cxx|cc|C)$") ++ if(TARGET VTK::vtkviskores_cuda OR TARGET VTK::vtkviskores_kokkos_cuda) ++ set_source_files_properties(${sources} PROPERTIES LANGUAGE CUDA) ++ endif() ++ if(TARGET VTK::vtkviskores_kokkos_hip) ++ set_source_files_properties(${sources} PROPERTIES LANGUAGE HIP) ++ kokkos_compilation(SOURCE ${sources}) ++ endif() ++endfunction() diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtk-consolidate-viskores-wrapping-pv61.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-consolidate-viskores-wrapping-pv61.patch new file mode 100644 index 00000000000..21c7f46224f --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-consolidate-viskores-wrapping-pv61.patch @@ -0,0 +1,309 @@ +From 9f09ea924e0f69fdbf4b504c99c4283a7daf3252 Mon Sep 17 00:00:00 2001 +From: Kenneth Moreland +Date: Mon, 13 Apr 2026 11:35:34 -0400 +Subject: [PATCH] Consolidate configuration of Viskores device code + +When compiling Viskores device code, extra CMake configuration must +be done to set the appropriate language and linking options. The +previous setup was repeated several times through the code and contained +lots of obsolete configuration. This change consolidates and cleans up +the configuration. + +This also fixes an issue where flags for the device compiler could be +given to the standard C++ compiler, which might not support the same +flags. +--- + Accelerators/Vtkm/Core/CMakeLists.txt | 32 +------------------ + .../Vtkm/Core/Testing/Cxx/CMakeLists.txt | 28 ---------------- + .../Vtkm/Core/vtkmlib/vtkmInitializer.cxx | 3 -- + Accelerators/Vtkm/DataModel/CMakeLists.txt | 29 +---------------- + .../Vtkm/DataModel/Testing/Cxx/CMakeLists.txt | 28 ---------------- + Accelerators/Vtkm/Filters/CMakeLists.txt | 26 +-------------- + IO/CatalystConduit/CMakeLists.txt | 19 ++--------- + ThirdParty/viskores/CMakeLists.txt | 17 +++++++++- + 8 files changed, 21 insertions(+), 186 deletions(-) + +diff --git a/Accelerators/Vtkm/Core/CMakeLists.txt b/Accelerators/Vtkm/Core/CMakeLists.txt +index 0501715be03..3e863bc7b4c 100644 +--- a/Accelerators/Vtkm/Core/CMakeLists.txt ++++ b/Accelerators/Vtkm/Core/CMakeLists.txt +@@ -37,37 +37,7 @@ vtk_module_set_property(VTK::AcceleratorsVTKmCore + VALUE viskores_pool) + + _vtk_module_real_target(vtkm_accel_target VTK::AcceleratorsVTKmCore) +-viskores_add_target_information(${vtkm_accel_target} +- DROP_UNUSED_SYMBOLS +- EXTENDS_VISKORES +- MODIFY_CUDA_FLAGS +- DEVICE_SOURCES ${sources}) +- +-list(TRANSFORM nowrap_classes APPEND ".cxx" OUTPUT_VARIABLE device_sources) +-if(VTK_USE_KOKKOS) +- add_compile_definitions(VTK_USE_KOKKOS) +-endif() +-if (TARGET VTK::vtkviskores_cuda) +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +- set_source_files_properties(${device_sources} PROPERTIES LANGUAGE CUDA) +- vtk_module_set_properties(VTK::AcceleratorsVTKmCore CUDA_SEPARABLE_COMPILATION ON) +- +- find_package(CUDAToolkit REQUIRED) +- vtk_module_link(VTK::AcceleratorsVTKmCore PRIVATE CUDA::cudart) +- +-elseif (TARGET VTK::vtkviskores_kokkos_cuda) +- set_source_files_properties(${device_sources} PROPERTIES LANGUAGE CUDA) +- kokkos_compilation(SOURCE ${device_sources}) +- +-elseif (TARGET VTK::vtkviskores_kokkos_hip) +- set_source_files_properties(${device_sources} PROPERTIES LANGUAGE HIP) +- kokkos_compilation(SOURCE ${device_sources}) +- +-endif () ++vtk_add_viskores_device_target_information(${vtkm_accel_target}) + + if (MSVC) + set(msvc_warning_flags +diff --git a/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt b/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt +index 1a32f156a73..c0c04adee7e 100644 +--- a/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt ++++ b/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt +@@ -6,32 +6,4 @@ vtk_add_test_cxx(vtkAcceleratorsVTKmCoreCxxTests tests + TestVTKMImplicitDataArray.cxx,NO_VALID + ) + +-if (TARGET VTK::vtkviskores_cuda OR TARGET VTK::vtkviskores_kokkos_cuda) +- foreach(src IN LISTS tests) +- string(REPLACE "," ";" src ${src}) +- list(GET src 0 src) +- +- set_source_files_properties(${src} PROPERTIES LANGUAGE CUDA) +- endforeach() +- +- #the tests aren't scoped as a child directory of vtkAcceleratorsVTKmCore +- #so we need to redo this logic +- viskores_get_cuda_flags(CMAKE_CUDA_FLAGS) +- +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +-endif() +- + vtk_test_cxx_executable(vtkAcceleratorsVTKmCoreCxxTests tests) +- +-if (TARGET VTK::vtkviskores_cuda) +- # When cuda is enabled VTK::AcceleratorsVTKmCore is built statically but with fpic +- # enabled so the tests are also built with fpic enabled +- set_target_properties(vtkAcceleratorsVTKmCoreCxxTests PROPERTIES +- CUDA_ARCHITECTURES OFF +- POSITION_INDEPENDENT_CODE ON +- ) +-endif() +diff --git a/Accelerators/Vtkm/Core/vtkmlib/vtkmInitializer.cxx b/Accelerators/Vtkm/Core/vtkmlib/vtkmInitializer.cxx +index 6cecef3bb9f..33d787e38b2 100644 +--- a/Accelerators/Vtkm/Core/vtkmlib/vtkmInitializer.cxx ++++ b/Accelerators/Vtkm/Core/vtkmlib/vtkmInitializer.cxx +@@ -9,8 +9,6 @@ + VTK_ABI_NAMESPACE_BEGIN + void InitializeVTKm() + { +-// Kokkos enabled devices needs to be initialized +-#ifdef VTK_USE_KOKKOS + static bool isInitialized{ false }; + if (!isInitialized) + { +@@ -19,7 +17,6 @@ void InitializeVTKm() + viskores::cont::Initialize(argc, const_cast(argv)); + isInitialized = true; + } +-#endif + } + + vtkmInitializer::vtkmInitializer() +diff --git a/Accelerators/Vtkm/DataModel/CMakeLists.txt b/Accelerators/Vtkm/DataModel/CMakeLists.txt +index b653c230133..6a71610f4d5 100644 +--- a/Accelerators/Vtkm/DataModel/CMakeLists.txt ++++ b/Accelerators/Vtkm/DataModel/CMakeLists.txt +@@ -43,34 +43,7 @@ vtk_module_set_property(VTK::AcceleratorsVTKmDataModel + PROPERTY JOB_POOL_COMPILE + VALUE viskores_pool) + _vtk_module_real_target(vtkm_accel_target VTK::AcceleratorsVTKmDataModel) +-viskores_add_target_information(${vtkm_accel_target} +- EXTENDS_VISKORES +- MODIFY_CUDA_FLAGS +- DEVICE_SOURCES ${sources}) +- +-if (TARGET VTK::vtkviskores_cuda) +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +- +- list(TRANSFORM nowrap_classes APPEND ".cxx" OUTPUT_VARIABLE nowrap_sources) +- set(cuda_impl ${nowrap_sources} vtkmDataSet.cxx) +- set_source_files_properties(${cuda_impl} PROPERTIES LANGUAGE CUDA) +- +- vtk_module_set_properties(VTK::AcceleratorsVTKmDataModel CUDA_SEPARABLE_COMPILATION ON) +- +- vtk_module_compile_options(VTK::AcceleratorsVTKmDataModel +- PUBLIC $<$:-Xcudafe --diag_suppress=extra_semicolon>) +- +-elseif (TARGET VTK::vtkviskores_kokkos_cuda) +- list(TRANSFORM nowrap_classes APPEND ".cxx" OUTPUT_VARIABLE nowrap_sources) +- set(cuda_impl ${nowrap_sources} vtkmDataSet.cxx) +- set_source_files_properties(${cuda_impl} PROPERTIES LANGUAGE CUDA) +- kokkos_compilation(SOURCE ${cuda_impl}) +- +-endif() ++vtk_add_viskores_device_target_information(${vtkm_accel_target}) + + if (MSVC) + set(msvc_warning_flags +diff --git a/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt b/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt +index a105aaa49ea..fdf8bc45806 100644 +--- a/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt ++++ b/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt +@@ -15,34 +15,6 @@ vtk_add_test_cxx(vtkAcceleratorsVTKmDataModelCxxTests tests + TestVTKMDataSet.cxx,NO_VALID + ) + +-if (TARGET VTK::vtkviskores_cuda) +- foreach(src IN LISTS tests) +- string(REPLACE "," ";" src ${src}) +- list(GET src 0 src) +- +- set_source_files_properties(${src} PROPERTIES LANGUAGE CUDA) +- endforeach() +- +- #the tests aren't scoped as a child directory of vtkAcceleratorsVTKmDataModel +- #so we need to redo this logic +- viskores_get_cuda_flags(CMAKE_CUDA_FLAGS) +- +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +-endif() +- + vtk_test_cxx_executable(vtkAcceleratorsVTKmDataModelCxxTests tests + RENDERING_FACTORY + ) +- +-if (TARGET VTK::vtkviskores_cuda) +- # When cuda is enabled VTK::AcceleratorsVTKmDataModel is built statically but with fpic +- # enabled so the tests are also built with fpic enabled +- set_target_properties(vtkAcceleratorsVTKmDataModelCxxTests PROPERTIES +- CUDA_ARCHITECTURES OFF +- POSITION_INDEPENDENT_CODE ON +- ) +-endif() +diff --git a/Accelerators/Vtkm/Filters/CMakeLists.txt b/Accelerators/Vtkm/Filters/CMakeLists.txt +index 4eb9989da51..c24edd94be7 100644 +--- a/Accelerators/Vtkm/Filters/CMakeLists.txt ++++ b/Accelerators/Vtkm/Filters/CMakeLists.txt +@@ -109,31 +109,7 @@ vtk_module_definitions(VTK::AcceleratorsVTKmFilters + PUBLIC "VTK_ENABLE_VISKORES_OVERRIDES=$") + + _vtk_module_real_target(vtkm_accel_target VTK::AcceleratorsVTKmFilters) +-viskores_add_target_information(${vtkm_accel_target} +- EXTENDS_VISKORES +- MODIFY_CUDA_FLAGS +- DEVICE_SOURCES ${sources}) +- +-if (TARGET VTK::vtkviskores_cuda) +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +- +- list(TRANSFORM classes APPEND ".cxx" OUTPUT_VARIABLE cuda_impl) +- set_source_files_properties(${cuda_impl} PROPERTIES LANGUAGE CUDA) +- vtk_module_set_properties(VTK::AcceleratorsVTKmFilters CUDA_SEPARABLE_COMPILATION ON) +- +- vtk_module_compile_options(VTK::AcceleratorsVTKmFilters +- PUBLIC $<$:-Xcudafe --diag_suppress=extra_semicolon>) +-elseif (TARGET VTK::vtkviskores_kokkos_cuda) +- +- list(TRANSFORM classes APPEND ".cxx" OUTPUT_VARIABLE cuda_impl) +- set_source_files_properties(${cuda_impl} PROPERTIES LANGUAGE CUDA) +- kokkos_compilation(SOURCE ${cuda_impl}) +- +-endif() ++vtk_add_viskores_device_target_information(${vtkm_accel_target}) + + if (MSVC) + set(msvc_warning_flags +diff --git a/IO/CatalystConduit/CMakeLists.txt b/IO/CatalystConduit/CMakeLists.txt +index 91d60f1638c..d1d6049279a 100644 +--- a/IO/CatalystConduit/CMakeLists.txt ++++ b/IO/CatalystConduit/CMakeLists.txt +@@ -16,23 +16,10 @@ vtk_module_add_module(VTK::IOCatalystConduit + CLASSES ${classes} + PRIVATE_CLASSES ${private_classes}) + +- +-if (TARGET VTK::vtkviskores_cuda) +- # Temporarily suppress "has address taken but no possible call to it" warnings, +- # until we figure out its implications. +- # We are disabling all warnings as nvlink has no known way to suppress +- # individual warning types. +- string(APPEND CMAKE_CUDA_FLAGS " -Xnvlink -w") +- +- set_source_files_properties(${classes_cuda} PROPERTIES LANGUAGE CUDA) +- +- vtk_module_set_properties(VTK::IOCatalystConduit +- CUDA_SEPARABLE_COMPILATION ON) +- +- vtk_module_compile_options(VTK::IOCatalystConduit +- PUBLIC $<$:-Xcudafe --diag_suppress=extra_semicolon>) +-endif () +- ++_vtk_module_real_target(vtkm_accel_target VTK::IOCatalystConduit) ++if (TARGET VTK::vtkviskores) ++ vtk_add_viskores_device_target_information(${vtkm_accel_target}) ++endif() + + vtk_add_test_mangling(VTK::IOCatalystConduit) + add_subdirectory(Catalyst) +diff --git a/ThirdParty/viskores/CMakeLists.txt b/ThirdParty/viskores/CMakeLists.txt +index bbe1b38bce0..6ddb9104b3b 100644 +--- a/ThirdParty/viskores/CMakeLists.txt ++++ b/ThirdParty/viskores/CMakeLists.txt +@@ -24,7 +24,7 @@ vtk_module_third_party( + STANDARD_INCLUDE_DIRS + EXTERNAL + PACKAGE Viskores +- TARGETS viskores::cont viskores::cont_testing viskores::filter viskores::worklet ++ TARGETS viskores::cont viskores::cont_testing viskores::filter + VERSION "1.1.0" + STANDARD_INCLUDE_DIRS) + +@@ -55,3 +55,19 @@ foreach (viskores_target IN LISTS viskores_specific_targets) + _vtk_module_install("vtkviskores_${viskores_target}") + add_library("VTK::vtkviskores_${viskores_target}" ALIAS "vtkviskores_${viskores_target}") + endforeach () ++ ++# If a VTK library contains Viskores worklets or other Viskores device code, the files must be ++# declared as the proper language and the library must link to VTK::vtkviskores_worklet. This ++# function sets this up. Use this function by giving it the name of a target. ++function(vtk_add_viskores_device_target_information target) ++ target_link_libraries(${target} PRIVATE VTK::vtkviskores_worklet) ++ get_target_property(sources ${target} SOURCES) ++ list(FILTER sources INCLUDE REGEX "\\.(cpp|cxx|cc|C)$") ++ if(TARGET VTK::vtkviskores_cuda OR TARGET VTK::vtkviskores_kokkos_cuda) ++ set_source_files_properties(${sources} PROPERTIES LANGUAGE CUDA) ++ endif() ++ if(TARGET VTK::vtkviskores_kokkos_hip) ++ set_source_files_properties(${sources} PROPERTIES LANGUAGE HIP) ++ kokkos_compilation(SOURCE ${sources}) ++ endif() ++endfunction() +-- +GitLab diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtk-external-fides-pv61.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-external-fides-pv61.patch new file mode 100644 index 00000000000..774e92dd73e --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-external-fides-pv61.patch @@ -0,0 +1,202 @@ +From 97799df970c090a5f18c6c60f7478036d54f0c43 Mon Sep 17 00:00:00 2001 +From: Fides Upstream +Date: Mon, 20 Apr 2026 12:22:58 -0400 +Subject: [PATCH 1/3] fides 2026-04-20 (ceedfb2f) + +Code extracted from: + + https://gitlab.kitware.com/third-party/fides.git + +at commit ceedfb2f766eeb82742474bc7346647413577b36 (for/vtk-20260420-master-1e7e886). +--- + ThirdParty/fides/vtkfides/fides/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ThirdParty/fides/vtkfides/fides/CMakeLists.txt b/ThirdParty/fides/vtkfides/fides/CMakeLists.txt +index d21e907420..deb18e37b8 100644 +--- a/ThirdParty/fides/vtkfides/fides/CMakeLists.txt ++++ b/ThirdParty/fides/vtkfides/fides/CMakeLists.txt +@@ -87,7 +87,7 @@ vtk_module_include(VTK::fides + PUBLIC + $ + $ +- $ ++ $ + ) + + include(GenerateExportHeader) +-- +2.50.1 (Apple Git-155) + +From ff6b10bf7130479e0c0d316a77fd1ecfc8328a14 Mon Sep 17 00:00:00 2001 +From: Kenneth Moreland +Date: Tue, 14 Apr 2026 13:24:02 -0400 +Subject: [PATCH 2/3] Enable linking to an externally built Fides + +--- + IO/Fides/vtkFidesReader.cxx | 6 +++++- + IO/Fides/vtkFidesWriter.cxx | 6 +++++- + ThirdParty/fides/CMakeLists.txt | 31 ++++++++++++++++++++++--------- + ThirdParty/fides/vtk_fides.h.in | 15 +++++++++++++++ + 4 files changed, 47 insertions(+), 11 deletions(-) + create mode 100644 ThirdParty/fides/vtk_fides.h.in + +diff --git a/IO/Fides/vtkFidesReader.cxx b/IO/Fides/vtkFidesReader.cxx +index 246e1c3ded..6450edebed 100644 +--- a/IO/Fides/vtkFidesReader.cxx ++++ b/IO/Fides/vtkFidesReader.cxx +@@ -20,7 +20,11 @@ + #include "vtkmlib/UnstructuredGridConverter.h" + #include "vtksys/SystemTools.hxx" + +-#include ++// Fides includes ++#include ++// clang-format off ++#include VTK_FIDES(fides/DataSetReader.h) ++// clang-format on + + #include + +diff --git a/IO/Fides/vtkFidesWriter.cxx b/IO/Fides/vtkFidesWriter.cxx +index 1eaf338f98..55259a9eb4 100644 +--- a/IO/Fides/vtkFidesWriter.cxx ++++ b/IO/Fides/vtkFidesWriter.cxx +@@ -26,7 +26,11 @@ + #include "vtkMPIController.h" + #endif + +-#include ++// Fides includes ++#include ++// clang-format off ++#include VTK_FIDES(fides/DataSetWriter.h) ++// clang-format on + + #include + #include +diff --git a/ThirdParty/fides/CMakeLists.txt b/ThirdParty/fides/CMakeLists.txt +index 2da2afa02b..a50b8eebcf 100644 +--- a/ThirdParty/fides/CMakeLists.txt ++++ b/ThirdParty/fides/CMakeLists.txt +@@ -1,9 +1,22 @@ +-vtk_module_third_party_internal( +- LICENSE_FILES "vtkfides/LICENSE.txt" +- SPDX_LICENSE_IDENTIFIER "BSD-3-Clause" +- SPDX_COPYRIGHT_TEXT "Copyright (c) 2019 Kitware Inc." +- SPDX_DOWNLOAD_LOCATION "git+https://gitlab.kitware.com/third-party/fides.git@for/vtk-20230505-master-6922a48e" +- VERSION "master" +- SUBDIRECTORY vtkfides +- STANDARD_INCLUDE_DIRS +- INTERFACE) ++vtk_module_third_party( ++ INTERNAL ++ LICENSE_FILES "vtkfides/LICENSE.txt" ++ SPDX_LICENSE_IDENTIFIER "BSD-3-Clause" ++ SPDX_COPYRIGHT_TEXT "Copyright (c) 2019 Kitware Inc." ++ SPDX_DOWNLOAD_LOCATION "git+https://gitlab.kitware.com/third-party/fides.git@for/vtk-20260420-master-1e7e886" ++ VERSION "master" ++ SUBDIRECTORY vtkfides ++ STANDARD_INCLUDE_DIRS ++ INTERFACE ++ EXTERNAL ++ PACKAGE Fides ++ TARGETS fides ++ STANDARD_INCLUDE_DIRS ++ ) ++ ++configure_file( ++ "${CMAKE_CURRENT_SOURCE_DIR}/vtk_fides.h.in" ++ "${CMAKE_CURRENT_BINARY_DIR}/vtk_fides.h") ++ ++vtk_module_install_headers( ++ FILES "${CMAKE_CURRENT_BINARY_DIR}/vtk_fides.h") +diff --git a/ThirdParty/fides/vtk_fides.h.in b/ThirdParty/fides/vtk_fides.h.in +new file mode 100644 +index 0000000000..5383f71c87 +--- /dev/null ++++ b/ThirdParty/fides/vtk_fides.h.in +@@ -0,0 +1,15 @@ ++// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen ++// SPDX-License-Identifier: BSD-3-Clause ++#ifndef vtk_fides_h ++#define vtk_fides_h ++ ++/* Use the fides library configured for VTK. */ ++#cmakedefine01 VTK_MODULE_USE_EXTERNAL_VTK_fides ++ ++#if VTK_MODULE_USE_EXTERNAL_VTK_fides ++# define VTK_FIDES(x) ++#else ++# define VTK_FIDES(x) ++#endif ++ ++#endif +-- +2.50.1 (Apple Git-155) + +From 86e8ce32b719aa9381268f547ff4e57b7a5e1e52 Mon Sep 17 00:00:00 2001 +From: Kenneth Moreland +Date: Thu, 16 Apr 2026 07:50:44 -0400 +Subject: [PATCH 3/3] Add test for Fides third-party module include file + +--- + ThirdParty/fides/Testing/CMakeLists.txt | 1 + + ThirdParty/fides/Testing/Cxx/CMakeLists.txt | 4 ++++ + ThirdParty/fides/Testing/Cxx/TestIncludeFides.cxx | 11 +++++++++++ + ThirdParty/fides/vtk.module | 4 ++++ + 4 files changed, 20 insertions(+) + create mode 100644 ThirdParty/fides/Testing/CMakeLists.txt + create mode 100644 ThirdParty/fides/Testing/Cxx/CMakeLists.txt + create mode 100644 ThirdParty/fides/Testing/Cxx/TestIncludeFides.cxx + +diff --git a/ThirdParty/fides/Testing/CMakeLists.txt b/ThirdParty/fides/Testing/CMakeLists.txt +new file mode 100644 +index 0000000000..35f9732a93 +--- /dev/null ++++ b/ThirdParty/fides/Testing/CMakeLists.txt +@@ -0,0 +1 @@ ++add_subdirectory(Cxx) +diff --git a/ThirdParty/fides/Testing/Cxx/CMakeLists.txt b/ThirdParty/fides/Testing/Cxx/CMakeLists.txt +new file mode 100644 +index 0000000000..d0f115663e +--- /dev/null ++++ b/ThirdParty/fides/Testing/Cxx/CMakeLists.txt +@@ -0,0 +1,4 @@ ++vtk_add_test_cxx(vtkfidesCxxTests tests ++ NO_DATA NO_VALID NO_OUTPUT ++ TestIncludeFides.cxx) ++vtk_test_cxx_executable(vtkfidesCxxTests tests) +diff --git a/ThirdParty/fides/Testing/Cxx/TestIncludeFides.cxx b/ThirdParty/fides/Testing/Cxx/TestIncludeFides.cxx +new file mode 100644 +index 0000000000..b6b81a4948 +--- /dev/null ++++ b/ThirdParty/fides/Testing/Cxx/TestIncludeFides.cxx +@@ -0,0 +1,11 @@ ++#include "vtk_fides.h" ++// clang-format off ++#include VTK_FIDES(fides/DataSetReader.h) ++// clang-format on ++ ++#include ++ ++int TestIncludeFides(int /*argc*/, char* /*argv*/[]) ++{ ++ return EXIT_SUCCESS; ++} +diff --git a/ThirdParty/fides/vtk.module b/ThirdParty/fides/vtk.module +index 07a6e0f2f9..197ff8ab03 100644 +--- a/ThirdParty/fides/vtk.module ++++ b/ThirdParty/fides/vtk.module +@@ -10,4 +10,8 @@ DEPENDS + VTK::vtkviskores + OPTIONAL_DEPENDS + VTK::mpi ++TEST_DEPENDS ++ VTK::TestingCore ++TEST_OPTIONAL_DEPENDS ++ VTK::mpi + THIRD_PARTY +-- +2.50.1 (Apple Git-155) + diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtk-fine-grained-viskores-targets-pv61.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-fine-grained-viskores-targets-pv61.patch new file mode 100644 index 00000000000..3e7f8cd304d --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-fine-grained-viskores-targets-pv61.patch @@ -0,0 +1,313 @@ +From c3514adb8fac48a0937de784d561c2f07c6f5945 Mon Sep 17 00:00:00 2001 +From: Ben Boeckel +Date: Tue, 31 Mar 2026 23:21:28 -0400 +Subject: [PATCH 1/4] vtkm: link to the proper viskores target + +--- + ThirdParty/vtkm/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ThirdParty/vtkm/CMakeLists.txt b/ThirdParty/vtkm/CMakeLists.txt +index 272306bdec..577e10cfe8 100644 +--- a/ThirdParty/vtkm/CMakeLists.txt ++++ b/ThirdParty/vtkm/CMakeLists.txt +@@ -1,5 +1,5 @@ + vtk_module_add_module(VTK::vtkvtkm HEADER_ONLY) +-vtk_module_link(VTK::vtkvtkm INTERFACE VTK::viskores) ++vtk_module_link(VTK::vtkvtkm INTERFACE VTK::vtkviskores) + + set(deprecation_warning "Target VTK::vtkvtkm deprecated, VTK::vtkviskores enabled.") + message(DEPRECATION "${deprecation_warning}") +-- +2.50.1 (Apple Git-155) + +From 8ac32d9610f21206ca812ab8abc28c5e41a88214 Mon Sep 17 00:00:00 2001 +From: Ben Boeckel +Date: Tue, 31 Mar 2026 23:21:43 -0400 +Subject: [PATCH 2/4] viskores: create fine-grained targets for components + +This gives a consistent interface for Viskores targets no matter how +Viskores is provided: vendored or externally. For external usage, the +`find_package` makes the imported targets scoped so that they are not +visible elsewhere in the tree. +--- + ThirdParty/viskores/CMakeLists.txt | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/ThirdParty/viskores/CMakeLists.txt b/ThirdParty/viskores/CMakeLists.txt +index 54031beeca..d23fdd5cb4 100644 +--- a/ThirdParty/viskores/CMakeLists.txt ++++ b/ThirdParty/viskores/CMakeLists.txt +@@ -23,3 +23,27 @@ vtk_module_third_party( + if(VTK_MODULE_USE_EXTERNAL_vtkviskores) + viskores_setup_job_pool() + endif() ++ ++set(viskores_specific_targets ++ cont ++ cont_testing ++ cuda ++ filter ++ kokkos_cuda ++ kokkos_hip ++ worklet) ++foreach (viskores_target IN LISTS viskores_specific_targets) ++ if (VTK_MODULE_USE_EXTERNAL_vtkviskores) ++ set(target "viskores::${viskores_target}") ++ else () ++ set(target "viskores_${viskores_target}") ++ endif () ++ if (NOT TARGET "${target}") ++ continue () ++ endif() ++ ++ add_library("vtkviskores_${viskores_target}" INTERFACE) ++ target_link_libraries("vtkviskores_${viskores_target}" INTERFACE "${target}") ++ _vtk_module_install("vtkviskores_${viskores_target}") ++ add_library("VTK::vtkviskores_${viskores_target}" ALIAS "vtkviskores_${viskores_target}") ++endforeach () +-- +2.50.1 (Apple Git-155) + +From 96c963f0817019c86f25851f4d550ecd312c9822 Mon Sep 17 00:00:00 2001 +From: Fides Upstream +Date: Wed, 22 Apr 2026 14:42:24 -0400 +Subject: [PATCH 3/4] fides 2026-04-22 (5330f6f2) + +Code extracted from: + + https://gitlab.kitware.com/third-party/fides.git + +at commit 5330f6f2bf47cab1434bbaa71a20a20f3051a03f (for/vtk-20260422-master-1e7e886). +--- + ThirdParty/fides/vtkfides/fides/CMakeLists.txt | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/ThirdParty/fides/vtkfides/fides/CMakeLists.txt b/ThirdParty/fides/vtkfides/fides/CMakeLists.txt +index deb18e37b8..72f0a9fbd8 100644 +--- a/ThirdParty/fides/vtkfides/fides/CMakeLists.txt ++++ b/ThirdParty/fides/vtkfides/fides/CMakeLists.txt +@@ -82,7 +82,9 @@ endif() + vtk_module_link(VTK::fides + PRIVATE + adios2::adios2 +- fides_rapidjson) ++ fides_rapidjson ++ VTK::vtkviskores_worklet ++ ) + vtk_module_include(VTK::fides + PUBLIC + $ +-- +2.50.1 (Apple Git-155) + +From 33d22c1f141c963c8f5a2cbabcbab9428f5b04a8 Mon Sep 17 00:00:00 2001 +From: Ben Boeckel +Date: Tue, 31 Mar 2026 23:23:33 -0400 +Subject: [PATCH 4/4] viskores: use third party "bridge" targets + +These work regardless of internal versus external Viskores. +--- + Accelerators/Vtkm/Core/CMakeLists.txt | 8 ++++---- + Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt | 4 ++-- + Accelerators/Vtkm/DataModel/CMakeLists.txt | 6 +++--- + Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt | 4 ++-- + Accelerators/Vtkm/Filters/CMakeLists.txt | 6 +++--- + Accelerators/Vtkm/Filters/Testing/Cxx/CMakeLists.txt | 4 ++-- + IO/CatalystConduit/CMakeLists.txt | 2 +- + IO/CatalystConduit/Testing/Cxx/CMakeLists.txt | 2 +- + 8 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/Accelerators/Vtkm/Core/CMakeLists.txt b/Accelerators/Vtkm/Core/CMakeLists.txt +index 062661eccf..0501715be0 100644 +--- a/Accelerators/Vtkm/Core/CMakeLists.txt ++++ b/Accelerators/Vtkm/Core/CMakeLists.txt +@@ -47,7 +47,7 @@ list(TRANSFORM nowrap_classes APPEND ".cxx" OUTPUT_VARIABLE device_sources) + if(VTK_USE_KOKKOS) + add_compile_definitions(VTK_USE_KOKKOS) + endif() +-if (TARGET viskores::cuda) ++if (TARGET VTK::vtkviskores_cuda) + # Temporarily suppress "has address taken but no possible call to it" warnings, + # until we figure out its implications. + # We are disabling all warnings as nvlink has no known way to suppress +@@ -59,11 +59,11 @@ if (TARGET viskores::cuda) + find_package(CUDAToolkit REQUIRED) + vtk_module_link(VTK::AcceleratorsVTKmCore PRIVATE CUDA::cudart) + +-elseif (TARGET viskores::kokkos_cuda) ++elseif (TARGET VTK::vtkviskores_kokkos_cuda) + set_source_files_properties(${device_sources} PROPERTIES LANGUAGE CUDA) + kokkos_compilation(SOURCE ${device_sources}) + +-elseif (TARGET viskores::kokkos_hip) ++elseif (TARGET VTK::vtkviskores_kokkos_hip) + set_source_files_properties(${device_sources} PROPERTIES LANGUAGE HIP) + kokkos_compilation(SOURCE ${device_sources}) + +@@ -87,7 +87,7 @@ if (MSVC) + ) + set(viskores_msvc_flags) + foreach (msvc_warning_flag IN LISTS msvc_warning_flags) +- if (TARGET viskores::cuda) ++ if (TARGET VTK::vtkviskores_cuda) + list(APPEND viskores_msvc_flags + $<$:-Xcompiler=${msvc_warning_flag},${msvc_warning_flag}>) + else () +diff --git a/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt b/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt +index a3b1851215..1a32f156a7 100644 +--- a/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt ++++ b/Accelerators/Vtkm/Core/Testing/Cxx/CMakeLists.txt +@@ -6,7 +6,7 @@ vtk_add_test_cxx(vtkAcceleratorsVTKmCoreCxxTests tests + TestVTKMImplicitDataArray.cxx,NO_VALID + ) + +-if (TARGET viskores::cuda OR TARGET viskores::kokkos_cuda) ++if (TARGET VTK::vtkviskores_cuda OR TARGET VTK::vtkviskores_kokkos_cuda) + foreach(src IN LISTS tests) + string(REPLACE "," ";" src ${src}) + list(GET src 0 src) +@@ -27,7 +27,7 @@ endif() + + vtk_test_cxx_executable(vtkAcceleratorsVTKmCoreCxxTests tests) + +-if (TARGET viskores::cuda) ++if (TARGET VTK::vtkviskores_cuda) + # When cuda is enabled VTK::AcceleratorsVTKmCore is built statically but with fpic + # enabled so the tests are also built with fpic enabled + set_target_properties(vtkAcceleratorsVTKmCoreCxxTests PROPERTIES +diff --git a/Accelerators/Vtkm/DataModel/CMakeLists.txt b/Accelerators/Vtkm/DataModel/CMakeLists.txt +index 1754ebe182..b653c23013 100644 +--- a/Accelerators/Vtkm/DataModel/CMakeLists.txt ++++ b/Accelerators/Vtkm/DataModel/CMakeLists.txt +@@ -48,7 +48,7 @@ viskores_add_target_information(${vtkm_accel_target} + MODIFY_CUDA_FLAGS + DEVICE_SOURCES ${sources}) + +-if (TARGET viskores::cuda) ++if (TARGET VTK::vtkviskores_cuda) + # Temporarily suppress "has address taken but no possible call to it" warnings, + # until we figure out its implications. + # We are disabling all warnings as nvlink has no known way to suppress +@@ -64,7 +64,7 @@ if (TARGET viskores::cuda) + vtk_module_compile_options(VTK::AcceleratorsVTKmDataModel + PUBLIC $<$:-Xcudafe --diag_suppress=extra_semicolon>) + +-elseif (TARGET viskores::kokkos_cuda) ++elseif (TARGET VTK::vtkviskores_kokkos_cuda) + list(TRANSFORM nowrap_classes APPEND ".cxx" OUTPUT_VARIABLE nowrap_sources) + set(cuda_impl ${nowrap_sources} vtkmDataSet.cxx) + set_source_files_properties(${cuda_impl} PROPERTIES LANGUAGE CUDA) +@@ -90,7 +90,7 @@ if (MSVC) + ) + set(viskores_msvc_flags) + foreach (msvc_warning_flag IN LISTS msvc_warning_flags) +- if (TARGET viskores::cuda) ++ if (TARGET VTK::vtkviskores_cuda) + list(APPEND viskores_msvc_flags + $<$:-Xcompiler=${msvc_warning_flag},${msvc_warning_flag}>) + else () +diff --git a/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt b/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt +index 627a3f5341..a105aaa49e 100644 +--- a/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt ++++ b/Accelerators/Vtkm/DataModel/Testing/Cxx/CMakeLists.txt +@@ -15,7 +15,7 @@ vtk_add_test_cxx(vtkAcceleratorsVTKmDataModelCxxTests tests + TestVTKMDataSet.cxx,NO_VALID + ) + +-if (TARGET viskores::cuda) ++if (TARGET VTK::vtkviskores_cuda) + foreach(src IN LISTS tests) + string(REPLACE "," ";" src ${src}) + list(GET src 0 src) +@@ -38,7 +38,7 @@ vtk_test_cxx_executable(vtkAcceleratorsVTKmDataModelCxxTests tests + RENDERING_FACTORY + ) + +-if (TARGET viskores::cuda) ++if (TARGET VTK::vtkviskores_cuda) + # When cuda is enabled VTK::AcceleratorsVTKmDataModel is built statically but with fpic + # enabled so the tests are also built with fpic enabled + set_target_properties(vtkAcceleratorsVTKmDataModelCxxTests PROPERTIES +diff --git a/Accelerators/Vtkm/Filters/CMakeLists.txt b/Accelerators/Vtkm/Filters/CMakeLists.txt +index 1b249d5f2d..4eb9989da5 100644 +--- a/Accelerators/Vtkm/Filters/CMakeLists.txt ++++ b/Accelerators/Vtkm/Filters/CMakeLists.txt +@@ -114,7 +114,7 @@ viskores_add_target_information(${vtkm_accel_target} + MODIFY_CUDA_FLAGS + DEVICE_SOURCES ${sources}) + +-if (TARGET viskores::cuda) ++if (TARGET VTK::vtkviskores_cuda) + # Temporarily suppress "has address taken but no possible call to it" warnings, + # until we figure out its implications. + # We are disabling all warnings as nvlink has no known way to suppress +@@ -127,7 +127,7 @@ if (TARGET viskores::cuda) + + vtk_module_compile_options(VTK::AcceleratorsVTKmFilters + PUBLIC $<$:-Xcudafe --diag_suppress=extra_semicolon>) +-elseif (TARGET viskores::kokkos_cuda) ++elseif (TARGET VTK::vtkviskores_kokkos_cuda) + + list(TRANSFORM classes APPEND ".cxx" OUTPUT_VARIABLE cuda_impl) + set_source_files_properties(${cuda_impl} PROPERTIES LANGUAGE CUDA) +@@ -153,7 +153,7 @@ if (MSVC) + ) + set(viskores_msvc_flags) + foreach (msvc_warning_flag IN LISTS msvc_warning_flags) +- if (TARGET viskores::cuda OR TARGET viskores::kokkos_cuda) ++ if (TARGET VTK::vtkviskores_cuda OR TARGET VTK::vtkviskores_kokkos_cuda) + list(APPEND viskores_msvc_flags + $<$:-Xcompiler=${msvc_warning_flag},${msvc_warning_flag}>) + else () +diff --git a/Accelerators/Vtkm/Filters/Testing/Cxx/CMakeLists.txt b/Accelerators/Vtkm/Filters/Testing/Cxx/CMakeLists.txt +index 8506bc29fd..6e831b2f87 100644 +--- a/Accelerators/Vtkm/Filters/Testing/Cxx/CMakeLists.txt ++++ b/Accelerators/Vtkm/Filters/Testing/Cxx/CMakeLists.txt +@@ -28,7 +28,7 @@ vtk_add_test_cxx(vtkAcceleratorsVTKmFiltersCxxTests tests + TestVTKMWarpVector.cxx + ) + +-if (TARGET viskores::cuda) ++if (TARGET VTK::vtkviskores_cuda) + foreach(src IN LISTS tests) + string(REPLACE "," ";" src ${src}) + list(GET src 0 src) +@@ -53,7 +53,7 @@ vtk_test_cxx_executable(vtkAcceleratorsVTKmFiltersCxxTests tests + RENDERING_FACTORY + ) + +-if (TARGET viskores::cuda) ++if (TARGET VTK::vtkviskores_cuda) + set_target_properties(vtkAcceleratorsVTKmFiltersCxxTests PROPERTIES + CUDA_ARCHITECTURES OFF) + endif() +diff --git a/IO/CatalystConduit/CMakeLists.txt b/IO/CatalystConduit/CMakeLists.txt +index d9f78669d5..91d60f1638 100644 +--- a/IO/CatalystConduit/CMakeLists.txt ++++ b/IO/CatalystConduit/CMakeLists.txt +@@ -17,7 +17,7 @@ vtk_module_add_module(VTK::IOCatalystConduit + PRIVATE_CLASSES ${private_classes}) + + +-if (TARGET viskores::cuda) ++if (TARGET VTK::vtkviskores_cuda) + # Temporarily suppress "has address taken but no possible call to it" warnings, + # until we figure out its implications. + # We are disabling all warnings as nvlink has no known way to suppress +diff --git a/IO/CatalystConduit/Testing/Cxx/CMakeLists.txt b/IO/CatalystConduit/Testing/Cxx/CMakeLists.txt +index a8e42b6ff1..9a956fc3d8 100644 +--- a/IO/CatalystConduit/Testing/Cxx/CMakeLists.txt ++++ b/IO/CatalystConduit/Testing/Cxx/CMakeLists.txt +@@ -31,7 +31,7 @@ if (TARGET VTK::ParallelMPI) + vtk_test_cxx_executable(vtkConduitCxxTests-MPI mpitests) + endif() + +-if (TARGET viskores::cuda) ++if (TARGET VTK::vtkviskores_cuda) + set_source_files_properties(TestConduitSourceDeviceMemory.cxx PROPERTIES LANGUAGE CUDA) + + +-- +2.50.1 (Apple Git-155) + diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtk-xdmf2-hdf51.13.1.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-xdmf2-hdf51.13.1.patch new file mode 100644 index 00000000000..bfeeb9c0320 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-xdmf2-hdf51.13.1.patch @@ -0,0 +1,61 @@ +From 3a536a3c6b949cb1c9dd147c3a395c3ff31856e8 Mon Sep 17 00:00:00 2001 +From: Ben Boeckel +Date: Thu, 14 Apr 2022 12:53:36 -0400 +Subject: [PATCH 1/6] xdmf2: install `XdmfExport.h` + +--- + VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt +index 274dbc4423c..a47bf4ee4d9 100644 +--- a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt ++++ b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt +@@ -276,6 +276,7 @@ vtk_module_add_module(VTK::xdmf2 + ${XdmfModelSource} + SOURCES ${XdmfExtraSource} + HEADERS Xdmf.h ++ XdmfExport.h + "${CMAKE_CURRENT_BINARY_DIR}/XdmfConfig.h" + HEADERS_SUBDIR "vtkxdmf2/libsrc") + set_target_properties(xdmf2 +-- +GitLab + + +From 1456c9e6ab2b244d225dcfc0a7f985933c09d5f3 Mon Sep 17 00:00:00 2001 +From: Ben Boeckel +Date: Thu, 14 Apr 2022 15:20:13 -0400 +Subject: [PATCH 6/6] xdmf2: support HDF5 1.13.1 + +--- + VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx +index 6a4966bb231..1a412b56d02 100644 +--- a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx ++++ b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx +@@ -156,6 +156,9 @@ static herr_t H5FD_dsm_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, hadd + } + + static const H5FD_class_t H5FD_dsm_g = { ++#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13)) ++ H5_VFD_RESERVED + 0xd3f2, /*value */ ++#endif + "dsm", /*name */ + MAXADDR, /*maxaddr */ + H5F_CLOSE_WEAK, /*fc_degree */ +@@ -193,6 +196,10 @@ static const H5FD_class_t H5FD_dsm_g = { + #endif + NULL, /*lock */ + NULL, /*unlock */ ++#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13)) ++ NULL, /*del */ ++ NULL, /*ctl */ ++#endif + H5FD_FLMAP_SINGLE /*fl_map */ + }; + +-- +GitLab diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtk-xdmf2-hdf51.13.2.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-xdmf2-hdf51.13.2.patch new file mode 100644 index 00000000000..54186671383 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtk-xdmf2-hdf51.13.2.patch @@ -0,0 +1,36 @@ +From 2cc0d020359f714587d14b2f25a2c5f235f829c9 Mon Sep 17 00:00:00 2001 +From: Ryan Krattiger +Date: Tue, 15 Nov 2022 15:00:36 -0600 +Subject: [PATCH] Xdmf2: Update HDF5 driver for 1.13.2 + +--- + VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx +index 1a412b56d02..ff4427d0265 100644 +--- a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx ++++ b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx +@@ -157,6 +157,7 @@ static herr_t H5FD_dsm_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, hadd + + static const H5FD_class_t H5FD_dsm_g = { + #if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13)) ++ 0, /*version */ + H5_VFD_RESERVED + 0xd3f2, /*value */ + #endif + "dsm", /*name */ +@@ -190,6 +191,12 @@ static const H5FD_class_t H5FD_dsm_g = { + NULL, /*get_handle */ + H5FD_dsm_read, /*read */ + H5FD_dsm_write, /*write */ ++#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13)) ++ NULL, /*read_vector */ ++ NULL, /*write_vector */ ++ NULL, /*read_selection */ ++ NULL, /*write_selection */ ++#endif + NULL, /*flush */ + #if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=8)) + NULL, /* truncate */ +-- +GitLab diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtk_alias_hdf5.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtk_alias_hdf5.patch new file mode 100644 index 00000000000..a580debfa1e --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtk_alias_hdf5.patch @@ -0,0 +1,14 @@ +diff --git a/CMake/patches/99/FindHDF5.cmake b/CMake/patches/99/FindHDF5.cmake +index b54877d519..adf5d84430 100644 +--- a/VTK/CMake/patches/99/FindHDF5.cmake ++++ b/VTK/CMake/patches/99/FindHDF5.cmake +@@ -1150,6 +1150,9 @@ if (HDF5_FOUND) + endif () + endif () + endforeach () ++ if(NOT TARGET "hdf5") ++ add_library(hdf5 ALIAS hdf5::hdf5) ++ endif() + unset(hdf5_lang) + + if (HDF5_DIFF_EXECUTABLE AND NOT TARGET hdf5::h5diff) diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-catalyst-pv551.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-catalyst-pv551.patch new file mode 100644 index 00000000000..8c8883740db --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-catalyst-pv551.patch @@ -0,0 +1,510 @@ +# The VTK-m changes are slated for paraview-5.5.x +# +# The catalyst changes (the working directory for output) are slated for +# paraview-5.6. +# They are API-compatible with paraview-5.5 but not ABI compatible. +# +# https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 +# https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 +# https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 +# +--- ParaView-v5.5.0/VTK/ThirdParty/vtkm/vtk-m/CMake/VTKmDetermineVersion.cmake.orig 2018-04-06 22:03:33.000000000 +0200 ++++ ParaView-v5.5.0/VTK/ThirdParty/vtkm/vtk-m/CMake/VTKmDetermineVersion.cmake 2018-04-23 12:00:23.708544206 +0200 +@@ -51,6 +51,8 @@ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE) ++ else() ++ set(output) + endif() + else() + set(result 0) +@@ -75,7 +77,7 @@ + + # Extracts components from a version string. See determine_version() for usage. + function(extract_version_components version_string var_prefix) +- string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)" ++ string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)$" + version_matches "${version_string}") + if(CMAKE_MATCH_0) + set(full ${CMAKE_MATCH_0}) +--- ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.cxx.orig 2018-04-06 22:03:33.000000000 +0200 ++++ ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.cxx 2018-05-11 12:02:26.894772713 +0200 +@@ -38,6 +38,7 @@ + #include "vtkStringArray.h" + + #include ++#include + + struct vtkCPProcessorInternals + { +@@ -47,12 +48,13 @@ + }; + + vtkStandardNewMacro(vtkCPProcessor); +-vtkMultiProcessController* vtkCPProcessor::Controller = NULL; ++vtkMultiProcessController* vtkCPProcessor::Controller = nullptr; + //---------------------------------------------------------------------------- + vtkCPProcessor::vtkCPProcessor() + { + this->Internal = new vtkCPProcessorInternals; +- this->InitializationHelper = NULL; ++ this->InitializationHelper = nullptr; ++ this->WorkingDirectory = nullptr; + } + + //---------------------------------------------------------------------------- +@@ -61,14 +63,15 @@ + if (this->Internal) + { + delete this->Internal; +- this->Internal = NULL; ++ this->Internal = nullptr; + } + + if (this->InitializationHelper) + { + this->InitializationHelper->Delete(); +- this->InitializationHelper = NULL; ++ this->InitializationHelper = nullptr; + } ++ this->SetWorkingDirectory(nullptr); + } + + //---------------------------------------------------------------------------- +@@ -95,7 +98,7 @@ + { + if (which < 0 || which >= this->GetNumberOfPipelines()) + { +- return NULL; ++ return nullptr; + } + int counter = 0; + vtkCPProcessorInternals::PipelineListIterator iter = this->Internal->Pipelines.begin(); +@@ -108,7 +111,7 @@ + counter++; + iter++; + } +- return NULL; ++ return nullptr; + } + + //---------------------------------------------------------------------------- +@@ -130,17 +133,41 @@ + } + + //---------------------------------------------------------------------------- +-int vtkCPProcessor::Initialize() ++int vtkCPProcessor::Initialize(const char* workingDirectory) + { +- if (this->InitializationHelper == NULL) ++ if (this->InitializationHelper == nullptr) + { + this->InitializationHelper = this->NewInitializationHelper(); + } ++ // make sure the directory exists here so that we only do it once ++ if (workingDirectory) ++ { ++ vtkMultiProcessController* controller = vtkMultiProcessController::GetGlobalController(); ++ int success = 1; ++ if (controller == nullptr || controller->GetLocalProcessId() == 0) ++ { ++ success = vtksys::SystemTools::MakeDirectory(workingDirectory) == true ? 1 : 0; ++ if (success == 0) ++ { ++ vtkWarningMacro("Could not make " ++ << workingDirectory << " directory. " ++ << "Results will be generated in current working directory instead."); ++ } ++ } ++ if (controller) ++ { ++ controller->Broadcast(&success, 1, 0); ++ } ++ if (success) ++ { ++ this->SetWorkingDirectory(workingDirectory); ++ } ++ } + return 1; + } + + //---------------------------------------------------------------------------- +-int vtkCPProcessor::Initialize(vtkMPICommunicatorOpaqueComm& comm) ++int vtkCPProcessor::Initialize(vtkMPICommunicatorOpaqueComm& comm, const char* workingDirectory) + { + #ifdef PARAVIEW_USE_MPI + if (vtkCPProcessor::Controller) +@@ -148,7 +175,7 @@ + vtkErrorMacro("Can only initialize with a communicator once per process."); + return 0; + } +- if (this->InitializationHelper == NULL) ++ if (this->InitializationHelper == nullptr) + { + vtkMPICommunicator* communicator = vtkMPICommunicator::New(); + communicator->InitializeExternal(&comm); +@@ -157,12 +184,12 @@ + this->Controller = controller; + this->Controller->SetGlobalController(controller); + communicator->Delete(); +- return this->Initialize(); ++ return this->Initialize(workingDirectory); + } + return 1; + #else + static_cast(&comm); // get rid of variable not used warning +- return this->Initialize(); ++ return this->Initialize(workingDirectory); + #endif + } + +@@ -225,6 +252,13 @@ + input->GetFieldData()->AddArray(catalystChannel); + } + } ++ ++ std::string originalWorkingDirectory; ++ if (this->WorkingDirectory) ++ { ++ originalWorkingDirectory = vtksys::SystemTools::GetCurrentWorkingDirectory(); ++ vtksys::SystemTools::ChangeDirectory(this->WorkingDirectory); ++ } + for (vtkCPProcessorInternals::PipelineListIterator iter = this->Internal->Pipelines.begin(); + iter != this->Internal->Pipelines.end(); iter++) + { +@@ -248,6 +282,10 @@ + } + } + } ++ if (originalWorkingDirectory.empty() == false) ++ { ++ vtksys::SystemTools::ChangeDirectory(originalWorkingDirectory); ++ } + // we want to reset everything here to make sure that new information + // is properly passed in the next time. + dataDescription->ResetAll(); +@@ -259,7 +297,7 @@ + { + if (this->Controller) + { +- this->Controller->SetGlobalController(NULL); ++ this->Controller->SetGlobalController(nullptr); + this->Controller->Finalize(1); + this->Controller->Delete(); + } +--- ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.h.orig 2018-04-06 22:03:33.000000000 +0200 ++++ ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.h 2018-05-11 12:02:26.894772713 +0200 +@@ -76,14 +76,16 @@ + virtual void RemoveAllPipelines(); + + /// Initialize the co-processor. Returns 1 if successful and 0 +- /// otherwise. + /// otherwise. If Catalyst is built with MPI then Initialize() + /// can also be called with a specific MPI communicator if + /// MPI_COMM_WORLD isn't the proper one. Catalyst is initialized +- /// to use MPI_COMM_WORLD by default. +- virtual int Initialize(); ++ /// to use MPI_COMM_WORLD by default. Both methods have an optional ++ /// workingDirectory argument which will set *WorkingDirectory* so ++ /// that files will be put relative to this directory. ++ virtual int Initialize(const char* workingDirectory = nullptr); + #ifndef __WRAP__ +- virtual int Initialize(vtkMPICommunicatorOpaqueComm& comm); ++ virtual int Initialize( ++ vtkMPICommunicatorOpaqueComm& comm, const char* workingDirectory = nullptr); + #endif + + /// The Catalyst input field data string array name. This array will +@@ -111,6 +113,13 @@ + /// implementation an opportunity to clean up, before it is destroyed. + virtual int Finalize(); + ++ /// Get the current working directory for outputting Catalyst files. ++ /// If not set then Catalyst output files will be relative to the ++ /// current working directory. This will not affect where Catalyst ++ /// looks for Python scripts. *WorkingDirectory* gets set through ++ /// the *Initialize()* methods. ++ vtkGetStringMacro(WorkingDirectory); ++ + protected: + vtkCPProcessor(); + virtual ~vtkCPProcessor(); +@@ -118,6 +127,11 @@ + /// Create a new instance of the InitializationHelper. + virtual vtkObject* NewInitializationHelper(); + ++ /// Set the current working directory for outputting Catalyst files. ++ /// This is a protected method since simulation code adaptors should ++ /// set this through the *Initialize()* methods. ++ vtkSetStringMacro(WorkingDirectory); ++ + private: + vtkCPProcessor(const vtkCPProcessor&) = delete; + void operator=(const vtkCPProcessor&) = delete; +@@ -125,6 +139,7 @@ + vtkCPProcessorInternals* Internal; + vtkObject* InitializationHelper; + static vtkMultiProcessController* Controller; ++ char* WorkingDirectory; + }; + + #endif +--- ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPXMLPWriterPipeline.cxx.orig 2018-04-06 22:03:33.000000000 +0200 ++++ ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPXMLPWriterPipeline.cxx 2018-05-11 12:02:26.894772713 +0200 +@@ -31,6 +31,7 @@ + #include + #include + ++#include + #include + #include + +@@ -174,7 +175,7 @@ + + for (unsigned int i = 0; i < dataDescription->GetNumberOfInputDescriptions(); i++) + { +- const char* inputName = dataDescription->GetInputDescriptionName(i); ++ std::string inputName = dataDescription->GetInputDescriptionName(i); + vtkCPInputDataDescription* idd = dataDescription->GetInputDescription(i); + vtkDataObject* grid = idd->GetGrid(); + if (grid == nullptr) +@@ -206,6 +207,8 @@ + vtkSMStringVectorProperty* fileName = + vtkSMStringVectorProperty::SafeDownCast(writer->GetProperty("FileName")); + ++ // If we have a / in the channel name we take it out of the filename we're going to write to ++ inputName.erase(std::remove(inputName.begin(), inputName.end(), '/'), inputName.end()); + std::ostringstream o; + if (this->Path.empty() == false) + { +--- ParaView-v5.5.0/Wrapping/Python/paraview/coprocessing.py.orig 2018-04-06 22:03:33.000000000 +0200 ++++ ParaView-v5.5.0/Wrapping/Python/paraview/coprocessing.py 2018-05-11 12:02:27.038772408 +0200 +@@ -11,22 +11,12 @@ + from paraview.vtk.vtkPVVTKExtensionsCore import * + import math + +-# ----------------------------------------------------------------------------- +-def IsInModulo(timestep, frequencyArray): +- """ +- Return True if the given timestep is in one of the provided frequency. +- This can be interpreted as follow:: +- +- isFM = IsInModulo(timestep, [2,3,7]) +- +- is similar to:: ++# If the user created a filename in a location that doesn't exist by default we'll ++# make the directory for them. This can be changed though by setting createDirectoriesIfNeeded ++# to False. ++createDirectoriesIfNeeded = True + +- isFM = (timestep % 2 == 0) or (timestep % 3 == 0) or (timestep % 7 == 0) +- """ +- for frequency in frequencyArray: +- if frequency > 0 and (timestep % frequency == 0): +- return True +- return False ++# ----------------------------------------------------------------------------- + + class CoProcessor(object): + """Base class for co-processing Pipelines. +@@ -68,6 +58,9 @@ + self.__CinemaTracks = {} + self.__InitialFrequencies = {} + self.__PrintEnsightFormatString = False ++ self.__TimeStepToStartOutputAt=0 ++ self.__ForceOutputAtFirstCall=False ++ self.__FirstTimeStepIndex = None + + def SetPrintEnsightFormatString(self, enable): + """If outputting ExodusII files with the purpose of reading them into +@@ -87,6 +80,17 @@ + "Incorrect argument type: %s, must be a dict" % type(frequencies)) + self.__InitialFrequencies = frequencies + ++ def SetInitialOutputOptions(self, timeStepToStartOutputAt, forceOutputAtFirstCall): ++ """Set the frequencies at which the pipeline needs to be updated. ++ Typically, this is called by the subclass once it has determined what ++ timesteps co-processing will be needed to be done. ++ frequencies is a map, with key->string name of for the simulation ++ input, and value is a list of frequencies. ++ """ ++ ++ self.__TimeStepToStartOutputAt=timeStepToStartOutputAt ++ self.__ForceOutputAtFirstCall=forceOutputAtFirstCall ++ + def EnableLiveVisualization(self, enable, frequency = 1): + """Call this method to enable live-visualization. When enabled, + DoLiveVisualization() will communicate with ParaView server if possible +@@ -115,7 +119,7 @@ + # if this is a time step to do live then all of the inputs + # must be made available. note that we want the pipeline built + # before we do the actual first live connection. +- if self.__EnableLiveVisualization and timestep % self.__LiveVisualizationFrequency == 0 \ ++ if self.__EnableLiveVisualization and self.NeedToOutput(timestep, self.__LiveVisualizationFrequency) \ + and self.__LiveVisualizationLink: + if self.__LiveVisualizationLink.Initialize(servermanager.ActiveConnection.Session.GetSessionProxyManager()): + num_inputs = datadescription.GetNumberOfInputDescriptions() +@@ -132,13 +136,13 @@ + # hasn't been set up yet). If we don't have live enabled + # we know that the output frequencies aren't changed and can + # just use the initial frequencies. +- if self.__InitialFrequencies or not self.__EnableLiveVisualization: ++ if self.__ForceOutputAtFirstCall or self.__InitialFrequencies or not self.__EnableLiveVisualization: + num_inputs = datadescription.GetNumberOfInputDescriptions() + for cc in range(num_inputs): + input_name = datadescription.GetInputDescriptionName(cc) + + freqs = self.__InitialFrequencies.get(input_name, []) +- if self.__EnableLiveVisualization or ( self and IsInModulo(timestep, freqs) ): ++ if self.__EnableLiveVisualization or ( self and self.IsInModulo(timestep, freqs) ): + datadescription.GetInputDescription(cc).AllFieldsOn() + datadescription.GetInputDescription(cc).GenerateMeshOn() + else: +@@ -149,15 +153,14 @@ + for writer in self.__WritersList: + frequency = writer.parameters.GetProperty( + "WriteFrequency").GetElement(0) +- if (timestep % frequency) == 0 or \ +- datadescription.GetForceOutput() == True: ++ if self.NeedToOutput(timestep, frequency) or datadescription.GetForceOutput() == True: + writerinputs = cpstate.locate_simulation_inputs(writer) + for writerinput in writerinputs: + datadescription.GetInputDescriptionByName(writerinput).AllFieldsOn() + datadescription.GetInputDescriptionByName(writerinput).GenerateMeshOn() + + for view in self.__ViewsList: +- if (view.cpFrequency and timestep % view.cpFrequency == 0) or \ ++ if (view.cpFrequency and self.NeedToOutput(timestep, view.cpFrequency)) or \ + datadescription.GetForceOutput() == True: + viewinputs = cpstate.locate_simulation_inputs_for_view(view) + for viewinput in viewinputs: +@@ -192,8 +195,7 @@ + for writer in self.__WritersList: + frequency = writer.parameters.GetProperty( + "WriteFrequency").GetElement(0) +- if (timestep % frequency) == 0 or \ +- datadescription.GetForceOutput() == True: ++ if self.NeedToOutput(timestep, frequency) or datadescription.GetForceOutput() == True: + fileName = writer.parameters.GetProperty("FileName").GetElement(0) + paddingamount = writer.parameters.GetProperty("PaddingAmount").GetElement(0) + helperName = writer.GetXMLName() +@@ -203,6 +205,23 @@ + else: + ts = str(timestep).rjust(paddingamount, '0') + writer.FileName = fileName.replace("%t", ts) ++ if '/' in writer.FileName and createDirectoriesIfNeeded: ++ oktowrite = [1.] ++ import vtk ++ comm = vtk.vtkMultiProcessController.GetGlobalController() ++ if comm.GetLocalProcessId() == 0: ++ import os ++ newDir = writer.FileName[0:writer.FileName.rfind('/')] ++ try: ++ os.makedirs(newDir) ++ except OSError: ++ if not os.path.isdir(newDir): ++ print ("ERROR: Cannot make directory for", writer.FileName, ". No data will be written.") ++ oktowrite[0] = 0. ++ comm.Broadcast(oktowrite, 1, 0) ++ if oktowrite[0] == 0: ++ # we can't make the directory so no reason to update the pipeline ++ return + writer.UpdatePipeline(datadescription.GetTime()) + + def WriteImages(self, datadescription, rescale_lookuptable=False, +@@ -240,7 +259,7 @@ + + cinema_dirs = [] + for view in self.__ViewsList: +- if (view.cpFrequency and timestep % view.cpFrequency == 0) or \ ++ if (view.cpFrequency and self.NeedToOutput(timestep, view.cpFrequency)) or \ + datadescription.GetForceOutput() == True: + fname = view.cpFileName + ts = str(timestep).rjust(padding_amount, '0') +@@ -267,6 +286,24 @@ + if dirname: + cinema_dirs.append(dirname) + else: ++ if '/' in fname and createDirectoriesIfNeeded: ++ oktowrite = [1.] ++ import vtk ++ comm = vtk.vtkMultiProcessController.GetGlobalController() ++ if comm.GetLocalProcessId() == 0: ++ import os ++ newDir = fname[0:fname.rfind('/')] ++ try: ++ os.makedirs(newDir) ++ except OSError: ++ if not os.path.isdir(newDir): ++ print ("ERROR: Cannot make directory for", fname, ". No image will be output.") ++ oktowrite[0] = 0. ++ comm.Broadcast(oktowrite, 1, 0) ++ if oktowrite[0] == 0: ++ # we can't make the directory so no reason to update the pipeline ++ return ++ + if image_quality is None and fname.endswith('png'): + # for png quality = 0 means no compression. compression can be a potentially + # very costly serial operation on process 0 +@@ -307,7 +344,7 @@ + + + timeStep = datadescription.GetTimeStep() +- if self.__EnableLiveVisualization and timeStep % self.__LiveVisualizationFrequency == 0: ++ if self.__EnableLiveVisualization and self.NeedToOutput(timeStep, self.__LiveVisualizationFrequency): + if not self.__LiveVisualizationLink.Initialize(servermanager.ActiveConnection.Session.GetSessionProxyManager()): + return + +@@ -412,7 +449,7 @@ + """ + controller = servermanager.ParaViewPipelineController() + # assume that a client only proxy with the same name as a writer +- # is available in "insitu_writer_paramters" ++ # is available in "insitu_writer_parameters" + + # Since coprocessor sometimes pass writer as a custom object and not + # a proxy, we need to handle that. Just creating any arbitrary writer +@@ -666,3 +703,42 @@ + #restore what we showed + pv_introspect.restore_visibility(pxystate) + return os.path.basename(vfname) ++ ++ def IsInModulo(self, timestep, frequencies): ++ """ ++ Return True if the given timestep is in one of the provided frequency. ++ This can be interpreted as follow:: ++ ++ isFM = IsInModulo(timestep-timeStepToStartOutputAt, [2,3,7]) ++ ++ is similar to:: ++ ++ isFM = (timestep-timeStepToStartOutputAt % 2 == 0) or (timestep-timeStepToStartOutputAt % 3 == 0) or (timestep-timeStepToStartOutputAt % 7 == 0) ++ ++ The timeStepToStartOutputAt is the first timestep that will potentially be output. ++ """ ++ if timestep < self.__TimeStepToStartOutputAt and not self.__ForceOutputAtFirstCall: ++ return False ++ for frequency in frequencies: ++ if frequency > 0 and self.NeedToOutput(timestep, frequency): ++ return True ++ ++ return False ++ ++ ++ def NeedToOutput(self, timestep, frequency): ++ """ ++ Return True if we need to output based on the input timestep and frequency. Checks based ++ __FirstTimeStepIndex, __FirstTimeStepIndex, __ForceOutputAtFirstCall and __TimeStepToStartOutputAt ++ member variables. ++ """ ++ if self.__FirstTimeStepIndex == None: ++ self.__FirstTimeStepIndex = timestep ++ ++ if self.__ForceOutputAtFirstCall and self.__FirstTimeStepIndex == timestep: ++ return True ++ ++ if self.__TimeStepToStartOutputAt <= timestep and (timestep-self.__TimeStepToStartOutputAt) % frequency == 0: ++ return True ++ ++ return False diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-findmpi-downstream.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-findmpi-downstream.patch new file mode 100644 index 00000000000..31356ea51ae --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-findmpi-downstream.patch @@ -0,0 +1,51 @@ +From 5bf0eff1563820d7c997649da372ab003fd4af81 Mon Sep 17 00:00:00 2001 +From: Chuck Atkins +Date: Mon, 15 Feb 2021 13:59:50 -0500 +Subject: [PATCH] CMake: Fix FindMPI getting consumed by newer CMake versions + +--- + CMake/patches/FindMPI.cmake | 11 +++++++++++ + CMakeLists.txt | 7 ++++++- + 2 files changed, 17 insertions(+), 1 deletion(-) + create mode 100644 CMake/patches/FindMPI.cmake + +diff --git a/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake/patches/FindMPI.cmake b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake/patches/FindMPI.cmake +new file mode 100644 +index 000000000..a4ed44f04 +--- /dev/null ++++ b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake/patches/FindMPI.cmake +@@ -0,0 +1,11 @@ ++#------------------------------------------------------------------------------# ++# Distributed under the OSI-approved Apache License, Version 2.0. See ++# accompanying file Copyright.txt for details. ++#------------------------------------------------------------------------------# ++ ++# This module is already included in new versions of CMake ++if(CMAKE_VERSION VERSION_LESS 3.15) ++ include(${CMAKE_CURRENT_LIST_DIR}/3.15/FindMPI.cmake) ++else() ++ include(${CMAKE_ROOT}/Modules/FindMPI.cmake) ++endif() +diff --git a/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMakeLists.txt b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMakeLists.txt +index e907495f3..fa464ab8d 100644 +--- a/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMakeLists.txt ++++ b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMakeLists.txt +@@ -277,9 +277,14 @@ if(NOT VTKm_INSTALL_ONLY_LIBRARIES) + FILES + ${VTKm_SOURCE_DIR}/CMake/VTKmCMakeBackports.cmake + ${VTKm_SOURCE_DIR}/CMake/FindTBB.cmake +- ${VTKm_SOURCE_DIR}/CMake/patches/3.15/FindMPI.cmake ++ ${VTKm_SOURCE_DIR}/CMake/patches/FindMPI.cmake + DESTINATION ${VTKm_INSTALL_CMAKE_MODULE_DIR} + ) ++ install( ++ FILES ++ ${VTKm_SOURCE_DIR}/CMake/patches/3.15/FindMPI.cmake ++ DESTINATION ${VTKm_INSTALL_CMAKE_MODULE_DIR}/3.15 ++ ) + + # Install support files. + install( +-- +2.24.2 + diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-fix-problems-in-class-member-names.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-fix-problems-in-class-member-names.patch new file mode 100644 index 00000000000..c96e97c5875 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-fix-problems-in-class-member-names.patch @@ -0,0 +1,22 @@ +diff --git a/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/filter/scalar_topology/worklet/contourtree_distributed/HierarchicalContourTree.h b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/filter/scalar_topology/worklet/contourtree_distributed/HierarchicalContourTree.h +index acd5eca2b..5a23705db 100644 +--- a/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/filter/scalar_topology/worklet/contourtree_distributed/HierarchicalContourTree.h ++++ b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/filter/scalar_topology/worklet/contourtree_distributed/HierarchicalContourTree.h +@@ -663,7 +663,7 @@ std::string HierarchicalContourTree::PrintDotSuperStructure(const cha + auto hyperarcsPortal = this->Hyperarcs.ReadPortal(); + auto regularNodeGlobalIdsPortal = this->RegularNodeGlobalIds.ReadPortal(); + auto whichIterationPortal = this->WhichIteration.ReadPortal(); +- auto whichRoundPortal = this->whichRound.ReadPortal(); ++ auto whichRoundPortal = this->WhichRound.ReadPortal(); + auto superarcsPortal = this->Superarcs.ReadPortal(); + auto superparentsPortal = this->Superparents.ReadPortal(); + for (vtkm::Id supernode = 0; supernode < this->Supernodes.GetNumberOfValues(); supernode++) +@@ -708,7 +708,7 @@ std::string HierarchicalContourTree::PrintDotSuperStructure(const cha + if (contourtree_augmented::NoSuchElement(superarcTo)) + { // no superarc + // if it occurred on the final round, it's the global root and is shown as the NULL node +- if (whichRoundPortal.Get(superarcFrom) == this->NRounds) ++ if (whichRoundPortal.Get(superarcFrom) == this->NumRounds) + { // root node + outstream << "\tSN" << std::setw(1) << superarcFrom << " -> SA" << std::setw(1) << superarc + << " [label=\"S" << std::setw(1) << superarc << "\",style=dotted]\n"; \ No newline at end of file diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-remove-unused-method-from-mir-tables.patch b/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-remove-unused-method-from-mir-tables.patch new file mode 100644 index 00000000000..fba97e47623 --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/vtkm-remove-unused-method-from-mir-tables.patch @@ -0,0 +1,16 @@ +diff --git a/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/filter/contour/worklet/mir/MIRTables.h b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/filter/contour/worklet/mir/MIRTables.h +index 3dff3329e..a6f4d4f1f 100644 +--- a/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/filter/contour/worklet/mir/MIRTables.h ++++ b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/vtkm/filter/contour/worklet/mir/MIRTables.h +@@ -11400,11 +11400,6 @@ public: + return FacesLookup[shape]; + } + +- VTKM_EXEC vtkm::UInt8 GetPoint(vtkm::Id pointIndex) const +- { +- return this->CellFacePortal.Get(pointIndex); +- } +- + private: + typename vtkm::cont::ArrayHandle::ReadPortalType MIRTablesDataPortal; + typename vtkm::cont::ArrayHandle::ReadPortalType MIRTablesIndicesPortal; \ No newline at end of file diff --git a/repos/spack_repo/builtin/packages/tipi_paraview/xlc-compilation-pv590.patch b/repos/spack_repo/builtin/packages/tipi_paraview/xlc-compilation-pv590.patch new file mode 100644 index 00000000000..8105b2010dd --- /dev/null +++ b/repos/spack_repo/builtin/packages/tipi_paraview/xlc-compilation-pv590.patch @@ -0,0 +1,39 @@ +diff --git a/VTK/Common/DataModel/vtkStaticCellLinksTemplate.txx b/VTK/Common/DataModel/vtkStaticCellLinksTemplate.txx +index 514c0ee..66edca2 100644 +--- a/VTK/Common/DataModel/vtkStaticCellLinksTemplate.txx ++++ b/VTK/Common/DataModel/vtkStaticCellLinksTemplate.txx +@@ -356,7 +356,7 @@ void vtkStaticCellLinksTemplate::ThreadedBuildLinks( + + // Create an array of atomics with initial count=0. This will keep + // track of point uses. Count them in parallel. +- std::atomic* counts = new std::atomic[numPts] {}; ++ std::atomic* counts = new std::atomic[numPts] (); + CountUses count(cellArray, counts); + vtkSMPTools::For(0, numCells, count); + +diff --git a/VTK/Filters/Core/vtkBinnedDecimation.cxx b/VTK/Filters/Core/vtkBinnedDecimation.cxx +index 0736c56..8403908 100644 +--- a/VTK/Filters/Core/vtkBinnedDecimation.cxx ++++ b/VTK/Filters/Core/vtkBinnedDecimation.cxx +@@ -632,7 +632,7 @@ void BinPointsDecimate(int genMode, vtkIdType numPts, PointsT* pts, vtkPointData + // is a problem because a ptId can == zero; as a workaround, we'll + // initially use negative ids, and convert to positive ids in the + // final composition. +- std::atomic* ptMap = new std::atomic[numBins] {}; ++ std::atomic* ptMap = new std::atomic[numBins] (); + + // Is the triangle output? And eventually the offset into the output cell array. + TIds* triMap = new TIds[numTris + 1]; +diff --git a/VTK/Filters/Core/vtkWindowedSincPolyDataFilter.cxx b/VTK/Filters/Core/vtkWindowedSincPolyDataFilter.cxx +index 15e47a1..7baef33 100644 +--- a/VTK/Filters/Core/vtkWindowedSincPolyDataFilter.cxx ++++ b/VTK/Filters/Core/vtkWindowedSincPolyDataFilter.cxx +@@ -348,7 +348,7 @@ struct PointConnectivity : PointConnectivityBase + // accommodate more smoothing edges (although after a certain point, + // additional edges make little difference, especially at the cost of + // memory and speed). +- this->Offsets = new std::atomic[this->NumPts + 1] {}; // Initialized to zero ++ this->Offsets = new std::atomic[this->NumPts + 1] (); // Initialized to zero + this->Edges = nullptr; // initially until constructed + this->EdgeCounts = new EDGE_COUNT_TYPE[this->NumPts]; // values set later + } diff --git a/stacks/engflow/spack.yaml b/stacks/engflow/spack.yaml new file mode 100644 index 00000000000..7341be04a78 --- /dev/null +++ b/stacks/engflow/spack.yaml @@ -0,0 +1,24 @@ +# Windows Visualization Stack +# maintainers: +# - John Parent (@johnwparent) +# - Ryan Krattiger (@kwryankrattiger) + +spack: + view: false + include: + - ../../.ci/gitlab/ + + specs: + - "tipi-paraview" + + ci: + pipeline-gen: + - build-job: + image: { name: "tipibuild/linux-kitware-paraview@sha256:e0417824c4d417eb4d363f08954d11b94f9e6eb4ec76cee391db72e1e281fb18", entrypoint: ["/bin/bash"]} + before_script: + - mkdir -p /usr/local/share/.tipi/environments/generalized/v1/ + - mkdir -p /usr/local/share/.tipi/vT.w/ + + + cdash: + build-group: "Cmake-re test"