Skip to content

Commit

Permalink
sundials: use cmake target file of KLU
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Dec 30, 2023
1 parent 93e0595 commit 1dfb64a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
20 changes: 20 additions & 0 deletions mingw-w64-sundials/0004-suitesparse-import-target.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Use CMake target installed by SuiteSparse if available.

diff -urN sundials-6.7.0/cmake/tpl/FindKLU.cmake.orig sundials-6.7.0/cmake/tpl/FindKLU.cmake
--- sundials-6.7.0/cmake/tpl/FindKLU.cmake.orig 2023-12-18 18:26:43.000000000 +0100
+++ sundials-6.7.0/cmake/tpl/FindKLU.cmake 2023-12-30 20:26:08.649091700 +0100
@@ -30,6 +30,14 @@
# KLU_LIBRARIES - all of the libraries needed for KLU
# ---------------------------------------------------------------

+find_package(KLU CONFIG)
+
+if(TARGET SuiteSparse::KLU)
+ set(KLU_FOUND ON)
+ add_library(SUNDIALS::KLU ALIAS SuiteSparse::KLU)
+ return()
+endif()
+
# Set library prefixes for Windows
if(WIN32)
set(CMAKE_FIND_LIBRARY_PREFIXES lib ${CMAKE_FIND_LIBRARY_PREFIXES})
5 changes: 4 additions & 1 deletion mingw-w64-sundials/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _realname=sundials
pkgbase="mingw-w64-${_realname}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=6.7.0
pkgrel=1
pkgrel=2
pkgdesc="SUite of Nonlinear and DIfferential/ALgebraic equation Solvers (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
Expand Down Expand Up @@ -32,11 +32,13 @@ source=(https://github.com/LLNL/sundials/releases/download/v${pkgver}/${_realnam
'0001-hash-size.patch'
'0002-sundials-missing-export.patch'
'0003-sundials-use-default-installdirs.patch'
'0004-suitesparse-import-target.patch'
'0008-sundials-petsc-pkg-config-module.patch')
sha256sums=('5f113a1564a9d2d98ff95249f4871a4c815a05dbb9b8866a82b13ab158c37adb'
'9dd5c708bad0a592a7012c1bdfd91904867cd9efe89412d82706764b21c4537c'
'7f119fbcc8a630a4e3443e3bba252dafb4b1567ced1bf1389052253529e97ddc'
'310b9beb86426fd2f817391baf72c0f9aefe9dc31e737daed5cc0280b7693311'
'753b127af0aa1fbbf03ab67104846f968bd476659cb151d65931b5e5beae3f0d'
'd4a56ef02d87d8d17970733fe8391c12fea9465f093681a1091a24b2ad0a787a')

apply_patch_with_msg() {
Expand All @@ -54,6 +56,7 @@ prepare() {
0001-hash-size.patch \
0002-sundials-missing-export.patch \
0003-sundials-use-default-installdirs.patch \
0004-suitesparse-import-target.patch \
0008-sundials-petsc-pkg-config-module.patch
}

Expand Down

0 comments on commit 1dfb64a

Please sign in to comment.