From 78af18063cb9a68e4c8eb83f971705dd603dec50 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 13 Mar 2015 15:27:37 +0100 Subject: [PATCH 01/50] scripts/Bootstrap/Pmodules/libpmodules.bash: 'check_modules_env()' splitted into 'check_pmodules_env_vars()' and 'check_pmodules_directories()' --- scripts/Bootstrap/Pmodules/libpmodules.bash | 22 ++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/scripts/Bootstrap/Pmodules/libpmodules.bash b/scripts/Bootstrap/Pmodules/libpmodules.bash index 0590835..c54bb78 100644 --- a/scripts/Bootstrap/Pmodules/libpmodules.bash +++ b/scripts/Bootstrap/Pmodules/libpmodules.bash @@ -58,7 +58,7 @@ get_options() { "${bindir}/getopt" "$@" } -check_pmodules_env() { +check_pmodules_env_vars() { [[ -n "${PSI_PREFIX}" ]] && [[ -n "${PSI_CONFIG_DIR}" ]] && [[ -n "${PSI_MODULES_ROOT}" ]] && @@ -67,14 +67,22 @@ check_pmodules_env() { [[ -n "${PMODULES_VERSION}" ]] || die 1 " Error: the module environment you are going to use as source has not been initialized properly!" +} - [[ -d "${PSI_PREFIX}" ]] && - [[ -d "${PSI_PREFIX}/${PSI_CONFIG_DIR}" ]] && - [[ -d "${PSI_PREFIX}/${PSI_MODULES_ROOT}" ]] && - [[ -d "${PSI_PREFIX}/${PSI_TEMPLATES_DIR}" ]] && - [[ -d "${PMODULES_HOME}" ]] || die 1 " -Error: the module environment '$PSI_PREFIX' has not been initialized properly!" +check_pmodules_directories() { + local -r src_prefix="$1" + [[ -d "${src_prefix}" ]] && + [[ -d "${src_prefix}/${PSI_CONFIG_DIR}" ]] && + [[ -d "${src_prefix}/${PSI_MODULES_ROOT}" ]] && + [[ -d "${src_prefix}/${PSI_TEMPLATES_DIR}" ]] && + [[ -d "${src_prefix}/Tools/Pmodules/${PMODULES_VERSION}" ]] || die 1 " +Error: the module environment '${src_prefix}' has not been initialized properly!" +} + +check_pmodules_env() { + check_pmodules_env_vars + check_pmodules_directories "${PSI_PREFIX}" } From 543f7fa523c15a81c1cc5451d1aad4b075bc0d01 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 13 Mar 2015 15:31:56 +0100 Subject: [PATCH 02/50] scripts/Bootstrap/Pmodules/modmanage.in: create dir '/modulefiles'; add installation source to environment.bash --- scripts/Bootstrap/Pmodules/modmanage.in | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/Bootstrap/Pmodules/modmanage.in b/scripts/Bootstrap/Pmodules/modmanage.in index 6301e31..4ec9b3b 100755 --- a/scripts/Bootstrap/Pmodules/modmanage.in +++ b/scripts/Bootstrap/Pmodules/modmanage.in @@ -25,7 +25,7 @@ Switches: --force force overwrite Available SubCommands and Args: - init [--src=] [--user=] --dst= + init [--src=] [--user=] Initialize a new minimal Pmodule environment. install [--with=...] @@ -197,6 +197,7 @@ environment at '${PSI_PREFIX}' " init_pmodules_environment() { + local -r src_prefix="${PSI_PREFIX}" local -r target_prefix=$1 local src='' local dst='' @@ -212,26 +213,37 @@ environment at '${PSI_PREFIX}' $DRY mkdir -p "${target_prefix}" || die 1 "Error: make directory failed!" echo - src="${PSI_PREFIX}/${PSI_CONFIG_DIR}/" + src="${src_prefix}/${PSI_CONFIG_DIR}/" dst="${target_prefix}/${PSI_CONFIG_DIR}/" echo "Synching configuration from '${src}' to '${dst}'..." $DRY rsync --recursive --links --perms --delete \ "${src}" "${dst}" || die 1 "Error: synch operation failed!" echo - src="${PSI_PREFIX}/${PSI_TEMPLATES_DIR}/" + src="${src_prefix}/${PSI_TEMPLATES_DIR}/" dst="${target_prefix}/${PSI_TEMPLATES_DIR}/" echo "Synching template files from '${src}' to '${dst}'..." $DRY rsync --recursive --links --perms --delete \ "${src}" "${dst}" || die 1 "Error: synch operation failed!" echo + dst="${target_prefix}/${PSI_MODULES_ROOT}/" + echo "Creating root directory '${dst}' for module hierarchy ..." + $DRY mkdir -p "${dst}" + echo + echo "Syncing Pmodules ..." sync_module "Tools/Pmodules/${PMODULES_VERSION}" \ - "${PSI_PREFIX}" \ + "${src_prefix}" \ "${target_prefix}" || die 1 "Error: sync Pmodules failed!" echo - + + dst="${target_prefix}/${PSI_CONFIG_DIR}/environment.bash" + echo "Adding installation source '${src_prefix}' to '${dst}'..." + sed -i .bak '/PMODULES_INSTALL_SOURCE/d' "${dst}" + echo "declare -x PMODULES_INSTALL_SOURCE=\"${src_prefix}\"" >> "${dst}" + echo + if [[ -n "${user}" ]]; then echo "Changing user of new module environment to '${user}'..." $DRY chown -R "${user}" "${target_prefix}" || die 1 "Error: changing owner failed!" @@ -287,7 +299,7 @@ subcommand_install() { esac shift done - ${PMODULES_HOME}/bin/modulecmd bash search "${module_pattern[@]}" "${with[@]/#/--with}" "${releases[@]/#/--release=}" --no-header + PSI_PREFIX="${PMODULES_INSTALL_SOURCE}" ${PMODULES_HOME}/bin/modulecmd bash search "${module_pattern[@]}" "${with[@]/#/--with}" "${releases[@]/#/--release=}" --no-header } while (($# > 0)); do From c537be0ed9b821751eea9e332751ec1cf319d7a9 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 13 Mar 2015 15:33:23 +0100 Subject: [PATCH 03/50] scripts/Bootstrap/Pmodules/modulecmd.in: '--src=' option added to search sub-command --- scripts/Bootstrap/Pmodules/modulecmd.in | 44 ++++++++++++++++--------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/scripts/Bootstrap/Pmodules/modulecmd.in b/scripts/Bootstrap/Pmodules/modulecmd.in index 9901229..ba1a5f2 100755 --- a/scripts/Bootstrap/Pmodules/modulecmd.in +++ b/scripts/Bootstrap/Pmodules/modulecmd.in @@ -10,6 +10,8 @@ declare -rx PSI_LIBMODULES="${PMODULES_DIR}/lib/libmodules.tcl" declare -r modulepath_root="${PSI_PREFIX}/${PSI_MODULES_ROOT}" declare -ra modulepath=( ${MODULEPATH//:/ } ) +source "${PMODULES_DIR}/lib/libpmodules.bash" + if set -o | grep 'xtrace' | grep -q 'on'; then declare -r __XTRACE__='on' else @@ -668,22 +670,25 @@ subcommand_avail() { } get_families () { - if [[ ! -d "${modulepath_root}" ]]; then + local -r module_hierarchy_root="$1" + if [[ ! -d "${module_hierarchy_root}" ]]; then echo "" else { - cd "${modulepath_root}" + cd "${module_hierarchy_root}" ls -1 } fi } # -# $1: family name (not path!) +# $1: root of modulefile hierarchy +# $2: family name (not path!) compute_family_depth () { + local -r module_hierarchy_root="$1" + local -r family=$2 { - local -r family=$1 - cd "${modulepath_root}" + cd "${module_hierarchy_root}" local -r tmp=$(find "${family}" -depth -type f -o -type l | head -1) local -ar tmp2=( ${tmp//\// } ) local depth=${#tmp2[@]} @@ -701,8 +706,8 @@ subcommand_use() { echo -e "\t${f}" 1>&2 done echo -e "\nFamilies you may use in addition:" 1>&2 - for family in $(get_families); do - local -i depth=$( compute_family_depth "${family}") + for family in $(get_families "${modulepath_root}"); do + local -i depth=$( compute_family_depth "${modulepath_root}" "${family}") if ! is_used_family $f && (( depth == 0 )); then echo -e "\t${f}" 1>&2 fi @@ -739,7 +744,7 @@ subcommand_use() { # releases are always *appended* append_path PSI_USED_RELEASES "${arg}" elif [[ ! ${arg} =~ */* ]] && [[ -d ${modulepath_root}/${arg} ]]; then - local -i depth=$(compute_family_depth "${arg}") + local -i depth=$(compute_family_depth "${modulepath_root}" "${arg}") if (( depth == 0 )); then dirs_to_add+=( ${modulepath_root}/${arg} ) else @@ -816,6 +821,7 @@ subcommand_clear() { subcommand_search() { local modules=() local with_modules='//' + local src_prefix='' local _print_header='yes' local _print_modulefiles='no' local use_releases=':' @@ -833,22 +839,23 @@ subcommand_search() { # $1: module name pattern search () { local -r module=$1 + local -r module_hierarchy_root="${src_prefix}/${PSI_MODULES_ROOT}" # we must write temporary results to a file for sorting local -r tmpfile=$( mktemp /tmp/$(basename $0).XXXXXX ) || exit 1 local family # loop over all families - for family in $(get_families); do - local -i depth=$( compute_family_depth ${family} ) + for family in $(get_families "${module_hierarchy_root}"); do + local -i depth=$( compute_family_depth "${module_hierarchy_root}" "${family}" ) # get all potential directories of family $f with module-files local mpaths=( $(find \ - "${modulepath_root}/${family}" \ + "${module_hierarchy_root}/${family}" \ -type d \ -mindepth ${depth} -maxdepth ${depth} \ 2>/dev/null)) local mpath for mpath in "${mpaths[@]}"; do # get dependencies encoded in directory name - local p="${mpath/${modulepath_root}}" + local p="${mpath/${module_hierarchy_root}}" p=( ${p//\// } ) local deps=() local -i i @@ -870,7 +877,7 @@ subcommand_search() { done done done - if [[ "{_print_modulefiles}" == "no" ]]; then + if [[ "${_print_modulefiles}" == "no" ]]; then sort -k 1,1 -k 4,4 -k 5,5 "${tmpfile}" | awk "${with_modules}" 1>&2 else while read -a line; do @@ -914,6 +921,10 @@ subcommand_search() { -a | --all-releases ) use_releases=${available_releases} ;; + --src=* ) + src_prefix=${1/--src=} + check_pmodules_directories "${src_prefix}" + ;; -? | -h | --help ) usage ;; @@ -927,9 +938,12 @@ subcommand_search() { esac shift done - + if [[ -z "${src_prefix}" ]]; then + src_prefix="${PSI_PREFIX}" + fi + if [[ "${use_releases}" == ":" ]]; then - use_releases=":${PSI_USED_RELEASES}:" + use_releases=":${PSI_USED_RELEASES}:" fi [[ "${_print_header}" == "yes" ]] && print_header From 2c2a4f669d68382d250f9c5eb0b54bc165027d90 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 17 Mar 2015 10:05:25 +0100 Subject: [PATCH 04/50] scripts/Bootstrap/Pmodules/modulecmd.in: redirect output of sub-command 'search' to stderr if option '--print-modulefiles' is used --- scripts/Bootstrap/Pmodules/modulecmd.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/Bootstrap/Pmodules/modulecmd.in b/scripts/Bootstrap/Pmodules/modulecmd.in index ba1a5f2..bc47ba7 100755 --- a/scripts/Bootstrap/Pmodules/modulecmd.in +++ b/scripts/Bootstrap/Pmodules/modulecmd.in @@ -881,11 +881,11 @@ subcommand_search() { sort -k 1,1 -k 4,4 -k 5,5 "${tmpfile}" | awk "${with_modules}" 1>&2 else while read -a line; do - echo -n "${line[2]}/" + echo -n "${line[2]}/" 1>&2 for d in "${line[@]:3}"; do - echo -n "$d/" + echo -n "$d/" 1>&2 done - echo "${line[0]}" + echo "${line[0]}" 1>&2 done < <(sort -k 1,1 -k 4,4 -k 5,5 "${tmpfile}" | awk "${with_modules}") fi rm -f "${tmpfile}" From 2fb13788e5f834038a1b0866c52bd4900a8d0df5 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 17 Mar 2015 10:59:47 +0100 Subject: [PATCH 05/50] scripts/Bootstrap/Pmodules/modmanage.in: sub-command 'install' implemented --- scripts/Bootstrap/Pmodules/modmanage.in | 40 +++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/scripts/Bootstrap/Pmodules/modmanage.in b/scripts/Bootstrap/Pmodules/modmanage.in index 4ec9b3b..dfec8d1 100755 --- a/scripts/Bootstrap/Pmodules/modmanage.in +++ b/scripts/Bootstrap/Pmodules/modmanage.in @@ -267,8 +267,10 @@ subcommand_install() { local -a with=() local -a releases=() local -a module_pattern=() + local -r src_prefix="${PMODULES_INSTALL_SOURCE}" + local -r target_prefix="${PSI_PREFIX}" - opts=$(get_options -o h -l with: -l release: -l help -- "$@") + opts=$(get_options -o h -l with: -l release: -l help -l src: -- "$@") if [[ $? != 0 ]]; then subcommand_help_install exit 1 @@ -278,7 +280,10 @@ subcommand_install() { case $1 in --release ) releases+=( "$2" ) - echo $2 + shift + ;; + --src ) + src_prefix="$2" shift ;; --with ) @@ -299,7 +304,36 @@ subcommand_install() { esac shift done - PSI_PREFIX="${PMODULES_INSTALL_SOURCE}" ${PMODULES_HOME}/bin/modulecmd bash search "${module_pattern[@]}" "${with[@]/#/--with}" "${releases[@]/#/--release=}" --no-header + local -A modules_to_install + local -i n=0 + while read rel_modulefile; do + modules_to_install["${rel_modulefile}"]+='.' + let n+=1 + done < <(${PMODULES_HOME}/bin/modulecmd bash search \ + "${module_pattern[@]}" \ + "${with[@]/#/--with}" \ + "${releases[@]/#/--release=}" \ + --no-header --print-modulefiles \ + --src="${src_prefix}" 2>&1) + (( n == 0 )) && die 0 "Nothing to install..." + echo -e "The following modules will be installed/updated:\n" 1>&2 + for key in "${!modules_to_install[@]}"; do + echo " ${key}" 1>&2 + done + echo 1>&2 + get_YN_answer "Do you want to continue? [n] " || die 1 "Aborting..." + echo 1>&2 + for rel_modulefile in "${!modules_to_install[@]}"; do + if [[ -d "${target_prefix}/${rel_modulefile}" ]]; then + echo " Updating; ${rel_modulefile}..." 1>&2 + else + echo " Installing: ${rel_modulefile}..." + fi + sync_module "${rel_modulefile}" \ + "${src_prefix}" \ + "${target_prefix}" + done + echo -e "\nDone!\n" 1>&2 } while (($# > 0)); do From 9a745ecfc81a0ec52ddcaeee084af2e4d30c37b3 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 17 Mar 2015 17:22:15 +0100 Subject: [PATCH 06/50] scripts/Bootstrap/Pmodules/environment.bash: renamed --- .../Bootstrap/Pmodules/{environment.bash => environment.bash.in} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/Bootstrap/Pmodules/{environment.bash => environment.bash.in} (100%) diff --git a/scripts/Bootstrap/Pmodules/environment.bash b/scripts/Bootstrap/Pmodules/environment.bash.in similarity index 100% rename from scripts/Bootstrap/Pmodules/environment.bash rename to scripts/Bootstrap/Pmodules/environment.bash.in From 4faf9f7d29a906ed5864e65ade89afc472c5c74f Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 17 Mar 2015 17:23:34 +0100 Subject: [PATCH 07/50] config/Pmodules.conf: PMODULES_VERSION bumped to 0.99.2 --- config/Pmodules.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/Pmodules.conf b/config/Pmodules.conf index 15fb32d..15cae9f 100644 --- a/config/Pmodules.conf +++ b/config/Pmodules.conf @@ -1,4 +1,4 @@ -declare -x PMODULES_VERSION=0.99.1 +declare -x PMODULES_VERSION=0.99.2 declare -x MODULES_VERSION=3.2.10 declare -a COMPILER_VERSIONS=( 'gcc/4.7.4' 'gcc/4.8.3' 'gcc/4.8.4' 'gcc/4.9.2' ) From 025180d9fc9fe37b1daf9212b13c079397078f8a Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 17 Mar 2015 17:24:51 +0100 Subject: [PATCH 08/50] scripts/Bootstrap/install_pmodules.sh: run 'environment.bash.in' throu sed --- scripts/Bootstrap/install_pmodules.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/Bootstrap/install_pmodules.sh b/scripts/Bootstrap/install_pmodules.sh index 76fc0b1..13d301d 100755 --- a/scripts/Bootstrap/install_pmodules.sh +++ b/scripts/Bootstrap/install_pmodules.sh @@ -14,6 +14,7 @@ sed_cmd+="s:@PMODULES_VERSION@:${PMODULES_VERSION}:g;" sed_cmd+="s:@MODULES_VERSION@:${MODULES_VERSION}:g" sed "${sed_cmd}" "${SRC_DIR}/modulecmd.in" > "${SRC_DIR}/modulecmd" sed "${sed_cmd}" "${SRC_DIR}/modmanage.in" > "${SRC_DIR}/modmanage.bash" +sed "${sed_cmd}" "${SRC_DIR}/environment.bash.in" > "${SRC_DIR}/environment.bash" install -d -m 0755 "${PMODULES_HOME}/bin" install -d -m 0755 "${PMODULES_HOME}/config" From 30e636c03026f49a8fa3e446a1356156879c096f Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 17 Mar 2015 17:29:09 +0100 Subject: [PATCH 09/50] scripts/Bootstrap/Pmodules/bash: set MODULEPATH if empty only; remove old PMODUES_HOME in PATH and MANPATH; legacy variables MODULE_VERSION, MODULE_VERSION_STACK and MODULESHOME removed --- scripts/Bootstrap/Pmodules/bash | 51 ++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/scripts/Bootstrap/Pmodules/bash b/scripts/Bootstrap/Pmodules/bash index c5085bb..e55b9dc 100644 --- a/scripts/Bootstrap/Pmodules/bash +++ b/scripts/Bootstrap/Pmodules/bash @@ -90,6 +90,33 @@ prepend_path () { fi } +# +# Replace or remove a directory in a path variable. +# +# To remove a dir: +# replace_path PATH +# +# To replace a dir: +# replace_path PATH /replacement/path +# +# Args: +# $1 name of the shell variable to set (e.g. PATH) +# $2 a grep pattern identifying the element to be removed/replaced +# $3 the replacement string (use "" for removal) +# +# Based on solution published here: +# https://stackoverflow.com/questions/273909/how-do-i-manipulate-path-elements-in-shell-scripts +# +function replace_path () { + local -r path=$1 + local -r removepat=$2 + local -r replacestr=$3 + + local -r removestr=$(echo "${!path}" | tr ":" "\n" | grep -m 1 "^$removepat\$") + export $path=$(echo "${!path}" | tr ":" "\n" | sed "s:^${removestr}\$:${replacestr}:" | + sed '/^\s*$/d' | tr "\n" ":" | sed -e 's|^:||' -e 's|:$||') +} + ############################################################################# # setup environment # @@ -99,18 +126,20 @@ fi if [[ -z ${MODULEPATH} ]]; then declare -x MODULEPATH='' + for f in ${PSI_DEFAULT_FAMILIES}; do + append_path MODULEPATH "${PSI_PREFIX}/${PSI_MODULES_ROOT}/$f" + append_path PSI_LOADEDFAMILIES "${f}" + done fi if [[ -z ${PSI_LOADEDFAMILIES} ]]; then declare -x PSI_LOADEDFAMILIES='' fi -for f in ${PSI_DEFAULT_FAMILIES}; do - append_path MODULEPATH "${PSI_PREFIX}/${PSI_MODULES_ROOT}/$f" - append_path PSI_LOADEDFAMILIES "${f}" -done -append_path PATH "${PMODULES_HOME}/bin" -append_path MANPATH "${PMODULES_HOME}/share/man" +replace_path PATH "${PMODULES_HOME%/*}/.*" +replace_path MANPATH "${PMODULES_HOME%/*}/.*" +append_path PATH "${PMODULES_HOME}/bin" +append_path MANPATH "${PMODULES_HOME}/share/man" ############################################################################# # initialize bash completion @@ -122,10 +151,12 @@ fi ############################################################################# # legacy... # -declare -x MODULE_VERSION=${PMODULES_VERSION} -declare -x MODULE_VERSION_STACK="${PMODULE_VERSION}" -declare -x MODULESHOME="${PMODULES_HOME}" - +#declare -x MODULE_VERSION=${PMODULES_VERSION} +#declare -x MODULE_VERSION_STACK="${PMODULE_VERSION}" +#declare -x MODULESHOME="${PMODULES_HOME}" +unset MODULE_VERSION +unset MODULE_VERSION_STACK +unset MODULESHOME # Local Variables: # mode: sh From 0366201a0bad69bf6613f934985f4d721dd4826a Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 17 Mar 2015 17:30:34 +0100 Subject: [PATCH 10/50] scripts/Bootstrap/Pmodules/environment.bash.in: hardcoded version replaced with @PMODULES_VERSION@ --- scripts/Bootstrap/Pmodules/environment.bash.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Bootstrap/Pmodules/environment.bash.in b/scripts/Bootstrap/Pmodules/environment.bash.in index be8bfca..16c9eb9 100644 --- a/scripts/Bootstrap/Pmodules/environment.bash.in +++ b/scripts/Bootstrap/Pmodules/environment.bash.in @@ -3,7 +3,7 @@ declare -x PSI_PREFIX=$(cd $(dirname "${BASH_SOURCE}")/.. && pwd) if [[ -z ${PMODULES_VERSION} ]]; then - declare -x PMODULES_VERSION="0.99.1" + declare -x PMODULES_VERSION="@PMODULES_VERSION@" fi declare -x PMODULES_HOME="${PSI_PREFIX}/Tools/Pmodules/${PMODULES_VERSION}" From 2172a047c10293f63551f9cce01e0312940f68df Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 17 Mar 2015 17:32:24 +0100 Subject: [PATCH 11/50] ignore files edited --- scripts/Bootstrap/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/Bootstrap/.gitignore b/scripts/Bootstrap/.gitignore index 11934a7..f3c2f53 100644 --- a/scripts/Bootstrap/.gitignore +++ b/scripts/Bootstrap/.gitignore @@ -1,2 +1,3 @@ +environment.bash modulecmd modmanage.bash From 861ab772be18eda7617bd46b6af521d1c9f6ffcc Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 14:48:00 +0100 Subject: [PATCH 12/50] config/Pmodules.conf: family configuration removed, did not work properly anyway --- config/Pmodules.conf | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/config/Pmodules.conf b/config/Pmodules.conf index 15cae9f..956049e 100644 --- a/config/Pmodules.conf +++ b/config/Pmodules.conf @@ -4,14 +4,3 @@ declare -x MODULES_VERSION=3.2.10 declare -a COMPILER_VERSIONS=( 'gcc/4.7.4' 'gcc/4.8.3' 'gcc/4.8.4' 'gcc/4.9.2' ) declare -a MPI_VERSIONS=( 'openmpi/1.6.5' 'openmpi/1.8.2' 'openmpi/1.8.4' ) declare -a HDF5_VERSIONS=( 'hdf5/1.8.12' 'hdf5/1.8.14' ) - -declare COMPILER='gcc' -declare COMPILER_VERSION='4.8.4' -declare GCC_VERSION="${COMPILER_VERSION}" - -declare MPI='openmpi' -declare MPI_VERSION='1.8.4' -declare OPENMPI_VERSION="${MPI_VERSION}" - -declare HDF5='hdf5/1.8.12' -declare HDF5_serial='hdf5_serial/1.8.12' From cc7a8100ac7d6333300123e4704d655dd0893c30 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 14:49:09 +0100 Subject: [PATCH 13/50] lib/libem.bash: load modules specified with '--with=' while sourcing the library --- lib/libem.bash | 177 ++++++++++++++++++++++++------------------------- 1 file changed, 88 insertions(+), 89 deletions(-) diff --git a/lib/libem.bash b/lib/libem.bash index f63c895..67fc508 100644 --- a/lib/libem.bash +++ b/lib/libem.bash @@ -96,85 +96,6 @@ ENV=VALUE exit 1 } - -debug_on='no' -force_rebuild='no' -ENVIRONMENT_ARGS='' -dry_run='no' -bootstrap='no' - -# array collecting all modules specified on the command line via '--with=module' -with_modules=() - -while (( $# > 0 )); do - case $1 in - -j ) - JOBS=$2 - shift - ;; - --jobs=[0-9]* ) - JOBS=${1/--jobs=} - ;; - -v | --verbose) - debug_on='yes' - ;; - -f | --force-rebuild ) - force_rebuild='yes' - ;; - -b | --bootstrap ) - bootstrap='yes' - force_rebuild='yes' - ;; - -? | -h | --help ) - usage - ;; - --dry-run ) - dry_run='yes' - ;; - --release=* ) - MODULE_RELEASE=${1/--release=} - ;; - --with=*/* ) - with_modules+=( ${1/--with=} ) - ;; - *=* ) - eval $1 - ENVIRONMENT_ARGS="${ENVIRONMENT_ARGS} $1" - ;; - * ) - V=$1 - ;; - esac - shift -done - -if [[ ${debug_on} == yes ]]; then - trap 'echo "$BASH_COMMAND"' DEBUG -fi - -# while bootstraping the module command is not yet available -if [[ ${bootstrap} == no ]]; then - source "${PSI_PREFIX}/${PSI_CONFIG_DIR}/profile.bash" - MODULECMD="${PMODULES_HOME}/bin/modulecmd" - [[ -x ${MODULECMD} ]] || die 1 "${MODULECMD}: no such executable" - module use unstable - module purge -fi - -P=$(basename $(dirname "${BUILDSCRIPT}")) -_P=$(echo $P | tr [:lower:] [:upper:]) -_P=${_P//-/_} -_V=${_P}_VERSION - -eval "${ENVIRONMENT_ARGS}" - -if [[ -n ${PSI_RELEASES} ]]; then - declare -r releases="${PSI_RELEASES}" -else - # set defaults, if file doesn't exist or isn't readable - declare -r releases=":unstable:stable:deprecated:" -fi - is_release () { [[ ${releases} =~ :$1: ]] } @@ -223,16 +144,6 @@ function module_is_available() { } function _load_build_dependencies() { - # :FIXME: merge this two loops, load only modules which are required - # this merge is not as easy as it looks like at a first glance! - for m in "${with_modules[@]}"; do - if module_is_available "$m"; then - echo "Loading module: ${m}" - module load "${m}" - else - die 44 "$m: module not available!" - fi - done for m in "${MODULE_BUILD_DEPENDENCIES[@]}"; do [[ -z $m ]] && continue if [[ ! $m =~ "*/*" ]]; then @@ -719,6 +630,94 @@ function em.make_all() { em.cleanup_build } +############################################################################## +# +debug_on='no' +force_rebuild='no' +ENVIRONMENT_ARGS='' +dry_run='no' +bootstrap='no' + +# array collecting all modules specified on the command line via '--with=module' +with_modules=() + +while (( $# > 0 )); do + case $1 in + -j ) + JOBS=$2 + shift + ;; + --jobs=[0-9]* ) + JOBS=${1/--jobs=} + ;; + -v | --verbose) + debug_on='yes' + ;; + -f | --force-rebuild ) + force_rebuild='yes' + ;; + -b | --bootstrap ) + bootstrap='yes' + force_rebuild='yes' + ;; + -? | -h | --help ) + usage + ;; + --dry-run ) + dry_run='yes' + ;; + --release=* ) + MODULE_RELEASE=${1/--release=} + ;; + --with=*/* ) + with_modules+=( ${1/--with=} ) + ;; + *=* ) + eval $1 + ENVIRONMENT_ARGS="${ENVIRONMENT_ARGS} $1" + ;; + * ) + V=$1 + ;; + esac + shift +done + +if [[ ${debug_on} == yes ]]; then + trap 'echo "$BASH_COMMAND"' DEBUG +fi + +# while bootstraping the module command is not yet available +if [[ ${bootstrap} == no ]]; then + source "${PSI_PREFIX}/${PSI_CONFIG_DIR}/profile.bash" + MODULECMD="${PMODULES_HOME}/bin/modulecmd" + [[ -x ${MODULECMD} ]] || die 1 "${MODULECMD}: no such executable" + module use unstable + module purge + for m in "${with_modules[@]}"; do + if module_is_available "$m"; then + echo "Loading module: ${m}" + module load "${m}" + else + die 44 "$m: module not available!" + fi + done +fi + +P=$(basename $(dirname "${BUILDSCRIPT}")) +_P=$(echo $P | tr [:lower:] [:upper:]) +_P=${_P//-/_} +_V=${_P}_VERSION + +eval "${ENVIRONMENT_ARGS}" + +if [[ -n ${PSI_RELEASES} ]]; then + declare -r releases="${PSI_RELEASES}" +else + # set defaults, if file doesn't exist or isn't readable + declare -r releases=":unstable:stable:deprecated:" +fi + # Local Variables: # mode: sh # sh-basic-offset: 8 From 6a7ae8ed52deef7ddee8ab4a57cb5b9ccc431472 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 14:50:41 +0100 Subject: [PATCH 14/50] scripts/Bootstrap/Pmodules/bash: run module purge and re-initialize everything --- scripts/Bootstrap/Pmodules/bash | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/scripts/Bootstrap/Pmodules/bash b/scripts/Bootstrap/Pmodules/bash index e55b9dc..e2276b6 100644 --- a/scripts/Bootstrap/Pmodules/bash +++ b/scripts/Bootstrap/Pmodules/bash @@ -117,24 +117,18 @@ function replace_path () { sed '/^\s*$/d' | tr "\n" ":" | sed -e 's|^:||' -e 's|:$||') } +module purge + ############################################################################# # setup environment # -if [[ -z ${LOADEDMODULES} ]]; then - declare -x LOADEDMODULES='' -fi - -if [[ -z ${MODULEPATH} ]]; then - declare -x MODULEPATH='' - for f in ${PSI_DEFAULT_FAMILIES}; do - append_path MODULEPATH "${PSI_PREFIX}/${PSI_MODULES_ROOT}/$f" - append_path PSI_LOADEDFAMILIES "${f}" - done -fi - -if [[ -z ${PSI_LOADEDFAMILIES} ]]; then - declare -x PSI_LOADEDFAMILIES='' -fi +declare -x LOADEDMODULES='' +declare -x PSI_LOADEDFAMILIES='' +declare -x MODULEPATH='' +for f in ${PSI_DEFAULT_FAMILIES}; do + append_path MODULEPATH "${PSI_PREFIX}/${PSI_MODULES_ROOT}/$f" + append_path PSI_LOADEDFAMILIES "${f}" +done replace_path PATH "${PMODULES_HOME%/*}/.*" replace_path MANPATH "${PMODULES_HOME%/*}/.*" @@ -151,9 +145,6 @@ fi ############################################################################# # legacy... # -#declare -x MODULE_VERSION=${PMODULES_VERSION} -#declare -x MODULE_VERSION_STACK="${PMODULE_VERSION}" -#declare -x MODULESHOME="${PMODULES_HOME}" unset MODULE_VERSION unset MODULE_VERSION_STACK unset MODULESHOME From 4f3d3c812a415e8e087720316966a3760068b970 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 17:44:12 +0100 Subject: [PATCH 15/50] lib/libem.bash: unset CDPATH added; fix problem with --bootstrap --- lib/libem.bash | 95 ++++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/lib/libem.bash b/lib/libem.bash index 67fc508..5dcb5cb 100644 --- a/lib/libem.bash +++ b/lib/libem.bash @@ -2,6 +2,9 @@ PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin +# disable auto-echo feature of 'cd' +unset CDPATH + shopt -s expand_aliases @@ -434,58 +437,56 @@ function _setup_env2() { } -if [[ ${bootstrap} == yes ]]; then - # redefine function for bootstrapping - function _setup_env2() { - if [[ -z ${MODULE_FAMILY} ]]; then +# redefine function for bootstrapping +function _setup_env2_bootstrap() { + if [[ -z ${MODULE_FAMILY} ]]; then die 1 "$P: family not set." - fi + fi - if [[ -z $V ]]; then + if [[ -z $V ]]; then V=$(eval echo \$${_P}_VERSION) - fi + fi - # oops, we need a version - if [[ -z $V ]]; then + # oops, we need a version + if [[ -z $V ]]; then die 1 "$P: Missing version." - fi - MODULE_SRCDIR="${BUILD_TMPDIR}/src/${P/_serial}-$V" - MODULE_BUILDDIR="${BUILD_TMPDIR}/build/$P-$V" - MODULE_FAMILY='Tools' - MODULE_NAME="Pmodules/${PMODULES_VERSION}" - # set PREFIX of module - PREFIX="${PSI_PREFIX}/${MODULE_FAMILY}/${MODULE_NAME}" - - MODULE_RELEASE='unstable' - info "${MODULE_NAME}: will be released as \"${MODULE_RELEASE}\"" + fi + MODULE_SRCDIR="${BUILD_TMPDIR}/src/${P/_serial}-$V" + MODULE_BUILDDIR="${BUILD_TMPDIR}/build/$P-$V" + MODULE_FAMILY='Tools' + MODULE_NAME="Pmodules/${PMODULES_VERSION}" + # set PREFIX of module + PREFIX="${PSI_PREFIX}/${MODULE_FAMILY}/${MODULE_NAME}" + + MODULE_RELEASE='unstable' + info "${MODULE_NAME}: will be released as \"${MODULE_RELEASE}\"" - # directory for README's, license files etc - DOCDIR="${PREFIX}/share/doc/$P" + # directory for README's, license files etc + DOCDIR="${PREFIX}/share/doc/$P" - # set tar-ball and flags for tar - TARBALL="${BUILD_DOWNLOADSDIR}/${P/_serial}" - if [[ -r "${TARBALL}-${V}.tar.gz" ]]; then - TARBALL+="-${V}.tar.gz" - elif [[ -r "${TARBALL}-${OS}-${V}.tar.gz" ]]; then - TARBALL+="-${OS}-${V}.tar.gz" - elif [[ -r "${TARBALL}-${V}.tar.bz2" ]]; then - TARBALL+="-${V}.tar.bz2" - elif [[ -r "${TARBALL}-${OS}-${V}.tar.bz2" ]]; then - TARBALL+="-${OS}-${V}.tar.bz2" - else - error "tar-ball for $P/$V not found." - exit 43 - fi - C_INCLUDE_PATH="${PREFIX}/include" - CPLUS_INCLUDE_PATH="${PREFIX}/include" - CPP_INCLUDE_PATH="${PREFIX}/include" - LIBRARY_PATH="${PREFIX}/lib" - LD_LIBRARY_PATH="${PREFIX}/lib" - DYLD_LIBRARY_PATH="${PREFIX}/lib" + # set tar-ball and flags for tar + TARBALL="${BUILD_DOWNLOADSDIR}/${P/_serial}" + if [[ -r "${TARBALL}-${V}.tar.gz" ]]; then + TARBALL+="-${V}.tar.gz" + elif [[ -r "${TARBALL}-${OS}-${V}.tar.gz" ]]; then + TARBALL+="-${OS}-${V}.tar.gz" + elif [[ -r "${TARBALL}-${V}.tar.bz2" ]]; then + TARBALL+="-${V}.tar.bz2" + elif [[ -r "${TARBALL}-${OS}-${V}.tar.bz2" ]]; then + TARBALL+="-${OS}-${V}.tar.bz2" + else + error "tar-ball for $P/$V not found." + exit 43 + fi + C_INCLUDE_PATH="${PREFIX}/include" + CPLUS_INCLUDE_PATH="${PREFIX}/include" + CPP_INCLUDE_PATH="${PREFIX}/include" + LIBRARY_PATH="${PREFIX}/lib" + LD_LIBRARY_PATH="${PREFIX}/lib" + DYLD_LIBRARY_PATH="${PREFIX}/lib" - PATH+=":${PREFIX}/bin" - } -fi + PATH+=":${PREFIX}/bin" +} function _prep() { @@ -600,7 +601,11 @@ function em.make_all() { _setup_env1 _load_build_dependencies # setup module specific environment - _setup_env2 + if [[ ${bootstrap} == no ]]; then + _setup_env2 + else + _setup_env2_bootstrap + fi if [[ ! -d "${PREFIX}" ]] || [[ ${force_rebuild} == 'yes' ]]; then echo "Building $P/$V ..." From 406536df533609b6c8c8f159f98c235c8832f16b Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 17:44:57 +0100 Subject: [PATCH 16/50] scripts/Bootstrap/Pmodules/modmanage.in: unset CDPATH added --- scripts/Bootstrap/Pmodules/modmanage.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/Bootstrap/Pmodules/modmanage.in b/scripts/Bootstrap/Pmodules/modmanage.in index dfec8d1..4579575 100755 --- a/scripts/Bootstrap/Pmodules/modmanage.in +++ b/scripts/Bootstrap/Pmodules/modmanage.in @@ -1,5 +1,7 @@ #!@PMODULES_HOME@/bin/bash +unset CDPATH + shopt -s expand_aliases declare -r bindir=$(cd $(dirname "$0") && pwd) From a777b1240c6c3be5ff65e902df308c469fb9ba44 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 17:46:18 +0100 Subject: [PATCH 17/50] scripts/Bootstrap/Pmodules/modulecmd.in: unset CDPATH added; print message in sub-command 'load' if no module specified --- scripts/Bootstrap/Pmodules/modulecmd.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/Bootstrap/Pmodules/modulecmd.in b/scripts/Bootstrap/Pmodules/modulecmd.in index bc47ba7..bb67e02 100755 --- a/scripts/Bootstrap/Pmodules/modulecmd.in +++ b/scripts/Bootstrap/Pmodules/modulecmd.in @@ -1,4 +1,8 @@ #!@PMODULES_HOME@/bin/bash +# + +# we have to unset CDPATH, otherwise 'cd' prints the directoy! +unset CDPATH declare -r PMODULES_DIR=$( cd "$(dirname $0)/.." && pwd ) declare -r version='@PMODULES_VERSION@' @@ -464,6 +468,11 @@ subcommand_generic1plus() { "${modulecmd}" "${shell}" "${subcommand}" "$@" } +# +# load module +# +# $1: module to load +# subcommand_load() { output_load_hints() { local -ra rels=( ${available_releases//:/ } ) @@ -509,7 +518,9 @@ subcommand_load() { } local -r m=$1 - if module_is_available "${m}"; then + if [[ "${m}" == "" ]]; then + echo "No module specified." 1>&2 + elif module_is_available "${m}"; then "${modulecmd}" "${shell}" load "${m}" else if [[ ${userlvl} = 'novice' ]]; then From 8a800c602fe905589dbc18d5726b4050df3b28d9 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 17:47:20 +0100 Subject: [PATCH 18/50] scripts/Bootstrap/compile_pmodules.sh: print message and exit, if something failed to compile --- scripts/Bootstrap/compile_pmodules.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/Bootstrap/compile_pmodules.sh b/scripts/Bootstrap/compile_pmodules.sh index 5c38325..9d60e93 100755 --- a/scripts/Bootstrap/compile_pmodules.sh +++ b/scripts/Bootstrap/compile_pmodules.sh @@ -8,13 +8,13 @@ source "${BASE_DIR}/config/Pmodules.conf" unset PMODULES_HOME source "/opt/psi/config/environment.bash" -${BOOTSTRAP_DIR}/gettext/build --bootstrap -${BOOTSTRAP_DIR}/getopt/build --bootstrap -${BOOTSTRAP_DIR}/dialog/build --bootstrap -${BOOTSTRAP_DIR}/bash/build --bootstrap -${BOOTSTRAP_DIR}/Tcl/build --bootstrap +${BOOTSTRAP_DIR}/gettext/build --bootstrap || { echo "compiling 'gettext' failed!"; exit 1; } +${BOOTSTRAP_DIR}/getopt/build --bootstrap || { echo "compiling 'getopt' failed!"; exit 1; } +${BOOTSTRAP_DIR}/dialog/build --bootstrap || { echo "compiling 'dialog' failed!"; exit 1; } +${BOOTSTRAP_DIR}/bash/build --bootstrap || { echo "compiling 'bash' failed!"; exit 1; } +${BOOTSTRAP_DIR}/Tcl/build --bootstrap || { echo "compiling 'Tcl' failed!"; exit 1; } # we have to remove the init directory - otherwise the next build will fail... rm -rf "${PMODULES_HOME}/init" -${BOOTSTRAP_DIR}/Modules/build --bootstrap +${BOOTSTRAP_DIR}/Modules/build --bootstrap || { echo "compiling 'Modules' failed!"; exit 1; } mv -v "${PMODULES_HOME}/bin/modulecmd" "${PMODULES_HOME}/bin/modulecmd.tcl" From 907ab0d0505f651c9d8ffa485b03a78732363f31 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 17:49:04 +0100 Subject: [PATCH 19/50] scripts/Bootstrap: all build dependencies removed --- scripts/Bootstrap/Tcl/build | 3 +-- scripts/Bootstrap/bash/build | 3 +-- scripts/Bootstrap/dialog/build | 1 - scripts/Bootstrap/gettext/build | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/Bootstrap/Tcl/build b/scripts/Bootstrap/Tcl/build index 402004d..78de767 100755 --- a/scripts/Bootstrap/Tcl/build +++ b/scripts/Bootstrap/Tcl/build @@ -21,7 +21,6 @@ function em.post_install() { { cd "${PREFIX}"/bin && rm -f tclsh && ln -fs tclsh${V%.*} tclsh; }; } -em.add_to_family 'Programming' +em.add_to_family 'Tools' em.set_docfiles 'license.terms' 'README' -em.set_build_dependencies "${COMPILER}" em.make_all diff --git a/scripts/Bootstrap/bash/build b/scripts/Bootstrap/bash/build index 19ef03f..edc9d5b 100755 --- a/scripts/Bootstrap/bash/build +++ b/scripts/Bootstrap/bash/build @@ -8,6 +8,5 @@ function em.configure() { || exit 1 } -em.add_to_family 'System' -em.set_build_dependencies "${COMPILER}" +em.add_to_family 'Tools' em.make_all diff --git a/scripts/Bootstrap/dialog/build b/scripts/Bootstrap/dialog/build index ae80ddd..edc9d5b 100755 --- a/scripts/Bootstrap/dialog/build +++ b/scripts/Bootstrap/dialog/build @@ -9,5 +9,4 @@ function em.configure() { } em.add_to_family 'Tools' -em.set_build_dependencies "${COMPILER}" em.make_all diff --git a/scripts/Bootstrap/gettext/build b/scripts/Bootstrap/gettext/build index 68d8744..9409c14 100755 --- a/scripts/Bootstrap/gettext/build +++ b/scripts/Bootstrap/gettext/build @@ -20,5 +20,4 @@ function em.configure() { } em.add_to_family 'Tools' -em.set_build_dependencies "${COMPILER}" em.make_all From 247d9431b51ebcec50494b3cae9ad9fb9b693ec8 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 18:08:05 +0100 Subject: [PATCH 20/50] scripts/Bootstrap/Pmodules/modmanage.in: in sub-command 'init': option '--version=' added, with this option you specify the version of Pmodules to be sync'ed --- scripts/Bootstrap/Pmodules/modmanage.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/Bootstrap/Pmodules/modmanage.in b/scripts/Bootstrap/Pmodules/modmanage.in index 4579575..5168a50 100755 --- a/scripts/Bootstrap/Pmodules/modmanage.in +++ b/scripts/Bootstrap/Pmodules/modmanage.in @@ -142,7 +142,7 @@ subcommand_init() { local target_prefixes=() local user='' local opts='' - opts=$(get_options -o h -l src: -l user: -l help -- "$@") + opts=$(get_options -o h -l src: -l user: -l help -l version: -- "$@") if [[ $? != 0 ]]; then subcommand_help_init exit 1 @@ -158,6 +158,10 @@ subcommand_init() { user=$2 shift ;; + --version ) + PMODULES_VERSION=$2 + shift + ;; -- ) : ;; From 1b6781702dc7b6aecca6a260dbb6fd4f75d18c37 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 18:17:30 +0100 Subject: [PATCH 21/50] config/versions.conf: default version of ippl changed --- config/versions.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/versions.conf b/config/versions.conf index 9dacd8a..55f2324 100644 --- a/config/versions.conf +++ b/config/versions.conf @@ -19,7 +19,7 @@ H5hut 1.99.13 H5root 1.2.0 hdf5_serial 1.8.14 hdf5 1.8.14 -ippl 1.1.3 +ippl 1.1.4 libtool 2.4.2 libungif 4.1.4 lua 5.1.4.5 From 4fc10233c6e6d3e12cafad4feca920eea8e35d99 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 18:20:01 +0100 Subject: [PATCH 22/50] scripts/Bootstrap/Modules/build: bugfix: use PMODULES_VERSION to set TCL_DIR --- scripts/Bootstrap/Modules/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Bootstrap/Modules/build b/scripts/Bootstrap/Modules/build index 115b214..a22a7e1 100755 --- a/scripts/Bootstrap/Modules/build +++ b/scripts/Bootstrap/Modules/build @@ -2,7 +2,7 @@ #set -o functrace source "$(dirname $0)/../../../lib/libem.bash" -TCL_DIR="${PSI_PREFIX}/Tools/Pmodules/0.99.0" +TCL_DIR="${PSI_PREFIX}/Tools/Pmodules/${PMODULES_VERSION}" PATH="${TCL_DIR}/bin:${PATH}" From a85c5070ca01a7767e9bb51e809c08bfbf6addbf Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 18:25:39 +0100 Subject: [PATCH 23/50] scripts/Bootstrap/Pmodules/modmanage.in: in sub-command 'install': options '--dry-run' and '--force' added; do not re-sync existing moules if not forced --- scripts/Bootstrap/Pmodules/modmanage.in | 27 +++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/scripts/Bootstrap/Pmodules/modmanage.in b/scripts/Bootstrap/Pmodules/modmanage.in index dfec8d1..361fe3e 100755 --- a/scripts/Bootstrap/Pmodules/modmanage.in +++ b/scripts/Bootstrap/Pmodules/modmanage.in @@ -51,7 +51,7 @@ init [--src=] [--user=] subcommand_help_install() { echo " -install [--with=...] +install ... [--with=...] [--release=...] [--src=] Install matching modules " 1>&2 } @@ -111,11 +111,12 @@ sync_module() { local -r rel_module_prefix=$( get_module_prefix "${rel_modulefile}" ) local -r rel_releasefile=$( get_releasefile_name "${rel_modulefile}" ) - $DRY mkdir -p "${target_prefix}/${rel_module_prefix}" || return $? - $DRY rsync --links --perms --recursive --delete \ - "${src_prefix}/${rel_module_prefix}/" \ - "${target_prefix}/${rel_module_prefix}/" || return $? - + if [[ ! -d "${target_prefix}/${rel_module_prefix}" ]] || [[ "${force}" == 'yes' ]]; then + $DRY mkdir -p "${target_prefix}/${rel_module_prefix}" || return $? + $DRY rsync --links --perms --recursive --delete \ + "${src_prefix}/${rel_module_prefix}/" \ + "${target_prefix}/${rel_module_prefix}/" || return $? + fi local -r src_modulefile="${src_prefix}/${PSI_MODULES_ROOT}/${rel_modulefile}" local -r src_releasefile="${src_prefix}/${PSI_MODULES_ROOT}/${rel_releasefile}" local -r target_modulefile="${target_prefix}/${PSI_MODULES_ROOT}/${rel_modulefile}" @@ -270,7 +271,7 @@ subcommand_install() { local -r src_prefix="${PMODULES_INSTALL_SOURCE}" local -r target_prefix="${PSI_PREFIX}" - opts=$(get_options -o h -l with: -l release: -l help -l src: -- "$@") + opts=$(get_options -o hf -l dry-run -l force -l with: -l release: -l help -l src: -- "$@") if [[ $? != 0 ]]; then subcommand_help_install exit 1 @@ -278,6 +279,12 @@ subcommand_install() { eval set -- "${opts}" while (($# > 0)); do case $1 in + --dry-run ) + DRY='echo' + ;; + --force | -f ) + force='yes' + ;; --release ) releases+=( "$2" ) shift @@ -293,7 +300,11 @@ subcommand_install() { -- ) : ;; - -* | -h | --help ) + -h | --help ) + subcommand_help_install + exit 1 + ;; + -* ) echo "$1: illegal option" 1>&2 subcommand_help_init exit 1 From d722a60c895710cae1cdf4ce541694150f23cf0a Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 18 Mar 2015 18:37:57 +0100 Subject: [PATCH 24/50] scripts/Bootstrap/Pmodules/modmanage.in: bugfix in sub-command 'install' --- scripts/Bootstrap/Pmodules/modmanage.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Bootstrap/Pmodules/modmanage.in b/scripts/Bootstrap/Pmodules/modmanage.in index abf6a45..ba3dd3e 100755 --- a/scripts/Bootstrap/Pmodules/modmanage.in +++ b/scripts/Bootstrap/Pmodules/modmanage.in @@ -328,7 +328,7 @@ subcommand_install() { let n+=1 done < <(${PMODULES_HOME}/bin/modulecmd bash search \ "${module_pattern[@]}" \ - "${with[@]/#/--with}" \ + "${with[@]/#/--with=}" \ "${releases[@]/#/--release=}" \ --no-header --print-modulefiles \ --src="${src_prefix}" 2>&1) From 0ad320508bb176a5002b4c23e9a79ed9ea7dfcfd Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 19 Mar 2015 16:51:29 +0100 Subject: [PATCH 25/50] lib/libem.bash: do not overwrite versions set with '--with=' with default versions defined in 'config/versions.conf' --- lib/libem.bash | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/libem.bash b/lib/libem.bash index 5dcb5cb..34f6029 100644 --- a/lib/libem.bash +++ b/lib/libem.bash @@ -28,15 +28,6 @@ declare -xr BUILD_TMPDIR="${BUILD_BASEDIR}/tmp" declare -xr BUILD_DOWNLOADSDIR="${BUILD_BASEDIR}/Downloads" declare -xr BUILD_VERSIONSFILE="${BUILD_CONFIGDIR}/versions.conf" -#declare -xr PSI_TEMPLATES_DIR='templates' - -if [[ -z "${BUILD_CONFIGDIR}/families.d/"*.conf ]]; then - die 1 "Default family configuration not set in ${BUILD_CONFIGDIR}/families.d" -fi - -#for f in "${BUILD_CONFIGDIR}/families.d/"*.conf; do -# source "${f}" -#done source "${BUILD_CONFIGDIR}/Pmodules.conf" declare -x PREFIX='' @@ -62,7 +53,8 @@ declare -x LIBRARY_PATH declare -x LD_LIBRARY_PATH declare -x DYLD_LIBRARY_PATH - +############################################################################## +# function usage() { error " Usage: $0 [OPTIONS..] [VERSION] [ENV=VALUE...] @@ -260,6 +252,8 @@ function _write_build_dependencies() { # setup general environment function _setup_env1() { + local varname='' + C_INCLUDE_PATH='' CPLUS_INCLUDE_PATH='' CPP_INCLUDE_PATH='' @@ -277,8 +271,11 @@ function _setup_env1() { [[ -z ${_name} ]] && continue [[ -z ${_version} ]] && continue [[ "${_name:0:1}" == '#' ]] && continue - _NAME=$(echo ${_name} | tr [:lower:] [:upper:]) - eval ${_NAME}_VERSION=$_version + var_name=$(echo ${_name} | tr [:lower:] [:upper:])_VERSION + # don't set version, if already set + if [[ -z ${!var_name} ]]; then + eval ${var_name}="${_version}" + fi done < "${BUILD_VERSIONSFILE}" } From bde7be36df59427f5f57fa6e3df7b9818a04703e Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 19 Mar 2015 18:10:13 +0100 Subject: [PATCH 26/50] scripts/Tools/git/build: added --- scripts/Tools/git/build | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/Tools/git/build diff --git a/scripts/Tools/git/build b/scripts/Tools/git/build new file mode 100755 index 0000000..ed9c700 --- /dev/null +++ b/scripts/Tools/git/build @@ -0,0 +1,26 @@ +#!/bin/bash + +source "$(dirname $0)/../../../lib/libem.bash" + +function em.configure() { + cd "${MODULE_SRCDIR}" + "${MODULE_SRCDIR}"/configure \ + --prefix="${PREFIX}" \ + --with-tcltk="${PMODULES_HOME}" \ + || exit 1 +} + +function em.build() { + cd "${MODULE_SRCDIR}" + make +} + +em.add_to_family 'Tools' +em.set_docfiles 'COPYING' 'README' +em.make_all + +# Local Variables: +# mode: sh +# sh-basic-offset: 8 +# tab-width: 8 +# End: From ad664353cd677e538e844bcef00b09a38605e188 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 19 Mar 2015 18:10:37 +0100 Subject: [PATCH 27/50] scripts/MPI/OPAL/with: added --- scripts/MPI/OPAL/with | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 scripts/MPI/OPAL/with diff --git a/scripts/MPI/OPAL/with b/scripts/MPI/OPAL/with new file mode 100644 index 0000000..4463df4 --- /dev/null +++ b/scripts/MPI/OPAL/with @@ -0,0 +1,9 @@ +gcc/4.8.3 +openmpi/1.8.2 +ippl/1.1.4 +hdf5/1.8.12 +H5hut/1.99.13 +trilinos/11.10.2 +boost/1.55.0 +gsl/1.15 +root/5.34.19 From d148fbbdf72e8b4f9c4fd31f2f5ac48f241da292 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 20 Mar 2015 12:43:39 +0100 Subject: [PATCH 28/50] lib/libem.bash: do not load modules twice while loading build dependencies --- lib/libem.bash | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/libem.bash b/lib/libem.bash index 34f6029..b92df28 100644 --- a/lib/libem.bash +++ b/lib/libem.bash @@ -28,7 +28,7 @@ declare -xr BUILD_TMPDIR="${BUILD_BASEDIR}/tmp" declare -xr BUILD_DOWNLOADSDIR="${BUILD_BASEDIR}/Downloads" declare -xr BUILD_VERSIONSFILE="${BUILD_CONFIGDIR}/versions.conf" -source "${BUILD_CONFIGDIR}/Pmodules.conf" +#source "${BUILD_CONFIGDIR}/Pmodules.conf" declare -x PREFIX='' declare -x DOCDIR='' @@ -91,10 +91,26 @@ ENV=VALUE exit 1 } +############################################################################## +# +# test whether a the string passed in $1 is a valid release name +# +# $1: string to be tested +# is_release () { [[ ${releases} =~ :$1: ]] } +############################################################################## +# +# test whether a module is loaded or not +# +# $1: module name +# +em.is_loaded() { + [[ :${LOADEDMODULES}: =~ :$1: ]] +} + function em.set_release() { is_release "$1" || die 1 "$P: unknown release type: $1" [[ "$1" == "deprecated" ]] && die 0 "$P: is deprecated, we don't rebuild it." @@ -149,6 +165,7 @@ function _load_build_dependencies() { echo "$m: warning: No version set, loading default ..." fi fi + em.is_loaded "$m" && continue if ! module_is_available "$m"; then debug "${m}: module not available" local rels=( ${releases//:/ } ) From f42d8c41a44a7ab1522e97844a3d3b92a73ba75d Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 20 Mar 2015 16:27:55 +0100 Subject: [PATCH 29/50] lib/libem.bash: family 'OPAL' added; load modules listed in file 'with_modules', if exist --- lib/libem.bash | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/libem.bash b/lib/libem.bash index b92df28..88a08f6 100644 --- a/lib/libem.bash +++ b/lib/libem.bash @@ -8,7 +8,8 @@ unset CDPATH shopt -s expand_aliases -declare -r BUILDSCRIPT=$( cd $(dirname "$0") && pwd )/$(basename "$0") +declare -r BUILDSCRIPT_DIR=$( cd $(dirname "$0") && pwd ) +declare -r BUILDSCRIPT="${BUILDSCRIPT_DIR}"/$(basename "$0") declare -rx ARGS="$@" declare -rx SHLIBDIR=$( cd $(dirname "$BASH_SOURCE") && pwd ) declare -r OS=$(uname -s) @@ -366,6 +367,17 @@ function _setup_env2() { MODULE_NAME+="${HDF5}/${HDF5_VERSION}/" MODULE_NAME+="${P}/${V}" ;; + OPAL ) + MODULE_RPREFIX="${P}/${V}" + MODULE_RPREFIX+="/${OPAL}/${OPAL_VERSION}" + MODULE_RPREFIX+="/${MPI}/${MPI_VERSION}" + MODULE_RPREFIX+="/${COMPILER}/${COMPILER_VERSION}" + + MODULE_NAME="${COMPILER}/${COMPILER_VERSION}/" + MODULE_NAME+="${MPI}/${MPI_VERSION}/" + MODULE_NAME+="${OPAL}/${OPAL_VERSION}/" + MODULE_NAME+="${P}/${V}" + ;; HDF5_serial ) MODULE_RPREFIX="${P}/${V}" MODULE_RPREFIX+="/hdf5_serial/${HDF5_SERIAL_VERSION}" @@ -660,6 +672,10 @@ bootstrap='no' # array collecting all modules specified on the command line via '--with=module' with_modules=() +if [[ -r "${BUILDSCRIPT_DIR}/with_modules" ]]; then + with_modules+=( $(cat "${BUILDSCRIPT_DIR}/with_modules") ) +fi + while (( $# > 0 )); do case $1 in -j ) From e928d9984b2d237863a894c82c3cf1fc30beb1c6 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 20 Mar 2015 16:30:47 +0100 Subject: [PATCH 30/50] optPilot moved to family 'OPAL' and renamed to 'opt-pilot' --- scripts/{MPI/optPilot => OPAL/opt-pilot}/build | 4 ++-- scripts/OPAL/opt-pilot/with_modules | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) rename scripts/{MPI/optPilot => OPAL/opt-pilot}/build (86%) create mode 100644 scripts/OPAL/opt-pilot/with_modules diff --git a/scripts/MPI/optPilot/build b/scripts/OPAL/opt-pilot/build similarity index 86% rename from scripts/MPI/optPilot/build rename to scripts/OPAL/opt-pilot/build index f6e5e83..eee8d88 100755 --- a/scripts/MPI/optPilot/build +++ b/scripts/OPAL/opt-pilot/build @@ -12,9 +12,9 @@ function em.configure() { "${MODULE_SRCDIR}" } -em.add_to_family 'MPI' +em.add_to_family 'OPAL' em.set_runtime_dependencies "${COMPILER}" "${MPI}" em.set_build_dependencies 'cmake' "${COMPILER}" "${MPI}" 'boost' 'hdf5' 'H5hut' 'trilinos' 'ippl' 'gsl' 'boost' 'OPAL' -em.set_supported_compilers 'gcc/4.7' 'gcc/4.8' +em.set_supported_compilers 'gcc/4.8' em.make_all diff --git a/scripts/OPAL/opt-pilot/with_modules b/scripts/OPAL/opt-pilot/with_modules new file mode 100644 index 0000000..bbad858 --- /dev/null +++ b/scripts/OPAL/opt-pilot/with_modules @@ -0,0 +1,10 @@ +gcc/4.8.3 +openmpi/1.8.2 +ippl/1.1.4 +hdf5/1.8.12 +H5hut/1.99.13 +trilinos/11.10.2 +boost/1.55.0 +gsl/1.15 +root/5.34.19 +OPAL/1.3.2 From 99bc0f1e67dd486ce7504966bcbea222548f8c6e Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 20 Mar 2015 17:25:49 +0100 Subject: [PATCH 31/50] scripts/MPI/OPAL/with_modules: renamed --- scripts/MPI/OPAL/{with => with_modules} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/MPI/OPAL/{with => with_modules} (100%) diff --git a/scripts/MPI/OPAL/with b/scripts/MPI/OPAL/with_modules similarity index 100% rename from scripts/MPI/OPAL/with rename to scripts/MPI/OPAL/with_modules From 9523996b8a1d6f7a1aee8a1d905ec44331fa2436 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 20 Mar 2015 17:27:55 +0100 Subject: [PATCH 32/50] lib/libem.bash: bugfix in environment cleanup --- lib/libem.bash | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/libem.bash b/lib/libem.bash index 88a08f6..35ac0e2 100644 --- a/lib/libem.bash +++ b/lib/libem.bash @@ -268,9 +268,11 @@ function _write_build_dependencies() { done } -# setup general environment -function _setup_env1() { - local varname='' +############################################################################## +# +# cleanup environment +# +em.cleanup_env() { C_INCLUDE_PATH='' CPLUS_INCLUDE_PATH='' @@ -284,7 +286,14 @@ function _setup_env1() { CXXFLAGS='' LIBS='' LDFLAGS='' - +} + +############################################################################## +# +# load default versions +# + _setup_env1() { + local varname='' while read _name _version; do [[ -z ${_name} ]] && continue [[ -z ${_version} ]] && continue @@ -669,6 +678,8 @@ ENVIRONMENT_ARGS='' dry_run='no' bootstrap='no' +em.cleanup_env + # array collecting all modules specified on the command line via '--with=module' with_modules=() From 40e0143b9f773779540ec5a76ee135891561f3a1 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 23 Mar 2015 17:01:24 +0100 Subject: [PATCH 33/50] scripts/Bootstrap/Pmodules/libmodules.tcl: add debug output if PREFIX does not exist --- scripts/Bootstrap/Pmodules/libmodules.tcl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/Bootstrap/Pmodules/libmodules.tcl b/scripts/Bootstrap/Pmodules/libmodules.tcl index 7ad721c..f1a355e 100644 --- a/scripts/Bootstrap/Pmodules/libmodules.tcl +++ b/scripts/Bootstrap/Pmodules/libmodules.tcl @@ -181,6 +181,8 @@ proc set_std_environment { PREFIX name version } { if { [lsearch ${::dont-setenv} "${NAME}_HOME"] == -1 } { setenv ${NAME}_HOME $PREFIX } + } else { + debug "$PREFIX is not a directory" } if { [file isdirectory "$PREFIX/bin"] } { From c2ffa54b9100f0291b5fa1c830dc64e40e2f33e5 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 23 Mar 2015 17:29:15 +0100 Subject: [PATCH 34/50] scripts/HDF5/build_all_variants: exit if a build failed --- scripts/HDF5/build_all_variants | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/HDF5/build_all_variants b/scripts/HDF5/build_all_variants index 262f179..88d48a6 100755 --- a/scripts/HDF5/build_all_variants +++ b/scripts/HDF5/build_all_variants @@ -19,6 +19,7 @@ for cc in "${COMPILER_VERSIONS[@]}"; do echo " compile: $cc" echo " mpi: $mpi" echo " hdf5: $hdf5" + exit 1 } done done From 8d8925c9035abbe338f31100e1602b00358085c3 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 23 Mar 2015 17:30:10 +0100 Subject: [PATCH 35/50] scripts/HDF5/H5hut/build: disable vtkconvert --- scripts/HDF5/H5hut/build | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/HDF5/H5hut/build b/scripts/HDF5/H5hut/build index eb9097a..a689248 100755 --- a/scripts/HDF5/H5hut/build +++ b/scripts/HDF5/H5hut/build @@ -18,7 +18,6 @@ function em.configure() { --prefix="${PREFIX}" \ --enable-parallel \ --enable-debug \ - --enable-vtkconverter \ --with-hdf5=$HDF5_PREFIX \ --with-pic \ || exit 1 From 3b75bd4d75e624e3c9eb203f1d0d665170323509 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 23 Mar 2015 17:36:25 +0100 Subject: [PATCH 36/50] scripts/HDF5_serial/build_all_variants: added --- scripts/HDF5_serial/build_all_variants | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 scripts/HDF5_serial/build_all_variants diff --git a/scripts/HDF5_serial/build_all_variants b/scripts/HDF5_serial/build_all_variants new file mode 100755 index 0000000..6854f9e --- /dev/null +++ b/scripts/HDF5_serial/build_all_variants @@ -0,0 +1,22 @@ +#!/bin/bash + +declare -r basedir=$(dirname $0) +source '../../config/Pmodules.conf' + +declare -r recipe="${basedir}/$1/build" +shift + +if [[ ! -x "${recipe}" ]]; then + echo "Error: no recipe to build '$1'!" + exit 1 +fi + +for cc in "${COMPILER_VERSIONS[@]}"; do + for hdf in "${HDF5_SERIAL_VERSIONS[@]}"; do + "${recipe}" "$@" --with=$cc --with=$hdf || { + echo "Oops: build failed for:" + echo " compiler: $cc" + echo " HDF5 (serial): $hdf" + } + done +done From 9cb136ccc4e6b59346407dddf468545cab862768 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 23 Mar 2015 18:36:40 +0100 Subject: [PATCH 37/50] config/Pmodules.conf: (P)MODULES_VERSION removed --- config/Pmodules.conf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/Pmodules.conf b/config/Pmodules.conf index 956049e..22d1961 100644 --- a/config/Pmodules.conf +++ b/config/Pmodules.conf @@ -1,6 +1,4 @@ -declare -x PMODULES_VERSION=0.99.2 -declare -x MODULES_VERSION=3.2.10 - declare -a COMPILER_VERSIONS=( 'gcc/4.7.4' 'gcc/4.8.3' 'gcc/4.8.4' 'gcc/4.9.2' ) declare -a MPI_VERSIONS=( 'openmpi/1.6.5' 'openmpi/1.8.2' 'openmpi/1.8.4' ) declare -a HDF5_VERSIONS=( 'hdf5/1.8.12' 'hdf5/1.8.14' ) +declare -a HDF5_SERIAL_VERSIONS=( 'hdf5_serial/1.8.12' 'hdf5_serial/1.8.14' ) From 9e3f159bfcb1b9be947d4dba0151334c99c4ac0b Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 23 Mar 2015 18:40:03 +0100 Subject: [PATCH 38/50] scripts/Bootstrap: read (P)MODULES_VERSION from Pmodules_version.conf --- scripts/Bootstrap/Pmodules_version.conf | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 scripts/Bootstrap/Pmodules_version.conf diff --git a/scripts/Bootstrap/Pmodules_version.conf b/scripts/Bootstrap/Pmodules_version.conf new file mode 100644 index 0000000..6057d13 --- /dev/null +++ b/scripts/Bootstrap/Pmodules_version.conf @@ -0,0 +1,7 @@ +declare -x PMODULES_VERSION=0.99.1 +declare -x MODULES_VERSION=3.2.10 + +declare -a COMPILER_VERSIONS=( 'gcc/4.7.4' 'gcc/4.8.3' 'gcc/4.8.4' 'gcc/4.9.2' ) +declare -a MPI_VERSIONS=( 'openmpi/1.6.5' 'openmpi/1.8.2' 'openmpi/1.8.4' ) +declare -a HDF5_VERSIONS=( 'hdf5/1.8.12' 'hdf5/1.8.14' ) +declare -a HDF5_SERIAL_VERSIONS=( 'hdf5_serial/1.8.12' 'hdf5_serial/1.8.14' ) From 15815f6e6a505aeb57eed204cfe3a1f3cb96cfce Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 23 Mar 2015 18:40:21 +0100 Subject: [PATCH 39/50] scripts/Bootstrap: read (P)MODULES_VERSION from Pmodules_version.conf --- scripts/Bootstrap/compile_pmodules.sh | 2 +- scripts/Bootstrap/install_pmodules.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Bootstrap/compile_pmodules.sh b/scripts/Bootstrap/compile_pmodules.sh index 9d60e93..5de1ca8 100755 --- a/scripts/Bootstrap/compile_pmodules.sh +++ b/scripts/Bootstrap/compile_pmodules.sh @@ -3,7 +3,7 @@ declare -r BASE_DIR=$(cd "$(dirname $0)/../.." && pwd) declare -r BOOTSTRAP_DIR="${BASE_DIR}/scripts/Bootstrap" -source "${BASE_DIR}/config/Pmodules.conf" +source "${BOOTSTRAP_DIR}/Pmodules_version.conf" unset PMODULES_HOME source "/opt/psi/config/environment.bash" diff --git a/scripts/Bootstrap/install_pmodules.sh b/scripts/Bootstrap/install_pmodules.sh index 13d301d..a6fb606 100755 --- a/scripts/Bootstrap/install_pmodules.sh +++ b/scripts/Bootstrap/install_pmodules.sh @@ -4,7 +4,7 @@ declare -r BASE_DIR=$(cd "$(dirname $0)/../.." && pwd) declare -r BOOTSTRAP_DIR="${BASE_DIR}/scripts/Bootstrap" declare -r SRC_DIR="${BOOTSTRAP_DIR}/Pmodules" -source "${BASE_DIR}/config/Pmodules.conf" +source "${BOOTSTRAP_DIR}/Pmodules_version.conf" unset PMODULES_HOME source "/opt/psi/config/environment.bash" From 12d6f2f5329bb2c316c388258f486040b3ea502a Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 Mar 2015 13:28:34 +0100 Subject: [PATCH 40/50] scripts/Programming/Tcl/build: compile with system compiler --- scripts/Programming/Tcl/build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/Programming/Tcl/build b/scripts/Programming/Tcl/build index 402004d..6aa8add 100755 --- a/scripts/Programming/Tcl/build +++ b/scripts/Programming/Tcl/build @@ -21,7 +21,9 @@ function em.post_install() { { cd "${PREFIX}"/bin && rm -f tclsh && ln -fs tclsh${V%.*} tclsh; }; } +# use system's cc +declare CC=cc + em.add_to_family 'Programming' em.set_docfiles 'license.terms' 'README' -em.set_build_dependencies "${COMPILER}" em.make_all From 87ffe565a1587260d50c4d6b73123d5e8ab613fb Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 Mar 2015 13:29:20 +0100 Subject: [PATCH 41/50] scripts/Programming/Tk/build: added --- scripts/Programming/Tk/build | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 scripts/Programming/Tk/build diff --git a/scripts/Programming/Tk/build b/scripts/Programming/Tk/build new file mode 100755 index 0000000..9ca58c4 --- /dev/null +++ b/scripts/Programming/Tk/build @@ -0,0 +1,32 @@ +#!/bin/bash + +source "$(dirname $0)/../../../lib/libem.bash" + +function em.configure() { + case ${OS} in + Linux ) + srcdir="${MODULE_SRCDIR}/unix" + ;; + Darwin ) + srcdir="${MODULE_SRCDIR}/macosx" + ;; + esac + "${srcdir}"/configure \ + --prefix="${PREFIX}" \ + --with-tcl=${TCL_PREFIX}/lib \ + --enable-shared=no \ + || exit 1 +} + +function em.post_install() { + : + #{ cd "${PREFIX}"/bin && rm -f tclsh && ln -fs tclsh${V%.*} tclsh; }; +} + +# use system's cc +declare CC=cc + +em.add_to_family 'Programming' +em.set_build_dependencies 'Tcl' +em.set_docfiles 'license.terms' 'README' +em.make_all From 38f3a237f2278194fe96205f953689fb6718e26b Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 Mar 2015 13:30:01 +0100 Subject: [PATCH 42/50] scripts/Tools/git/build: run-time dependencies 'Tcl' and 'Tk' added --- scripts/Tools/git/build | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/Tools/git/build b/scripts/Tools/git/build index ed9c700..52423c3 100755 --- a/scripts/Tools/git/build +++ b/scripts/Tools/git/build @@ -16,6 +16,7 @@ function em.build() { } em.add_to_family 'Tools' +em.set_runtime_dependencies 'Tcl' 'Tk' em.set_docfiles 'COPYING' 'README' em.make_all From 4f9229e8f13674313839cf771bbf4b948a68bd9d Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 Mar 2015 13:30:59 +0100 Subject: [PATCH 43/50] scripts/Tools/git/with_modules: added --- scripts/Tools/git/with_modules | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 scripts/Tools/git/with_modules diff --git a/scripts/Tools/git/with_modules b/scripts/Tools/git/with_modules new file mode 100644 index 0000000..70974ad --- /dev/null +++ b/scripts/Tools/git/with_modules @@ -0,0 +1,2 @@ +Tcl/8.6.4 +Tk/8.6.4 From ebc2a121c51b2d9dcbf4aee3cc4f47cddcf4d30a Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 Mar 2015 13:36:47 +0100 Subject: [PATCH 44/50] scripts/HDF5/H5hut/build: 'vtk' removed as build dependency --- scripts/HDF5/H5hut/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/HDF5/H5hut/build b/scripts/HDF5/H5hut/build index a689248..4420013 100755 --- a/scripts/HDF5/H5hut/build +++ b/scripts/HDF5/H5hut/build @@ -36,7 +36,7 @@ function em.install() { em.add_to_family 'HDF5' em.set_runtime_dependencies "${COMPILER}" "${MPI}" 'hdf5' -em.set_build_dependencies "autoconf" "automake" "libtool" "${COMPILER}" "${MPI}" "vtk" "hdf5" +em.set_build_dependencies "autoconf" "automake" "libtool" "${COMPILER}" "${MPI}" "hdf5" em.set_docfiles 'AUTHORS' 'COPYING' em.make_all From b4652a6d76e55a06f7f948a9b7aa909a49b98e4f Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 Mar 2015 13:37:41 +0100 Subject: [PATCH 45/50] scripts/System/nmap/build: setting release removed --- scripts/System/nmap/build | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/System/nmap/build b/scripts/System/nmap/build index aaf593f..f71397c 100755 --- a/scripts/System/nmap/build +++ b/scripts/System/nmap/build @@ -23,7 +23,6 @@ function em.install() { make install } -em.release 'unstable' em.add_to_family 'System' em.set_build_dependencies "${COMPILER}" em.make_all From b6021f80a4bebf780ca15fd0579b1d82b9ba9b17 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 Mar 2015 14:43:06 +0100 Subject: [PATCH 46/50] lib/libem.bash: bugfix in 'em.cleanup_build()' --- lib/libem.bash | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/libem.bash b/lib/libem.bash index 35ac0e2..4ec90e1 100644 --- a/lib/libem.bash +++ b/lib/libem.bash @@ -584,14 +584,14 @@ function _set_link() { } function em.cleanup_build() { - ( - [[ -d /${MODULE_BUILDDIR} ]] || return 0 - cd "/${MODULE_BUILDDIR}/.."; - if [[ $(pwd) != / ]]; then - echo "Cleaning up $(pwd)/${COMPILER_VERSION}" - rm -rf * - fi - ); + [[ -n "${MODULE_BUILDDIR}" ]] \ + || die 1 "Oops: internal error: MODULE_BUILDDIR is set to empty string..." + [[ "${MODULE_BUILDDIR}" == "/" ]] \ + && die 1 "Oops: internal error: MODULE_BUILDDIR is set to '/'..." + [[ -d "/${MODULE_BUILDDIR}" ]] \ + || die 1 "Oops: internal error: MODULE_BUILDDIR=${MODULE_BUILDDIR} is not a directory..." + echo "Cleaning up '/${MODULE_BUILDDIR}'..." + rm -rf "/${MODULE_BUILDDIR}" } function em.cleanup_src() { From 3aae40abcd27f5aa361b39da415ed95657c33045 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 Mar 2015 14:43:41 +0100 Subject: [PATCH 47/50] scripts/MPI/build_all_variants: exit on error --- scripts/MPI/build_all_variants | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/MPI/build_all_variants b/scripts/MPI/build_all_variants index e626c5a..5aa47d3 100755 --- a/scripts/MPI/build_all_variants +++ b/scripts/MPI/build_all_variants @@ -17,6 +17,7 @@ for cc in "${COMPILER_VERSIONS[@]}"; do echo "Oops: build failed for:" echo " compiler: $cc" echo " mpi: $mpi" + exit 1 } done done From 2e45aa799d39e07e6b07a0bbb498ac7b7b79b763 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 Mar 2015 14:44:26 +0100 Subject: [PATCH 48/50] scripts/Tools/git/build: use bar '--with-tcltk' --- scripts/Tools/git/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Tools/git/build b/scripts/Tools/git/build index 52423c3..0f72c23 100755 --- a/scripts/Tools/git/build +++ b/scripts/Tools/git/build @@ -6,7 +6,7 @@ function em.configure() { cd "${MODULE_SRCDIR}" "${MODULE_SRCDIR}"/configure \ --prefix="${PREFIX}" \ - --with-tcltk="${PMODULES_HOME}" \ + --with-tcltk \ || exit 1 } From 0ba06aa74b71952599cc7fa96cbd2352e91bb27e Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 Mar 2015 18:54:12 +0100 Subject: [PATCH 49/50] lib/libem.bash: - bugfixes in setting up family HDF5_serial - skip call of em.cleanup_build() if nothing was build --- lib/libem.bash | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/libem.bash b/lib/libem.bash index 4ec90e1..f1949c9 100644 --- a/lib/libem.bash +++ b/lib/libem.bash @@ -393,7 +393,7 @@ function _setup_env2() { MODULE_RPREFIX+="/${COMPILER}/${COMPILER_VERSION}" MODULE_NAME="${COMPILER}/${COMPILER_VERSION}/" - MODULE_NAME+="hdf5_serial/${HDF5_VERSION}/" + MODULE_NAME+="hdf5_serial/${HDF5_SERIAL_VERSION}/" MODULE_NAME+="${P}/${V}" ;; * ) @@ -632,6 +632,7 @@ function _post_install() { } function em.make_all() { + local building='no' echo "${P}:" _setup_env1 _load_build_dependencies @@ -643,6 +644,7 @@ function em.make_all() { fi if [[ ! -d "${PREFIX}" ]] || [[ ${force_rebuild} == 'yes' ]]; then + building='yes' echo "Building $P/$V ..." [[ ${dry_run} == yes ]] && die 0 "" _check_compiler @@ -667,7 +669,8 @@ function em.make_all() { if [[ ${bootstrap} == 'no' ]]; then _set_link fi - em.cleanup_build + [[ ${building} == yes ]] && em.cleanup_build + return 0 } ############################################################################## From 308079c18d194e112207802b65d7c2706404665f Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 24 Mar 2015 18:54:48 +0100 Subject: [PATCH 50/50] scripts/HDF5_serial/build_all_variants: - exit if a build failed --- scripts/HDF5_serial/build_all_variants | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/HDF5_serial/build_all_variants b/scripts/HDF5_serial/build_all_variants index 6854f9e..65d7c65 100755 --- a/scripts/HDF5_serial/build_all_variants +++ b/scripts/HDF5_serial/build_all_variants @@ -17,6 +17,7 @@ for cc in "${COMPILER_VERSIONS[@]}"; do echo "Oops: build failed for:" echo " compiler: $cc" echo " HDF5 (serial): $hdf" + exit 1 } done done