[GRASSLIST:3979] Re: [GRASS5] [bug #2545] (grass) vect32 fails to build

,

The patch below shows how I propose to fix this. I think src/CMD/gmake.sh should be changed so that $(OBJARCH) is preprended at the beginning of a path leading to a .o file rather than immediately preceding the filename.
i.e. Vlib/open.o becomes $(OBJARCH)/Vlib/open.o rather than Vlib/$(OBJARCH)/open.o as at present.

Paul

Your patch resolve bug #2545 and bug #2547. Now is possible to create libvect_combined.a

This should fix things for both the alternate and gmake systems.
It will also cause problems for badly written or non-standard Gmakefiles. The only one I came across is for r3.null and I will fix that by building r3.null and r3.mask from the same directory (cf. r.mapcalc and r3.mapcalc are built from the same directory).

But there might also be problems with non-standard Gmakefiles in add-on modules people have written themselves I suppose. But probably not very likely. So I just wanted to post this here for a while for comments before committing the changes.

The r.terraflow Gmakefile also needs fixed so it will work with both build systems. It has a related but different problem with using sub-directories.

Yes the only problem is in r3.null like you say...

Thanx

--
________________________________________________________________________
|| Lorenzo Moretti e-mail: lorenzo.moretti@bologna.enea.it ||/|/| ENEA prot/idr Web: http://wwwamb.bologna.enea.it/ || | via Don Fiammelli, 2 FTP: ftp://ftpamb.bologna.enea.it/ (res.)
~~~~~~ 40128 BOLOGNA - ITALY Ph: +39-0516098086 Fax: +39-0516098131
      Download GRASS for MAC OS X: http://wwwamb.bologna.enea.it/forgrass/
________________________________________________________________________

I just downloaded the 5.7 source code after reading the announcement that it has been officially released. I have a problem with the include files for proj4 (installed proj4.4.7 in /usr/local/mapserve under include lib and bin). The configure reports no errors but the compile fails at

nad2bin.c:8:22 projects.h:No such file or directory

and a list of related warnings .

projects.h is right where I say it is, and I had no such problem with grass5.30 source. I did have an identical error problem with an "extra" freetype include file (installed with the slackware packages I originally chose) during the 5.30 compile, but I fixed that by specifying which include to use. I see no such problem with the proj4 includes and the 5.7 source.

Slackware 9.1 with kernel 2.4.20 , gcc 3.2.2 on an x86 PIII box.

I was curious if there is an obvious fix known for this. I searched the users archive but didn't see anything that seemed equivalent.

this was my configure command

CFLAGS="-g -Wall" configure --prefix=/usr/local --enable-sysv --enable-another-button --with-motif \
--with-glw --with-gdal=/usr/local/mapserve/bin/gdal-config \
--enable-shared --with-postgres=no --with-odbc-includes=/usr/local/unixODBC/include --with-odbc-libs=/usr/local/unixODBC/lib \
--with-fftw-includes=/usr/local/ifft/include --with-fftw-libs=/usr/local/ifft/lib --with-proj-libs=/usr/local/mapserve/lib\
--with-proj-includes=/usr/local/mapserve/include --with-cxx --with-mysql-includes=/usr/local/mysql/include/mysql \
--with-mysql-libs=/usr/local/mysql/lib/mysql --with-opengl-includes=/usr/local/mesa/include --with-opengl-libs=/usr/local/mesa/lib \
--with-mysql --with-freetype --with-freetype-libs=/usr/local/mapserve/lib --with-freetype-includes=/usr/include/freetype2

The first error/failure involving nad2bin.c (as quoted below) was corrected by changing the include line from
#include <projects.h>
to
#include "/usr/local/mapserve/include/projects.h"

which I don't think should be necessary based upon the configure command.

The compile then continued until it reached 'g.proj' under the 'general' directory. There were duplicate definitions due to the line
#include <cpl_csv.h>
deletion of this line allowed the compile to continue until the ' visualization/nviz directory' was reached. I have included the complete error message for the compile at this point, dumped using "make 2> outfile" below. I was hoping someone could tell me if the first two changes I made will cause problems eventually, and if there is a fix for the errors involving nviz. Thanks for any assistance.

I am using mesa 3.4.2 source, and the libraries are installed as libGL.so.1.2.0 and libGLU.so.1.2.0 and related symlinks. glx.h is listed in its header as version 1.5.2.2

error output:

/misc/grass5/grass-5.7.0/include/version.h:1: warning: `VERSION_STRING' defined but not used
/misc/grass5/grass-5.7.0/include/version.h:2: warning: `VERSION_MAJOR' defined but not used
/misc/grass5/grass-5.7.0/include/version.h:3: warning: `VERSION_MINOR' defined but not used
/misc/grass5/grass-5.7.0/include/version.h:4: warning: `VERSION_RELEASE' defined but not used
Makefile:75: warning: overriding commands for target `htmlcmd'
../../include/Make/Rules.make:37: warning: ignoring old commands for target `htmlcmd'
ERROR: MAPSET fakestart not found
Makefile:39: warning: overriding commands for target `htmlcmd'
../../include/Make/Rules.make:37: warning: ignoring old commands for target `htmlcmd'
ERROR: No graphics device selected
No such graphics monitor as <fakestart>.
Please run "d.mon" to select a valid graphics monitor.
No such graphics monitor as <fakestart>.
Please run "d.mon" to select a valid graphics monitor.
Makefile:14: warning: overriding commands for target `htmlcmd'
../../include/Make/Rules.make:37: warning: ignoring old commands for target `htmlcmd'
Makefile:42: warning: overriding commands for target `htmlcmd'
../../../include/Make/Rules.make:37: warning: ignoring old commands for target `htmlcmd'

Where type is one of:
rast (raster files)
oldvect (old (GRASS 5.0) binary vector files)
vect (binary vector files)
icon (paint icon files)
labels (paint label files)
sites (site list files)
region (region definition files)
group (imagery group files)
3dview (3D view parameters)
Makefile:13: warning: overriding commands for target `htmletc'
../../include/Make/Rules.make:70: warning: ignoring old commands for target `htmletc'
Makefile:13: warning: overriding commands for target `htmletc'
../../include/Make/Rules.make:70: warning: ignoring old commands for target `htmletc'
ERROR: MAPSET fakestart not found
Makefile:15: warning: overriding commands for target `htmletc'
../../../include/Make/Rules.make:70: warning: ignoring old commands for target `htmletc'
ERROR: MAPSET fakestart not found
Makefile:15: warning: overriding commands for target `htmletc'
../../../include/Make/Rules.make:70: warning: ignoring old commands for target `htmletc'
ERROR: MAPSET fakestart not found

Where color type is one of:
aspect (aspect oriented grey colors)
grey (linear grey scale)
grey.eq (histogram equalized grey scale)
grey.log (histogram logarithmic transformed grey scale)
byg (blue through yellow to green colors)
byr (blue through yellow to red colors)
gyr (green through yellow to red colors)
rainbow (rainbow color table)
ramp (color ramp)
ryg (red through yellow to green colors)
random (random color table)
wave (color wave)
rules (create new color table by rules)

ERROR: MAPSET fakestart not found
Makefile:96: warning: overriding commands for target `htmlcmd'
../../include/Make/Rules.make:37: warning: ignoring old commands for target `htmlcmd'
ERROR: MAPSET fakestart not found
Makefile:15: warning: overriding commands for target `htmletc'
../../../include/Make/Rules.make:70: warning: ignoring old commands for target `htmletc'
Makefile:15: warning: overriding commands for target `htmletc'
../../../include/Make/Rules.make:70: warning: ignoring old commands for target `htmletc'
Makefile:80: warning: overriding commands for target `htmlcmd'
../../include/Make/Rules.make:37: warning: ignoring old commands for target `htmlcmd'
Makefile:89: warning: overriding commands for target `clean'
../../include/Make/Rules.make:30: warning: ignoring old commands for target `clean'
Makefile:36: warning: overriding commands for target `clean'
../../../../../include/Make/Rules.make:30: warning: ignoring old commands for target `clean'
Makefile:36: warning: overriding commands for target `clean'
../../../../../include/Make/Rules.make:30: warning: ignoring old commands for target `clean'
ERROR: MAPSET fakestart not found
No such graphics monitor as <fakestart>.
Please run "d.mon" to select a valid graphics monitor.
ERROR: GISRC - variable not set
/misc/grass5/grass-5.7.0/dist.i686-pc-linux-gnu/scripts/v.build.all: line 21: GISDBASE: parameter null or not set
Makefile:15: warning: overriding commands for target `clean'
../../include/Make/Rules.make:30: warning: ignoring old commands for target `clean'
ERROR: MAPSET fakestart not found

Version: GRASS5.0 beta, update: Novemebr 1999

Authors: original version - H.Mitasova, L.Mitas
        GRASS implementation and segmentation: I.Kosinovsky, D.P. Gerdes

Methods used in this program are described in the following papers:
Mitasova, H., and Mitas, L., 1993,
Interpolation by Regularized Spline with Tension:
I. Theory and implementation. Mathematical Geology, 25, 641-655.

Mitasova, H., and Hofierka, L., 1993
Interpolation by Regularized Spline with Tension:
II. Application to terrain modeling and surface geometry analysis.
Mathematical Geology, 25, 657-669.

Mitasova, H., Mitas, L., Brown, W.M., Gerdes, D.P., Kosinovsky, I.,
Baker, T., 1995, Modeling spatially and temporally
distributed phenomena: New methods and tools for GRASS GIS.
International Journal of Geographic Information Systems,V(9), No(4).
(special issue on Integration of GIS and Environmental Modeling)

The postscript versions of these papers are available via Internet at
http://www2.gis.uiuc.edu:2280/modviz/papers/listsj.html

Please cite these references in publications where the results of this
program were used.

ERROR: MAPSET fakestart not found
OBJ.i686-pc-linux-gnu/do_zoom.o(.text+0x8f2): In function `Create_OS_Ctx':
/misc/grass5/grass-5.7.0/visualization/nviz/src/do_zoom.c:275: undefined reference to `glXChooseFBConfig'
OBJ.i686-pc-linux-gnu/do_zoom.o(.text+0x9af):/misc/grass5/grass-5.7.0/visualization/nviz/src/do_zoom.c:287: undefined reference to `glXCreatePbuffer'
OBJ.i686-pc-linux-gnu/do_zoom.o(.text+0x9d4):/misc/grass5/grass-5.7.0/visualization/nviz/src/do_zoom.c:288: undefined reference to `glXMakeContextCurrent'
OBJ.i686-pc-linux-gnu/do_zoom.o(.text+0xa83): In function `Destroy_OS_Ctx':
/misc/grass5/grass-5.7.0/visualization/nviz/src/do_zoom.c:351: undefined reference to `glXDestroyPbuffer'
collect2: ld returned 1 exit status
make[3]: *** [nvwish] Error 1
make[2]: *** [nvwish] Error 2
make[1]: *** [subdirs] Error 1
make: *** [default] Error 1

Andrew wrote:

I just downloaded the 5.7 source code after reading the announcement that it has been officially released. I have a problem with the include files for proj4 (installed proj4.4.7 in /usr/local/mapserve under include lib and bin). The configure reports no errors but the compile fails at

nad2bin.c:8:22 projects.h:No such file or directory

and a list of related warnings .

projects.h is right where I say it is, and I had no such problem with grass5.30 source. I did have an identical error problem with an "extra" freetype include file (installed with the slackware packages I originally chose) during the 5.30 compile, but I fixed that by specifying which include to use. I see no such problem with the proj4 includes and the 5.7 source.

Slackware 9.1 with kernel 2.4.20 , gcc 3.2.2 on an x86 PIII box.

I was curious if there is an obvious fix known for this. I searched the users archive but didn't see anything that seemed equivalent.

I found the apparent problem in the nviz compilation. I had to change the include line
#include <GL/glx.h>
to
#include "/usr/local/mesa/include/glx.h"

and all proceeds to the end. The new interface is beautiful. I ca't wait to see what's new.
Thank you again,

Summary /fixes (in case it's useful)

Linux slackware 9.1 kv 2.4.20 , gcc 3.2.2, x86 PIII

some of the include statements in nad2bin , g.proj and nviz didn't reflect the parameters in my configure command

lib/proj/nad2bin.c required a change from #include <projects.h>
general/gproj/main.c deleted the #include <cpl_csv.h>
visualization/nviz/src/dozoom.c required a change from #include <GL/glx.h> to #include "/usr/local/mesa/include/glx.h"

Andrew wrote:

deletion of this line allowed the compile to continue until the '
visualization/nviz directory' was reached. I have included the complete
error message for the compile at this point, dumped using "make 2>
outfile" below. I was hoping someone could tell me if the first two
changes I made will cause problems eventually, and if there is a fix for
the errors involving nviz. Thanks for any assistance.

I am using mesa 3.4.2 source, and the libraries are installed as
libGL.so.1.2.0 and libGLU.so.1.2.0 and related symlinks. glx.h is listed
in its header as version 1.5.2.2

>OBJ.i686-pc-linux-gnu/do_zoom.o(.text+0x8f2): In function `Create_OS_Ctx':
>/misc/grass5/grass-5.7.0/visualization/nviz/src/do_zoom.c:275: undefined reference to `glXChooseFBConfig'
>OBJ.i686-pc-linux-gnu/do_zoom.o(.text+0x9af):/misc/grass5/grass-5.7.0/visualization/nviz/src/do_zoom.c:287: undefined reference to `glXCreatePbuffer'
>OBJ.i686-pc-linux-gnu/do_zoom.o(.text+0x9d4):/misc/grass5/grass-5.7.0/visualization/nviz/src/do_zoom.c:288: undefined reference to `glXMakeContextCurrent'
>OBJ.i686-pc-linux-gnu/do_zoom.o(.text+0xa83): In function `Destroy_OS_Ctx':
>/misc/grass5/grass-5.7.0/visualization/nviz/src/do_zoom.c:351: undefined reference to `glXDestroyPbuffer'

It may be that the headers don't match the library. Do you have
another set of OpenGL headers installed, e.g. in
/usr/X11R6/include/GL?

OTOH, the test which do_zoom.c uses is wrong. It is basing the
decision on whether to use GLX 1.3 functions on whether or not
GLX_PBUFFER_WIDTH is defined, when it should be testing
GLX_VERSION_1_3.

--
Glynn Clements <glynn.clements@virgin.net>

Andrew wrote:

I found the apparent problem in the nviz compilation. I had to change
the include line
#include <GL/glx.h>
to
#include "/usr/local/mesa/include/glx.h"

Your headers are broken. glx.h is supposed to reside in a subdirectory
named "GL", so that "#include <GL/glx.h>" works.

--
Glynn Clements <glynn.clements@virgin.net>

On Fri, 23 Jul 2004, Andrew wrote:

[...]

The first error/failure involving nad2bin.c (as quoted below) was corrected by changing the include line from
#include <projects.h>
to
#include "/usr/local/mapserve/include/projects.h"

which I don't think should be necessary based upon the configure command.

The general idea is that nad2bin.c should not need to be compiled (it is an internal PROJ program and requires projects.h which is really an internal PROJ header); the version of nad2bin on the system that is installed with PROJ.4 should be used here. But the current state of lib/proj/Makefile doesn't reflect this.

The compile then continued until it reached 'g.proj' under the 'general' directory. There were duplicate definitions due to the line
#include <cpl_csv.h>
deletion of this line allowed the compile to continue until

What do you mean by duplicate definitions? What was the error? cpl_csv.h guards against multiple inclusions so I can't see this being a problem. It is included because of the call to SetCSVFilenameHook().

Paul

Paul Kelly wrote:

On Fri, 23 Jul 2004, Andrew wrote:

[...]

The first error/failure involving nad2bin.c (as quoted below) was corrected by changing the include line from
#include <projects.h>
to
#include "/usr/local/mapserve/include/projects.h"

which I don't think should be necessary based upon the configure command.

The general idea is that nad2bin.c should not need to be compiled (it is an internal PROJ program and requires projects.h which is really an internal PROJ header); the version of nad2bin on the system that is installed with PROJ.4 should be used here. But the current state of lib/proj/Makefile doesn't reflect this.

The compile then continued until it reached 'g.proj' under the 'general' directory. There were duplicate definitions due to the line
#include <cpl_csv.h>
deletion of this line allowed the compile to continue until

What do you mean by duplicate definitions? What was the error? cpl_csv.h guards against multiple inclusions so I can't see this being a problem. It is included because of the call to SetCSVFilenameHook().

Paul

I mean that after "fixing" the nad2bin problem (if that's what modifying the include accomplished) my compile failed until/unless I removed the line in g.proj/main.c that includes cpl_csv.h The failure was indicated by a fatal error message that listed a dozen or so already defined quantities attributed to cpl_csv.h
I didn't save the log, since the elimination of this file resulted in a continued compilation. I do not/did not include any CSV headers or references explicitly, i.e. I don't think I compiled against a prior version, though I did have grass 5.30 installed (I renamed its directory structure before compiling so it was not in the system executable or library path). This is all I know about the error and its "fix". I thought it might be significant to report it in case someone else ends up in the same situation...it seemed that if the make doesn't use the paths as set in the configure command then there might be a problem under my architecture and system version. I could recompile from scratch and reproduce all the errors if someone wants them.