Skip to content

Commit

Permalink
trilinos: enable more packages
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Sep 12, 2024
1 parent 590415a commit 011dd10
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 35 deletions.
42 changes: 42 additions & 0 deletions mingw-w64-trilinos/0001-link-mpi.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff -urN Trilinos-trilinos-release-16-0-0/packages/adelus/src/CMakeLists.txt.orig Trilinos-trilinos-release-16-0-0/packages/adelus/src/CMakeLists.txt
--- Trilinos-trilinos-release-16-0-0/packages/adelus/src/CMakeLists.txt.orig 2024-07-22 21:31:42.000000000 +0200
+++ Trilinos-trilinos-release-16-0-0/packages/adelus/src/CMakeLists.txt 2024-09-12 18:23:54.236799900 +0200
@@ -119,6 +119,9 @@
HEADERS ${HEADERS}
SOURCES ${SOURCES}
)
+ IF(TPL_ENABLE_MPI)
+ target_link_libraries(zadelus PRIVATE MPI::MPI_CXX)
+ ENDIF()

ELSEIF(Adelus_ENABLE_SCPLX)
MESSAGE(" Building the S Complex library")
@@ -139,6 +142,9 @@
HEADERS ${HEADERS}
SOURCES ${SOURCES}
)
+ IF(TPL_ENABLE_MPI)
+ target_link_libraries(cadelus PRIVATE MPI::MPI_CXX)
+ ENDIF()

ELSEIF(Adelus_ENABLE_SREAL)
MESSAGE(" Building the single precision library")
@@ -159,6 +165,9 @@
HEADERS ${HEADERS}
SOURCES ${SOURCES}
)
+ IF(TPL_ENABLE_MPI)
+ target_link_libraries(sadelus PRIVATE MPI::MPI_CXX)
+ ENDIF()

ELSEIF(Adelus_ENABLE_DREAL)
MESSAGE(" Building the double precision library")
@@ -179,5 +188,8 @@
HEADERS ${HEADERS}
SOURCES ${SOURCES}
)
+ IF(TPL_ENABLE_MPI)
+ target_link_libraries(dadelus PRIVATE MPI::MPI_CXX)
+ ENDIF()

ENDIF()
15 changes: 15 additions & 0 deletions mingw-w64-trilinos/0002-stokhos-nox-condition.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff -urN Trilinos-trilinos-release-16-0-0/packages/stokhos/src/CMakeLists.txt.orig Trilinos-trilinos-release-16-0-0/packages/stokhos/src/CMakeLists.txt
--- Trilinos-trilinos-release-16-0-0/packages/stokhos/src/CMakeLists.txt.orig 2024-07-22 21:31:42.000000000 +0200
+++ Trilinos-trilinos-release-16-0-0/packages/stokhos/src/CMakeLists.txt 2024-09-12 19:43:02.405609700 +0200
@@ -198,6 +198,11 @@
${Stokhos_ENABLE_OpenMP_Default}
)

+IF (NOT (Stokhos_ENABLE_NOX AND NOX_ENABLE_ABSTRACT_IMPLEMENTATION_EPETRA AND
+ NOX_ENABLE_EpetraExt))
+ SET(HAVE_STOKHOS_NOX OFF)
+ENDIF()
+
TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h)

#
83 changes: 48 additions & 35 deletions mingw-w64-trilinos/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=16.0.0
_pkgver=${pkgver//./-}
pkgrel=2
pkgrel=3
pkgdesc='Algorithms for the solution of large-scale scientific problems" (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64')
Expand All @@ -22,40 +22,58 @@ depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-boost"
"${MINGW_PACKAGE_PREFIX}-netcdf"
"${MINGW_PACKAGE_PREFIX}-matio"
"${MINGW_PACKAGE_PREFIX}-hdf5"
"${MINGW_PACKAGE_PREFIX}-msmpi")
"${MINGW_PACKAGE_PREFIX}-hdf5")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-fc"
"${MINGW_PACKAGE_PREFIX}-perl"
"${MINGW_PACKAGE_PREFIX}-bc"
"${MINGW_PACKAGE_PREFIX}-python-numpy"
"${MINGW_PACKAGE_PREFIX}-msmpi"
"unzip")
optdepends=("${MINGW_PACKAGE_PREFIX}-seacas")
source=("https://github.com/${_realname}/Trilinos/archive/${_realname}-release-${_pkgver}.tar.gz")
sha256sums=('46bfc40419ed2aa2db38c144fb8e61d4aa8170eaa654a88d833ba6b92903f309')
source=("https://github.com/${_realname}/Trilinos/archive/${_realname}-release-${_pkgver}.tar.gz"
"0001-link-mpi.patch"
"0002-stokhos-nox-condition.patch")
sha256sums=('46bfc40419ed2aa2db38c144fb8e61d4aa8170eaa654a88d833ba6b92903f309'
'a8b8cd91a5218458fe6a5bede10002c1d7e1376159c4f7f49bd1f22b5b01954f'
'374970a2069cf91c5712cb5303438cad5c41441dbce98579193658273a6ead55')
noextract=(${_realname}-release-${_pkgver}.tar.gz)

# Helper macros to help make tasks easier #
apply_patch_with_msg() {
for _fname in "$@"
do
msg2 "Applying ${_fname}"
patch -Nbp1 -i "${srcdir}"/${_fname}
done
}

prepare(){
plain "Extract ${_realname}-release-${_pkgver}.tar.gz"
tar -xzf ${_realname}-release-${_pkgver}.tar.gz || true

cd "${srcdir}/Trilinos-${_realname}-release-${_pkgver}"
apply_patch_with_msg \
"0001-link-mpi.patch" \
"0002-stokhos-nox-condition.patch"
}

build() {
_build_trilinos() {
_static_opt=$1

declare -a extra_config
if check_option "debug" "n"; then
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi

#Static Build
mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static"

MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-GNinja \
${_static_opt} \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${extra_config[@]}" \
-DBLAS_LIBRARY_NAMES="openblas" \
Expand All @@ -64,50 +82,45 @@ build() {
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=ON \
-DTrilinos_ENABLE_ALL_PACKAGES=ON \
-DTPL_ENABLE_DLlib=OFF \
-DTPL_ENABLE_MPI=ON \
-DMPI_LIBRARY_NAMES=$(pkg-config --libs msmpi) \
-DTrilinos_ENABLE_Xpetra=OFF \
-DTrilinos_ENABLE_Epetra=ON \
-DTrilinos_ENABLE_EpetraExt=ON \
-DTrilinos_ENABLE_Intrepid2=OFF \
-DTrilinos_ENABLE_SEACAS=OFF \
-DTrilinos_ENABLE_Ifpack=ON \
-DTrilinos_ENABLE_ML=ON \
-DTrilinos_ENABLE_AztecOO=ON \
-DCMAKE_Fortran_FLAGS="$FCFLAGS -fallow-argument-mismatch" \
../Trilinos-${_realname}-release-${_pkgver}

${MINGW_PREFIX}/bin/cmake --build .

#Shared Build
}

build() {
# Static Build
mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static"

_build_trilinos "-DBUILD_SHARED_LIBS=OFF"

# Shared Build
mkdir -p "${srcdir}/build-${MSYSTEM}-shared" && cd "${srcdir}/build-${MSYSTEM}-shared"

MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${extra_config[@]}" \
-DBUILD_SHARED_LIBS=ON \
-DBLAS_LIBRARY_NAMES="openblas" \
-DLAPACK_LIBRARY_NAMES="openblas" \
-DTrilinos_ENABLE_Fortran=$([[ ${MINGW_PACKAGE_PREFIX} != *-clang-* ]] && echo "ON" || echo "OFF") \
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=ON \
-DTrilinos_ENABLE_ALL_PACKAGES=ON \
-DTPL_ENABLE_DLlib=OFF \
-DTrilinos_ENABLE_Xpetra=OFF \
-DTrilinos_ENABLE_Epetra=ON \
-DTrilinos_ENABLE_Intrepid2=OFF \
-DTrilinos_ENABLE_SEACAS=OFF \
-DCMAKE_Fortran_FLAGS="$FCFLAGS -fallow-argument-mismatch" \
../Trilinos-${_realname}-release-${_pkgver}

${MINGW_PREFIX}/bin/cmake --build .
_build_trilinos "-DBUILD_SHARED_LIBS=ON"
}

package() {
#Static Install
# Static Install
cd "${srcdir}/build-${MSYSTEM}-static"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install .

#Shared Install
# Shared Install
cd "${srcdir}/build-${MSYSTEM}-shared"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install .

install -Dm644 "${srcdir}"/Trilinos-${_realname}-release-${_pkgver}/LICENSE "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE

# Remove conflict with seacas package
#rm -r "${pkgdir}"${MINGW_PREFIX}/lib/external_packages/DLlib
# rm -r "${pkgdir}"${MINGW_PREFIX}/lib/external_packages/DLlib
}

0 comments on commit 011dd10

Please sign in to comment.