summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorgios Eleftheriou2018-10-04 00:57:17 +0200
committerGeorgios Eleftheriou2018-10-04 00:57:17 +0200
commitae3e1cb83872f4c85aef270a24d290cf88d6b2dc (patch)
tree7cc4454efc1262743e4e4ba86a4e2f43322446ae
parent1943d5acd42e4cd108766512abedb6ed5d3c2d77 (diff)
downloadaur-ae3e1cb83872f4c85aef270a24d290cf88d6b2dc.tar.gz
improvements (such as safer mpi patch, pkgconfig etc)
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD68
-rw-r--r--mpi.patch14
3 files changed, 66 insertions, 26 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 57f0df3fff9d..45260b663625 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,17 @@
pkgbase = hdf5-openmpi-java
pkgdesc = General purpose library and file format for storing scientific data (openmpi version) (full version including its Java Native Interfaces)
pkgver = 1.10.3
- pkgrel = 1
+ pkgrel = 2
url = https://portal.hdfgroup.org/display/support
arch = x86_64
license = custom
+ makedepends = cmake
makedepends = time
- makedepends = gcc-fortran
makedepends = java-environment
- depends = zlib
+ depends = bash
depends = libaec
depends = openmpi
+ depends = java-runtime
provides = hdf5-openmpi
provides = hdf5
provides = hdf5-cpp-fortran
@@ -18,10 +19,11 @@ pkgbase = hdf5-openmpi-java
conflicts = hdf5
conflicts = hdf5-openmpi
replaces = hdf5-fortran-openmpi
+ options = staticlibs
source = https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.3/src/hdf5-1.10.3.tar.bz2
source = mpi.patch
md5sums = 56c5039103c51a40e493b43c504ce982
- md5sums = dfa8dd50b8a7ebb3ad7249c627156cf9
+ md5sums = 63b43e3d4a5bbea4bcecc84874e08913
pkgname = hdf5-openmpi-java
diff --git a/PKGBUILD b/PKGBUILD
index b5c0ecb3753f..410d8a07ff31 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,24 +11,26 @@
_pkgname=hdf5
_mpi=openmpi
pkgname=${_pkgname}-${_mpi}-java
+_prefix=/usr
pkgver=1.10.3
-pkgrel=1
+pkgrel=2
pkgdesc="General purpose library and file format for storing scientific data (${_mpi} version) (full version including its Java Native Interfaces)"
arch=('x86_64')
url="https://portal.hdfgroup.org/display/support"
license=('custom')
-depends=('zlib' 'libaec' "${_mpi}")
-makedepends=('time' 'gcc-fortran' 'java-environment')
+depends=('bash' 'libaec' "${_mpi}" 'java-runtime')
+makedepends=('cmake' 'time' 'java-environment')
+options=('staticlibs')
provides=('hdf5-openmpi' 'hdf5' 'hdf5-cpp-fortran' "hdf5-fortran-${_mpi}")
conflicts=('hdf5' 'hdf5-openmpi')
replaces=("hdf5-fortran-${_mpi}")
source=("https://support.hdfgroup.org/ftp/HDF5/releases/${_pkgname}-${pkgver:0:4}/${_pkgname}-${pkgver}/src/${_pkgname}-${pkgver}.tar.bz2"
'mpi.patch')
md5sums=('56c5039103c51a40e493b43c504ce982'
- 'dfa8dd50b8a7ebb3ad7249c627156cf9')
+ '63b43e3d4a5bbea4bcecc84874e08913')
prepare() {
- [ ! -d build ] && mkdir -p build
+ mkdir -p build
cd "${_pkgname}-${pkgver}"
# FS#33343
@@ -38,6 +40,35 @@ prepare() {
build() {
cd build
+ # Crazy workaround: run CMake to generate pkg-config file
+ RUNPARALLEL="mpirun" \
+ OMPI_MCA_disable_memory_allocator=1 \
+ JAVADOC='javadoc -Xdoclint:none' \
+ cmake ../${_pkgname}-${pkgver} \
+ -DCMAKE_CXX_COMPILER=mpicxx \
+ -DCMAKE_C_COMPILER=mpicc \
+ -DCMAKE_Fortran_COMPILER=mpif90 \
+ -DCMAKE_C_FLAGS="${CPPFLAGS} ${CFLAGS}" \
+ -DCMAKE_CXX_FLAGS="${CPPFLAGS} ${CXXFLAGS}" \
+ -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
+ -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \
+ -DCMAKE_MODULE_LINKER_FLAGS="${LDFLAGS}" \
+ -DCMAKE_INSTALL_RPATH="" \
+ -DBUILD_SHARED_LIBS=ON \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX="${_prefix}" \
+ -DALLOW_UNSUPPORTED=ON \
+ -DHDF5_BUILD_HL_LIB=ON \
+ -DHDF5_BUILD_CPP_LIB=ON \
+ -DHDF5_BUILD_FORTRAN=ON \
+ -DHDF5_BUILD_JAVA=ON \
+ -DHDF5_ENABLE_Z_LIB_SUPPORT=ON \
+ -DHDF5_ENABLE_SZIP_SUPPORT=ON \
+ -DHDF5_ENABLE_SZIP_ENCODING=ON \
+ -DHDF5_ENABLE_PARALLEL=ON \
+ -DBUILD_TESTING=OFF
+
+ # But don’t build with it, it’s quite broken
"${srcdir}/${_pkgname}-${pkgver}"/configure \
CXX="mpicxx" \
CC="mpicc" \
@@ -46,8 +77,9 @@ build() {
RUNPARALLEL="mpirun" \
OMPI_MCA_disable_memory_allocator=1 \
JAVADOC='javadoc -Xdoclint:none' \
- --prefix=/usr \
- --disable-static \
+ --prefix="${_prefix}" \
+ --docdir="${_prefix}/share/doc/${_pkgname}" \
+ --enable-static \
--disable-sharedlib-rpath \
--enable-build-mode=production \
--enable-hl \
@@ -63,21 +95,21 @@ build() {
make
}
-check() {
+package() {
cd build
- # This is a parallel build, there will always be some MPI bugs,
- # so skip failures and don't kill the entire packaging process
- make check || warning "Some tests failed"
-}
+ make DESTDIR="${pkgdir}" install
-package() {
- cd build
+ # Remove leftover test files
+ rm "${pkgdir}${_prefix}"/include/tst{ds,image,lite,table}{,_tests}.mod
- make -j1 DESTDIR="${pkgdir}" install
+ # Move examples to a proper place
+ install -dm755 "${pkgdir}${_prefix}/share/doc/${_pkgname}"
+ mv "${pkgdir}${_prefix}"/share/{hdf5_examples,doc/${_pkgname}/examples}
- install -dm755 "${pkgdir}/usr/share/doc/${_pkgname}"
- mv "${pkgdir}"/usr/share/{hdf5_examples,doc/${_pkgname}/examples}
+ install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/COPYING" \
+ "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
- install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/COPYING" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
+ install -Dm644 CMakeFiles/hdf5{,_hl}{,_cpp}-${pkgver}.pc \
+ -t "${pkgdir}${_prefix}"/lib/pkgconfig
}
diff --git a/mpi.patch b/mpi.patch
index 4fadc13e26ab..e435f9be3ff5 100644
--- a/mpi.patch
+++ b/mpi.patch
@@ -6,13 +6,19 @@ https://bugs.archlinux.org/task/33343
--- a/src/H5public.h
+++ b/src/H5public.h
-@@ -58,6 +58,8 @@
+@@ -57,6 +57,15 @@
# include <stddef.h>
#endif
#ifdef H5_HAVE_PARALLEL
-+# define OMPI_SKIP_MPICXX /* Make sure that cxx specific headers are not included */
-+# define MPICH_SKIP_MPICXX
++# ifndef OMPI_SKIP_MPICXX
++# define OMPI_SKIP_MPICXX
++# endif
++# ifndef MPICH_IGNORE_CXX_SEEK
++# define MPICH_IGNORE_CXX_SEEK
++# endif
++# ifndef MPICH_SKIP_MPICXX
++# define MPICH_SKIP_MPICXX
++# endif
# include <mpi.h>
#ifndef MPI_FILE_NULL /*MPIO may be defined in mpi.h already */
# include <mpio.h>
-