George H.'s nasty LSF hack

As discussed elsewhere, LSF currently unsets your LD_LIBRARY_PATH. This can be really aggravating. So, I've come up with a few evil hacks which help to avoid the problem most of the time. Note that this is described for (t)csh users, though it can be made to work for bash users too (see me for how to do it if you need it). sh users are out of luck. The hack has three parts:

  1. Set up a file called lsflibsetup. Put it in your ~/bin directory, or you can (in step 3) point to mine in ~gah/bin/lsflibsetup. The file should look like this:
    if ($?LD_LIBRARY_PATH) then
        setenv LSF_LIBRARY_PATH $LD_LIBRARY_PATH
    endif
  2. In your .cshrc file, add the following lines:
        if ($?LSF_LIBRARY_PATH) then
            setenv LD_LIBRARY_PATH $LSF_LIBRARY_PATH
            unsetenv LSF_LIBRARY_PATH
        endif
  3. Add another two aliases (probably also in your .cshrc):
        alias bsub 'source $HOME/bin/lsflibsetup; bsub \!*; unsetenv LSF_LIBRARY_PATH'
        alias bdo 'bsub tcsh -c'
        alias bint 'bsub -Is tcsh -c'

Ta-daah! Now, if you submit a (t)csh script using bsub, it will grab the LD_LIRBARY_PATH from your submitting code correctly. If you use 'bdo', you can submit a quick one-liner as long as you don't need any other LSF flags; if you need alternate LSF flags, you can type it yourself: 'bsub -flags tcsh -c command'. And bint puts the commonly needed -Is interactive shell-mode flag in for you.

Maintained by George Heintzelman <gah@bnl.gov>