Re: LSMetrics - addon development

Markus Metz <[email protected]>
Newsgroups gmane.comp.gis.grass.user
Message-ID <CAG+h=FEQKXAbcX6BFPSUrsB630mO_7ez-a=hgw2WDjO4hpcFtA@mail.gmail.com>
On Thu, Feb 15, 2018 at 10:38 PM, Markus Neteler <[email protected]> wrote:
>
> On Thu, Feb 15, 2018 at 7:49 PM, Markus Metz
> <[email protected]> wrote:
> >
> >
> > On Thu, Feb 15, 2018 at 5:57 PM, Markus Neteler <[email protected]>
wrote:
> >>
> >> On Thu, Feb 15, 2018 at 5:43 PM, Moritz Lennert
> >> <[email protected]> wrote:
> >> > On 12/02/18 18:01, Bernardo Santos wrote:
> >> ...
> >> >> Regarding the comparison with the other GRASS tools, LSMetrics is
> >> >> complementary to many of the functions the r.li suite offers. I
still
> >> >> could
> >> >> not test r.pi since I had some trouble installing it, but I'll try
it
> >> >> again
> >> >> so that I can compare both packages. I believe they are also somehow
> >> >> complementary in many of the functions.
> >> >
> >> >
> >> > Yes, r.pi installation is still an issue.
> >>
> >> I have probably fixed it in r72243. Please try.
> >>
> >> But: I get this compilation error (probably easy to fix but I have no
> >> time right now):
> >>
> >> [mneteler@oboe r.pi.library ]$ make MODULE_TOPDIR=~/software/grass74
> >> gcc -shared -o
> >> /home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/lib/
libgrass_rpi.7.4.1svn.so
> >> -L/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/lib
> >> -L/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/lib
> >> -Wl,--no-undefined -Wl,-z,now -Wl,--export-dynamic
> >>
> >>
-Wl,-rpath-link,/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/lib
> >> -Wl,-soname,libgrass_rpi.7.4.1svn.so OBJ.x86_64-pc-linux-gnu/draw.o
> >> OBJ.x86_64-pc-linux-gnu/frag.o OBJ.x86_64-pc-linux-gnu/helpers.o
> >> OBJ.x86_64-pc-linux-gnu/stat_method.o  -lgrass_gis.7.4.1svn -lm  -lm
> >> OBJ.x86_64-pc-linux-gnu/draw.o: In function `draw_line':
> >>
> >>
/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library/draw.c:38:
> >> undefined reference to `swap'
> >>
> >>
/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library/draw.c:39:
> >> undefined reference to `swap'
> >>
> >>
/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library/draw.c:43:
> >> undefined reference to `swap'
> >>
> >>
/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library/draw.c:44:
> >> undefined reference to `swap'
> >> collect2: error: ld returned 1 exit status
> >> make: *** [/home/mneteler/software/grass74/include/Make/Shlib.make:10:
> >>
> >> /home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/lib/
libgrass_rpi.7.4.1svn.so]
> >> Error 1
> >
> > swap is in draw.c L3-9
>
>
> Yes, I saw that - quite confusing that it does not compile (Fedora 27):
>
> > I can not reproduce this error. Do you have any changes in your local
copy?
>
> all clean and shiny
>
> > Maybe also try make clean, then make again, because
>
> yes done. So I get:
>
> [mneteler@oboe r.pi ]$ make MODULE_TOPDIR=~/software/grass74
> make -C r.pi.library || echo
> /home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library
> >> /home/mneteler/software/grass74/error.log
> make[1]: Entering directory
> '/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library'
> test -d OBJ.x86_64-pc-linux-gnu || mkdir -p OBJ.x86_64-pc-linux-gnu
> gcc  -g -Wall -Wshadow -Wlogical-op
> -Werror-implicit-function-declaration -fPIC -fno-common -fexceptions
> -Wextra -Wunused -Waggressive-loop-optimizations -Wreturn-type
> -Wfatal-errors -march=native -std=gnu99 -fexceptions -fstack-protector
> -m64   -fPIC
 -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -DPACKAGE=\""grasslibs"\"
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
>
-DRELDIR=\"/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library\"
> -o OBJ.x86_64-pc-linux-gnu/draw.o -c draw.c
> draw.c: In function ‘draw_point’:
> draw.c:11:62: warning: unused parameter ‘sy’ [-Wunused-parameter]
>  void draw_point(int *map, int val, int x, int y, int sx, int sy, int
width)
>                                                               ^~
> gcc  -g -Wall -Wshadow -Wlogical-op
> -Werror-implicit-function-declaration -fPIC -fno-common -fexceptions
> -Wextra -Wunused -Waggressive-loop-optimizations -Wreturn-type
> -Wfatal-errors -march=native -std=gnu99 -fexceptions -fstack-protector
> -m64   -fPIC
 -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -DPACKAGE=\""grasslibs"\"
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
>
-DRELDIR=\"/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library\"
> -o OBJ.x86_64-pc-linux-gnu/frag.o -c frag.c
> gcc  -g -Wall -Wshadow -Wlogical-op
> -Werror-implicit-function-declaration -fPIC -fno-common -fexceptions
> -Wextra -Wunused -Waggressive-loop-optimizations -Wreturn-type
> -Wfatal-errors -march=native -std=gnu99 -fexceptions -fstack-protector
> -m64   -fPIC
 -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -DPACKAGE=\""grasslibs"\"
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
>
-DRELDIR=\"/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library\"
> -o OBJ.x86_64-pc-linux-gnu/helpers.o -c helpers.c
> gcc  -g -Wall -Wshadow -Wlogical-op
> -Werror-implicit-function-declaration -fPIC -fno-common -fexceptions
> -Wextra -Wunused -Waggressive-loop-optimizations -Wreturn-type
> -Wfatal-errors -march=native -std=gnu99 -fexceptions -fstack-protector
> -m64   -fPIC
 -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -DPACKAGE=\""grasslibs"\"
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
> -I/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/include
>
-DRELDIR=\"/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library\"
> -o OBJ.x86_64-pc-linux-gnu/stat_method.o -c stat_method.c
> gcc -shared -o
/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/lib/
libgrass_rpi.7.4.1svn.so
> -L/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/lib
> -L/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/lib
> -Wl,--no-undefined -Wl,-z,now -Wl,--export-dynamic
>
-Wl,-rpath-link,/home/mneteler/software/grass74/dist.x86_64-pc-linux-gnu/lib
> -Wl,-soname,libgrass_rpi.7.4.1svn.so OBJ.x86_64-pc-linux-gnu/draw.o
> OBJ.x86_64-pc-linux-gnu/frag.o OBJ.x86_64-pc-linux-gnu/helpers.o
> OBJ.x86_64-pc-linux-gnu/stat_method.o  -lgrass_gis.7.4.1svn -lm  -lm
> OBJ.x86_64-pc-linux-gnu/draw.o: In function `draw_line':
>
/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library/draw.c:38:
> undefined reference to `swap'
>
/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library/draw.c:39:
> undefined reference to `swap'
>
/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library/draw.c:43:
> undefined reference to `swap'
>
/home/mneteler/software/grass-addons/grass7/raster/r.pi/r.pi.library/draw.c:44:
> undefined reference to `swap'
> collect2: error: ld returned 1 exit status
>
> Maybe my compiler flags matter?

I can't reproduce with your compiler flags. A wild guess: in draw.c:L3 try
to replace inline with static

Markus M
>
> markusN

_______________________________________________
grass-user mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.