[Thread Prev][Thread Next][Index]

Re: [ferret_users] run ferret and pyferret together



Hallo,
this is an excellent concept. It helps a lot to maintain ferret on PCs but also on a server with many users. Access becomes much simpler for newbees. I would propose to offer this in future releases for ferret installation? It is as simple as the current one but keeps software and environment strictly together. This avoids interaction between different instances of ferret. Please find below a more complex script "ferret" that accounts also for the hierachie of directories:
- ferrets defaults
- institute/companies additional tools of common interest
- users private tools.

To keep many versions of a software in parallel, on servers and PCs as well, the modules environment
https://www.nersc.gov/users/software/nersc-user-environment/modules/
may be recommended. It is part of many linux distributions. Installation and usage is very simple, maintainance needs some reading, or better some working examples, but it saves much more time than it consumes - also on single user PCs.

Best,
Martin Schmidt

#!/bin/bash
source /sw/viz/ferret/py_ferret_120_ub_py_27/ferret_paths
# append paths for personal Ferret scripts
export FER_IOW=/sw/viz/ferret/ferret_iow
[[ -d $FER_IOW/go ]]            && export FER_GO=". $FER_IOW/go "${FER_GO#.}
[[ -d $FER_IOW/ppl ]] && export FER_PALETTE=". $FER_IOW/ppl "${FER_PALETTE#.} [[ -d $FER_IOW/dsets ]] && export FER_DATA=". $FER_IOW/dsets "${FER_DATA#.} [[ -d $FER_IOW/ext_func/libs ]] && export FER_EXTERNAL_FUNCTIONS=". $FER_IOW/ext_func/libs "${FER_EXTERNAL_FUNCTIONS#.} [[ -d $HOME/ferret/go ]] && export FER_GO=". $HOME/ferret/go $FER_IOW/go "${FER_GO#.} [[ -d $HOME/ferret/ppl ]] && export FER_PALETTE=". $HOME/ferret/ppl $FER_IOW/ppl "${FER_PALETTE#.} [[ -d $HOME/ferret/data ]] && export FER_DATA=". $HOME/ferret/data $FER_IOW/dsets "${FER_DATA#.} [[ -d $HOME/ferret/ext_func/libs ]] && export FER_EXTERNAL_FUNCTIONS=". $HOME/ferret/ext_func/libs_linux "${FER_EXTERNAL_FUNCTIONS#.}
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sw/data/netcdf/4.3.2/lib64
/sw/viz/ferret/py_ferret_120_ub_py_27/bin/pyferret $*

Am 20.01.2016 um 13:51 schrieb Ryo Furue:
Hi Patrick,

I would like to work with both tools for testing purposes.
But after having sourced the 2 different environnements,
I get some environment variables conflicts that
I do understand but don't know how to solve properly.
I don't set env.vars. globally but use my own wrapper script like this:

     #!/bin/sh
     FER_DIR="/usr/local/ferret"
     export FER_DSETS="$FER_DIR"
     export FER_FONTS="${FER_DIR}/ppl/fonts"
     export PLOTFONTS="${FER_DIR}/ppl/fonts"
     # . . . after setting all env.vars. . . .
     exec "$FER_DIR/bin/ferret_v6.94" "$@"

and call this script "ferret".  Then you don't have to set env.vars. any longer.

I don't use pyferret, but you can write two scripts like this, one for
ferret and the other for pyferret, their env.vars. not conflicting.

Instead of writing scripts like the above, you may be get by with

    #!/bin/sh
    source /usr/local/ferret/bin/ferret_paths.sh
    exec /usr/local/ferret/bin/ferret_v6.94 "$@"

(untested).

Cheers,

Ryo



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement