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