From 1e41553ee05d9ef9c9cc85e0c0bbd779000578e9 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 11 Oct 2018 10:30:21 +0200 Subject: [PATCH] hdf5_serial - build-script reviewed --- Compiler/hdf5_serial/build | 59 +++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 17 deletions(-) diff --git a/Compiler/hdf5_serial/build b/Compiler/hdf5_serial/build index 937642c..776dba7 100755 --- a/Compiler/hdf5_serial/build +++ b/Compiler/hdf5_serial/build @@ -1,23 +1,48 @@ #!/usr/bin/env modbuild -SOURCE_URL="https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${V_MAJOR}.${V_MINOR}/hdf5-$V/src/hdf5-$V.tar.bz2" - -pbuild::configure() { - test "$(basename "$CPP")" = "pgprepro" && { - CPP=cpp - CXX=g++ - echo "INFO: substituted pgprepro with cpp, and pgc++ with g++!" - } - "${SRC_DIR}"/configure \ - --prefix="${PREFIX}" \ - --enable-shared \ - --enable-cxx \ - --enable-unsupported \ - --enable-threadsafe \ - --with-pic \ - || exit 1 -} +pbuild::set_download_url "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${V_MAJOR}.${V_MINOR}/hdf5-$V/src/hdf5-$V.tar.bz2" pbuild::add_to_group 'Compiler' +pbuild::add_docfiles ACKNOWLEDGMENTS +pbuild::add_docfiles COPYING +pbuild::add_docfiles MANIFEST +pbuild::add_docfiles README.txt + +pbuild::pre_configure() { + pbuild::add_configure_args "--enable-shared" + pbuild::add_configure_args "--enable-cxx" + pbuild::add_configure_args "--enable-unsupported" + pbuild::add_configure_args "--enable-threadsafe" + pbuild::add_configure_args "--with-pic" + case "${COMPILER}" in + clang-macos ) + enable_fortran='no' + # we do not have Fortran in Xcode + ;; + pgi ) + # PGI uses GCC's include files, some object files and + # the STL implementation! + # The PGI C pre-processor is broken and doesn't work + # for HDF5. We use the pre-processor of the underlying + # GCC... + # This is a bit hackish! + # + # The following eval sets GCCDIR! Which is something + # like: + # /opt/psi/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0 + # + eval $(pgcc -show 2>/dev/null | \ + awk '/^GCCDIR[[:space:]]*=/{gsub(/[[:space:]]/,""); print $0}') + pbuild::add_configure_args "CPP=${GCCDIR%%/..*}/cpp" + pbuild::add_configure_args "CFLAGS=-fPIC" + pbuild::add_configure_args "CXXFLAGS=-fPIC" + pbuild::add_configure_args "FCFLAGS=-fPIC" + ;; + esac + if [[ "${enable_fortran}" == 'yes' ]]; then + pbuild::add_configure_args "--enable-fortran" + fi +} + pbuild::make_all