[GRASSLIST:4649] Re: Compiling Grass

Glynn Clements glynn at gclements.plus.com
Tue Oct 26 20:58:56 EDT 2004


David Bannon wrote:

> Hi Folks, hope someone can point be in the right direction. Trying to
> compile version 5.7 on a system that does not have any of the GIS things you
> people usually have lying around. So I'm missing things that the developers
> probably don't think about ...
> 
> Any way, my experiences, firstly seems lots of configure things are turned
> on by default and if not wanted need to be turned off despite what configure
> --help indicates. This list includes gdal, postgres, odbc.

The configure --help output is bound to be accurate, as a single
statement determines both the "default: yes/no" in the help text and
whether the corresponding variable defaults to yes or no.

If "configure --help" indicates that a particular --with-* switch
defaults to "yes", then you will get an error if the checks for that
package fail. If you want to build without that package, you have to
supply an explicit --without-* switch.

This is intentional. The configure script used to generate a warning
and disable the package if the checks failed. Unfortunately, people
seemed to miss the warning then ask why certain features didn't work. 
Consequently, missing dependencies now result in a fatal error unless
you manually disable the package.

> Anyway, turn them off and then find we need PROJ.4, is that mentioned
> anywhere ?

All dependencies should be listed in the REQUIREMENTS.html file. PROJ4
is listed in that file:

<li>PROJ4 - Projection Library<br>
<a href="http://www.remotesensing.org/proj/">http://www.remotesensing.org/proj/</a>
<br></li>

> OK, get and compile that and tell grass config about it
> "--with-proj-includes=/common/src/brecca/proj-4.4.8/src/"

I wouldn't rely upon being able to reference external packages
directly from their source directory. You normally have to install
them, them reference the installation directories.

> So now configure works, but make does not. Seems when we get to building
> lib/proj it does not know about that path set in configure. Spent several
> happy hours trying to follow the make file's includes. Gave up and (sorry,
> really nasty hack) redefined CC as being "gcc -I${EXTRA_INC}", yeah, really
> nasty but easier than following those includes! Now the compile proceeds
> until it needs ogr_api.h down in db/drivers/org, but OGR is supposed to be
> turned off!
> 
> Google finds people associating this problem with gdal, OK, I get and
> compile gdal. Now, to compile gdal with grass support it needs to be told
> where grass is installed. But to install (or make) grass I need the
> gdal-config file, presumably built when making gdal!  I'm going around in
> circles!!  

I suggest building GDAL *without* GRASS support.

First, if you only intend to use GDAL for GRASS, there is no advantage
to enabling GRASS support. GRASS can read GRASS databases on its own;
it doesn't need to use GDAL to do so.

Second, versions of GDAL which were built with GRASS support tend to
be less reliable when used with GRASS than versions which were built
without GRASS support (as the programs end up depending upon GRASS
libraries via multiple paths).

> Here is how I configure grass :
> ./configure --with-proj-libs=/usr/local01/lib \
> 	--prefix=/usr/local01 \
> 	--with-proj-includes=/common/src/brecca/proj-4.4.8/src/ \
> 	--with-gdal=/common/src/brecca/gdal-1.2.3 \
> 	--without-postgres --without-odbc
> 
> And this is what it spits out at the end :
> ..
> checking for gdal-config... no
> configure: error: *** couldn't find gdal-config

Have you actually *installed* GDAL (i.e. "make install")?

> And, no there is no gdal-config there.
> 
> So, is the source for 5.7 buildable or have I grabbed the wrong tree ?

It's buildable.

> Should a newbee like me be trying to build some other version ?

5.3 is probably a bit easier to build, but not massively so.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-user mailing list