diff --git a/mingw-w64-hypre/0001-fix-win32-check.patch b/mingw-w64-hypre/0001-fix-win32-check.patch new file mode 100644 index 0000000000..976907e18d --- /dev/null +++ b/mingw-w64-hypre/0001-fix-win32-check.patch @@ -0,0 +1,42 @@ +From d35d5af4a10f189df3df2ae44aa6042add660216 Mon Sep 17 00:00:00 2001 +From: Biswapriyo Nath +Date: Sat, 12 Feb 2022 08:28:29 +0530 +Subject: [PATCH] Fix checking Windows platform with preprocessor + +Check _WIN32 instead of _MSC_VER because the later one is for MSVC only. +Also __MINGW64__ is defined for 64 bit only. So, chekcing _WIN32 includes +all cases. This fixes building with 32 bit mingw-w64 toolchain. +--- + src/utilities/_hypre_utilities.h | 2 +- + src/utilities/hopscotch_hash.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/utilities/_hypre_utilities.h b/src/utilities/_hypre_utilities.h +index 5b07583..37a2dff 100644 +--- a/src/utilities/_hypre_utilities.h ++++ b/src/utilities/_hypre_utilities.h +@@ -1947,7 +1947,7 @@ static inline HYPRE_Int + first_lsb_bit_indx( hypre_uint x ) + { + HYPRE_Int pos; +-#if defined(_MSC_VER) || defined(__MINGW64__) ++#ifdef _WIN32 + if (x == 0) + { + pos = 0; +diff --git a/src/utilities/hopscotch_hash.h b/src/utilities/hopscotch_hash.h +index 7ad3888..28f7c3a 100644 +--- a/src/utilities/hopscotch_hash.h ++++ b/src/utilities/hopscotch_hash.h +@@ -133,7 +133,7 @@ static inline HYPRE_Int + first_lsb_bit_indx( hypre_uint x ) + { + HYPRE_Int pos; +-#if defined(_MSC_VER) || defined(__MINGW64__) ++#ifdef _WIN32 + if (x == 0) + { + pos = 0; +-- +2.35.1 + diff --git a/mingw-w64-hypre/PKGBUILD b/mingw-w64-hypre/PKGBUILD index b2addaac26..bb41fd9cfe 100644 --- a/mingw-w64-hypre/PKGBUILD +++ b/mingw-w64-hypre/PKGBUILD @@ -3,23 +3,33 @@ _realname=hypre pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") -pkgver=2.23.0 +pkgver=2.24.0 pkgrel=1 pkgdesc='A library for solving large, sparse linear systems on massively parallel computers (mingw-w64)' arch=('any') -mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32') depends=("${MINGW_PACKAGE_PREFIX}-openblas" "${MINGW_PACKAGE_PREFIX}-superlu" "${MINGW_PACKAGE_PREFIX}-superlu_dist" "${MINGW_PACKAGE_PREFIX}-msmpi" - "${MINGW_PACKAGE_PREFIX}-openmp") + "${MINGW_PACKAGE_PREFIX}-openmp" + "${MINGW_PACKAGE_PREFIX}-lapack") makedepends=("${MINGW_PACKAGE_PREFIX}-ninja" "${MINGW_PACKAGE_PREFIX}-cmake" "${MINGW_PACKAGE_PREFIX}-cc") license=('LGPL') -url="https://github.com/hypre-space/hypre" -source=("https://github.com/hypre-space/hypre/archive/refs/tags/v${pkgver}.tar.gz") -sha256sums=('8A9F9FB6F65531B77E4C319BF35BFC9D34BF529C36AFE08837F56B635AC052E2') +url="www.llnl.gov/casc/hypre/" +source=("${_realname}-${pkgver}.tar.gz::https://github.com/hypre-space/hypre/archive/refs/tags/v${pkgver}.tar.gz" + "0001-fix-win32-check.patch") +sha256sums=('f480e61fc25bf533fc201fdf79ec440be79bb8117650627d1f25151e8be2fdb5' + '9402d6d7115dc5e9f65209281c6783d973fe7fdc184963a9b346686023737ba1') + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + + # https://github.com/hypre-space/hypre/pull/578 + patch -p1 -i "${srcdir}/0001-fix-win32-check.patch" +} build() { #Static Build @@ -63,14 +73,20 @@ build() { package() { #Static Install cd "${srcdir}/build-${MINGW_CHOST}-static" - DESTDIR=${pkgdir} cmake --build . --target install + DESTDIR="${pkgdir}" cmake --install ./ #Shared Install cd "${srcdir}/build-${MINGW_CHOST}-shared" - DESTDIR=${pkgdir} cmake --build . --target install - install -Dm644 ${srcdir}/${_realname}-${pkgver}/COPYRIGHT ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE - - #Fix: The DLL gets installed to ../lib/libHYPRE.dll instead of ../bin/libHYPRE.dll - mkdir -p ${pkgdir}${MINGW_PREFIX}/bin - mv ${pkgdir}${MINGW_PREFIX}/lib/*.dll ${pkgdir}${MINGW_PREFIX}/bin + DESTDIR="${pkgdir}" cmake --install ./ + + # Remove path reference in cmake files + local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) + for _f in "${pkgdir}${MINGW_PREFIX}"/lib/cmake/HYPRE/*.cmake; do + sed -e "s|${PREFIX_WIN}|\$\{_IMPORT_PREFIX\}|g" -i ${_f} + sed -e "s|${MINGW_PREFIX}|\$\{_IMPORT_PREFIX\}|g" -i ${_f} + done + + install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYRIGHT" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYRIGHT" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE-APACHE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE-APACHE" + install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE-MIT" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE-MIT" }