[GRASSLIST:2770] Re: compiling grass and gd includes

cmbarton michael.barton at asu.edu
Fri Dec 7 13:34:21 EST 2001



Thanks for all the help. I hope our discussion is also helping other 
trying to compile GRASS. I think this should about do it (fingers 
crossed). I have a couple of interesting issues with freetype and gdal 
mentioned below.

I should also mention that I am using the WONDERFUL fink utility and 
service for installing many of my unix packages. GRASS is currently in 
their CVS submission tracker for inclusion in the OS X/Darwin ports that 
fink supports (my suggestion). When complete, it will build from the 
source. Unfortunately, I have been unable to get PostgreSQL to compile 
and install correctly either from the source, or via fink (also source 
file with patches to the configure script). I anyone out there has been 
successful in getting PostgreSQL on a Mac OSX system, I'd love to hear 
about it.

> This implies that FreeType isn't installed correctly.
> The directory in which ft2build.h resides should also contain a
> subdirectory called "freetype". In turn, that subdirectory should
> contain several freetype headers, plus subdirectories called "cache",
> "config" and "internal":
>   $ ls -R /usr/X11R6/include/freetype2
>   /usr/X11R6/include/freetype2:
>   freetype/  ft2build.h

I have all this stuff (including all the header files). However, 
ft2build.h is in the /sw/include directory instead of the 
/sw/include/freetype2 directory. I will cp ft2build.h to 
/sw/include/freetype2 and try the configure again.

>> So I should just ./configure with all turned off -- including freetype?
> Yes. You can use --without-blas and --without-lapack with no loss of
> functionality. --without-freetype only disables d.text.freetype, and
> --without-motif only disables xganim.
>>> Note: If an argument is passed to --with-gdal, it should be the path
>>> to the "gdal-config" script, e.g. "--with-gdal=/sw/bin/gdal-config".
>> I had to use the precompiled binary of gdal for OSX. It only comes with
>> a dynamic library (libgdal.1.1.dylib). No gdal-config.
> What about headers (gdal.h, cpl_*.h)? Although, it appears that
> r.in.gdal will compile without them when not using --with-gdal.

These didn't come with the package...only the dylib.

>> Should I let the configure script default to without gdal?
> At present, r.in.gdal is always included in the build. --with-gdal
> simply tries to link it to libgdal at build time. Without this switch,
> r.in.gdal will attempt to load it via dlopen(). This will probably
> fail on MacOSX; the code expects the library to have one of the
> following names:
> 	libgdal.1.1.so
> 	gdal.1.0.so
> 	gdal.so.1.0
> 	libgdal.so.1
> If you need r.in.gdal, I'd suggest editing the file src/CMD/head/head
> after running "configure" but before running "make". But, AFAICT, this
> approach requires the GDAL headers to be installed.

I would like to have r.in.gdal. I'll check the head file as you suggest. 
Interestingly, I am running r.in.gdal on the precompiled Mac OSX binary 
with only the gdal dylib. I had to change my login shell script to set 
the DYLD_LIBRARY_PATH environment variable, but that was it. Maybe I 
should let it compile without linking to gdal and not worry about it???

Michael Barton, Professor & Curator
Department of Anthropology
Arizona State University
Tempe, AZ  85287-2402

More information about the grass-user mailing list