Skip to content

Commit 226c1af

Browse files
authored
[magma] Use 2.9.0 version, Fix CMake 4.0 policy error (#46801)
1 parent 45261b1 commit 226c1af

File tree

8 files changed

+76
-146
lines changed

8 files changed

+76
-146
lines changed

ports/magma/clang-cuda.patch

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,5 @@
1-
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index eeb0bb0b8f..6a5e0a747a 100644
3-
--- a/CMakeLists.txt
4-
+++ b/CMakeLists.txt
5-
@@ -310,10 +309,17 @@ if (MAGMA_ENABLE_CUDA)
6-
)
7-
else()
8-
# No Position Independent Code on Windows. Compiler will complain if you add that flag.
9-
- target_compile_options(magma_nvcc_flags
10-
- INTERFACE
11-
- $<$<COMPILE_LANGUAGE:CUDA>:--compiler-options;${FORTRAN_CONVENTION}>
12-
- )
13-
+ if(NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
14-
+ target_compile_options(magma_nvcc_flags
15-
+ INTERFACE
16-
+ $<$<COMPILE_LANGUAGE:CUDA>:--compiler-options;${FORTRAN_CONVENTION}>
17-
+ )
18-
+ else()
19-
+ target_compile_options(magma_nvcc_flags
20-
+ INTERFACE
21-
+ $<$<COMPILE_LANGUAGE:CUDA>:${FORTRAN_CONVENTION}>
22-
+ )
23-
+ endif()
24-
endif(COMPILER_SUPPORTS_FPIC)
25-
26-
set(MAGMA_HAVE_CUDA "1")
271
diff --git a/control/magma_internal.h b/control/magma_internal.h
28-
index 2310659235..c4d0eb8f6b 100644
2+
index 7af16a5..0133e44 100644
293
--- a/control/magma_internal.h
304
+++ b/control/magma_internal.h
315
@@ -33,7 +33,7 @@
@@ -37,11 +11,10 @@ index 2310659235..c4d0eb8f6b 100644
3711

3812
#include <float.h>
3913
#define copysign(x,y) _copysign(x,y)
40-
@@ -42,7 +42,9 @@
41-
#define isfinite(x) _finite(x)
14+
@@ -43,6 +43,9 @@
4215
// note _snprintf has slightly different semantics than snprintf
4316
#define snprintf _snprintf
44-
-
17+
4518
+ #elif !defined(__NVCC__)
4619
+ // make sure this actually uses the C version and not the C++ overloads
4720
+ #define copysign(x,y) copysign((double)x,(double)y)

ports/magma/fix-cmake4.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index fc61af7..a3c9606 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -654,7 +654,7 @@ endif()
6+
7+
8+
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${SPARSE_TEST_DIR}" )
9+
-cmake_policy( SET CMP0037 OLD)
10+
+cmake_policy( SET CMP0037 NEW)
11+
foreach( TEST ${sparse_testing_all} )
12+
string( REGEX REPLACE "\\.(cpp|f90|F90)" "" EXE ${TEST} )
13+
string( REGEX REPLACE "${SPARSE_TEST_DIR}/" "" EXE ${EXE} )

ports/magma/fix-min-max.patch

Lines changed: 0 additions & 60 deletions
This file was deleted.

ports/magma/no-tests.patch

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
1-
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index a4f5b35ef3..eeb0bb0b8f 100644
3-
--- a/CMakeLists.txt
4-
+++ b/CMakeLists.txt
5-
@@ -663,7 +670,7 @@ target_link_libraries( lapacktest
6-
7-
# ----------------------------------------
8-
# compile tester library
9-
-add_library( tester ${libtest_all} )
10-
+add_library( tester EXCLUDE_FROM_ALL ${libtest_all} )
11-
target_link_libraries( tester
12-
magma
13-
lapacktest
14-
@@ -726,11 +726,12 @@ foreach( filename ${testing_all} )
15-
list( APPEND testing_all_cpp ${filename} )
16-
endif()
17-
endforeach()
18-
+set(testing_all_cpp "")
19-
foreach( TEST ${testing_all_cpp} )
20-
string( REGEX REPLACE "\\.(cpp|f90|F90)" "" EXE ${TEST} )
21-
string( REGEX REPLACE "testing/" "" EXE ${EXE} )
22-
#message( "${TEST} --> ${EXE}" )
23-
- add_executable( ${EXE} ${TEST} )
24-
+ add_executable( ${EXE} EXCLUDE_FROM_ALL ${TEST} )
25-
target_link_libraries( ${EXE} tester lapacktest magma )
26-
list( APPEND testing ${EXE} )
27-
endforeach()
28-
@@ -749,6 +750,7 @@ endif()
29-
30-
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${SPARSE_TEST_DIR}" )
31-
cmake_policy( SET CMP0037 OLD)
32-
+set(sparse_testing_all "")
33-
foreach( TEST ${sparse_testing_all} )
34-
string( REGEX REPLACE "\\.(cpp|f90|F90)" "" EXE ${TEST} )
35-
string( REGEX REPLACE "${SPARSE_TEST_DIR}/" "" EXE ${EXE} )
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index a3c9606..a783c57 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -569,6 +569,7 @@ target_link_libraries( lapacktest
6+
7+
# ----------------------------------------
8+
# compile tester library
9+
+if(FALSE)
10+
add_library( tester ${libtest_all} )
11+
target_link_libraries( tester
12+
magma
13+
@@ -576,8 +577,7 @@ target_link_libraries( tester
14+
${blas_fix}
15+
${LAPACK_LIBRARIES}
16+
)
17+
-
18+
-
19+
+endif()
20+
# ----------------------------------------
21+
# compile MAGMA sparse library
22+
23+
@@ -619,7 +619,7 @@ add_custom_target( sparse-lib DEPENDS magma_sparse )
24+
25+
# ----------------------------------------
26+
# compile each tester
27+
-
28+
+if(FALSE)
29+
# save testers to testing/
30+
# save tester lib files to testing_lib/ to avoid cluttering lib/
31+
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY testing )
32+
@@ -664,7 +664,7 @@ foreach( TEST ${sparse_testing_all} )
33+
list( APPEND sparse-testing ${EXE} )
34+
endforeach()
35+
add_custom_target( sparse-testing DEPENDS ${sparse-testing} )
36+
-
37+
+endif()
38+
39+
# ----------------------------------------
40+
# what to install

ports/magma/portfile.cmake

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,22 @@ if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
88
endif()
99

1010
vcpkg_download_distfile(
11-
dist_file
12-
URLS https://icl.utk.edu/projectsfiles/magma/downloads/magma-${VERSION}.tar.gz
13-
FILENAME magma-${VERSION}.tar.gz
14-
SHA512 4c2d7c472a69f3b0d491410900db1622478476673e4896dcec26060b839918cdf3cfdfb2680ecbb2042335e8bcc11c44244a82d11e15ba93c489ae5c66d7385a
11+
dist_file
12+
URLS https://icl.utk.edu/projectsfiles/magma/downloads/magma-${VERSION}.tar.gz
13+
FILENAME magma-${VERSION}.tar.gz
14+
SHA512 233beb3d2809c12a27a9b7a6a0eb0bec0ade91fa6bf1a63e1ca4d491491ed5a8729996ac8fbf68ab8d678acab6ed56b7728689358a7b76b20b101227a9851c16
1515
)
1616

1717
vcpkg_extract_source_archive(
18-
src_path
19-
ARCHIVE "${dist_file}"
20-
PATCHES
21-
disable-openmp-msvc.patch
22-
no-tests.patch
23-
clang-cuda.patch
24-
fix-min-max.patch
18+
src_path
19+
ARCHIVE "${dist_file}"
20+
PATCHES
21+
disable-openmp-msvc.patch
22+
no-tests.patch
23+
clang-cuda.patch
24+
fix-cmake4.patch
2525
)
2626

27-
28-
2927
vcpkg_find_cuda(OUT_CUDA_TOOLKIT_ROOT cuda_toolkit_root)
3028

3129
vcpkg_cmake_configure(
@@ -38,10 +36,7 @@ vcpkg_cmake_configure(
3836
"-DCUDAToolkit_ROOT=${cuda_toolkit_root}"
3937
${opts}
4038
)
41-
42-
4339
vcpkg_cmake_install()
44-
4540
vcpkg_fixup_pkgconfig()
4641

4742
file(READ "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/magma.pc" contents)

ports/magma/vcpkg.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"name": "magma",
3-
"version": "2.8.0",
4-
"port-version": 2,
3+
"version": "2.9.0",
54
"description": "Matrix Algebra on GPU and Multi-core Architectures (MAGMA) is a collection of next-generation linear algebra libraries for heterogeneous computing",
65
"homepage": "https://icl.utk.edu/magma/",
7-
"license": null,
6+
"license": "BSD-3-Clause",
87
"dependencies": [
98
"blas",
109
"cuda",

versions/baseline.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6037,8 +6037,8 @@
60376037
"port-version": 3
60386038
},
60396039
"magma": {
6040-
"baseline": "2.8.0",
6041-
"port-version": 2
6040+
"baseline": "2.9.0",
6041+
"port-version": 0
60426042
},
60436043
"magnum": {
60446044
"baseline": "2020.06",

versions/m-/magma.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "6a0f963b2fe86970d2db449084da3dc8f360151c",
5+
"version": "2.9.0",
6+
"port-version": 0
7+
},
38
{
49
"git-tree": "a54067bca358c87d6517a37b8360264e58097dc5",
510
"version": "2.8.0",

0 commit comments

Comments
 (0)