[GRASSweb-list]scott: web/macgrass macosx_grass50compile.html,NONE,1.1

grass at intevation.de grass at intevation.de
Wed Apr 28 11:26:03 EDT 2004

Author: scott

Update of /grassrepository/web/macgrass
In directory doto:/tmp/cvs-serv5127

Added Files:
Log Message:
put into right place and updated

--- NEW FILE: macosx_grass50compile.html ---
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<p><b>Initial Notes:</b> </p>
<p>A comprehensive review of, or set of instructions for, compiling GRASS 
on a Mac is not here yet.  In the meantime, here are some notes put together 
by Scott Mitchell (smitch AT mac dot com).  Suggestions / additions welcome. 
&nbsp;See also <a href="macosx_buildnotes.html">material compiled by others</a>, 
not yet incorporated here. </p>
<p>Compiling GRASS under Mac OS X requires the development tools to be installed. 
 This is a separate package if you installed OS X yourself, and depending 
on the software version, it is either on one of the install disks, or you 
need to download it from Apple (it's free).  If OS X came pre-installed on 
your computer, the developer tools may have been installed for you, depending 
on the computer model and when it was purchased.  If not, they may be on a
CD that came with the computer, and if not you also need to download them 
from Apple. </p>
<p>Two checks I can think of off the top of my head to see if they are installed 
are to (1) check to see if you have a /Developer directory in your boot drive, 
or (2) at a command line prompt, type the command gcc and press enter - if 
you get a "Command not found" error, or something to that effect, you likely 
don't have the tools installed.  If you get "gcc: no input files", then you've 
got the tools. </p>
<p>Beyond having the necessary compilers and libraries provided by the development 
environment, you also need all of the other <a
 href="../grass5/source/REQUIREMENTS.html">prerequisites</a> for GRASS.  If
you are experienced in building Unix/Linux applications, you may elect to
obtain and compile them all yourself.  Otherwise, you will probably want to
use some form of packaging system.  In either case, refer back to the main
<a href="macgrass.html">GRASS on Mac page</a> for more details. </p>
<p>Once you have all the prerequisities in place, compiling GRASS is relatively
 straightforward, or at least it's pretty much the same on this platform
as others, except perhaps that some required libraries are in non-standard
locations  from the point of view of other platforms.  For example, if you
have used FINK  to install related tools, those will be located under the
/sw directory.  Some of the required bits are provided by Apple and are typically
under /usr, and if you compiled and installed anything manually, it may be
under /usr/local.  </p>
<p>For more compilation advice, until I receive any other great suggestions,
 the best I can offer is to show the procedure I have been using successfully
 on my own machines. </p>
<p> I have most of the required extras installed by fink.  These include the
graphics libraries, Postgresql, unixodbc, FFTW, lesstif, and libdl.  Freetype
is provided by Apple's X11 on my Panther machines, and by fink on the Jaguar
one (which also  has XFree86 provided by fink instead of by Apple).  I have
compiled PROJ4 and GDAL myself and installed them in to the default /usr/local
hierarchy, mostly using the instructions and defaults that come with those
packages.  So for  PROJ I just did the typical set of commands to compile
it: </p>
<pre>	./configure<br>	make<br>	sudo make install </pre>
  For GDAL, there was a small change, which was necessary at one time to
get  the compile to work for Macs - I don't know if that is still the case,
but  it's safe to keep it this way as far as GRASS compatibility:  
<pre>	./configure --with-python=no </pre>
  and then it gets standard:  
<pre>	make<br>	sudo make install<br></pre>
<p>Next, I'm ready to set up the GRASS compile, in the GRASS source directory.
 Note that I'm assuming that you've obtained and extracted the source, and 
have read all the directions that come with it - this document is not duplicating
 any of the other directions on this site, just pointing out parts that may 
be different than on other systems. </p>
<p>So first I need to configure the build so that it finds all my extra libraries. 
 Instead of typing in the location for ALL of the libraries that are provided 
by my FINK installation, I use the generic --with-includes= and --with-libs= 
to tell configure to add the /sw/[lib,include] directories to all of its searches
for the requirements.  Some of the other switches used are described below.
<p>So my configure command (copied from my last compile of v5.3-cvs) is:
<pre>./configure  --with-includes="/usr/X11R6/include /sw/include" \<br>	--with-libs="/usr/X11R6/lib /sw/lib" --with-motif --with-glw \<br>	--with-postgres=yes --with-gdal=/usr/local/bin/gdal-config \<br>	--with-proj --with-freetype \<br>	--with-freetype-includes=/usr/X11R6/include/freetype2 --enable-64-bit \<br>	--enable-shared --with-gd \<br>	--with-postgres-includes=/sw/include/postgresql \<br>	--with-postgres-libs=/sw/lib/postgresql/<br>	<br></pre>
<p>Notes on the above command: </p>
   <li>This starts the configure command which will run through a series
of tests, looking for capabilities of your development environment and locations
and versions of the required libraries, etc - it sets up a compilation configuration
which is drawn on by the make program (next step) to do the actual compile.</li>
  <li>This is actually all one command, split in to multiple lines to make
it easier to see and/or copy/paste. &nbsp;The "\" at the end of each line
tells the shell that you enter the command in to that the command will be
continued on the next line. &nbsp;You can either copy and paste each of these
lines as they are shown above, or enter it all as one command line (in which
case, skip the "\" characters).<br>
  <li>The --enable-64-bit is because this was on a G5 computer, so if anything 
in the code can take advantage of the 64 bit platform, that turns it on. 
To be honest, I haven't checked to see if this actually does anything yet. 
 If you are doing this on a G4, skip that one.</li>
  <li>The --enable-shared tells GRASS to build shared versions of the GRASS 
 libraries instead of building them in to each binary module, resulting in 
 much smaller files being built.  I THINK this actually now depracated in 
that this is not the default for modern versions of GRASS 5.3 and higher. 
 If you want to do my homework and check that for me, search the mailing list
archives, the relevant post is probably by Paul Kelly or Glynn Clements. 
In any case, it doesn't hurt to leave it in here. </li>
<p>After that, the </p>
  command builds the software.  Check the error log file. If all looks good, 
<pre>sudo make install</pre>
  will put everything in place.   
<p>Please do get back to me using "smitch at mac dot com" with suggestions 
or problems regarding these instructions. </p>
<p>Scott </p>

More information about the grass-web mailing list