summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorCharles Ferenbaugh <cferenba@lanl.gov>2022-10-05 14:06:12 -0600
committerGitHub <noreply@github.com>2022-10-05 14:06:12 -0600
commit417760e82927eafa6deeb3baeba7d428d3c87036 (patch)
treedc4dd3f97fe44d56bdf821897027b86345c0f76c /var
parente0b418f288561ab1273b12ad6cfa7728651c5368 (diff)
downloadspack-417760e82927eafa6deeb3baeba7d428d3c87036.tar.gz
spack-417760e82927eafa6deeb3baeba7d428d3c87036.tar.bz2
spack-417760e82927eafa6deeb3baeba7d428d3c87036.tar.xz
spack-417760e82927eafa6deeb3baeba7d428d3c87036.zip
Fix wonton CMake config to not break host codes (#33026)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/wonton/fix-cmake-config-r3d.patch23
-rw-r--r--var/spack/repos/builtin/packages/wonton/fix-cmake-config.patch32
-rw-r--r--var/spack/repos/builtin/packages/wonton/package.py5
3 files changed, 60 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/wonton/fix-cmake-config-r3d.patch b/var/spack/repos/builtin/packages/wonton/fix-cmake-config-r3d.patch
new file mode 100644
index 0000000000..c80028577e
--- /dev/null
+++ b/var/spack/repos/builtin/packages/wonton/fix-cmake-config-r3d.patch
@@ -0,0 +1,23 @@
+--- wonton-1.3.3-orig/wonton/intersect/r3d/config/r3dConfig.cmake.in 2021-03-29 03:04:15.000000000 -0600
++++ wonton-1.3.3/wonton/intersect/r3d/config/r3dConfig.cmake.in 2022-09-21 16:17:20.875412000 -0600
+@@ -2,9 +2,6 @@
+ # R3D configuration file template
+ #-----------------------------------------------------------------------------
+
+-# Compiler Definitions
+-set(CMAKE_C_COMPILER @CMAKE_C_COMPILER@ CACHE FILEPATH "C Compiler used for compiling R3D")
+-
+ # R3D installation path
+ set(r3d_ROOT @CMAKE_INSTALL_PREFIX@ CACHE PATH "Path to R3D installation")
+
+@@ -22,10 +19,6 @@
+ cmake_policy(SET CMP0074 NEW) # find_package honors Pkg_ROOT variables
+ endif ()
+
+-if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
+- set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE) # search for PkgConfig.cmake files first
+-endif ()
+-
+
+ #
+ # Import R3D targets
diff --git a/var/spack/repos/builtin/packages/wonton/fix-cmake-config.patch b/var/spack/repos/builtin/packages/wonton/fix-cmake-config.patch
new file mode 100644
index 0000000000..97628c7625
--- /dev/null
+++ b/var/spack/repos/builtin/packages/wonton/fix-cmake-config.patch
@@ -0,0 +1,32 @@
+--- wonton-1.2.11-orig/cmake/wontonConfig.cmake.in 2021-01-20 13:25:56.000000000 -0700
++++ wonton-1.2.11/cmake/wontonConfig.cmake.in 2022-09-12 16:28:11.104950000 -0600
+@@ -12,10 +12,6 @@
+ set(WONTON_VERSION_MINOR @WONTON_VERSION_PATCH@ CACHE STRING "Patch version of WONTON")
+
+
+-# Compiler Definitions
+-set(CMAKE_C_COMPILER @CMAKE_C_COMPILER@ CACHE FILEPATH "C Compiler used for compiling WONTON")
+-set(CMAKE_CXX_COMPILER @CMAKE_CXX_COMPILER@ CACHE FILEPATH "CXX Compiler used for compiling WONTON")
+-
+ # Wonton installation path
+ set(WONTON_ROOT @CMAKE_INSTALL_PREFIX@ CACHE PATH "Path to Wonton installation")
+
+@@ -65,6 +61,7 @@
+ endif ()
+
+ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
++ set(SAVED_CMAKE_FIND_PACKAGE_PREFER_CONFIG "${CMAKE_FIND_PACKAGE_PREFER_CONFIG}")
+ set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE) # search for PkgConfig.cmake files first
+ endif ()
+
+@@ -135,6 +132,10 @@
+ # Restore original CMAKE_MODULE_PATH
+ set(CMAKE_MODULE_PATH ${SAVED_CMAKE_MODULE_PATH})
+
++if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
++ set(CMAKE_FIND_PACKAGE_PREFER_CONFIG "${SAVED_CMAKE_FIND_PACKAGE_PREFER_CONFIG}")
++endif ()
++
+ #
+ # Import wonton targets
+ #
diff --git a/var/spack/repos/builtin/packages/wonton/package.py b/var/spack/repos/builtin/packages/wonton/package.py
index 1c3c22cd80..17f8c3fe70 100644
--- a/var/spack/repos/builtin/packages/wonton/package.py
+++ b/var/spack/repos/builtin/packages/wonton/package.py
@@ -76,6 +76,11 @@ class Wonton(CMakePackage):
depends_on("kokkos +openmp", when="+kokkos +openmp")
depends_on("kokkos +cuda", when="+kokkos +cuda")
+ # Wonton-provided CMake config files contain some settings that
+ # can break host codes; these patches fix that
+ patch("fix-cmake-config.patch", when="@1.2.0:1.3.3")
+ patch("fix-cmake-config-r3d.patch", when="@1.3.0:1.3.3")
+
def cmake_args(self):
options = []
if "+mpi" in self.spec: