Commit 01ff5d65 authored by gsell's avatar gsell

mojor review

- namespace prefix OTB_ added to most variables
- update to current versions
- exit with well defined codes on error
- compile Boost with -fPIC
- several configuration files added
- CMake script added which can be used to make the toolchain relocatable
- installation of profiles 'opal.sh' and 'otb_setup.sh'
- improved setup.sh
parent 667ca723
#!/bin/bash
#
# OPAL Toolchain Build recipe to build the GNU Multiple Precision.
# Arithmetic Library.
#
# https://gmplib.org
#
P=gmp
V=${GMP_VERSION:-6.2.0}
trap "otb_exit" EXIT
if [[ -n "${TOOLSET}" ]] && [[ "${TOOLSET}" != "gcc" ]]; then
echo "TOOLSET is set to '${TOOLSET}' - skipping compilation of gmp" 1>&2
if [[ -n "${OTB_TOOLSET}" ]] && [[ "${OTB_TOOLSET}" != "gcc" ]]; then
echo "TOOLSET is set to '${OTB_TOOLSET}' - skipping compilation of gmp" 1>&2
exit 0
fi
# recipe for:
P=gmp
V=${GMP_VERSION:-6.1.2}
FNAME="$P-$V.tar.bz2"
DOWNLOAD_URL="https://gmplib.org/download/$P/${FNAME}"
SRC_FILE="${DOWNLOADS_DIR}/${FNAME}"
SRC_FILE="${OTB_DOWNLOAD_DIR}/${FNAME}"
# download
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}"
test -r "${SRC_FILE}" || \
curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${OTB_ERR_DOWNLOAD}
# unpack
mkdir -p "${SRC_DIR}/$P" && cd "$_"
tar xvf "${SRC_FILE}"
mkdir -p "${OTB_SRC_DIR}/$P" && cd "$_" || exit ${OTB_ERR_SYSTEM}
tar xvf "${SRC_FILE}" || exit ${OTB_ERR_UNTAR}
# configure
mkdir -p "${SRC_DIR}/$P/build" && cd "$_"
"${SRC_DIR}/$P/$P-$V/configure" \
--prefix="${PREFIX}" \
--disable-shared
mkdir -p "${OTB_SRC_DIR}/$P/build" && cd "$_" || exit ${OTB_ERR_SYSTEM}
"${OTB_SRC_DIR}/$P/$P-$V/configure" \
--prefix="${OTB_PREFIX}" \
--disable-shared || exit ${OTB_ERR_CONFIGURE}
# compile and install
make -j ${NJOBS}
make install
make -j ${NJOBS} || exit ${OTB_ERR_MAKE}
make install || exit ${OTB_ERR_INSTALL}
# Local Variables:
# mode: shell-script-mode
# sh-basic-offset: 8
# End:
#!/bin/bash
#
# OPAL Toolchain Build recipe to build the GNU MPFR Library.
#
# https://www.mpfr.org
#
P=mpfr
V=${MPFR_VERSION:=4.0.2}
trap "otb_exit" EXIT
if [[ -n "${TOOLSET}" ]] && [[ "${TOOLSET}" != "gcc" ]]; then
echo "TOOLSET is set to '${TOOLSET}' - skipping compilation of mpfr" 1>&2
if [[ -n "${OTB_TOOLSET}" ]] && [[ "${OTB_TOOLSET}" != "gcc" ]]; then
echo "TOOLSET is set to '${OTB_TOOLSET}' - skipping compilation of mpfr" 1>&2
exit 0
fi
# recipe for:
P=mpfr
V=${MPFR_VERSION:=4.0.1}
FNAME="$P-$V.tar.gz"
DOWNLOAD_URL="http://www.mpfr.org/$P-$V/$P-$V.tar.gz"
SRC_FILE="${DOWNLOADS_DIR}/${FNAME}"
SRC_FILE="${OTB_DOWNLOAD_DIR}/${FNAME}"
# download
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}"
test -r "${SRC_FILE}" || \
curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${OTB_ERR_DOWNLOAD}
# unpack
mkdir -p "${SRC_DIR}/$P" && cd "$_"
tar xvf "${SRC_FILE}"
mkdir -p "${OTB_SRC_DIR}/$P" && cd "$_" || exit ${OTB_ERR_SYSTEM}
tar xvf "${SRC_FILE}" || exit ${OTB_ERR_UNTAR}
# configure
mkdir -p "${SRC_DIR}/$P/build" && cd "$_"
"${SRC_DIR}/$P/$P-$V/configure" \
--prefix="${PREFIX}" \
--with-gmp="${PREFIX}" \
--disable-shared
mkdir -p "${OTB_SRC_DIR}/$P/build" && cd "$_" || exit ${OTB_ERR_SYSTEM}
"${OTB_SRC_DIR}/$P/$P-$V/configure" \
--prefix="${OTB_PREFIX}" \
--with-gmp="${OTB_PREFIX}" \
--disable-shared || exit ${OTB_ERR_CONFIGURE}
# compile & install
make -j ${NJOBS}
make install
make -j ${NJOBS} || exit ${OTB_ERR_MAKE}
make install || exit ${OTB_ERR_INSTALL}
# Local Variables:
# mode: shell-script-mode
# sh-basic-offset: 8
# End:
#!/bin/bash
#
# OPAL Toolchain Build recipe for GNU MPC Library.
#
# http://www.multiprecision.org/mpc
#
P=mpc
V=${MPC_VERSION:-1.1.0}
if [[ -n "${TOOLSET}" ]] && [[ "${TOOLSET}" != "gcc" ]]; then
echo "TOOLSET is set to '${TOOLSET}' - skipping compilation of mpc" 1>&2
trap "otb_exit" EXIT
if [[ -n "${OTB_TOOLSET}" ]] && [[ "${OTB_TOOLSET}" != "gcc" ]]; then
echo "TOOLSET is set to '${OTB_TOOLSET}' - skipping compilation of mpc" 1>&2
exit 0
fi
# recipe for:
P=mpc
V=${MPC_VERSION:-1.1.0}
FNAME="$P-$V.tar.gz"
DOWNLOAD_URL="ftp://ftp.gnu.org/gnu/$P/$P-$V.tar.gz"
SRC_FILE="${DOWNLOADS_DIR}/${FNAME}"
SRC_FILE="${OTB_DOWNLOAD_DIR}/${FNAME}"
# download
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}"
test -r "${SRC_FILE}" || \
curl -L --output "$_" "${DOWNLOAD_URL}"
# unpack
mkdir -p "${SRC_DIR}/$P" && cd "$_"
mkdir -p "${OTB_SRC_DIR}/$P" && cd "$_"
tar xvf "${SRC_FILE}"
# configure
mkdir -p "${SRC_DIR}/$P/build" && cd "$_"
"${SRC_DIR}/$P/$P-$V/configure" \
--prefix="${PREFIX}" \
--with-gmp="${PREFIX}" \
--with-mpfr="${PREFIX}" \
mkdir -p "${OTB_SRC_DIR}/$P/build" && cd "$_"
"${OTB_SRC_DIR}/$P/$P-$V/configure" \
--prefix="${OTB_PREFIX}" \
--with-gmp="${OTB_PREFIX}" \
--with-mpfr="${OTB_PREFIX}" \
--disable-shared
# compile & install
make -j ${NJOBS}
make install
# Local Variables:
# mode: shell-script-mode
# sh-basic-offset: 8
# End:
#!/bin/bash
#
# OPAL Toolchain Build recipe for the GNU Compiler Collection (GCC)
#
# https://gcc.gnu.org
#
P=gcc
V=${OTB_COMPILER_VERSION:-8.4.0}
trap "otb_exit" EXIT
if [[ -n "${TOOLSET}" ]] && [[ "${TOOLSET}" != "gcc" ]]; then
echo "TOOLSET is set to '${TOOLSET}' - skipping compilation of gcc" 1>&2
if [[ -n "${OTB_TOOLSET}" ]] && [[ "${OTB_TOOLSET}" != "gcc" ]]; then
echo "TOOLSET is set to '${OTB_TOOLSET}' - skipping compilation of gcc" 1>&2
exit 0
fi
# recipe for:
P=gcc
V=${GCC_VERSION:-7.4.0}
FNAME="$P-$V.tar.gz"
DOWNLOAD_URL="https://ftp.gnu.org/gnu/$P/$P-$V/${FNAME}"
SRC_FILE="${DOWNLOADS_DIR}/${FNAME}"
SRC_FILE="${OTB_DOWNLOAD_DIR}/${FNAME}"
# download
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}"
test -r "${SRC_FILE}" || \
curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${OTB_ERR_DOWNLOAD}
# GCC on Linux tries to create the directory $PREFIX/lib64.
# GCC on Linux tries to create the directory $OTB_PREFIX/lib64.
# So 'make install' fails, if this is a sym-link.
if [[ $(uname -s) == Linux ]]; then
rm -v "${PREFIX}/lib64"
if [[ -e ${OTB_PREFIX}/lib64 ]]; then
rm -v "${OTB_PREFIX}/lib64" || exit ${OTB_ERR_SYSTEM}
fi
fi
# unpack
mkdir -p "${SRC_DIR}/$P" && cd "$_"
tar xvf "${SRC_FILE}"
mkdir -v -p "${OTB_SRC_DIR}/$P" && cd "$_" || exit ${OTB_ERR_SYSTEM}
tar xvf "${SRC_FILE}" || exit ${OTB_ERR_UNTAR}
# configure
mkdir -p "${SRC_DIR}/$P/build" && cd "$_"
"${SRC_DIR}/$P/$P-$V/configure" \
--prefix="${PREFIX}" \
--with-gmp="${PREFIX}" \
--with-mpfr="${PREFIX}" \
--with-mpc="${PREFIX}" \
mkdir -v -p "${OTB_SRC_DIR}/$P/build" && cd "$_" || exit ${OTB_ERR_SYSTEM}
"${OTB_SRC_DIR}/$P/$P-$V/configure" \
--prefix="${OTB_PREFIX}" \
--with-gmp="${OTB_PREFIX}" \
--with-mpfr="${OTB_PREFIX}" \
--with-mpc="${OTB_PREFIX}" \
--enable-languages=c,c++,objc,obj-c++,lto,fortran \
--enable-lto \
--disable-multilib \
--with-build-config=bootstrap-debug
--with-build-config=bootstrap-debug || exit ${OTB_ERR_CONFIGURE}
# compile & install
make -j 2
make install
make -j 3 || exit ${OTB_ERR_MAKE}
make install || exit ${OTB_ERR_INSTALL}
# make this version of the C compiler available via 'cc'
ln -v -f "${OTB_PREFIX}/bin/gcc" "${OTB_PREFIX}/bin/cc"
# move files from "${PREFIX}/lib64" to "${PREFIX}/lib"
# move files from "${OTB_PREFIX}/lib64" to "${OTB_PREFIX}/lib"
# and recreate sym-link
shopt -s nullglob
if [[ $(uname -s) == Linux ]]; then
mv -v "${PREFIX}/lib64/"* "${PREFIX}/lib"
rmdir "${PREFIX}/lib64"
( cd $PREFIX; ln -s lib lib64;)
mv -v "${OTB_PREFIX}/lib64/"* "${OTB_PREFIX}/lib" || exit ${OTB_ERR_POST_INSTALL}
rmdir -v "${OTB_PREFIX}/lib64" || exit ${OTB_ERR_POST_INSTALL}
( cd "${OTB_PREFIX}" && ln -vfs lib lib64 || exit ${OTB_ERR_SETUP};)
fi
# Local Variables:
# mode: shell-script-mode
# sh-basic-offset: 8
# End:
#!/bin/bash
#
# Recipe for
# OPAL Toolchain Build recipe for CMake
#
# https://cmake.org
#
P=cmake
V=${CMAKE_VERSION:-3.15.5}
trap "otb_exit" EXIT
FNAME="$P-$V.tar.gz"
DOWNLOAD_URL="https://cmake.org/files/v${V%.*}/${FNAME}"
SRC_FILE="${DOWNLOADS_DIR}/${FNAME}"
SRC_FILE="${OTB_DOWNLOAD_DIR}/${FNAME}"
#
# Download
#
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${BUILD_ERR_DOWNLOAD}
test -r "${SRC_FILE}" || \
curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${OTB_ERR_DOWNLOAD}
#
# Unpack
#
mkdir -p "${SRC_DIR}/$P" && cd "$_" || exit ${BUILD_ERR_SETUP}
tar xvf "${SRC_FILE}" || exit ${BUILD_ERR_UNTAR}
mkdir -p "${OTB_SRC_DIR}/$P" && cd "$_" || exit ${OTB_ERR_SYSTEM}
tar xvf "${SRC_FILE}" || exit ${OTB_ERR_UNTAR}
#
# Configure
# You might have to add the option --system-curl
#
mkdir -p "${SRC_DIR}/$P/build" && cd "$_" || exit ${BUILD_ERR_SETUP}
"${SRC_DIR}/cmake/cmake-$V/bootstrap" \
--prefix="${PREFIX}" \
--verbose || exit ${BUILD_ERR_CONFIGURE}
mkdir -p "${OTB_SRC_DIR}/$P/build" && cd "$_" || exit ${OTB_ERR_SYSTEM}
"${OTB_SRC_DIR}/cmake/cmake-$V/bootstrap" \
--prefix="${OTB_PREFIX}" \
--verbose || exit ${OTB_ERR_CONFIGURE}
#
# Compile and install CMake
#
make -j ${NJOBS} || exit ${BUILD_ERR_MAKE}
make install || exit ${BUILD_ERR_INSTALL}
make -j ${NJOBS} || exit ${OTB_ERR_MAKE}
make install || exit ${OTB_ERR_INSTALL}
# Local Variables:
# mode: shell-script-mode
# sh-basic-offset: 8
# End:
#!/bin/bash
#
# OPAL Toolchain Build recipe for Open MPI
#
# https://www.open-mpi.org
#
P=openmpi
V=${OTB_MPI_VERSION:-3.1.6}
trap "otb_exit" EXIT
if [[ -n "${MPI_IMPLEMENTATION}" ]] && [[ "${MPI_IMPLEMENTATION}" != "openmpi" ]]; then
echo "MPI implementation is set to '${MPI_IMPLEMENTATION}' - skipping compilation of openmpi" 1>&2
if [[ -n "${OTB_MPI}" ]] && [[ "${OTB_MPI}" != "openmpi" ]]; then
echo "MPI implementation is set to '${OTB_MPI}' - skipping compilation of openmpi" 1>&2
exit 0
fi
# recipe for:
P=openmpi
V=${OPENMPI_VERSION:-3.1.6}
FNAME="$P-$V.tar.gz"
DOWNLOAD_URL="http://www.open-mpi.org/software/ompi/v${V%.*}/downloads/${FNAME}"
SRC_FILE="${DOWNLOADS_DIR}/${FNAME}"
SRC_FILE="${OTB_DOWNLOAD_DIR}/${FNAME}"
# Download
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${BUILD_ERR_DOWNLOAD}
test -r "${SRC_FILE}" || \
curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${OTB_ERR_DOWNLOAD}
# Unpack
mkdir -p "${SRC_DIR}/$P" && cd "$_" || exit ${BUILD_ERR_SETUP}
tar xvf "${SRC_FILE}" || exit ${BUILD_ERR_UNTAR}
mkdir -p "${OTB_SRC_DIR}/$P" && cd "$_" || exit ${OTB_ERR_SYSTEM}
tar xvf "${SRC_FILE}" || exit ${OTB_ERR_UNTAR}
# Configure
mkdir -p "${SRC_DIR}/$P/build" && cd "$_" || exit ${BUILD_ERR_SETUP}
"${SRC_DIR}/$P/$P-$V/configure" \
--prefix="${PREFIX}" \
unset OPAL_PREFIX
mkdir -p "${OTB_SRC_DIR}/$P/build" && cd "$_" || exit ${OTB_ERR_SYSTEM}
"${OTB_SRC_DIR}/$P/$P-$V/configure" \
--prefix="${OTB_PREFIX}" \
--enable-mpi-cxx \
--enable-mpi-cxx-seek \
--enable-orterun-prefix-by-default \
--enable-shared \
--with-sge=yes \
--with-slurm=yes || exit ${BUILD_ERR_CONFIGURE}
--with-slurm=yes || exit ${OTB_ERR_CONFIGURE}
# Compile and install
make -j ${NJOBS} || exit ${BUILD_ERR_MAKE}
make install || exit ${BUILD_ERR_INSTALL}
make -j ${NJOBS} || exit ${OTB_ERR_MAKE}
make install || exit ${OTB_ERR_INSTALL}
# Local Variables:
# mode: shell-script-mode
# sh-basic-offset: 8
# End:
#!/bin/bash
#
# OPAL Toolchain Build recipe for MPICH
#
# http://www.mpich.org
#
P=mpich
V=${OTB_MPI_VERSION:-3.3.1}
trap "otb_exit" EXIT
if [[ -n "${MPI_IMPLEMENTATION}" ]] && [[ "${MPI_IMPLEMENTATION}" != "mpich" ]]; then
echo "MPI implementation is set to '${MPI_IMPLEMENTATION}' - skipping compilation of mpich" 1>&2
if [[ -n "${OTB_MPI}" ]] && [[ "${OTB_MPI}" != "mpich" ]]; then
echo "MPI implementation is set to '${OTB_MPI}' - skipping compilation of mpich" 1>&2
exit 0
fi
# recipe for:
P=mpich
V=${MPICH_VERSION:-3.3.1}
FNAME="$P-$V.tar.gz"
DOWNLOAD_URL="http://www.mpich.org/static/downloads/$V/${FNAME}"
SRC_FILE="${DOWNLOADS_DIR}/${FNAME}"
SRC_FILE="${OTB_DOWNLOAD_DIR}/${FNAME}"
# Download
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}"
test -r "${SRC_FILE}" || \
curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${OTB_ERR_DOWNLOAD}
# Unpack
mkdir -p "${SRC_DIR}/$P" && cd "$_"
tar xvf "${SRC_FILE}"
mkdir -p "${OTB_SRC_DIR}/$P" && cd "$_" || exit ${OTB_ERR_SYSTEM}
tar xvf "${SRC_FILE}" || exit ${OTB_ERR_UNTAR}
# Configure
mkdir -p "${SRC_DIR}/$P/build" && cd "$_"
"${SRC_DIR}/$P/$P-$V/configure" \
--prefix="${PREFIX}" \
mkdir -p "${OTB_SRC_DIR}/$P/build" && cd "$_" || exit ${OTB_ERR_SYSTEM}
"${OTB_SRC_DIR}/$P/$P-$V/configure" \
--prefix="${OTB_PREFIX}" \
--enable-cxx \
--disable-fortran
--disable-fortran || exit ${OTB_ERR_CONFIGURE}
# Compile and install
make -j ${NJOBS}
make install
make -j ${NJOBS} || exit ${OTB_ERR_MAKE}
make install || exit ${OTB_ERR_INSTALL}
# Local Variables:
# mode: shell-script-mode
# sh-basic-offset: 8
# End:
#!/bin/bash
# recipe for:
#
# OPAL Toolchain Build recipe for HDF5 library.
#
# https://www.hdfgroup.org/solutions/hdf5/
#
P=hdf5
V=${HDF5_VERSION:-1.10.6}
trap "otb_exit" EXIT
FNAME="$P-$V.tar.gz"
DOWNLOAD_URL="https://support.hdfgroup.org/ftp/HDF5/releases/$P-${V%.*}/$P-$V/src/${FNAME}"
SRC_FILE="${DOWNLOADS_DIR}/${FNAME}"
SRC_FILE="${OTB_DOWNLOAD_DIR}/${FNAME}"
# download
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${BUILD_ERR_DOWNLOAD}
test -r "${SRC_FILE}" || \
curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${OTB_ERR_DOWNLOAD}
# unpack
mkdir -p "${SRC_DIR}/$P" && cd "$_" || exit ${BUILD_ERR_SETUP}
tar xvf "${SRC_FILE}" || exit ${BUILD_ERR_UNTAR}
mkdir -p "${OTB_SRC_DIR}/$P" && cd "$_" || exit ${OTB_ERR_SYSTEM}
tar xvf "${SRC_FILE}" || exit ${OTB_ERR_UNTAR}
# configure
mkdir -p "${SRC_DIR}/$P/build" && cd "$_" || exit ${BUILD_ERR_SETUP}
CC=mpicc CXX=mpicxx FC=mpifort "${SRC_DIR}/$P/$P-$V/configure" \
--prefix="${PREFIX}" \
mkdir -p "${OTB_SRC_DIR}/$P/build" && cd "$_" || exit ${OTB_ERR_SYSTEM}
CC=mpicc CXX=mpicxx FC=mpifort "${OTB_SRC_DIR}/$P/$P-$V/configure" \
--prefix="${OTB_PREFIX}" \
--enable-shared \
--enable-parallel \
--enable-cxx \
--enable-unsupported \
--with-pic || exit ${BUILD_ERR_CONFIGURE}
--with-pic || exit ${OTB_ERR_CONFIGURE}
# compile and install
make -j ${NJOBS} || exit ${BUILD_ERR_MAKE}
make install || exit ${BUILD_ERR_INSTALL}
make -j ${NJOBS} || exit ${OTB_ERR_MAKE}
make install || exit ${OTB_ERR_INSTALL}
# Local Variables:
# mode: shell-script-mode
# sh-basic-offset: 8
# End:
#!/bin/bash
# recipe for:
#
# OPAL Toolchain Build recipe for the GNU Scientific Library.
#
# https://www.gnu.org/software/gsl/
#
P=gsl
V=${GSL_VERSION:-2.6}
trap "otb_exit" EXIT
FNAME="$P-$V.tar.gz"
DOWNLOAD_URL="ftp://ftp.gnu.org/gnu/$P/${FNAME}"
SRC_FILE="${DOWNLOADS_DIR}/${FNAME}"
SRC_FILE="${OTB_DOWNLOAD_DIR}/${FNAME}"
# download
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${BUILD_ERR_DOWNLOAD}
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${OTB_ERR_DOWNLOAD}
# unpack
mkdir -p "${SRC_DIR}/$P" && cd "$_" || exit ${BUILD_ERR_SETUP}
tar xvf "${SRC_FILE}" || exit ${BUILD_ERR_UNTAR}
mkdir -p "${OTB_SRC_DIR}/$P" && cd "$_" || exit ${OTB_ERR_SYSTEM}
tar xvf "${SRC_FILE}" || exit ${OTB_ERR_UNTAR}
# configure
mkdir -p "${SRC_DIR}/$P/build" && cd "$_" || exit ${BUILD_ERR_SETUP}
"${SRC_DIR}/$P/$P-$V/configure" \
--prefix="${PREFIX}" \
--disable-shared || exit ${BUILD_ERR_CONFIGURE}
mkdir -p "${OTB_SRC_DIR}/$P/build" && cd "$_" || exit ${OTB_ERR_SYSTEM}
CFLAGS="-fPIC" "${OTB_SRC_DIR}/$P/$P-$V/configure" \
--prefix="${OTB_PREFIX}" \
--disable-shared || exit ${OTB_ERR_CONFIGURE}
# compile & install
make -j ${NJOBS} || exit ${BUILD_ERR_MAKE}
make install || exit ${BUILD_ERR_INSTALL}
make -j ${NJOBS} || exit ${OTB_ERR_MAKE}
make install || exit ${OTB_ERR_INSTALL}
# Local Variables:
# mode: shell-script-mode
# sh-basic-offset: 8
# End:
#!/bin/bash
# recipe for:
#
# OPAL Toolchain Build recipe for the HDF5 utility toolkit.
#
# https://gitlab.psi.ch/H5hut/src
#
P=H5hut
V=${H5HUT_VERSION:-2.0.0rc6}
trap "otb_exit" EXIT
FNAME="$P-$V.tar.gz"
DOWNLOAD_URL="http://amas.web.psi.ch/Downloads/$P/${FNAME}"
SRC_FILE="${DOWNLOADS_DIR}/${FNAME}"
SRC_FILE="${OTB_DOWNLOAD_DIR}/${FNAME}"
# download
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${BUILD_ERR_DOWNLOAD}
test -r "${SRC_FILE}" || \
curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${OTB_ERR_DOWNLOAD}
# unpack
mkdir -p "${SRC_DIR}/$P" && cd "$_" || exit ${BUILD_ERR_SETUP}
tar xvf "${SRC_FILE}" || exit ${BUILD_ERR_UNTAR}
cd "${SRC_DIR}/$P/$P-$V" || exit ${BUILD_ERR_SETUP}
./autogen.sh || exit ${BUILD_ERR_CONFIGURE}
mkdir -p "${OTB_SRC_DIR}/$P" && cd "$_" || exit ${OTB_ERR_SYSTEM}
tar xvf "${SRC_FILE}" || exit ${OTB_ERR_UNTAR}
cd "${OTB_SRC_DIR}/$P/$P-$V" || exit ${OTB_ERR_SYSTEM}
./autogen.sh || exit ${OTB_ERR_CONFIGURE}
# configure
mkdir -p "${SRC_DIR}/$P/build" && cd "$_"
CC=mpicc CXX=mpicxx "${SRC_DIR}/$P/$P-$V/configure" \
--prefix="${PREFIX}" \
mkdir -p "${OTB_SRC_DIR}/$P/build" && cd "$_"
CC=mpicc CXX=mpicxx "${OTB_SRC_DIR}/$P/$P-$V/configure" \
--prefix="${OTB_PREFIX}" \
--enable-shared \
--enable-parallel \
--with-pic || exit ${BUILD_ERR_CONFIGURE}
--with-pic || exit ${OTB_ERR_CONFIGURE}
# compile and install
make -j ${NJOBS} || exit ${BUILD_ERR_MAKE}
make install || exit ${BUILD_ERR_INSTALL}
make -j ${NJOBS} || exit ${OTB_ERR_MAKE}
make install || exit ${OTB_ERR_INSTALL}
# Local Variables:
# mode: shell-script-mode
# sh-basic-offset: 8
# End:
#!/bin/bash
# recipe for:
#
# OPAL Toolchain Build recipe for zlib.
#
# http://zlib.net
#
P=zlib
V=${ZLIB_VERSION:-1.2.11}
trap "otb_exit" EXIT
FNAME="$P-$V.tar.gz"
DOWNLOAD_URL="https://zlib.net/${FNAME}"
SRC_FILE="${DOWNLOADS_DIR}/${FNAME}"
SRC_FILE="${OTB_DOWNLOAD_DIR}/${FNAME}"
# download
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${BUILD_ERR_DOWNLOAD}
test -r "${SRC_FILE}" || curl -L --output "$_" "${DOWNLOAD_URL}" || exit ${OTB_ERR_DOWNLOAD}
# unpack
mkdir -p "${SRC_DIR}/$P" && cd "$_" || exit ${BUILD_ERR_SYSTEM}
tar xvf "${SRC_FILE}" || exit ${BUILD_ERR_UNTAR}
mkdir -p "${OTB_SRC_DIR}/$P" && cd "$_" || exit ${OTB_ERR_SYSTEM}
tar xvf "${SRC_FILE}" || exit ${OTB_ERR_UNTAR}
# configure