[GRASSLIST:4643] Compiling Grass

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.

Anyway, turn them off and then find we need PROJ.4, is that mentioned
anywhere ? OK, get and compile that and tell grass config about it
"--with-proj-includes=/common/src/brecca/proj-4.4.8/src/"

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!!

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

And, no there is no gdal-config there.

So, is the source for 5.7 buildable or have I grabbed the wrong tree ?
Should a newbee like me be trying to build some other version ?

Hey, if you are still here, thanks for at least reading this long story !

David

-------------------------------------------------------------
David Bannon D.Bannon@vpac.org
Phone 61 03 9925 4733 Fax 61 03 9925 4647
Mobile 0418 525687 http://www.vpac.org
Systems Manager, Victorian Partnership for Advanced Computing
-------------------------------------------------------------

--- David Bannon <D.Bannon@vpac.org> 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.

Anyway, turn them off and then find we need PROJ.4,
is that mentioned
anywhere ? OK, get and compile that and tell grass
config about it

"--with-proj-includes=/common/src/brecca/proj-4.4.8/src/"

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!!

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

And, no there is no gdal-config there.

So, is the source for 5.7 buildable or have I
grabbed the wrong tree ?
Should a newbee like me be trying to build some
other version ?

Hey, if you are still here, thanks for at least
reading this long story !

David

David,

Here is my experience in compiling first experimental
cvs of GRASS 5.3 and then GRASS 5.7. You first need
GRASS 5.3 installed to compile GRASS 5.7.

First I compile the libraries needed for GRASS 5.3 to
have all the additional stuff I want. That are:

- fftw (you need the version 2 and not 3)
(./configure, make, make install)

- gdal (You should get the latest version 1.2.3 if I
am not wrong. You do not need to compile gdal with
grass)

- proj (there are rpms of proj in the PostGIS site.
Try to find 4.4.8

- PostgreSQL (Many distros have it included, but the
src.rpm is not difficult to compile.)

- motif, blas and lapack are also included in my linux
distribution

Gdal, proj and PostgreSQL are strongly recommended.
See also if you have tcltk on your machine. There is a
nice GUI included with the source.

Find and download Markus's conf_grass50_linux.sh shell
script. It will help you to clear things up. You
should edit it the way to suit your needs.

After that make and make install should go without
problems.

GRASS 5.7 is a new version with stronger vector
database support. To compile that follow the
instructions of the INSTALL file in the main source
directory. But you MUST have GRASS 5.3 installed
first. The configure step is very similar to gras5.3
configure, but be attentive to the CFLAGS="-g -Wall"
and --with-grass50.

You did not tell us what OS you are running. There are
also precompiled versions of GRASS.

Miha

___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

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/&quot;&gt;http://www.remotesensing.org/proj/&lt;/a&gt;
<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@gclements.plus.com>

On Tue, Oct 26, 2004 at 04:39:44PM +0100, Miha Staut wrote:

--- David Bannon <D.Bannon@vpac.org> wrote:

...

Here is my experience in compiling first experimental
cvs of GRASS 5.3 and then GRASS 5.7. You first need
GRASS 5.3 installed to compile GRASS 5.7.

Small correction:
You simply need the *source* code of
GRASS 5.3 to compile 5.7. No need to compile 5.3.

Markus

....
Stuff about 5.7 not compiling deleted.
....

Hi Miha, thanks for your suggestions. I grabbed the source for 5.3 and, as
you suggested, it compiles OK (except for src/raster/r.mapcalc3) as long as
I turn off gdal. If I turn on gdal it also balks at the lack of gdal-config,
just where is this file supposed to come from ?

Anyway, I installed the now compiled 5.3 and then tried gdal. It still
cannot find the grass libraries, I'm telling it where its been installed,
trying :

--with-grass=/usr/local01/grass53
--with-grass=/usr/local01/grass5.3.0
--with-grass=/usr/local01/grass53/lib

And getting errors like this

checking for G_asprintf in -lgrass_gis... no
configure: error: --with-grass=/usr/local01/grass53 requested, but libraries
not found!

So I have two problems :

1. I don't have a gdal-config, don't know what it should contain, cannot get
one.

2. I cannot get gdal to recognise the grass5.3 install, particularly
libgrass_gris (because its not there!)

Have to say that I don't see why I need 5.3 before installing 5.7, perhaps
that's the bit I'm missing. Are you doing something with the 5.3 install
that affects the 5.7 ?

I'm wondering if the problem is happening because we are installing into
/usr/local01/ rather than /usr/local. We need to do that because it's a
pretty large cluster, don't have a lot of flexability about how we install
things.

Your suggestions :

Fftw - yep, we have 2.1.3
Gdal - like I said, it will not compile with grass support, demanding to see
libgrass_gis. 5.3 does not make or install one.
Proj - got that compiled and installed.
Motif, blas and lapack - are installed.
Postgres - we don't plan to use postgres

Don't want to use rpms because want to find whats missing at this stage.

The system is part of a 200 CPU cluster running RH7.3, reasonably well
updated and the 2.4.26 kernel.

David

David,

Here is my experience in compiling first experimental
cvs of GRASS 5.3 and then GRASS 5.7. You first need
GRASS 5.3 installed to compile GRASS 5.7.

First I compile the libraries needed for GRASS 5.3 to
have all the additional stuff I want. That are:

- fftw (you need the version 2 and not 3)
(./configure, make, make install)

- gdal (You should get the latest version 1.2.3 if I
am not wrong. You do not need to compile gdal with
grass)

- proj (there are rpms of proj in the PostGIS site.
Try to find 4.4.8

- PostgreSQL (Many distros have it included, but the
src.rpm is not difficult to compile.)

- motif, blas and lapack are also included in my linux distribution

Gdal, proj and PostgreSQL are strongly recommended.
See also if you have tcltk on your machine. There is a
nice GUI included with the source.

Find and download Markus's conf_grass50_linux.sh shell
script. It will help you to clear things up. You
should edit it the way to suit your needs.

After that make and make install should go without
problems.

GRASS 5.7 is a new version with stronger vector
database support. To compile that follow the
instructions of the INSTALL file in the main source
directory. But you MUST have GRASS 5.3 installed
first. The configure step is very similar to gras5.3
configure, but be attentive to the CFLAGS="-g -Wall"
and --with-grass50.

You did not tell us what OS you are running. There are
also precompiled versions of GRASS.

Miha

___________________________________________________________ALL
-NEW Yahoo! Messenger - all new features - even more fun!
http://uk.messenger.yahoo.com

On Thu, 28 Oct 2004, David Bannon wrote:

....
Stuff about 5.7 not compiling deleted.
....

Hi Miha, thanks for your suggestions. I grabbed the source for 5.3 and, as
you suggested, it compiles OK (except for src/raster/r.mapcalc3) as long as

r.mapcalc is quite important; post the errors you are getting to the developers' mailing list if you need help getting it working.

I turn off gdal. If I turn on gdal it also balks at the lack of gdal-config,
just where is this file supposed to come from ?

It should come with GDAL when you install it. Have you installed GDAL properly?

Anyway, I installed the now compiled 5.3 and then tried gdal. It still
cannot find the grass libraries, I'm telling it where its been installed,
trying :

You don't need GRASS support in GDAL. That is only if you want GDAL to be able to read GRASS databases for some third party application. Anyway the problem you have is that libgrass does not come with GRASS and is separate. But you don't need it. Just don't use --with-grass

checking for G_asprintf in -lgrass_gis... no

Ah I see you are using the new direct GRASS support in GDAL, not libgrass. But you need GRASS 5.7 for that. But again, you don't need GRASS support in GDAL to use GDAL with GRASS. GRASS can read it's own format. You need GDAL to read other formats.

Have to say that I don't see why I need 5.3 before installing 5.7, perhaps
that's the bit I'm missing. Are you doing something with the 5.3 install
that affects the 5.7 ?

You don't need to compile or install 5.3 to use 5.7. You just need the source code. The 5.7 CVS doesn't contain the source code for those modules that haven't changed between 5.3 and 5.7.

I'm wondering if the problem is happening because we are installing into
/usr/local01/ rather than /usr/local. We need to do that because it's a
pretty large cluster, don't have a lot of flexability about how we install
things.

No that should be no problem.

Motif, blas and lapack - are installed.

You only need motif for xganim and blas and lapack for s.surf.krig which is not compiled by default (i.e. you don't need them).

Hope this points you in the right direction

Paul K

Paul Kelly wrote:

> Anyway, I installed the now compiled 5.3 and then tried gdal. It still
> cannot find the grass libraries, I'm telling it where its been installed,
> trying :

You don't need GRASS support in GDAL. That is only if you want GDAL to be
able to read GRASS databases for some third party application.

Almost. The r.out.gdal script in 5.7 relies upon gdal_translate being
able to read GRASS databases, i.e. using a version of GDAL which was
built with GRASS support.

OTOH, r.in.gdal doesn't require GDAL to have GRASS support.

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

Thanks Paul, you have clarified a couple of things for me.

r.mapcalc is quite important; post the errors you are getting to the
developers' mailing list if you need help getting it working.

Check, I assumed because it compile proceeded it was unnecessary. Will go
back to it and chase.

> ... gdal-config....
It should come with GDAL when you install it. Have you installed GDAL
properly?

Yes, as far as I know. I'll have another look.

You don't need GRASS support in GDAL. That is only if you
want GDAL to be

That's an eye opener !

> 5.3 install that affects the 5.7 ?

You don't need to compile or install 5.3 to use 5.7. You just
need the
source code. The 5.7 CVS doesn't contain the source code for
those modules
that haven't changed between 5.3 and 5.7.

Right ! Now, does that mean that I should untar the source into the same
directory ? And in what order, first 5.3 and the overwrite with 5.7 ??

(Note, I'm not using the cvs of 5.7, it's the 'release' from the web site.

Hope this points you in the right direction

Certainly going a long way towards it!

David

> You don't need to compile or install 5.3 to use 5.7. You just
> need the source code. The 5.7 CVS doesn't contain the source code
> for those modules that haven't changed between 5.3 and 5.7.

Right ! Now, does that mean that I should untar the source into the
same directory ? And in what order, first 5.3 and the overwrite with
5.7 ??

If nothing yet exists:

put 5.3-cvs in /usr/src/grass53
put 5.7-cvs in /usr/src/grass57
  Both must be from CVS the same day.

then:
./configure --with-grass50=/usr/src/grass53 [--other-switches ...]
make mix
make
make install

or something like that.

the 'make mix' step links in the file which have not changed between 5.3
and 5.7 (mostly raster support)

Note if you have already built an earlier version you need to clean out
house before updating the CVS, etc., read the 5.7 INSTALL file for details.

(Note, I'm not using the cvs of 5.7, it's the 'release' from the web
site.

5.7.0 you don't need 5.3
5.7-weekly snapshot you do

Hamish