Tuesday, October 12, 2010

More Adventures in Climate Analysis Installs

So here I document getting Ferret to work on a Mac; getting it to run on the super is another problem. I assumed no privileges and more or less succeeded. However, the install instructions are (as is normal with scientist code) broken.

Here are the absurd installation instructions:


This is basically just three useful links to the actual binaries under "Environment and Executable files"; ignore the rest of it.

Then proceed to

http://ferret.pmel.noaa.gov/static/Downloads/ferret_installation_and_update_guide_v600.html

If you don;t knwo about environment variables in bash, go study up on them.

The first step 1 should be
tar xf $GET_LOCATION/fer_environment.tar

The second step 1 and step 2 [sic] work as noted. Step 3 should be
tar xf $GET_LOCATION/fer_dsets.tar
as the Mac ungzips behind your back. Your next step will have to be backwards, as the Finstall script expects the exectuables to be gzipped. So go back to your download directory and type

gzip fer_executables.tar


Also, you will have to find a place for an extra file in the middle of the next step. Be sensible, create a ~/.Ferret directory before doing the next step. Use that for your $SET_FER .

Now you can run the Finstall per instructions. But the script you ghet out will be a csh script not a bash script. The following edits worked for me:


export FER_DIR=/Users/tobis/Ferret
export FER_DSETS=/Users/tobis/FerSamp

# if ( $PATH !~ *ferret* ) then
# export PATH={$PATH}:$FER_DIR/bin
# else
# echo replacing ferret path
# export PATH=`echo $PATH | awk -F: '{for (i=1; i<=NF; i++) {if ($i \!~ /ferret\/bin/) {printf "%s:",$i}}}'`
# export PATH={$PATH}$FER_DIR/bin
# endif

# =========== Initially make no modifications below this line ===========

# Default Ferret document browser
# export FER_WEB_BROWSER="netscape -ncols 60"
export FER_EXTERNAL_FUNCTIONS="$FER_DIR/ext_func/libs"
export FER_GO=". $FER_DIR/go $FER_DIR/examples $FER_DIR/contrib"
export FER_DATA=". $FER_DSETS/data $FER_DIR/go $FER_DIR/examples $FER_DIR/contrib"
export FER_DESCR=". $FER_DSETS/descr"
export FER_GRIDS=". $FER_DSETS/grids"
export TMAP="$FER_DIR/fmt"
export PLOTFONTS="$FER_DIR/ppl/fonts"
export SPECTRA="$FER_DIR/ppl" # for old ferret versions
export FER_PALETTE=". $FER_DIR/ppl" # palette search list


So basically, change all the setenvs to exports, put in the equal sign, comment out the if/else block. If you are better with bash scripts, the if/else thing looks harmless.

I did not uncomment the reference to netscape. I don;t know where to get a netscape for os X 10.6 anyway. Sigh.

This actually works!


Meanwhile Chas has bunches of hoops for me to jump through. Will keep you posted, if you exist.

No comments: