Skip to content

Commit e343b2a

Browse files
committed
SUNDAILS commit hash is broken on released spack-packages
1 parent 854e9ea commit e343b2a

10 files changed

+1182
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
From 5466501b51cc329aeea234f562aa85bedf870321 Mon Sep 17 00:00:00 2001
2+
From: "Cody J. Balos" <[email protected]>
3+
Date: Mon, 8 Mar 2021 13:28:11 -0800
4+
Subject: [PATCH] add missing README to examples/cvode/hip
5+
6+
---
7+
examples/cvode/hip/README | 3 +++
8+
1 file changed, 3 insertions(+)
9+
create mode 100644 examples/cvode/hip/README
10+
11+
diff --git a/examples/cvode/hip/README b/examples/cvode/hip/README
12+
new file mode 100644
13+
index 000000000..8480fbf7d
14+
--- /dev/null
15+
+++ b/examples/cvode/hip/README
16+
@@ -0,0 +1,3 @@
17+
+List of Hip CVODE examples
18+
+
19+
+ cvAdvDiff_kry_hip : 2-D advection-diffusion (nonstiff)
20+
--
21+
2.29.1
22+
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
From 0e197ce186ffae8213c297786811401861d249c1 Mon Sep 17 00:00:00 2001
2+
From: "Cody J. Balos" <[email protected]>
3+
Date: Wed, 4 Nov 2020 10:43:36 -0800
4+
Subject: [PATCH 1/2] fix expansion of generator expression
5+
6+
---
7+
src/sunlinsol/superludist/CMakeLists.txt | 2 +-
8+
src/sunmatrix/slunrloc/CMakeLists.txt | 2 +-
9+
2 files changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/src/sunlinsol/superludist/CMakeLists.txt b/src/sunlinsol/superludist/CMakeLists.txt
12+
index ac1ece36c..5b59d6bfd 100644
13+
--- a/src/sunlinsol/superludist/CMakeLists.txt
14+
+++ b/src/sunlinsol/superludist/CMakeLists.txt
15+
@@ -32,7 +32,7 @@ sundials_add_library(sundials_sunlinsolsuperludist
16+
sundials_generic_obj
17+
LINK_LIBRARIES
18+
PUBLIC sundials_sunmatrixslunrloc SUNDIALS::SUPERLUDIST
19+
- $<IF:$<BOOL:SUPERLUDIST_OpenMP>,OpenMP::OpenMP_C,>
20+
+ $<IF:$<BOOL:${SUPERLUDIST_OpenMP}>,OpenMP::OpenMP_C,>
21+
COMPILE_OPTIONS
22+
PRIVATE ${_compile_options}
23+
OUTPUT_NAME
24+
diff --git a/src/sunmatrix/slunrloc/CMakeLists.txt b/src/sunmatrix/slunrloc/CMakeLists.txt
25+
index 25ee00dd3..7713435d9 100644
26+
--- a/src/sunmatrix/slunrloc/CMakeLists.txt
27+
+++ b/src/sunmatrix/slunrloc/CMakeLists.txt
28+
@@ -34,7 +34,7 @@ sundials_add_library(sundials_sunmatrixslunrloc
29+
sundials_generic_obj
30+
LINK_LIBRARIES
31+
PUBLIC SUNDIALS::SUPERLUDIST
32+
- $<IF:$<BOOL:SUPERLUDIST_OpenMP>,OpenMP::OpenMP_C,>
33+
+ $<IF:$<BOOL:${SUPERLUDIST_OpenMP}>,OpenMP::OpenMP_C,>
34+
COMPILE_OPTIONS
35+
PRIVATE ${_compile_options}
36+
OUTPUT_NAME
37+
--
38+
2.29.1
39+
40+
41+
From 09cd3ab587f8999d068946d8be180da0a3c6ad32 Mon Sep 17 00:00:00 2001
42+
From: "Cody J. Balos" <[email protected]>
43+
Date: Tue, 3 Nov 2020 11:43:58 -0800
44+
Subject: [PATCH 2/2] dont use NULL in ltest for Hypre
45+
46+
---
47+
cmake/tpl/SundialsHypre.cmake | 7 +++----
48+
1 file changed, 3 insertions(+), 4 deletions(-)
49+
50+
diff --git a/cmake/tpl/SundialsHypre.cmake b/cmake/tpl/SundialsHypre.cmake
51+
index 9633f1c11..19d4bf201 100644
52+
--- a/cmake/tpl/SundialsHypre.cmake
53+
+++ b/cmake/tpl/SundialsHypre.cmake
54+
@@ -78,15 +78,14 @@ if(HYPRE_FOUND AND (NOT HYPRE_WORKS))
55+
"ADD_EXECUTABLE(ltest ltest.c)\n"
56+
"TARGET_LINK_LIBRARIES(ltest ${HYPRE_LIBRARIES})\n")
57+
58+
- # Create a C source file which calls a hypre function
59+
file(WRITE ${HYPRE_TEST_DIR}/ltest.c
60+
"\#include \"HYPRE_parcsr_ls.h\"\n"
61+
"int main(){\n"
62+
"HYPRE_ParVector par_b;\n"
63+
"HYPRE_IJVector b;\n"
64+
- "par_b = NULL;\n"
65+
- "b = NULL;\n"
66+
- "if (par_b != NULL || b != NULL) return(1);\n"
67+
+ "par_b = 0;\n"
68+
+ "b = 0;\n"
69+
+ "if (par_b != 0 || b != 0) return(1);\n"
70+
"else return(0);\n"
71+
"}\n")
72+
73+
--
74+
2.29.1
75+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From d4afbed86fc4f9925e55367267b3796a522ba5d5 Mon Sep 17 00:00:00 2001
2+
From: Renjith Ravindran <[email protected]>
3+
Date: Sun, 14 Jan 2024 10:20:21 +0000
4+
Subject: [PATCH] Change HIP_PLATFORM from HCC to AMD and NVCC to NVIDIA
5+
6+
---
7+
include/sundials/sundials_hip_policies.hpp | 4 ++--
8+
1 file changed, 2 insertions(+), 2 deletions(-)
9+
10+
diff --git a/include/sundials/sundials_hip_policies.hpp b/include/sundials/sundials_hip_policies.hpp
11+
index d759bbc..f6dfe41 100644
12+
--- a/include/sundials/sundials_hip_policies.hpp
13+
+++ b/include/sundials/sundials_hip_policies.hpp
14+
@@ -30,9 +30,9 @@ namespace sundials
15+
namespace hip
16+
{
17+
18+
-#if defined(__HIP_PLATFORM_HCC__)
19+
+#if defined(__HIP_PLATFORM_AMD__)
20+
constexpr const sunindextype WARP_SIZE = 64;
21+
-#elif defined(__HIP_PLATFORM_NVCC__)
22+
+#elif defined(__HIP_PLATFORM_NVIDIA__)
23+
constexpr const sunindextype WARP_SIZE = 32;
24+
#endif
25+
constexpr const sunindextype MAX_BLOCK_SIZE = 1024;
26+
--
27+
2.39.3
28+
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
diff --git a/config/FindPackageMultipass.cmake b/config/FindPackageMultipass.cmake
2+
index 128eee9..847c246 100644
3+
--- a/config/FindPackageMultipass.cmake
4+
+++ b/config/FindPackageMultipass.cmake
5+
@@ -138,7 +138,10 @@ macro (MULTIPASS_SOURCE_RUNS includes libraries source runs language)
6+
math (EXPR _tmp "${MULTIPASS_TEST_COUNT} + 1") # Why can't I add to a cache variable?
7+
set (MULTIPASS_TEST_COUNT ${_tmp} CACHE INTERNAL "Unique test ID")
8+
set (testname MULTIPASS_TEST_${MULTIPASS_TEST_COUNT}_${runs})
9+
- set (testdir ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp)
10+
+ set (testdir ${PROJECT_BINARY_DIR}/PETSC_test)
11+
+ if (NOT EXISTS ${testdir})
12+
+ file(MAKE_DIRECTORY ${testdir})
13+
+ endif ()
14+
set (CMAKE_REQUIRED_INCLUDES ${includes})
15+
set (CMAKE_REQUIRED_LIBRARIES ${libraries})
16+
# if MPI is available, use it for the test
17+
@@ -148,24 +151,38 @@ macro (MULTIPASS_SOURCE_RUNS includes libraries source runs language)
18+
set (REQUIRED_COMPILER ${CMAKE_${language}_COMPILER})
19+
endif ()
20+
if(${language} STREQUAL "C")
21+
- file(WRITE ${testdir}/src.c "${source}")
22+
- try_run(${testname} _compiles ${testdir} ${testdir}/src.c
23+
- CMAKE_FLAGS -DCMAKE_C_COMPILER=${REQUIRED_COMPILER} -DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}
24+
- LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
25+
- elseif(${language} STREQUAL "CXX")
26+
- file(WRITE ${testdir}/src.cxx "${source}")
27+
- try_run(${testname} _compiles ${testdir} ${testdir}/src.cxx
28+
- CMAKE_FLAGS -DCMAKE_CXX_COMPILER=${REQUIRED_COMPILER} -DINCLUDE_DIRECTORIES=${CMAKE_REQUIRED_INCLUDES}
29+
- LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
30+
- endif()
31+
- # ${testname} is the exit code returned by try_run,
32+
- # so 0 is success and anything else is a failure.
33+
- if (${testname})
34+
- set (${runs} FALSE)
35+
+ set (extension c)
36+
else ()
37+
+ set (extension cxx)
38+
+ endif ()
39+
+ # Create simple test code
40+
+ file(WRITE ${testdir}/src.${extension} "${source}")
41+
+ # Create a CMakeLists.txt file for the test code
42+
+ file(WRITE ${testdir}/CMakeLists.txt
43+
+ "cmake_minimum_required(VERSION 3.5)\n"
44+
+ "project(ctest ${language})\n"
45+
+ "set(CMAKE_VERBOSE_MAKEFILE ON)\n"
46+
+ "set(CMAKE_${language}_COMPILER \"${REQUIRED_COMPILER}\")\n"
47+
+ "set(CMAKE_${language}_FLAGS \"${CMAKE_${language}_FLAGS}\")\n"
48+
+ "include_directories(${CMAKE_REQUIRED_INCLUDES})\n"
49+
+ "add_executable(ctest src.${extension})\n"
50+
+ "target_link_libraries(ctest ${CMAKE_REQUIRED_LIBRARIES})\n")
51+
+ # Attempt to compile the test code
52+
+ try_compile(${testname} ${testdir} ${testdir} ctest
53+
+ OUTPUT_VARIABLE _output)
54+
+ # Write output compiling the test code
55+
+ file(WRITE ${testdir}/src.out "${_output}")
56+
+ # To ensure we do not use stuff from the previous attempts,
57+
+ # we must remove the CMakeFiles directory.
58+
+ file(REMOVE_RECURSE ${testdir}/CMakeFiles)
59+
+ # Process test result
60+
+ if (${testname})
61+
set (${runs} TRUE)
62+
+ else ()
63+
+ set (${runs} FALSE)
64+
endif ()
65+
unset (_compiles)
66+
+ unset (_output)
67+
endmacro (MULTIPASS_SOURCE_RUNS)
68+
69+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
diff -ruN spack-src/examples/nvector/CMakeLists.txt spack-src-patched/examples/nvector/CMakeLists.txt
2+
--- spack-src/examples/nvector/CMakeLists.txt 2022-04-22 16:55:14.000000000 +0000
3+
+++ spack-src-patched/examples/nvector/CMakeLists.txt 2022-08-03 16:34:47.789320825 +0000
4+
@@ -25,6 +25,10 @@
5+
6+
# Build the nvector test utilities
7+
add_library(test_nvector_obj OBJECT test_nvector.c)
8+
+if(BUILD_SHARED_LIBS)
9+
+ # need PIC when shared libs are used since the example executables will link to the shared lib
10+
+ set_property(TARGET test_nvector_obj PROPERTY POSITION_INDEPENDENT_CODE TRUE)
11+
+endif()
12+
target_link_libraries(test_nvector_obj PRIVATE sundials_nvecserial)
13+
14+
if(ENABLE_MPI AND MPI_C_FOUND)
15+
@@ -33,6 +37,9 @@
16+
add_subdirectory(mpiplusx)
17+
# Build the mpi nvector test utilities
18+
add_library(test_nvectormpi_obj OBJECT test_mpinvector.c)
19+
+ if(BUILD_SHARED_LIBS)
20+
+ set_property(TARGET test_nvectormpi_obj PROPERTY POSITION_INDEPENDENT_CODE TRUE)
21+
+ endif()
22+
target_link_libraries(test_nvectormpi_obj PRIVATE MPI::MPI_C sundials_nvecparallel)
23+
endif()
24+
add_subdirectory(manyvector)

0 commit comments

Comments
 (0)