reset() { ( cd ${LAPTREE}; make reset; ) } # reset() pure() { ( cd ${LAPTREE}; make pure; ) } # pure() error() { echo >&2 ${1}; exit ${2}; } # error() unlap() { unset LAPINSTANCE LAPVERSION LAPGALAXY LAPTREE LAPLIBRARY LAPTOOLS LAPOS LAPSTORE LAPLOG LAPTMP; } # unlap() # # as our first order of business, determine which LAP instance is running # host=${HOSTNAME}; if [ -z "${host}" ]; then host=$(hostname); fi # # _fix_me_ # the following cannot work in tool execution on compute nodes. (6-may-16; oe) # if [ "${host}" = "ps.hpc.uio.no" ]; then LAPINSTANCE=development; elif [ "${host}" = "at.hpc.uio.no" ]; then LAPINSTANCE=production; elif [ "${host}" = "lap-test.hpc.uio.no" ]; then LAPINSTANCE=test; else LAPINSTANCE=local; fi export LAPINSTANCE; # # the top-level directory of the Galaxy installation (e.g. used by the cron(8) # reporting scripts) # if [ -z "${LAPGALAXY}" ]; then LAPGALAXY=/home/laportal/galaxy; export LAPGALAXY; fi # # make global variable for LAP Tree directory accessible to other processes. # export LAPTREE; # # determine the location of the LAP Library code (currently in Python only). # if [ -z "${LAPLIBRARY}" ]; then if [ -d ${LAPTREE%/tree}/library ]; then LAPLIBRARY=${LAPTREE%/tree}/library; else LAPLIBRARY=/projects/lap/development/trunk/library; fi fi export LAPLIBRARY; # # now, work out the current operating system, one of `linux' (x86), `solaris' # (sparc), or `windows' (x86); anything else will require manual installation. # if [ -z "${LAPOS}" ]; then if [ "$OSTYPE" = "linux" -o "$OSTYPE" = "linux-gnu" ]; then # # apparently, (some) Debian installations come with an older uname(1), # where `-i' is not available :-{. (11-mar-05; oe) # if uname -i > /dev/null 2>&1; then cpu=$(uname -i) if [ "${cpu}" = "unknown" ]; then cpu=$(uname -m); fi else cpu=$(uname -m) fi case "${cpu}" in i?86) LAPOS="linux.x86.32" ;; x86_64) LAPOS="linux.x86.64" ;; *) echo "LAPOS: unknown Linux variant (check \`uname -m'); exit." exit 1; esac else echo "LAPOS: unknown Linux variant (check \`uname -m'); exit." exit 1; fi fi export LAPOS # # make available connection information to our annotation storage # if [ -z ${LAPSTORE} ]; then LAPSTORE=mongodb://lapstore:l%40pst0re@10.110.0.132:27017/lapstore fi export LAPSTORE # # # establish a target directory for informative LAP files, primarily the logs # from batch processing et al. the default is a sub-directory of $LAPTREE. # if [ -z "${LAPLOG}" ]; then LAPLOG=${LAPTREE%/tree}/log; mkdir -p ${LAPLOG} > /dev/null 2>&1; fi export LAPLOG; # # and another target directory for temporary files, e.g. various intermediate # files created by LAP Library code, tool wrappers, or tools themselves. # if [ -z "${LAPTMP}" ]; then export LAPTMP=/tmp; fi # # when running under SLURM control, actually force temporary files into the # job-specific scratch directory (which will later be purged automagically). # if [ -n "${SLURM_JOB_ID}" -a -n "${SCRATCH}" ]; then export LAPTMP=${SCRATCH}/tmp; mkdir -p ${LAPTMP} > /dev/null 2>&1; export TMPDIR=${LAPTMP}; fi # # record the base address of the SVN repository used, to make it easier for # scripts to generalize across various access methods, e.g. `svn.emmtee.net' # vs. `logon.emmtee.net' vs. SSL-encrypted access. # if [ -z "${LAPSVN}" ]; then { export LAPSVN=$(svn info $LAPTREE/etc | egrep '^URL: ' | sed 's/^URL: //'); LAPSVN=$(echo ${LAPSVN} | sed 's@^\(http://[^/]*\).*$@\1@'); } > /dev/null 2>&1 fi # # make sure we see our own command interpreters first in the PATH # PATH=${LAPTREE}/python/lap:${LAPTREE}/java/lap:${LAPTREE}/perl/lap:${PATH}