summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Huebl <axel.huebl@plasma.ninja>2022-06-01 17:49:25 -0700
committerGitHub <noreply@github.com>2022-06-01 18:49:25 -0600
commitadef8f6ca7ab03aea65e84e9f7c64383c702a2b6 (patch)
treec3c071bdd292d500f4dba142bbb55890756635d7
parentc36f15e29eff5d1f9cb6f7932a0edd7c420bf9e9 (diff)
downloadspack-adef8f6ca7ab03aea65e84e9f7c64383c702a2b6.tar.gz
spack-adef8f6ca7ab03aea65e84e9f7c64383c702a2b6.tar.bz2
spack-adef8f6ca7ab03aea65e84e9f7c64383c702a2b6.tar.xz
spack-adef8f6ca7ab03aea65e84e9f7c64383c702a2b6.zip
WarpX: Patch no-MPI & Lib Install (#30866)
Fixes WarpX issues: - https://github.com/ECP-WarpX/WarpX/pull/3134 - https://github.com/ECP-WarpX/WarpX/pull/3141 and uses GitHub patch URLs directly instead of storing patch copies.
-rw-r--r--var/spack/repos/builtin/packages/warpx/2626.patch34
-rw-r--r--var/spack/repos/builtin/packages/warpx/package.py24
2 files changed, 22 insertions, 36 deletions
diff --git a/var/spack/repos/builtin/packages/warpx/2626.patch b/var/spack/repos/builtin/packages/warpx/2626.patch
deleted file mode 100644
index 699744b89d..0000000000
--- a/var/spack/repos/builtin/packages/warpx/2626.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 9785e706229622626133c4b03c7abd004f62023f Mon Sep 17 00:00:00 2001
-From: Axel Huebl <axel.huebl@plasma.ninja>
-Date: Sat, 4 Dec 2021 15:28:13 -0800
-Subject: [PATCH] Fix: Installed Symlink LIB
-
-The latest patch to these routines broke our library alias in installs.
-
-By default, this variable is relative and needs the prefix appended.
-In some cases, e.g., if externally set, it can already be absolute. In that
-case, we skip adding the prefix.
----
- CMakeLists.txt | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 04092ba962..a549546ab9 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -343,9 +343,14 @@ if(WarpX_LIB)
- else()
- set(mod_ext "so")
- endif()
-+ if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
-+ set(ABS_INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR})
-+ else()
-+ set(ABS_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
-+ endif()
- install(CODE "file(CREATE_LINK
- $<TARGET_FILE_NAME:shared>
-- ${CMAKE_INSTALL_LIBDIR}/libwarpx.${lib_suffix}.${mod_ext}
-+ ${ABS_INSTALL_LIB_DIR}/libwarpx.${lib_suffix}.${mod_ext}
- COPY_ON_ERROR SYMBOLIC)")
- endif()
-
diff --git a/var/spack/repos/builtin/packages/warpx/package.py b/var/spack/repos/builtin/packages/warpx/package.py
index 61853136ce..a53a2f3212 100644
--- a/var/spack/repos/builtin/packages/warpx/package.py
+++ b/var/spack/repos/builtin/packages/warpx/package.py
@@ -132,7 +132,22 @@ class Warpx(CMakePackage):
# The symbolic aliases for our +lib target were missing in the install
# location
# https://github.com/ECP-WarpX/WarpX/pull/2626
- patch('2626.patch', when='@21.12')
+ patch('https://github.com/ECP-WarpX/WarpX/pull/2626.patch?full_index=1',
+ sha256='a431d4664049d6dcb6454166d6a948d8069322a111816ca5ce01553800607544',
+ when='@21.12')
+
+ # Workaround for AMReX<=22.06 no-MPI Gather
+ # https://github.com/ECP-WarpX/WarpX/pull/3134
+ # https://github.com/AMReX-Codes/amrex/pull/2793
+ patch('https://github.com/ECP-WarpX/WarpX/pull/3134.patch?full_index=1',
+ sha256='b786ce64a3c2c2b96ff2e635f0ee48532e4ae7ad9637dbf03f11c0768c290690',
+ when='@22.02:22.05')
+
+ # Forgot to install ABLASTR library
+ # https://github.com/ECP-WarpX/WarpX/pull/3141
+ patch('https://github.com/ECP-WarpX/WarpX/pull/3141.patch?full_index=1',
+ sha256='dab6fb44556ee1fd466a4cb0e20f89bde1ce445c9a51a2c0f59d1740863b5e7d',
+ when='@22.04,22.05')
def cmake_args(self):
spec = self.spec
@@ -168,10 +183,15 @@ class Warpx(CMakePackage):
def libs(self):
libsuffix = {'1': '1d', '2': '2d', '3': '3d', 'rz': 'rz'}
dims = self.spec.variants['dims'].value
- return find_libraries(
+ libs = find_libraries(
['libwarpx.' + libsuffix[dims]], root=self.prefix, recursive=True,
shared=True
)
+ libs += find_libraries(
+ ['libablastr'], root=self.prefix, recursive=True,
+ shared=self.spec.variants['shared']
+ )
+ return libs
# WarpX has many examples to serve as a suitable smoke check. One
# that is typical was chosen here