Files
MX_Pmodule/Compiler/hdf5_serial/build
Achim Gsell 2a3a99fb16 hdf5_serial: enable Fortran bindings
Fortran was not enabled by accident!
2019-03-11 11:33:56 +01:00

50 lines
1.7 KiB
Plaintext
Executable File

#!/usr/bin/env modbuild
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::install_docfiles ACKNOWLEDGMENTS
pbuild::install_docfiles COPYING
pbuild::install_docfiles MANIFEST
pbuild::install_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 )
# we do not have Fortran in Xcode
pbuild::add_configure_args "--disable-fortran"
pbuild::add_configure_args "--disable-fortran2003"
;;
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"
pbuild::add_configure_args "--enable-fortran"
pbuild::add_configure_args "--enable-fortran2003"
;;
* )
pbuild::add_configure_args "--enable-fortran"
pbuild::add_configure_args "--enable-fortran2003"
esac
}