Hi
i successfully installed grass5.7, with the sources of 5.3 (after working with grass 5.0.3) on a suse8.2.
Now i tried to run own code with grass5.7 as i did with in 5.0.3 using the gmake5 for compiling,
but i cannot find a similar gmake5-file (as in 5.0.3) for the grass5.7.
My questions are now:
- Does i have to install grass5.3 for working with own code addressing tools in grass5.7 (or is just downloading the sources and telling 5.7 where it is enough)?
- how can i get a appropriate gmake5 for grass5.7?
Thanks Dani
Hamish schrieb:
i successfully installed grass5.7, with the sources of 5.3 (after working with grass 5.0.3) on a suse8.2.
Now i tried to run own code with grass5.7 as i did with in 5.0.3
using the gmake5 for compiling,
but i cannot find a similar gmake5-file (as in 5.0.3) for the
grass5.7.
My questions are now:
- Does i have to install grass5.3 for working with own code addressing
tools in grass5.7
you only need 5.3 for the make 'mix step' .. after that you don't need
it anymore.
- how can i get a appropriate gmake5 for grass5.7?
use 'make' instead; copy a Makefile from another similar module & modify
to suit.
Hamish
Hi
i renamed the Gmakefile to Makefile (cause i got no other Makefile):
CC=g++
# include of dirs, e.g.gis.h is in ...
CFLAGS=-g -Wall
EXTRA_CFLAGS=-I /data/gis/nfp48/nfp48/ipodlas0.1/grass/grass57/grass57/include
# including of libs: e.g. D_ are in DISPLAYLIB
# order of libs: important -> DISPLAYLIB before RASTERLIB before GISLIB,etc
LIBES=$(DISPLAYLIB) $(RASTERLIB) $(IMAGERYLIB) $(VASKLIB) \
$(GISLIB) $(DATETIMELIB) $(CURSES) $(XDRLIB) $(MATHLIB) $(SEGMENTLIB)
DEPLIBES=$(DEPIMAGERYLIB) $(DEPGISLIB) $(DEPVASKLIB) $(DEPVASK)
OBJ=main.cc plotRasterMap.cc
all: plotRasterMap
#with -g: gdb enabling option
plotRasterMap: $(OBJ) $(LIBES) $(DEPLIBS)
$(CC) $(LDFLAGS) -g -o $@ $(OBJ) $(LIBES) $(DEPLIBES) $(LIST): global.h
$(LIBES): #in case of library change;i.e.they must be here,
$(DEPLIBS):
# to clean up
.PHONY: clean
clean:
rm *.o *~ ~* *@ \#*
and get errors now starting with:
... undefined reference to `G_gisinit'
...
(going on with similar errors concerning G_ and R_ functions)
I guess this means either a library is missing or the order is wrong in LIBES, but i cannot figure out what.
Thanks dani
Daniel Isenegger wrote:
> use 'make' instead; copy a Makefile from another similar module & modify
> to suit.
i renamed the Gmakefile to Makefile (cause i got no other Makefile):
That won't work. The syntax of a 5.7 Makefile is completely different
to that of a Gmakefile.
Copy a Makefile from a similar module and modify it.
--
Glynn Clements <glynn.clements@virgin.net>
Glynn Clements schrieb:
Daniel Isenegger wrote:
use 'make' instead; copy a Makefile from another similar module & modify
to suit.
i renamed the Gmakefile to Makefile (cause i got no other Makefile):
That won't work. The syntax of a 5.7 Makefile is completely different
to that of a Gmakefile.
Copy a Makefile from a similar module and modify it.
Hi thanks for your advice,
but i didn't succeed to move a step forward:
'Copy a Makefile from a similar module and modify it.'
a makefile from grass57 module? Like e.g. the display/d.erase/Makefile? (there I'm stuck with the include-line and its further invocations (Module.make))
However, i tried with different version of Makefiles
(e.g.
CC=g++
CFLAGS=-c -Wall
EXTRA_CFLAGS=-I /data/gis/nfp48/nfp48/ipodlas0.1/grass/grass57/grass57/include/
# collection of dependencies
OBJ=main.o plotRasterMap.o
plotRasterMap: $(OBJ)
$(CC) $(LDFLAGS) -g -o $@ $(OBJ)
main.o: main.cc plotRasterMap.h
plotRasterMap.o: plotRasterMap.cc plotRasterMap.h
or with
...
#Path to header-files
INCLUDE=-I/data/gis/nfp48/nfp48/ipodlas0.1/grass/grass57/grass57/include/
#Path to librarys
LIBS=-L/data/gis/nfp48/nfp48/ipodlas0.1/grass/grass57/grass57/lib
..
)
the answer is allways
g++ -g -o plotRasterMap -I/data/gis/nfp48/nfp48/ipodlas0.1/grass/grass57/grass57/include/ main.cc plotRasterMap.cc
... undefined reference to `G_gisinit'
How can i invoke GRASS-functions?
Thanks Dani
Daniel Isenegger wrote:
> > > use 'make' instead; copy a Makefile from another similar module & modify
> > > to suit.
> >
> > i renamed the Gmakefile to Makefile (cause i got no other Makefile):
>
> That won't work. The syntax of a 5.7 Makefile is completely different
> to that of a Gmakefile.
>
> Copy a Makefile from a similar module and modify it.
Hi thanks for your advice,
but i didn't succeed to move a step forward:
'Copy a Makefile from a similar module and modify it.'
a makefile from grass57 module? Like e.g. the display/d.erase/Makefile?
Yes. To simplify matters, use a Makefile from a module which has a
similar set of dependencies. E.g. if you need to use the
raster/display libraries, use a Makefile from one of the display/d.*
modules.
(there I'm stuck with the include-line and its further invocations
(Module.make))
What do you mean by "stuck"? All modules (programs) need the line:
include $(MODULE_TOPDIR)/include/Make/Module.make
This includes all of the common definitions, along with the settings
which are generated by the configure script.
In earlier versions, the gmake script concatenated a set of files (one
of which was the Gmakefile) to produce the final Makefile. In 5.7, we
just use the "include" directive instead.
However, i tried with different version of Makefiles
None of which look remotely like any of the 5.7 Makefiles, which
suggests that you aren't copying an existing Makefile.
--
Glynn Clements <glynn.clements@virgin.net>