Commit bc9e6379 authored by gsell's avatar gsell
Browse files

build-blocks:

- use modbuild in shebang
- refactore function calls
parent 380ae5db
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash" pbuild::configure() {
pmodules.configure() {
case ${COMPILER} in case ${COMPILER} in
gcc ) gcc )
CC='gcc' CC='gcc'
...@@ -37,12 +34,12 @@ COMMON_PROF = -pg ...@@ -37,12 +34,12 @@ COMMON_PROF = -pg
EOF EOF
} }
pmodules.build() { pbuild::build() {
cd "${MODULE_SRCDIR}" cd "${MODULE_SRCDIR}"
make make
} }
pmodules.install() { pbuild::install() {
make PREFIX="${PREFIX}" install make PREFIX="${PREFIX}" install
# We have to build shared libs and remove them here. # We have to build shared libs and remove them here.
# Building with NOSHARED gives an error during install - # Building with NOSHARED gives an error during install -
...@@ -52,10 +49,10 @@ pmodules.install() { ...@@ -52,10 +49,10 @@ pmodules.install() {
#( cd "${PREFIX}/lib"; ln -fs #( cd "${PREFIX}/lib"; ln -fs
} }
pmodules.add_to_group 'Compiler' pbuild::add_to_group 'Compiler'
pmodules.set_runtime_dependencies "${COMPILER}" pbuild::set_runtime_dependencies "${COMPILER}"
pmodules.set_build_dependencies "${COMPILER}" pbuild::set_build_dependencies "${COMPILER}"
pmodules.set_docfiles 'LICENSE' 'README.md' pbuild::set_docfiles 'LICENSE' 'README.md'
pmodules.set_supported_compilers 'gcc' 'intel' pbuild::set_supported_compilers 'gcc' 'intel'
pmodules.make_all pbuild::make_all
pmodules.cleanup_src pbuild::cleanup_src
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash" pbuild::configure() {
pmodules.configure() {
cat <<EOF > "${MODULE_SRCDIR}/make.inc" cat <<EOF > "${MODULE_SRCDIR}/make.inc"
SHELL = /bin/sh SHELL = /bin/sh
PLAT = PLAT =
...@@ -25,12 +23,12 @@ COMMON_PROF = -pg ...@@ -25,12 +23,12 @@ COMMON_PROF = -pg
EOF EOF
} }
pmodules.build() { pbuild::build() {
cd "${MODULE_SRCDIR}" cd "${MODULE_SRCDIR}"
make make
} }
pmodules.install() { pbuild::install() {
make PREFIX="${PREFIX}" install make PREFIX="${PREFIX}" install
# We have to build shared libs and remove them here. # We have to build shared libs and remove them here.
# Building with NOSHARED gives an error during install - # Building with NOSHARED gives an error during install -
...@@ -40,10 +38,10 @@ pmodules.install() { ...@@ -40,10 +38,10 @@ pmodules.install() {
#( cd "${PREFIX}/lib"; ln -fs #( cd "${PREFIX}/lib"; ln -fs
} }
pmodules.add_to_group 'Compiler' pbuild::add_to_group 'Compiler'
pmodules.set_runtime_dependencies "${COMPILER}" pbuild::set_runtime_dependencies "${COMPILER}"
pmodules.set_build_dependencies "${COMPILER}" pbuild::set_build_dependencies "${COMPILER}"
pmodules.set_docfiles 'LICENSE' 'README.md' pbuild::set_docfiles 'LICENSE' 'README.md'
pmodules.set_supported_compilers 'gcc' pbuild::set_supported_compilers 'gcc'
pmodules.make_all pbuild::make_all
pmodules.cleanup_src pbuild::cleanup_src
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash" pbuild::configure() {
pmodules.configure() {
cat <<EOF > "${MODULE_SRCDIR}/make.inc" cat <<EOF > "${MODULE_SRCDIR}/make.inc"
PLAT = PLAT =
SuperLUroot = \${PREFIX} SuperLUroot = \${PREFIX}
...@@ -28,21 +26,21 @@ CDEFS = -DAdd_ ...@@ -28,21 +26,21 @@ CDEFS = -DAdd_
EOF EOF
} }
pmodules.build() { pbuild::build() {
cd "${MODULE_SRCDIR}" cd "${MODULE_SRCDIR}"
mkdir -p "${PREFIX}/lib" mkdir -p "${PREFIX}/lib"
make make
} }
pmodules.install() { pbuild::install() {
make install make install
mkdir -p "${PREFIX}/include" mkdir -p "${PREFIX}/include"
install -m 0444 "${MODULE_SRCDIR}"/SRC/*.h "${PREFIX}/include" install -m 0444 "${MODULE_SRCDIR}"/SRC/*.h "${PREFIX}/include"
} }
pmodules.add_to_group 'Compiler' pbuild::add_to_group 'Compiler'
pmodules.set_runtime_dependencies "${COMPILER}" pbuild::set_runtime_dependencies "${COMPILER}"
pmodules.set_build_dependencies "${COMPILER}" 'OpenBLAS' pbuild::set_build_dependencies "${COMPILER}" 'OpenBLAS'
pmodules.set_docfiles 'README' pbuild::set_docfiles 'README'
pmodules.make_all pbuild::make_all
pmodules.cleanup_src pbuild::cleanup_src
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash" pbuild::configure() {
pmodules.configure() {
cat <<EOF > "${MODULE_SRCDIR}/SuiteSparse_config/SuiteSparse_config.mk" cat <<EOF > "${MODULE_SRCDIR}/SuiteSparse_config/SuiteSparse_config.mk"
CF = \$(CFLAGS) \$(CPPFLAGS) \$(TARGET_ARCH) -O3 -fexceptions -fPIC -DNTIMER CF = \$(CFLAGS) \$(CPPFLAGS) \$(TARGET_ARCH) -O3 -fexceptions -fPIC -DNTIMER
RANLIB = ranlib RANLIB = ranlib
...@@ -26,19 +24,19 @@ TBB = ...@@ -26,19 +24,19 @@ TBB =
EOF EOF
} }
pmodules.build() { pbuild::build() {
cd "${MODULE_SRCDIR}/UMFPACK" cd "${MODULE_SRCDIR}/UMFPACK"
make TARGET=CORE2 BINARY=64 USE_THREAD=0 NO_SHARED=1 make TARGET=CORE2 BINARY=64 USE_THREAD=0 NO_SHARED=1
} }
pmodules.install() { pbuild::install() {
install -d "${PREFIX}/include" install -d "${PREFIX}/include"
install -d "${PREFIX}/lib" install -d "${PREFIX}/lib"
make PREFIX="${PREFIX}" install make PREFIX="${PREFIX}" install
} }
pmodules.add_to_group 'Compiler' pbuild::add_to_group 'Compiler'
pmodules.set_runtime_dependencies "${COMPILER}" 'OpenBLAS' pbuild::set_runtime_dependencies "${COMPILER}" 'OpenBLAS'
pmodules.set_build_dependencies "${COMPILER}" 'OpenBLAS' pbuild::set_build_dependencies "${COMPILER}" 'OpenBLAS'
pmodules.make_all pbuild::make_all
#pmodules.cleanup_src #pbuild::cleanup_src
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash" pbuild::configure() {
pmodules.configure() {
"${MODULE_SRCDIR}"/configure \ "${MODULE_SRCDIR}"/configure \
--prefix="${PREFIX}" \ --prefix="${PREFIX}" \
|| exit 1 || exit 1
} }
pmodules.add_to_group 'Compiler' pbuild::add_to_group 'Compiler'
pmodules.set_runtime_dependencies "${COMPILER}" pbuild::set_runtime_dependencies "${COMPILER}"
pmodules.set_build_dependencies "${COMPILER}" pbuild::set_build_dependencies "${COMPILER}"
pmodules.make_all pbuild::make_all
# Local Variables: # Local Variables:
# mode: sh # mode: sh
......
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash"
# :TODO: detect compiler # :TODO: detect compiler
TOOLSET=intel-linux TOOLSET=intel-linux
BOOST_BUILD_PATH="${MODULE_BUILDDIR}" BOOST_BUILD_PATH="${MODULE_BUILDDIR}"
pmodules.configure() { pbuild::configure() {
cd "${MODULE_SRCDIR}" cd "${MODULE_SRCDIR}"
"${MODULE_SRCDIR}"/bootstrap.sh \ "${MODULE_SRCDIR}"/bootstrap.sh \
--prefix="${PREFIX}" \ --prefix="${PREFIX}" \
...@@ -17,7 +15,7 @@ pmodules.configure() { ...@@ -17,7 +15,7 @@ pmodules.configure() {
|| exit 1 || exit 1
} }
pmodules.build() { pbuild::build() {
cd "${MODULE_SRCDIR}" cd "${MODULE_SRCDIR}"
./b2 \ ./b2 \
--build-type=minimal \ --build-type=minimal \
...@@ -30,7 +28,7 @@ pmodules.build() { ...@@ -30,7 +28,7 @@ pmodules.build() {
stage stage
} }
pmodules.install() { pbuild::install() {
cd "${MODULE_SRCDIR}" cd "${MODULE_SRCDIR}"
./b2 \ ./b2 \
--build-type=minimal \ --build-type=minimal \
...@@ -43,8 +41,8 @@ pmodules.install() { ...@@ -43,8 +41,8 @@ pmodules.install() {
install install
} }
pmodules.add_to_group 'Compiler' pbuild::add_to_group 'Compiler'
pmodules.set_runtime_dependencies "${COMPILER}" pbuild::set_runtime_dependencies "${COMPILER}"
pmodules.set_build_dependencies "${COMPILER}" 'Python' pbuild::set_build_dependencies "${COMPILER}" 'Python'
pmodules.make_all pbuild::make_all
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash" pbuild::configure() {
pmodules.configure() {
"${MODULE_SRCDIR}"/configure \ "${MODULE_SRCDIR}"/configure \
--prefix="${PREFIX}" \ --prefix="${PREFIX}" \
|| exit 1 || exit 1
} }
pmodules.add_to_group 'Compiler' pbuild::add_to_group 'Compiler'
pmodules.set_docfiles \ pbuild::set_docfiles \
'AUTHORS' \ 'AUTHORS' \
'BUGS' \ 'BUGS' \
'COPYING' \ 'COPYING' \
...@@ -20,9 +18,9 @@ pmodules.set_docfiles \ ...@@ -20,9 +18,9 @@ pmodules.set_docfiles \
'THANKS' \ 'THANKS' \
'TODO' 'TODO'
pmodules.set_runtime_dependencies "${COMPILER}" pbuild::set_runtime_dependencies "${COMPILER}"
pmodules.set_build_dependencies "${COMPILER}" pbuild::set_build_dependencies "${COMPILER}"
pmodules.make_all pbuild::make_all
# Local Variables: # Local Variables:
# mode: sh # mode: sh
......
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash" pbuild::configure() {
pmodules.configure() {
"${MODULE_SRCDIR}"/configure \ "${MODULE_SRCDIR}"/configure \
--prefix="${PREFIX}" \ --prefix="${PREFIX}" \
--enable-shared \ --enable-shared \
...@@ -12,8 +10,8 @@ pmodules.configure() { ...@@ -12,8 +10,8 @@ pmodules.configure() {
|| exit 1 || exit 1
} }
pmodules.add_to_group 'Compiler' pbuild::add_to_group 'Compiler'
pmodules.set_runtime_dependencies "${COMPILER}" pbuild::set_runtime_dependencies "${COMPILER}"
pmodules.set_build_dependencies "${COMPILER}" pbuild::set_build_dependencies "${COMPILER}"
pmodules.make_all pbuild::make_all
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash" pbuild::configure() {
pmodules.configure() {
unset F90 unset F90
"${MODULE_SRCDIR}"/configure \ "${MODULE_SRCDIR}"/configure \
--prefix="${PREFIX}" \ --prefix="${PREFIX}" \
...@@ -12,8 +10,8 @@ pmodules.configure() { ...@@ -12,8 +10,8 @@ pmodules.configure() {
} }
pmodules.add_to_group 'Compiler' pbuild::add_to_group 'Compiler'
pmodules.set_runtime_dependencies "${COMPILER}" pbuild::set_runtime_dependencies "${COMPILER}"
pmodules.set_build_dependencies "${COMPILER}" pbuild::set_build_dependencies "${COMPILER}"
pmodules.set_docfiles 'COPYRIGHT' 'README' pbuild::set_docfiles 'COPYRIGHT' 'README'
pmodules.make_all pbuild::make_all
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash"
case ${OS} in case ${OS} in
Darwin ) Darwin )
...@@ -12,7 +10,7 @@ Darwin ) ...@@ -12,7 +10,7 @@ Darwin )
;; ;;
esac esac
pmodules.configure() { pbuild::configure() {
"${MODULE_SRCDIR}"/configure \ "${MODULE_SRCDIR}"/configure \
--disable-ldap \ --disable-ldap \
--disable-mysql \ --disable-mysql \
...@@ -27,11 +25,11 @@ pmodules.configure() { ...@@ -27,11 +25,11 @@ pmodules.configure() {
|| exit 1 || exit 1
} }
pmodules.build() { pbuild::build() {
make -j 4 make -j 4
} }
pmodules.install() { pbuild::install() {
make clean make clean
rm -f Makefile rm -f Makefile
...@@ -66,7 +64,7 @@ pmodules.install() { ...@@ -66,7 +64,7 @@ pmodules.install() {
mv "${PREFIX}/README" "${DOCDIR}" mv "${PREFIX}/README" "${DOCDIR}"
} }
pmodules.add_to_group 'Compiler' pbuild::add_to_group 'Compiler'
pmodules.set_runtime_dependencies "${COMPILER}" pbuild::set_runtime_dependencies "${COMPILER}"
pmodules.set_build_dependencies "${COMPILER}" pbuild::set_build_dependencies "${COMPILER}"
pmodules.make_all pbuild::make_all
#!/bin/bash #!/usr/bin/env modbuild
# #
# Notes: # Notes:
# On Mac OS X VTK does not compile out of the box with self-compiled GCC. # On Mac OS X VTK does not compile out of the box with self-compiled GCC.
...@@ -6,11 +6,9 @@ ...@@ -6,11 +6,9 @@
# and remove these strings. # and remove these strings.
# #
source "$(dirname $0)/../../../lib/libpmodules.bash"
case ${OS} in case ${OS} in
Darwin ) Darwin )
pmodules.pre_configure() { pbuild::pre_configure() {
# for the time being: on Mac OS X we need GL/gl.h from MacPorts: # for the time being: on Mac OS X we need GL/gl.h from MacPorts:
std::append_path C_INLCUDE_PATH '/opt/local/include' std::append_path C_INLCUDE_PATH '/opt/local/include'
std::append_path CPLUS_INCLUDE_PATH '/opt/local/include' std::append_path CPLUS_INCLUDE_PATH '/opt/local/include'
...@@ -18,7 +16,7 @@ Darwin ) ...@@ -18,7 +16,7 @@ Darwin )
;; ;;
esac esac
pmodules.configure() { pbuild::configure() {
cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX \ cmake -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX \
-DVTK_INSTALL_INCLUDE_DIR:PATH=include \ -DVTK_INSTALL_INCLUDE_DIR:PATH=include \
-DVTK_INSTALL_LIB_DIR:PATH=lib \ -DVTK_INSTALL_LIB_DIR:PATH=lib \
...@@ -26,8 +24,8 @@ pmodules.configure() { ...@@ -26,8 +24,8 @@ pmodules.configure() {
"${MODULE_SRCDIR}" "${MODULE_SRCDIR}"
} }
pmodules.add_to_group 'Compiler' pbuild::add_to_group 'Compiler'
pmodules.set_runtime_dependencies "${COMPILER}" pbuild::set_runtime_dependencies "${COMPILER}"
pmodules.set_build_dependencies 'cmake' "${COMPILER}" pbuild::set_build_dependencies 'cmake' "${COMPILER}"
pmodules.make_all pbuild::make_all
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash" pbuild::pre_configure() {
pmodules.pre_configure() {
./autogen.sh ./autogen.sh
} }
pmodules.configure() { pbuild::configure() {
CC=$MPICC CC=$MPICC
CXX=$MPICXX CXX=$MPICXX
F77=$MPIF77 F77=$MPIF77
...@@ -23,20 +21,20 @@ pmodules.configure() { ...@@ -23,20 +21,20 @@ pmodules.configure() {
|| exit 1 || exit 1
} }
pmodules.build() { pbuild::build() {
make -C src make -C src
make -C tools make -C tools
} }
pmodules.install() { pbuild::install() {
make -C src install make -C src install
make -C tools install make -C tools install
} }
pmodules.add_to_group 'HDF5' pbuild::add_to_group 'HDF5'
pmodules.set_runtime_dependencies "${COMPILER}" "${MPI}" 'hdf5' pbuild::set_runtime_dependencies "${COMPILER}" "${MPI}" 'hdf5'
pmodules.set_build_dependencies "autoconf" "automake" "libtool" "${COMPILER}" "${MPI}" "hdf5" pbuild::set_build_dependencies "autoconf" "automake" "libtool" "${COMPILER}" "${MPI}" "hdf5"
pmodules.set_docfiles 'AUTHORS' 'COPYING' pbuild::set_docfiles 'AUTHORS' 'COPYING'
pmodules.make_all pbuild::make_all
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash" pbuild::pre_configure() {
pmodules.pre_configure() {
: :
} }
pmodules.configure() { pbuild::configure() {
CC=$MPICC CC=$MPICC
CXX=$MPICXX CXX=$MPICXX
F77=$MPIF77 F77=$MPIF77
...@@ -20,9 +18,9 @@ pmodules.configure() { ...@@ -20,9 +18,9 @@ pmodules.configure() {
|| exit 1 || exit 1
} }
pmodules.add_to_group 'HDF5' pbuild::add_to_group 'HDF5'
pmodules.set_runtime_dependencies "${COMPILER}" "${MPI}" 'hdf5' pbuild::set_runtime_dependencies "${COMPILER}" "${MPI}" 'hdf5'
pmodules.set_build_dependencies "${COMPILER}" "${MPI}" 'hdf5' pbuild::set_build_dependencies "${COMPILER}" "${MPI}" 'hdf5'
pmodules.set_docfiles 'COPYRIGHT' 'README.md' 'RELEASE_NOTES.md' pbuild::set_docfiles 'COPYRIGHT' 'README.md' 'RELEASE_NOTES.md'
pmodules.make_all pbuild::make_all
#!/bin/bash #!/usr/bin/env modbuild
source "$(dirname $0)/../../../lib/libpmodules.bash" pbuild::configure() {