[GRASS5] trouble copiling 5.1

Hi all,

I have trouble compiling 5.1. It fails with

make[2]: Entering directory `/home/mlennert/SRC/grass51/vector/v.digit'
gcc -g -Wall -I/home/mlennert/SRC/grass51/include -I/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/include -I/home/mlennert/SRC/grass51/include -I/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/include -I/usr/X11R6/include/ -I/usr/include/gr -I/usr/local/include -I/usr/include -I/usr/include/postgresql -I/usr/include/postgresql/internal -I/home/mlennert/SRC/grass51/include -I/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/include \
        -o OBJ.i686-pc-linux-gnu/c_face.o -c c_face.c
c_face.c:4: tcl.h: No such file or directory
c_face.c:5: tk.h: No such file or directory
In file included from c_face.c:8:
global.h:1: tcl.h: No such file or directory
global.h:2: tk.h: No such file or directory
make[2]: *** [OBJ.i686-pc-linux-gnu/c_face.o] Error 1
make[2]: Leaving directory `/home/mlennert/SRC/grass51/vector/v.digit'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/mlennert/SRC/grass51/vector'
make: *** [default] Error 1

I use the config command:

CFLAGS="-g -Wall" ./configure --with-grass50=/home/mlennert/SRC/grass50 --with-tcltk-includes=/usr/include/tcl8.3 --with-postgres-includes="/usr/include/postgresql /usr/include/postgresql/internal"

and the configure seems to work well:

checking whether to use Tcl/Tk... yes
checking for location of Tcl/Tk includes... /usr/include/tcl8.3
checking for tcl.h... yes
checking for tk.h... yes
checking Tcl version... 8.3
checking Tk version... 8.3
checking for location of Tcl/Tk library...
checking for Tcl_Init in -ltcl... no
checking for Tcl_Init in -ltcl... no
checking for Tcl_Init in -ltcl8.3... yes
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk... no
checking for Tk_MainWindow in -ltk8.3... yes

Can someone help me ?

Moritz

Moritz Lennert wrote:

I have trouble compiling 5.1. It fails with

make[2]: Entering directory `/home/mlennert/SRC/grass51/vector/v.digit'
gcc -g -Wall -I/home/mlennert/SRC/grass51/include -I/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/include -I/home/mlennert/SRC/grass51/include -I/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/include -I/usr/X11R6/include/ -I/usr/include/gr -I/usr/local/include -I/usr/include -I/usr/include/postgresql -I/usr/include/postgresql/internal -I/home/mlennert/SRC/grass51/include -I/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/include \
        -o OBJ.i686-pc-linux-gnu/c_face.o -c c_face.c
c_face.c:4: tcl.h: No such file or directory
c_face.c:5: tk.h: No such file or directory
In file included from c_face.c:8:
global.h:1: tcl.h: No such file or directory
global.h:2: tk.h: No such file or directory
make[2]: *** [OBJ.i686-pc-linux-gnu/c_face.o] Error 1
make[2]: Leaving directory `/home/mlennert/SRC/grass51/vector/v.digit'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/mlennert/SRC/grass51/vector'
make: *** [default] Error 1

It appears that vector/v.digit/Makefile needs:

  EXTRA_CFLAGS = $(TCLINCDIR) $(TKINCDIR)

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

Glynn Clements wrote:

Moritz Lennert wrote:

I have trouble compiling 5.1. It fails with

make[2]: Entering directory `/home/mlennert/SRC/grass51/vector/v.digit'
gcc -g -Wall -I/home/mlennert/SRC/grass51/include -I/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/include -I/home/mlennert/SRC/grass51/include -I/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/include -I/usr/X11R6/include/ -I/usr/include/gr -I/usr/local/include -I/usr/include -I/usr/include/postgresql -I/usr/include/postgresql/internal -I/home/mlennert/SRC/grass51/include -I/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/include \
       -o OBJ.i686-pc-linux-gnu/c_face.o -c c_face.c
c_face.c:4: tcl.h: No such file or directory
c_face.c:5: tk.h: No such file or directory
In file included from c_face.c:8:
global.h:1: tcl.h: No such file or directory
global.h:2: tk.h: No such file or directory
make[2]: *** [OBJ.i686-pc-linux-gnu/c_face.o] Error 1
make[2]: Leaving directory `/home/mlennert/SRC/grass51/vector/v.digit'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/mlennert/SRC/grass51/vector'
make: *** [default] Error 1

It appears that vector/v.digit/Makefile needs:

  EXTRA_CFLAGS = $(TCLINCDIR) $(TKINCDIR)

Now I get:

make[2]: *** No rule to make target `settings.tcl', needed by `/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/etc/v.digit/settings.tcl'. Stop.

I actually don't have a settings.tcl, nor the incons directory also mentioned in the Makefile. Is this a a problem in the vector/v.digit/Makefile, or am I missing files (cvs update does not get anything else) ?

Moritz

On Thursday 28 November 2002 03:35 pm, Moritz Lennert wrote:

make[2]: *** No rule to make target `settings.tcl', needed by
`/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/etc/v.digit/settings.tcl
'. Stop.

I actually don't have a settings.tcl, nor the incons directory also
mentioned in the Makefile. Is this a a problem in the
vector/v.digit/Makefile, or am I missing files (cvs update does not get
anything else) ?

Sorry, I added EXTRA_CFLAGS to my Makefile and commited the Makefile
only and forgot that it is completely changed, no it is reverted to older
version + EXTRA_CFLAGS.

Radim

Radim Blazek wrote:

On Thursday 28 November 2002 03:35 pm, Moritz Lennert wrote:

make[2]: *** No rule to make target `settings.tcl', needed by
`/home/mlennert/SRC/grass51/dist.i686-pc-linux-gnu/etc/v.digit/settings.tcl
'. Stop.

I actually don't have a settings.tcl, nor the incons directory also
mentioned in the Makefile. Is this a a problem in the
vector/v.digit/Makefile, or am I missing files (cvs update does not get
anything else) ?

Sorry, I added EXTRA_CFLAGS to my Makefile and commited the Makefile
only and forgot that it is completely changed, no it is reverted to older
version + EXTRA_CFLAGS.

Radim

Now I get two more errors:

1) a simple typo (missing ;):

make[2]: Entering directory `/home/mlennert/SRC/grass51/vector/v.mapcalc'
gcc -O2 -Wall -Werror -rdynamic -o mapcalc.o -c mapcalc.c
bison -d v.mapcalc.y
gcc -O2 -Wall -Werror -rdynamic -o yylex.o -c yylex.c
gcc -O2 -Wall -Werror -rdynamic -o v.mapcalc.o -c v.mapcalc.tab.c
v.mapcalc.y: In function `yyparse':
v.mapcalc.y:72: parse error before `}

2) I don"t know how to fix this:

OBJ.i686-pc-linux-gnu/query_postgr.o(.text+0x17d): In function `query_postgr':
/home/mlennert/SRC/grass51/visualization/nviz/src/query_postgr.c:59: undefined reference to `runInfxQry'
OBJ.i686-pc-linux-gnu/query_postgr.o(.text+0x2c8): In function `query_pg_site':
/home/mlennert/SRC/grass51/visualization/nviz/src/query_postgr.c:102: undefined reference to `runqry'
collect2: ld returned 1 exit status

Moritz

On Thursday 28 November 2002 04:04 pm, Moritz Lennert wrote:

Now I get two more errors:

1) a simple typo (missing ;):

make[2]: Entering directory `/home/mlennert/SRC/grass51/vector/v.mapcalc'
gcc -O2 -Wall -Werror -rdynamic -o mapcalc.o -c mapcalc.c
bison -d v.mapcalc.y
gcc -O2 -Wall -Werror -rdynamic -o yylex.o -c yylex.c
gcc -O2 -Wall -Werror -rdynamic -o v.mapcalc.o -c v.mapcalc.tab.c
v.mapcalc.y: In function `yyparse':
v.mapcalc.y:72: parse error before `}

v.mapcalc does almost nothing now, so I removed it from vector/Makefile.

2) I don"t know how to fix this:

OBJ.i686-pc-linux-gnu/query_postgr.o(.text+0x17d): In function
`query_postgr':
/home/mlennert/SRC/grass51/visualization/nviz/src/query_postgr.c:59:
undefined reference to `runInfxQry'
OBJ.i686-pc-linux-gnu/query_postgr.o(.text+0x2c8): In function
`query_pg_site':
/home/mlennert/SRC/grass51/visualization/nviz/src/query_postgr.c:102:
undefined reference to `runqry'
collect2: ld returned 1 exit status

I don't know.

Radim

Radim Blazek wrote:

> 2) I don"t know how to fix this:
>
> OBJ.i686-pc-linux-gnu/query_postgr.o(.text+0x17d): In function
> `query_postgr':
> /home/mlennert/SRC/grass51/visualization/nviz/src/query_postgr.c:59:
> undefined reference to `runInfxQry'
> OBJ.i686-pc-linux-gnu/query_postgr.o(.text+0x2c8): In function
> `query_pg_site':
> /home/mlennert/SRC/grass51/visualization/nviz/src/query_postgr.c:102:
> undefined reference to `runqry'
> collect2: ld returned 1 exit status

I don't know.

runqry() is defined in runInfxQry.c; however, that file is only used
if the "doconfigure" script (visualization/nviz/doconfigure) sets it
up that way. Basically, there are two versions of query_postgr.c; a
version which actually uses Postgres (query_postgr_orig.c), and a stub
version (query_postgr_dummy.c). The doconfigure script copies one of
these to query_postgr.c. A similar situation exists for
panel_query.tcl.

Also, the whole of runInfxQry.c is conditionalised upon:

#if defined(HAVE_POSTGRES_H) || defined(HAVE_POSTGRES_FE_H)

Basically, the way in which NVIZ' Postgres support is handled is
something of a hack, and needs to be cleaned up.

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

On Thursday 28 November 2002 04:45 pm, Glynn Clements wrote:

Basically, the way in which NVIZ' Postgres support is handled is
something of a hack, and needs to be cleaned up.

We have 'pg' driver in grass51 now, so I think that Postgres in
nviz may be replaced by dbmi (code for vectors will be the
same as for d.what.vect -a)

Radim

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

Basically, the way in which NVIZ' Postgres support
is handled is
something of a hack, and needs to be cleaned up.

On CVS head:

VARHDRSZ if defined directly (not from postgres-fe.h);

I've finished removing "dirty-style" programming code
from
grass.postgresql which I rudely introduced there. Now
all 13
modules a) are uniform with QRY_LENGTH defined in
header
file instead of (1024) everywhere in code b)
PQclear added everywhere in error checks c) renamed
confusing -Infx- names to -Pg- d) removed unused
variables/header files. e)removed bogus static
definitions for SQL command buffers + identing and
minor changes. I also removed (or not? at least I
tried to!) confusing v.in.shape.pg_alex&david dirs (we
don't want them?), the same about oldman.
I commented out v.in.arc.pg in modules Gmakefile. (?)

I updated the manual "First steps" and Readme, too.

I will update the CVS on Pogtgres NVIZ support some
time later to get rid of the older hack.

--alex

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com