[GRASSLIST:8674] Re: compiling question osx

William Kyngesburye woklist at kyngchaos.com
Tue Oct 18 10:32:43 EDT 2005


Since there's been no reply from someone more qualified, I'll give  
this a shot:

In general, I don't think it's possible to build a module to add to a  
binary distribution.  At least easily.  There is something you can do  
in Mac OS X - build the libraries and the module, then change the  
libraries that the maodule looks for:

- after configure cd to the 'lib' folder and make.  This is why  
trying to make the module didn't work for you - you didn't say if you  
ran configure, and everything needs the GRASS libraries to build.

- then cd to your module folder and make

- everything is built into 'dist.powerpc-apple-darwinX.X.X' folder,  
so cd to the bin folder in there.  Use install_name_tool to change  
the locations of all the grass libraries that the module binary uses  
to match Lorenzo's (use otool -L on libraries and programs to see  
what the paths are).

This is a Mac OS X thing, as far as I know.  On Linux systems people  
would tell you to set a linker variable to tell the system to look  
elsewhere for libraries, without actually changing the binaries.   
install_name_tool is handy for fixing poorly configured libraries  
distributed by some (ie where it's path is the build path, there's no  
path, ...).

- copy just the module to a folder in your shell environment path.   
You probably don't want to copy it to Lorenzo's GRASS bin since it  
could get trashed on an update.  Though if you're modifying a module,  
you probably should delete it from Lorenzo's GRASS.  A good choice  
would be the bin set in your environment GRASS_ADDON_PATH.


You should use the same version of GRASS source as Lorenzo's  
binaries.  Depending on what configure options you use and what the  
module needs and how Lorenzo configured his, and if he patched  
anything, this may or may not work.  I've found that a minimum needed  
to build GRASS is:

./configure --enable-sysv --with-proj --with-proj-includes= --with- 
proj-libs= --without-jpeg --without-tiff --without-png --without- 
tcltk --without-fftw --without-x --without-glw --without-motif -- 
without-opengl --with-gdal=

and fill in the with= options with their paths (ie Lorenzo's  
binaries).  If your module needs any of the 'without' options you'll  
have to add them also.


On Oct 14, 2005, at 3:55 PM, Ian MacMillan wrote:

> Hi all, I am trying to compile a single module in grass on mac  
> osx.  However I have been running off the binaries from Lorenzo's  
> site without ever compiling for source.  If I have the source as  
> well on my computer, and I have modified the module I want, what is  
> the next step?  I have tried just running make in that module's  
> directory, but I am running into all kinds of errors (a bit too  
> numerous to list here).  It seems like every time I track one down,  
> another pops up, and I am getting the feeling that I might be  
> taking the wrong approach.
>
> My question is this, if I haven't actually compiled Grass on my  
> machine, is it possible to then compile a single module without  
> recompiling everything else?  Do I need to change a bunch of file  
> paths in the module of interest first (ps.map)?
>
> Thanks for any help y'all might give,
> -Ian
>
>
> -------------------------------------------------------------
> This message has been scanned by Postini anti-virus software.
>
>

-----
William Kyngesburye <kyngchaos at kyngchaos.com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect




More information about the grass-user mailing list