# # make sure this file is included from your personal `~/.bashrc', e.g. put the # following towards the end of `~/.bashrc' (and uncomment these, of course): # # LOGONROOT=~/logon # if [ -f ${LOGONROOT}/dot.bashrc ]; then # . ${LOGONROOT}/dot.bashrc # fi # # if you decide to keep your LOGON source tree in a different location, say # `~/src/logon', instead, then adjust the above accordingly. it should not be # necessary to make changes to _this_ file, however. # # ----------------------------------------------------------------------------- # file: .bashrc # module: LOGON initialization file for BaSH # version: 0.0 -- 21-nov-03 # written by: oe, uio # last update: # updated by: # ----------------------------------------------------------------------------- # # ----------------------------------------------------------------------------- # # make global variable for LOGON directory tree accessible to other processes. # export LOGONROOT # # establish a target directory for informative LOGON files, primarily the logs # from batch processing et al. the default is a sub-directory of $LOGONROOT. # if [ -z "${LOGONLOG}" ]; then export LOGONLOG=${LOGONROOT}/log fi # # and another target directory for temporary files, e.g. various intermediate # files created by [incr tsdb()] (including potentially large event files for # MaxEnt experimentation), and the results of Redwoods exports. # if [ -z "${LOGONTMP}" ]; then export LOGONTMP=/tmp fi # # prepend LOGON binary directory to the global search path # PATH=${LOGONROOT}/bin:$PATH # # first, work out the current operating system, one of `linux' (x86), `solaris' # (sparc), or `windows' (x86); anything else will require manual installation. # if [ "$OSTYPE" = "linux" -o "$OSTYPE" = "linux-gnu" ]; then # # apparently, (some) Debian installations come with an older uname(1), where # `-i' is not available :-{. (30-apr-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) os="linux.x86.32" ;; x86_64) os="linux.x86.64" ;; unknown) os="linux.x86.32" ;; *) echo "dot.bashrc: unknown Linux variant (check \`uname -i')." os="linux.x86.32"; esac elif [ "$OSTYPE" = "darwin" -o "${OSTYPE%%?.?}" = "darwin" ]; then os="macos.ppc.32"; elif [ "$OSTYPE" = "solaris" -o "${OSTYPE%%?.?}" = "solaris" ]; then os="solaris"; elif [ "$OSTYPE" = "cygwin" ]; then os="windows"; fi # # giving a few more people (at sites with XLE licenses) access to the LOGON CVS # repository, we feel a little protective of parts of the tree. # if [ -d ${LOGONROOT}/parc ]; then chmod 700 ${LOGONROOT}/parc > /dev/null 2>&1 fi # # even on systems that have no Motif installed, make sure the LKB can find its # Motif libraries (this is somewhat of a hack, really). also, add the path for # XLE Sicstus libraries (used by the XLE), so dynamic loading will work. # if [ -z "${LD_LIBRARY_PATH}" ]; then LD_LIBRARY_PATH=${LOGONROOT}/lingo/lkb/lib/${os} else LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${LOGONROOT}/lingo/lkb/lib/${os} fi LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${LOGONROOT}/parc/xle/lib/${os} LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${LOGONROOT}/uio/lib/${os} export LD_LIBRARY_PATH # # on 64-bit machines, also include 32-bit libraries, so we can run things in # compatibility mode. # if [ "$os" = "linux.x86.64" ]; then LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${LOGONROOT}/lingo/lkb/lib/linux.x86.32 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${LOGONROOT}/parc/xle/lib/linux.x86.32 LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${LOGONROOT}/uio/lib/linux.x86.32 fi # # make sure there is a directory `~/tmp' for the LKB to store temporary data; # also, make sure to install a couple of dummy `dot' files, unless they exist # already. # /bin/mkdir ${HOME}/tmp > /dev/null 2>&1 if [ ! -f ${HOME}/.cvsrc ]; then /bin/cp ${LOGONROOT}/dot.cvsrc ${HOME}/.cvsrc; fi if [ ! -f ${HOME}/.pvm_hosts ]; then /bin/cp ${LOGONROOT}/dot.pvm_hosts ${HOME}/.pvm_hosts; fi if [ -f ${HOME}/.clinit.cl -o -f ${HOME}/.tsdbrc ]; then . ${LOGONROOT}/etc/sanitize fi if [ ! -f ${HOME}/.podiumrc ]; then /bin/cp ${LOGONROOT}/dot.podiumrc ${HOME}/.podiumrc; fi # # for ChaSen, we need to expand $LOGONROOT a we create a user-specific file # rc="$LOGONROOT/.chasenrc"; /bin/rm -f ${rc}; echo -en ";;;\n;;; this files is (re-)created automatically from " > ${rc}; echo -e "\`\$LOGONROOT/dot.chasenrc'\n;;;\n" >> ${rc}; sed "s@_LOGONROOT_@$LOGONROOT@" $LOGONROOT/dot.chasenrc >> ${rc}; # # 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. # { export LOGONSVN=$(svn info $LOGONROOT | egrep '^URL: ' | sed 's/^URL: //'); LOGONSVN=$(echo ${LOGONSVN} | sed 's@^\(http://[^/]*\).*$@\1@'); } > /dev/null 2>&1 # # as we start experimenting with larger cpu grids, this will be required too # export PVM_RSH=/usr/bin/ssh # # request emacs(1) as the standard editor, e.g. for CVS comments. # export EDITOR=emacs # # make some of the `gold' profiles visible in the default [incr tsdb()] home # { mkdir ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold; # # while there is no active work on the original LOGON language pair, makethe # [incr tsdb()] list of \`gold' profiles more compact, leaving out NorGram. # if false; then if [ -h ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/norgram ]; then : else ln -s ${LOGONROOT}/parc/pargram/norwegian/bokmal/gold \ ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/norgram; fi fi if [ -h ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/erg ]; then if { /bin/ls -l ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/erg \ | egrep "tsdb/gold$"; } > /dev/null 2>&1; then : else /bin/rm ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/erg > /dev/null 2>&1; ln -s ${LOGONROOT}/lingo/erg/tsdb/gold \ ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/erg; fi else ln -s ${LOGONROOT}/lingo/erg/tsdb/gold \ ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/erg; fi if [ -h ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/terg ]; then : else ln -s ${LOGONROOT}/lingo/terg/tsdb/gold \ ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/terg; fi if [ -h ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/logon ]; then : else ln -s ${LOGONROOT}/gold ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/logon; fi if [ -h ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/gg ]; then if { /bin/ls -l ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/gg \ | egrep "tsdb/gold$"; } > /dev/null 2>&1; then : else /bin/rm ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/gg > /dev/null 2>&1; ln -s ${LOGONROOT}/dfki/gg/tsdb/gold \ ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/gg; fi else ln -s ${LOGONROOT}/dfki/gg/tsdb/gold \ ${LOGONROOT}/lingo/lkb/src/tsdb/home/gold/gg; fi } > /dev/null 2>&1 # # turn on the new Linguistic User Interface (LUI) in the LKB # if [ -z "$LUI" ]; then export LUI=t fi # # rumor has it the new morphology code requires a pointer to the PARGRAM root # export PARGRAM=${LOGONROOT}/parc/pargram # # a convenience function for dan and oe, to simplify interactive testing # function terg () { if [ -z "${1}" ]; then n=1; else n=${1}; fi cheap -t -sm -yy -default-les=all -cm=${n} -verbose=3 \ $LOGONROOT/lingo/erg/english < /tmp/${USER}.yy \ 2>&1 | tee /tmp/$USER.log } # merg()