[GRASS5] Mac OSX binary install directions

Michael Barton michael.barton at asu.edu
Thu Dec 11 11:11:04 EST 2003


Hamish and others,

I've been messing with and installing GRASS on OSX for awhile now. Here 
are a couple of clarifications based on my experiences.

>
> Here a some of my notes which may be useful for your write-up.
> This is for a binary only install.

***Basic requirements for installing GRASS 5.3 binaries on OSX***

X11 (note different versions for OSX 10.2 and 10.3)
tcltk for X11

That's it.

HOWEVER (a big however). You will WANT to have GDAL installed for 
import/export and may want a few other items installed (such as 
PostgreSQL).

***You can get X11 in a variety of flavors from a variety of sources. I 
use X11 from Apple. Also install the X11 SDK file (almost hidden on the 
X11 install page).

****tcltk for X11 I have only been able to find in source version (from 
the main tcltk web page) or on FINK. If there is another version out 
there in binary, it would be very good to know where it is.

See Hamish's notes below for getting and installing FINK. Note: you 
MUST also install the Apple X11 SDK for FINK to work correctly 
(otherwise it doesn't realize you have an existing X11 installation and 
tries to install another one, though it isn't supposed to do this). 
Also look at Hamish's notes for different shell login scripts.

On OSX 10.2, fink installs and automatically fixes the login script to 
correctly add path names for fink-installed programs like tcltk. If you 
want to also want to have a path set for GRASS installed in 
/usr/loca/bin (the default for binaries), you will need to add this to 
your path. You can do this in Fink Commander preferences or by adding 
this directory to the path line in the file  /sw/bin/init.csh. Note you 
will need su privileges to do this.

On OSX 10.3, it is more complicated as Apple has switched from tcshell 
to bash. First, you need to make the path modification to init.sh 
(instead of init.csh). Second, you will need to add the line "source 
/sw/bin/init.sh" to the file /etc/.bashrc. (I do it this way to make 
sure that the new path is available to all users of a system).

Using Fink Commander, install tcltk. As Hamish points out, you can also 
install other related programs like R, GIMP, XFIG, etc.

**** If you install PostgreSQL, I recommend installing it from Marc 
Liyange's page <http://www.entropy.ch/software/macosx/> rather than 
Fink. The fink install has some permission problems. These are fixable, 
but complicate the installation. He also includes a script to 
automatically start PostgreSQL each time you start your computer and 
links to the excellent PHP administrator for PostgreSQL (install Marc's 
PHP first).

****You can install GDAL via fink, but it is very dated at present. 
Marcus has provided a great set of GDAL binaries with OGR support. I 
don't know where they will be posted however, if Marcus takes down his 
temporary site for them. If you install these, make the link file as 
Hamish suggests below (this is more important for GRASS 5.3, but you 
might as well do it).

>

Here are a couple additions to Hamish's excellent directions for 
installing GRASS 5.7 binaries

***Basic requirements for installing GRASS 5.3 binaries on OSX***

X11 (note different versions for OSX 10.2 and 10.3)
tcltk for X11 (required for the tcltk interface)
GDAL with OGR (GRASS 5.3 won't run without this)
PROJ4 (GRASS 5.3 won't run without this)

That's it.  Again, you might want to install a series of related 
applications.

> GRASS 5.7 on OSX 10.3
>
>
> 1) Install Apple's X11 and friends
> Our new system came with OSX 10.3 preinstalled, and past the point of 
> custom
> install so I had to download Apple's X11 from their website[1]. After
> installing that, I headed over to Applications/Installers/Developer 
> Tools
> and double clicked Developer.mpkg; from the custom install list I
> choose Devel Tools Software, MacOSX SDK, BSD SDK, and X11 SDK.

You've got to have X11 SDK install for Fink to work (needed for 
installing tcltk--at least by me).

>
> 2) Setup a root password
> Open Apps/Utilities/Terminal and type 'sudo su' and set a strong 
> password.
>

As Hamish notes, this is optional

> 3) Install R-statistics[2]
> This is optional, but useful for geostats. Click on CRAN, choose a 
> mirror,
> click on R Binaries, macosx, and download RAqua.dmg. Double click on 
> that
> package and install tcltk, libreadline, and finally RAqua. This 
> installs
> the OSX port of R to Applications/StartR. I made a link to this 
> application
> so I could start R from the command line by typing "R":
> (as root)
> mkdir /usr/local/bin  (if it doesn't already exist)
> ln -s /Applications/StartR.app/Contents/MacOS/StartR /usr/local/bin/R
>
> Next, start R and type:
> install.packages("akima")
> install.packages("VR")
> install.packages("GRASS")
> install.packages("RODBC")
> install.packages("grasper")
> install.packages("mgcv")
> install.packages("shapefiles")
> .. and any other packages that might look interesting to you
>
> The GRASS website has a useful R primer[3].
>
>

See my notes above for additional information on bash shell scripts for 
fink and correct paths using OSX 10.3

Also note that this is different for OSX 10.2 because it uses tcshell 
(also see above)

I would change these X startup files AFTER installing FINK because FINK 
changes some of them during its install.

> 4) Setup X startup files.
> OSX's Terminal looks for .bash_profile but not .bashrc. Apple's X11 
> looks for
> .bashrc but not .bash_profile. Solution (kludge) follows:
>
> .bash_profile:
> . ~/.bashrc    # does this need to be a hard path for the GRASS init 
> script?
>
> .bashrc:
> alias rm='rm -i'
> alias cp='cp -i'
> alias mv='mv -i'
> alias ls='ls -FG'
> alias ll='ls -la'
> alias la='ls -A'
> alias dir='/bin/ls'
> PATH="$PATH":/usr/local/bin
>
> I also disabled the xterm& in /etc/X11/xinit/xinitrc.
>
> 5) Install Fink[4]
> Download & run the Fink Installer. Double click on "Fink 0.6.2 
> Installer.pkg"
> and after that is setup, drag the FinkCommander folder to your desktop.
> Check this line has been added to all users' .bashrc:
> . /sw/bin/init.sh
> I ran 'fink configure' to setup which Fink mirror to talk to, but 
> that's not
> a strict requirement.
> May need to log out & back in to take effect.
>
> 6) Run FinkCommander
> Setup to use stable packages, it has already guessed to use the 10.3 
> branch.
> This branch is missing some packages as of this writing, but saves 
> time vs.
> compiles. I installed: wget, gimp, dlcompat-shlibs (needed for Gimp),
> tcklk (yes, again), and gmt. I would have installed nedit and octave 
> if they
> were in the stable archive at the time in binary form. Gimp brings 
> down a lot
> of goodies like the netpbm tools and libpng which will probably be 
> needed
> later. Someone noted about needing the TclTk from unstable for 
> compile??
>
>
> 7) Install PROJ.4 and GDAL
> Download[5] and follow Markus's instructions to install PROJ and GDAL.
> Then as root, make the following two links:
> ln -s /sw/lib/libgdal.1.1.9.dylib /usr/local/lib/libgdal.1.1.dylib
> Forget what the second one was, thought it for Proj. What breaks?

I can answer this one as I posted a note on this a few days ago.

For PROJ4, you need to
1. un-gzip the file. It produces a mirror of the /usr directory with 
all the PROJ files in the proper places
2. manually copy all the files to their corresponding directories in 
/usr. For example, if you un-gzipped PROJ4 into temp, copy all files in 
/temp/usr/lib to /usr/lib. The primary offending file that seems to be 
left out and not installed properly is libproj.dylib. GRASS 5.3 will 
not run if it cannot find this file.

Important clarification for GDAL. Hamish's link assumes a fink install 
for GDAL (all fink stuff install into /sw). I don't know what version 
fink now has. A few weeks back, it was an older one and not 1.1.9 and 
did NOT include OGR. As Marcus' GDAL binary is currently set up, it has 
an install script to place all of its pieces in the /usr/* directories 
(not in the /sw/* directories). You will need to make the link noted by 
Hamish because the current build of GRASS 5.3 looks for 
libgdal.1.1.dylib. This file does not exist in the newer version 
provided by Marcus (ver. 1.9). Hence, you need to make link to 
/usr/lib/libgdal.1.1.9.dylib. HOWEVER, this link SHOULD be

ln -s /usr/lib/libgdal.1.1.9.dylib /usr/local/lib/libgdal.1.1.dylib

because libdgal.1.1.9.dylib is found in /usr/lib and not in /sw/lib

GRASS 5.3 will not run if it cannot find libgdal.1.1.dylib.

>
> These are probably better dealt with by getting /sw/lib added to OSX's
> ld path, where ever that lives.

See note above. The best (fink) way to do this is to modify the path 
line  in /sw/bin/init.csh (for OSX 10.2) or /sw/bin/init.sh (for OSX 
10.3). Then add the source /sw/bin/init.csh (for  10.2) or source 
/sw/bin/init.sh (for 10.3) to the .cshrc file (for 10.2) or .bashrc 
file (for 10.3).


>
>
> 8) Install GRASS
> Download[5] and follow Markus's instructions. I found it better to use
> wget instead of Safari to do the download to keep the MD5 hash the same
> as Safari automatically unpacks the archive.
> (as root)
>  grass57-20_11_2003-powerpc-apple-darwin6.8-install.sh \
>     grass57-20_11_2003-powerpc-apple-darwin6.8-bin.tar.gz \
>     /usr/local/grass57
>
> mkdir ~/grassdata
>  and install the Spearfish, Leics, and Radim's g51test data sets there.
>
>
> 9) Add links to the X11 menu
> Start X11 (Apps/Utilities), choose Customize.. from the Applications 
> menu.
> Add Item, Add Item. Double click on blanks & fill in:
> Name       Command
> GRASS 5.7  xterm -geometry 123x25+5+400 -e grass57
> The GIMP   gimp
>
>
> 10) Enjoy. Everything seems to work, even NVIZ.

Indeed it does. I have now installed this on 10.2 and 10.3 systems.

I hope this helps

>
>
> [1] http://www.apple.com/macosx/features/x11/download/
> [2] http://www.r-project.org/
> [3] http://grass.ibiblio.org/statsgrass/grass_geostats.html
> [4] http://fink.sourceforge.net/
> [5] http://mpa.itc.it/markus/grass57/macosx/  [TEMPORARY]
>
>
>
>
> Hamish
>
____________________
C. Michael Barton, Professor
Department of Anthropology
PO Box 872402
Arizona State University
Tempe, AZ  85287-2402
USA

Phone: 480-965-6262
Fax: 480-965-7671




More information about the grass-dev mailing list