scripts/Bootstrap/{environment.bash,profile.bash}: added
This commit is contained in:
30
scripts/Bootstrap/environment.bash
Normal file
30
scripts/Bootstrap/environment.bash
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -x PSI_PREFIX=$(cd $(dirname "${BASH_SOURCE}")/.. && pwd)
|
||||
declare -x PSI_CONFIG_DIR=$(basename $(cd $(dirname "${BASH_SOURCE}") && pwd))
|
||||
|
||||
if [[ -z ${PMODULES_VERSION} ]]; then
|
||||
declare -x PMODULES_VERSION="0.99.1"
|
||||
fi
|
||||
|
||||
declare -x PMODULES_HOME="${PSI_PREFIX}/Tools/Pmodules/${PMODULES_VERSION}"
|
||||
|
||||
declare -A PSI_FAMILIES=(
|
||||
['Legacy']=0
|
||||
['Libraries']=0
|
||||
['Programming']=0
|
||||
['Numeric']=0
|
||||
['System']=0
|
||||
['Tools']=0
|
||||
['Compiler']=2
|
||||
['MPI']=4
|
||||
['HDF5_serial']=4
|
||||
['HDF5']=6
|
||||
)
|
||||
|
||||
declare -x PSI_MODULES_ROOT='modulefiles'
|
||||
|
||||
declare -x PSI_DEFAULT_FAMILIES='Tools Programming'
|
||||
|
||||
declare -x PSI_RELEASES=':unstable:stable:deprecated:'
|
||||
declare -x PSI_USED_RELEASES='stable'
|
||||
39
scripts/Bootstrap/profile.bash
Normal file
39
scripts/Bootstrap/profile.bash
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
#############################################################################
|
||||
# read Pmodules configuration
|
||||
#
|
||||
_init_env_file="$(dirname ${BASH_SOURCE})/environment.bash"
|
||||
if [[ ! -r "${_init_env_file}" ]]; then
|
||||
echo "Oops: cannot initialize Modules!"
|
||||
echo "${_init_env_file}: file does not exist or is not readable."
|
||||
return 1
|
||||
fi
|
||||
source "${_init_env_file}"
|
||||
unset _init_env_file
|
||||
|
||||
############################################################################
|
||||
# check configuration
|
||||
#
|
||||
if [[ ! -d ${PSI_PREFIX} ]] || [[ ! -d ${PMODULES_HOME} ]]; then
|
||||
echo "Oops: cannot initialize module environment !"
|
||||
return 1
|
||||
fi
|
||||
|
||||
############################################################################
|
||||
# inititialize Pmodules for bash
|
||||
#
|
||||
_init_bash="${PMODULES_HOME}/init/bash"
|
||||
if [[ ! -r "${_init_bash}" ]]; then
|
||||
echo "Oops: cannot initialize Modules!"
|
||||
echo "${_init_bash}: File does not exist or is not readable."
|
||||
return 1
|
||||
fi
|
||||
source "${_init_bash}"
|
||||
unset _init_bash
|
||||
|
||||
# Local Variables:
|
||||
# mode: sh
|
||||
# sh-basic-offset: 8
|
||||
# tab-width: 8
|
||||
# End:
|
||||
Reference in New Issue
Block a user