- configuration file 'environment.bash' merged into 'profile.bash'

- OS dependent build configuration is now in 'modbuild.conf'
- set PATH before sourcing 'modbuild.conf'
- installation path of modulefile fixed
- go through all build steps if nothing else is specified on command line
This commit is contained in:
2017-06-09 10:36:05 +02:00
parent f757d9f920
commit dac5885500
9 changed files with 77 additions and 117 deletions
+23 -22
View File
@@ -25,16 +25,6 @@ unset FC
unset F77
unset F90
# assemble default path
PATH='/usr/bin:/bin:/usr/sbin:/sbin'
#if [[ "${OS}" == "Darwin" ]]; then
# # :FIXME: do we really need this?
# # if required we should do this in the build-block
# [[ -d "/opt/X11/bin" ]] && PATH+=':/opt/X11/bin' || \
# std::info "Xquarz is not installed in '/opt/X11'"
#fi
#..............................................................................
# global variables used in the library
@@ -52,8 +42,6 @@ declare -x ModuleRelease=''
# abs. path is "${PREFIX}/${_docdir}/$P"
declare -r _DOCDIR='share/doc'
# set default for the defined releases
if [[ -z ${PMODULES_DEFINED_RELEASES} ]]; then
declare -r PMODULES_DEFINED_RELEASES=":unstable:stable:deprecated:"
@@ -795,14 +783,20 @@ pbuild::make_all() {
std::info "${P}/${V}: skipping modulefile installation ..."
return
fi
local -r dst="${PMODULES_ROOT}/${ModuleGroup}/${PMODULES_MODULEFILES_DIR}/${P}"
# assemble name of modulefile
local dst="${PMODULES_ROOT}/"
dst+="${ModuleGroup}/"
dst+="${PMODULES_MODULEFILES_DIR}/"
dst+="${ModuleName}"
std::info "${P}/${V}: installing modulefile in '${dst}' ..."
mkdir -p "${dst}"
install -m 0444 "${src}" "${dst}/$V"
# directory where to install module- and release-file
local -r dstdir=${dst%/*}
std::info "${P}/${V}: installing modulefile in '${dstdir}' ..."
mkdir -p "${dstdir}"
install -m 0444 "${src}" "${dst}"
std::info "${P}/${V}: setting release to '${ModuleRelease}' ..."
local -r release_file=".release-${ModuleName##*/}"
echo "${ModuleRelease}" > "${dst}/${release_file}"
echo "${ModuleRelease}" > "${dstdir}/.release-$V"
}
##############################################################################
@@ -828,14 +822,17 @@ pbuild::make_all() {
[[ ${dry_run} == yes ]] && std::die 0 ""
check_compiler
if [[ ! -e "${MODULE_BUILDDIR}/.prep" ]] || [[ ${force_rebuild} == 'yes' ]] ; then
if [[ ! -e "${MODULE_BUILDDIR}/.prep" ]] || \
[[ ${force_rebuild} == 'yes' ]] || \
[[ -z ${target} ]]; then
pbuild::prep
touch "${MODULE_BUILDDIR}/.prep"
fi
[[ "${target}" == "prep" ]] && return 0
if [[ ! -e "${MODULE_BUILDDIR}/.configure" ]] || \
[[ ${force_rebuild} == 'yes' ]]; then
[[ ${force_rebuild} == 'yes' ]] || \
[[ -z ${target} ]]; then
cd "${MODULE_SRCDIR}"
pbuild::pre_configure
cd "${MODULE_BUILDDIR}"
@@ -844,14 +841,18 @@ pbuild::make_all() {
fi
[[ "${target}" == "configure" ]] && return 0
if [[ ! -e "${MODULE_BUILDDIR}/.compile" ]] || [[ ${force_rebuild} == 'yes' ]]; then
if [[ ! -e "${MODULE_BUILDDIR}/.compile" ]] || \
[[ ${force_rebuild} == 'yes' ]] || \
[[ -z ${target} ]]; then
cd "${MODULE_BUILDDIR}"
pbuild::build
touch "${MODULE_BUILDDIR}/.compile"
fi
[[ "${target}" == "compile" ]] && return 0
if [[ ! -e "${MODULE_BUILDDIR}/.install" ]] || [[ ${force_rebuild} == 'yes' ]]; then
if [[ ! -e "${MODULE_BUILDDIR}/.install" ]] || \
[[ ${force_rebuild} == 'yes' ]] || \
[[ -z ${target} ]]; then
cd "${MODULE_BUILDDIR}"
pbuild::install
pbuild::post_install
-2
View File
@@ -11,8 +11,6 @@ pmodules::get_options() {
pmodules::check_env_vars() {
[[ -n "${PMODULES_ROOT}" ]] &&
[[ -n "${PMODULES_CONFIG_DIR}" ]] &&
[[ -n "${PMODULES_TEMPLATES_DIR}" ]] &&
[[ -n "${PMODULES_HOME}" ]] &&
[[ -n "${PMODULES_VERSION}" ]] || std::die 1 "
Error: the module environment you are going to use as source has not been
+10 -16
View File
@@ -7,7 +7,7 @@ declare -r mydir=$(dirname "$0")
declare -r libpbuild='libpbuild.bash'
declare -r libstd='libstd.bash'
declare -r pmodule_environment='environment.bash'
declare -r pmodules_build_config='modbuild.conf'
declare -ra bash_libpath=("${mydir}" "${mydir}/../lib")
##############################################################################
@@ -146,7 +146,7 @@ declare force_rebuild='no'
declare dry_run='no'
declare enable_cleanup_build='yes'
declare enable_cleanup_src='no'
declare target='all'
declare target=''
declare bootstrap='no'
declare variants_file=''
@@ -269,25 +269,20 @@ fi
declare -r OS
# assemble default path. We have to do this here, before
# including the modbuild configuration file.
PATH="/usr/bin:/bin:/usr/sbin:/sbin:${PMODULES_DIR}/bin"
# source Pmodule environment configuration
if [[ "${bootstrap}" == "yes" ]]; then
[[ -r ${BUILD_BLOCK_DIR}/../config/${pmodule_environment} ]] || \
[[ -r ${BUILD_BLOCK_DIR}/../config/${pmodules_build_config} ]] || \
std::die 1 "Cannot read configuration file!"
source "${BUILD_BLOCK_DIR}/../config/${pmodule_environment}"
source "${BUILD_BLOCK_DIR}/../config/${pmodules_build_config}"
declare -r BUILD_BASEDIR=$(std::get_abspath "${BUILD_BLOCK_DIR}/..")
if [[ -r "${BUILD_BLOCK_DIR}/../config/modbuild.conf" ]]; then
source "${BUILD_BLOCK_DIR}/../config/modbuild.conf"
fi
elif [[ -n ${PMODULES_ROOT} ]] && [[ -n ${PMODULES_CONFIG_DIR} ]] && \
[[ -r ${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/${pmodule_environment} ]]; then
source ${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/${pmodule_environment}
elif [[ -n "${PMODULES_ROOT}" ]] && [[ -n "${PMODULES_CONFIG_DIR}" ]] && \
[[ -r "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/modbuild.conf" ]]; then
source "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/modbuild.conf"
declare -r BUILD_BASEDIR=$(std::get_abspath "${BUILD_BLOCK_DIR}/../..")
if [[ -r "${PMODULES_ROOT}/config/modbuild.conf" ]]; then
source "${PMODULES_ROOT}/config/modbuild.conf"
fi
else
std::die 3 "Build environment not setup properbly!"
fi
@@ -323,7 +318,6 @@ if [[ ${bootstrap} == no ]]; then
fi
# initialize module environment
source "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/profile.bash"
MODULECMD="${PMODULES_HOME}/bin/modulecmd"
[[ -x ${MODULECMD} ]] || std::die 1 "${MODULECMD}: no such executable"
+1 -1
View File
@@ -1464,7 +1464,7 @@ pmodules_init() {
declare -g PMODULES_DEFAULT_GROUPS=''
declare -g PMODULES_DEFAULT_RELEASES=''
source "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/environment.bash"
source "${PMODULES_ROOT}/${PMODULES_CONFIG_DIR}/profile.bash"
declare -g LOADEDMODULES=''
declare -g PMODULES_USED_GROUPS=''
+5 -9
View File
@@ -7,18 +7,18 @@
# ${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION}
#
declare -x PMODULES_DEFAULT_GROUPS
declare -x PMODULES_DEFAULT_RELEASES
declare -x PMODULES_VERSION
: ${PMODULES_DEFAULT_GROUPS:='Tools Programming'}
: ${PMODULES_DEFAULT_RELEASES:='stable'}
: ${PMODULES_VERSION:="@PMODULES_VERSION@}"
: ${PMODULES_VERSION:=@PMODULES_VERSION@}
#############################################################################
# N O C H A N G E S B E L O W T H I S L I N E ! #
#############################################################################
declare -x PMODULES_DEFAULT_GROUPS
declare -x PMODULES_DEFAULT_RELEASES
declare -x PMODULES_VERSION
declare -x PMODULES_MODULEFILES_DIR='modulefiles'
declare -x PMODULES_DEFINED_RELEASES=':unstable:stable:deprecated:'
@@ -27,10 +27,6 @@ declare -x PMODULES_CONFIG_DIR=$(basename $(cd $(dirname "${BASH_SOURCE}") && pw
declare -x PMODULES_HOME="${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION}"
declare -x PMODULES_DIR="${PMODULES_HOME}"
declare -x PMODULES_TEMPLATES_DIR='templates'
declare -x PMODULES_DISTFILESDIR="@PMODULES_DISTFILESDIR@"
declare -x PMODULES_TMPDIR="@PMODULES_TMPDIR@"
############################################################################
# some sanity checks
#
-24
View File
@@ -1,24 +0,0 @@
#!/bin/bash
#
#
# define PMODULES_ROOT only if it has not been passed as argument
# to build/install scripts
#
if [[ -z "${PMODULES_ROOT}" ]]; then
declare -x PMODULES_ROOT='/home/psi.local'
fi
declare -x PMODULES_CONFIG_DIR='config'
declare -x PMODULES_MODULEFILES_DIR='modulefiles'
declare -x PMODULES_TEMPLATES_DIR='templates'
declare -x PMODULES_HOME="${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION}"
declare -x PMODULES_DEFAULT_GROUPS='Tools Programming'
declare -x PMODULES_DEFINED_RELEASES=':unstable:stable:deprecated:'
declare -x PMODULES_DEFAULT_RELEASES='stable'
declare -x PMODULES_DISTFILESDIR='/afs/psi.ch/software/Pmodules/distfiles'
declare -x PMODULES_TMPDIR="/var/tmp/${USER}"
-31
View File
@@ -1,31 +0,0 @@
#!/bin/bash
#
#
# define PMODULES_ROOT only if it has not been passed as argument
# to build/install scripts
#
if [[ -z "${PMODULES_ROOT}" ]]; then
declare -x PMODULES_ROOT='/opt/psi'
fi
declare -x PMODULES_CONFIG_DIR='config'
declare -x PMODULES_MODULEFILES_DIR='modulefiles'
declare -x PMODULES_TEMPLATES_DIR='templates'
declare -x PMODULES_HOME="${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION}"
declare -x PMODULES_DEFAULT_GROUPS='Tools Programming'
declare -x PMODULES_DEFINED_RELEASES=':unstable:stable:deprecated:'
declare -x PMODULES_DEFAULT_RELEASES='stable'
if [[ -z ${PMODULES_DISTFILESDIR} ]]; then
PMODULES_DISTFILESDIR='/afs/psi.ch/software/Pmodules/distfiles'
fi
declare -x PMODULES_DISTFILESDIR
if [[ -z ${PMODULES_TMPDIR} ]]; then
PMODULES_TMPDIR="/var/tmp/${USER}"
fi
declare -x PMODULES_TMPDIR
+25
View File
@@ -1,5 +1,30 @@
#!/bin/bash
#
# define PMODULES_ROOT only if it has not been passed as argument
# to build/install scripts
#
declare -x PMODULES_ROOT
declare -x PMODULES_DISTFILESDIR
declare -x PMODULES_TMPDIR
: ${PMODULES_ROOT:=/opt/psi}
: ${PMODULES_DISTFILESDIR:=/opt/psi/var/distfiles}
: ${PMODULES_TMPDIR:=/var/tmp/${USER}}
declare -x PMODULES_CONFIG_DIR='config'
declare -x PMODULES_MODULEFILES_DIR='modulefiles'
declare -x PMODULES_HOME="${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION}"
declare -x PMODULES_DEFAULT_GROUPS='Tools Programming'
declare -x PMODULES_DEFINED_RELEASES=':unstable:stable:deprecated:'
declare -x PMODULES_DEFAULT_RELEASES='stable'
#-----------------------------------------------------------------------------
# OS specific configuration
#
case ${OS} in
Darwin )
declare -x MACOSX_DEPLOYMENT_TARGET='10.12'
@@ -1,17 +1,15 @@
#!/bin/bash
#
#
# define PMODULES_ROOT only if it has not been passed as argument
# to build/install scripts
#
if [[ -z "${PMODULES_ROOT}" ]]; then
declare -x PMODULES_ROOT='@PMODULES_ROOT@'
fi
: ${PMODULES_ROOT:=@PMODULES_ROOT@}
: ${PMODULES_DISTFILESDIR:=@PMODULES_DISTFILESDIR@}
: ${PMODULES_TMPDIR:=@PMODULES_TMPDIR@}
declare -x PMODULES_CONFIG_DIR='config'
declare -x PMODULES_MODULEFILES_DIR='modulefiles'
declare -x PMODULES_TEMPLATES_DIR='templates'
declare -x PMODULES_HOME="${PMODULES_ROOT}/Tools/Pmodules/${PMODULES_VERSION}"
@@ -19,13 +17,16 @@ declare -x PMODULES_DEFAULT_GROUPS='Tools Programming'
declare -x PMODULES_DEFINED_RELEASES=':unstable:stable:deprecated:'
declare -x PMODULES_DEFAULT_RELEASES='stable'
if [[ -z ${PMODULES_DISTFILESDIR} ]]; then
PMODULES_DISTFILESDIR='@PMODULES_DISTFILESDIR@'
fi
declare -x PMODULES_DISTFILESDIR
if [[ -z ${PMODULES_TMPDIR} ]]; then
PMODULES_TMPDIR="/var/tmp/${USER}"
fi
declare -x PMODULES_TMPDIR
#-----------------------------------------------------------------------------
# OS specific configuration
#
case ${OS} in
Darwin )
declare -x MACOSX_DEPLOYMENT_TARGET='10.12'
#declare -rx SDKROOT='macosx10.9'
;;
esac