From 249e5415e838ca76c888e910616251453ee77315 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Wed, 27 Mar 2024 15:14:49 -0600 Subject: Update exodusii package (#43379) * SEACAS: Update package.py to handle new SEACAS project name The base project name for the SEACAS project has changed from "SEACASProj" to "SEACAS" as of @2022-10-14, so the package needed to be updated to use the new project name when needed. The refactor also changes several: "-DSome_CMAKE_Option:BOOL=ON" to define("Some_CMAKE_Option", True) * exodusii -- refactor and bring up-to-date * Add missed patch file * [@spackbot] updating style on behalf of gsjaardema * Apply seacas windows patch here also. * Update url so old checksums valid; redo new checksums --------- Co-authored-by: gsjaardema --- .../builtin/packages/exodusii/Fix-ioss-tpl.patch | 25 ++++ .../repos/builtin/packages/exodusii/package.py | 157 ++++++++++++++------- 2 files changed, 134 insertions(+), 48 deletions(-) create mode 100644 var/spack/repos/builtin/packages/exodusii/Fix-ioss-tpl.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/exodusii/Fix-ioss-tpl.patch b/var/spack/repos/builtin/packages/exodusii/Fix-ioss-tpl.patch new file mode 100644 index 0000000000..587d73a885 --- /dev/null +++ b/var/spack/repos/builtin/packages/exodusii/Fix-ioss-tpl.patch @@ -0,0 +1,25 @@ +From 4d3884f65a6a4df08ee8dd68ddaee5449f1dd378 Mon Sep 17 00:00:00 2001 +From: Greg Sjaardema +Date: Tue, 26 Mar 2024 12:42:08 -0600 +Subject: [PATCH] Remove ioss as required library + +--- + packages/seacas/cmake/Dependencies.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/packages/seacas/cmake/Dependencies.cmake b/packages/seacas/cmake/Dependencies.cmake +index 3b1b3d6598..e75f5073f2 100644 +--- a/packages/seacas/cmake/Dependencies.cmake ++++ b/packages/seacas/cmake/Dependencies.cmake +@@ -4,7 +4,7 @@ TRIBITS_PACKAGE_DEFINE_DEPENDENCIES( + Exodus_for libraries/exodus_for PT OPTIONAL + ExoIIv2for32 libraries/exoIIv2for32 PT OPTIONAL + Nemesis libraries/nemesis PT OPTIONAL +- Ioss libraries/ioss PT REQUIRED ++ Ioss libraries/ioss PT OPTIONAL + Chaco libraries/chaco PT OPTIONAL + Aprepro_lib libraries/aprepro_lib PT OPTIONAL + Supes libraries/supes PT OPTIONAL +-- +2.39.3 (Apple Git-145) + diff --git a/var/spack/repos/builtin/packages/exodusii/package.py b/var/spack/repos/builtin/packages/exodusii/package.py index 1a755b3965..6cb0dac746 100644 --- a/var/spack/repos/builtin/packages/exodusii/package.py +++ b/var/spack/repos/builtin/packages/exodusii/package.py @@ -3,10 +3,12 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import sys + +from spack.operating_systems.mac_os import macos_version from spack.package import * -# TODO: Add support for a C++11 enabled installation that filters out the -# TODO: "C++11-Disabled" flag (but only if the spec compiler supports C++11). +is_windows = sys.platform == "win32" class Exodusii(CMakePackage): @@ -15,15 +17,50 @@ class Exodusii(CMakePackage): (problem definition), postprocessing (results visualization), and data transfer between codes. An Exodus II data file is a random access, machine independent, binary file that is written and read - via C, C++, or Fortran API routines. + via C, C++, or Fortran API routines. This package *only* installs + the C and optionally Fortran library for exodus. If you want the full + suite of exodus-releated tools including the IOSS library, install + the seacas package instead of this package. """ - homepage = "https://github.com/gsjaardema/seacas" - git = "https://github.com/gsjaardema/seacas.git" - url = "https://github.com/gsjaardema/seacas/archive/refs/tags/v2021-04-05.zip" + homepage = "https://sandialabs.github.io/seacas/" + git = "https://github.com/sandialabs/seacas.git" + url = "https://github.com/sandialabs/seacas/archive/refs/tags/v2019-08-20.zip" + maintainers("gsjaardema") - license("X11") + license("BSD-3-Clause") + version("master", branch="master") + version( + "2024-03-11", sha256="5d417aa652e4ec8d66e27714c63b8cb5a7f878fb7b2ec55f629636fcff7c0f00" + ) + version( + "2023-11-27", sha256="00c444b2def2c9cf5694bee5bb0284ce289e83f7c84ac28c6701c746cfde9a4c" + ) + version( + "2023-05-30", sha256="d2cbd43596ed3ad77186f865fe8aa81a2efe389ff345b24622ac76c16614b532" + ) + version( + "2022-10-14", sha256="a96f29de3b69e7e3f5f344396c8cf791fe277dab0217fc0b90b02e38e75bbdc1" + ) + version( + "2022-08-01", sha256="c12a677ba2178cf5161d63fef3b1da4d3888622199cea3e611f59649085681dc" + ) + version( + "2022-05-16", sha256="80f6b0dee91766ab207a366b8eea546cc1afa33cea24deebaa6583f283d80fab" + ) + version( + "2022-03-04", sha256="b2e09f0f64d75634b7d3f9844c2cea7acbc877c4ceebb6b91e8e494bb3653166" + ) + version( + "2022-02-16", sha256="e1907f6831d9a0dd2c65879ca5746b9a0ef57d7ccce0036d55c0c6c5628ac981" + ) + version( + "2022-01-27", sha256="d21c14b9b30f773cef8e2029773f3cc35da021eebe9060298231f95021eb814f" + ) + version( + "2021-10-11", sha256="5c04d252e1c4a10b037aa352b89487e581ec6b52bdb46e9e85f101bbdcd9c388" + ) version( "2021-04-05", sha256="f40d318674753287b8b28d2b4e5cca872cd772d4c7383af4a8f3eeb48fcc7ec0" ) @@ -55,61 +92,85 @@ class Exodusii(CMakePackage): "2019-10-14", sha256="f143d90e8a7516d25979d1416e580dea638332db723f26ae94a712dfe4052e8f" ) version("2016-08-09", commit="2ffeb1bd39454ad5aa230e12969ce976f3d1c92b") - version("master", branch="master") + patch("Fix-ioss-tpl.patch", when="@2021-10-11:") + + # Build options + variant("fortran", default=False, description="Compile with Fortran support") + variant("shared", default=True, description="Enables the build of shared libraries") variant("mpi", default=True, description="Enables MPI parallelism.") - variant("fortran", default=False, description="Build Fortran wrapper libraries.") + variant("thread_safe", default=False, description="Enable thread-safe exodus library") - depends_on("cmake@2.8.11:", type="build") + depends_on("cmake@3.22:", when="@2023-10-24:", type="build") + depends_on("cmake@3.17:", when="@:2023-05-30", type="build") depends_on("mpi", when="+mpi") - # https://github.com/gsjaardema/seacas/blob/master/NetCDF-Mapping.md - depends_on("netcdf-c@4.6.1:+mpi", when="+mpi") - depends_on("netcdf-c@4.6.1:~mpi", when="~mpi") + # Always depends on netcdf-c + depends_on("netcdf-c@4.8.0:+mpi+parallel-netcdf", when="+mpi") + depends_on("netcdf-c@4.8.0:~mpi", when="~mpi") + depends_on("hdf5+hl~mpi", when="~mpi") + depends_on("hdf5+hl+mpi", when="+mpi") - depends_on("python@2.7:") + depends_on("python@3.0:") + conflicts("+shared", when="platform=windows") + + def setup_run_environment(self, env): + env.prepend_path("PYTHONPATH", self.prefix.lib) def cmake_args(self): spec = self.spec + from_variant = self.define_from_variant + define = self.define + + if self.spec.satisfies("@2022-10-14:"): + project_name_base = "Seacas" + else: + project_name_base = "SEACASProj" + + options = [] - cc_path = spec["mpi"].mpicc if "+mpi" in spec else self.compiler.cc - cxx_path = spec["mpi"].mpicxx if "+mpi" in spec else self.compiler.cxx - - options = [ - # General Flags # - "-DSEACASProj_ENABLE_SEACASExodus=ON", - "-DSEACASProj_ENABLE_TESTS=ON", - "-DBUILD_SHARED_LIBS:BOOL=ON", - "-DTPL_ENABLE_Netcdf:BOOL=ON", - "-DHDF5_NO_SYSTEM_PATHS=ON", - "-DSEACASProj_SKIP_FORTRANCINTERFACE_VERIFY_TEST:BOOL=ON", - "-DSEACASProj_ENABLE_CXX11:BOOL=OFF", - "-DSEACASProj_ENABLE_Zoltan:BOOL=OFF", - "-DNetCDF_DIR:PATH={0}".format(spec["netcdf-c"].prefix), - # MPI Flags # - "-DTPL_ENABLE_MPI={0}".format("ON" if "+mpi" in spec else "OFF"), - "-DCMAKE_C_COMPILER={0}".format(cc_path), - "-DCMAKE_CXX_COMPILER={0}".format(cxx_path), - ] - if "+fortran" in spec: - fc_path = spec["mpi"].mpifc if "+mpi" in spec else self.compiler.f90 + # #################### Base Settings ####################### + # Only want to enable the Exodus library. If want anything else, use the seacas package. + options.extend( + [ + define(project_name_base + "_ENABLE_ALL_PACKAGES", False), + define(project_name_base + "_ENABLE_ALL_OPTIONAL_PACKAGES", False), + define(project_name_base + "_ENABLE_SECONDARY_TESTED_CODE", False), + define(project_name_base + "_ENABLE_SEACASExodus", True), + from_variant(project_name_base + "_ENABLE_SEACASExodus_for", "fortran"), + from_variant(project_name_base + "_ENABLE_SEACASExoIIv2for32", "fortran"), + define(project_name_base + "_HIDE_DEPRECATED_CODE", False), + from_variant("CMAKE_INSTALL_RPATH_USE_LINK_PATH", "shared"), + from_variant("BUILD_SHARED_LIBS", "shared"), + from_variant("SEACASExodus_ENABLE_THREADSAFE", "thread_safe"), + from_variant("TPL_ENABLE_Pthread", "thread_safe"), + from_variant(project_name_base + "_ENABLE_Fortran", "fortran"), + ] + ) + if "~shared" in self.spec and not is_windows: + options.append(self.define(project_name_base + "_EXTRA_LINK_FLAGS", "z;dl")) + options.append(from_variant("TPL_ENABLE_MPI", "mpi")) + if "+mpi" in spec and not is_windows: options.extend( [ - "-DSEACASProj_ENABLE_Fortran:BOOL=ON", - "-DCMAKE_Fortran_COMPILER={0}".format(fc_path), - "-DSEACASProj_ENABLE_SEACASExodus_for:BOOL=ON", - "-DSEACASProj_ENABLE_SEACASExoIIv2for32:BOOL=ON", + define("CMAKE_C_COMPILER", spec["mpi"].mpicc), + define("CMAKE_CXX_COMPILER", spec["mpi"].mpicxx), + define("CMAKE_Fortran_COMPILER", spec["mpi"].mpifc), + define("MPI_BASE_DIR", spec["mpi"].prefix), ] ) - # Python # - # Handle v2016 separately because of older tribits - if spec.satisfies("@:2016-08-09"): - options.append( - "-DPYTHON_EXECUTABLE={0}".format( - join_path(self.spec["python"].prefix.bin, "python") - ) - ) + + # ##################### Dependencies ########################## + # Always need NetCDF-C + options.extend( + [define("TPL_ENABLE_Netcdf", True), define("NetCDF_ROOT", spec["netcdf-c"].prefix)] + ) + + # ################# RPath Handling ###################### + if sys.platform == "darwin" and macos_version() >= Version("10.12"): + # use @rpath on Sierra due to limit of dynamic loader + options.append(define("CMAKE_MACOSX_RPATH", True)) else: - options.append("-DPython_ROOT={0}".format(spec["python"].prefix)) + options.append(define("CMAKE_INSTALL_NAME_DIR", self.prefix.lib)) return options -- cgit v1.2.3-70-g09d2