[GRASS-dev] Problems installing the r.pi suite using g.extension [was: Re: [GRASS-user] LSMetrics - addon development]

Moving this over to grass-dev...

On 16/02/18 10:14, Markus Metz wrote:

On Fri, Feb 16, 2018 at 10:05 AM, Markus Neteler <neteler@osgeo.org <mailto:neteler@osgeo.org>> wrote:
>
> On Fri, Feb 16, 2018 at 9:42 AM, Markus Metz
> <markus.metz.giswork@gmail.com <mailto:markus.metz.giswork@gmail.com>> wrote:
> ...
> > I can't reproduce with your compiler flags. A wild guess: in draw.c:L3 try
> > to replace inline with static
>
> Yes, this helps. I didn't submit the change, will you do that?

done in r72247

Even though everything seems to install alright, I get an error message:

g.extension r.pi
Fetching <r.pi> from GRASS GIS Addons repository (be patient)...
Compiling...
Installing...
make[1]: *** No rule to make target 'install'. Stop.
Updating addons metadata file...
Installation of <r.pi> successfully finished

I imagine this due to the fact that I run GRASS directly from the source directory and not from ?

But when I try to install it using the system-wide installation (Debian package, grass-dev is installed), I get:

g.extension r.pi
Fetching <r.pi> from GRASS GIS Addons repository (be patient)...
Compiling...
/usr/bin/ld: cannot open output file /usr/lib/grass74/lib/libgrass_rpi.7.4.0.so: Permission denied
collect2: error: ld returned 1 exit status
make[1]: *** [/usr/lib/grass74/lib/libgrass_rpi.7.4.0.so] Error 1
/bin/sh: 1: cannot create /usr/lib/grass74/error.log: Permission denied
make: *** [r.pi.library] Error 2
ERROR: Compilation failed, sorry. Please check above error messages.

i.e. it tries to install the lib into the system-wide installation directory, not the user .grass7/addons directory.

Removing also doesn't seem to work:

g.extension r.pi op=remove -f
ERROR: Unable to remove file
        '/home/mlennert/.grass7/addons/docs/man/man1/man1/r.pi.corr.mw.1'
ERROR: Unable to remove file
        '/home/mlennert/.grass7/addons/docs/man/man1/man1/r.pi.lm.1'
ERROR: Unable to remove file
        '/home/mlennert/.grass7/addons/docs/man/man1/man1/r.pi.grow.1'
ERROR: Unable to remove file
        '/home/mlennert/.grass7/addons/docs/man/man1/man1/r.pi.rectangle.1'
Updating addons metadata file...
Extension <r.pi> successfully uninstalled.

but

ls .grass7/addons/bin/r.pi*
.grass7/addons/bin/r.pi.corearea .grass7/addons/bin/r.pi.graph .grass7/addons/bin/r.pi.nlm.circ
.grass7/addons/bin/r.pi.csr.mw .grass7/addons/bin/r.pi.graph.dec .grass7/addons/bin/r.pi.nlm.stats
.grass7/addons/bin/r.pi.energy .grass7/addons/bin/r.pi.graph.pr .grass7/addons/bin/r.pi.odc
.grass7/addons/bin/r.pi.energy.pr .grass7/addons/bin/r.pi.graph.red .grass7/addons/bin/r.pi.prob.mw
.grass7/addons/bin/r.pi.enn .grass7/addons/bin/r.pi.import .grass7/addons/bin/r.pi.prox
.grass7/addons/bin/r.pi.enn.pr .grass7/addons/bin/r.pi.index .grass7/addons/bin/r.pi.searchtime
.grass7/addons/bin/r.pi.export .grass7/addons/bin/r.pi.neigh .grass7/addons/bin/r.pi.searchtime.mw
.grass7/addons/bin/r.pi.fnn .grass7/addons/bin/r.pi.nlm .grass7/addons/bin/r.pi.searchtime.pr

I guess we need some more work on how to handle these suites...

Moritz

On Fri, Feb 16, 2018 at 12:47 PM, Moritz Lennert <mlennert@club.worldonline.be> wrote:

Moving this over to grass-dev…

On 16/02/18 10:14, Markus Metz wrote:

On Fri, Feb 16, 2018 at 10:05 AM, Markus Neteler <neteler@osgeo.org mailto:[neteler@osgeo.org](mailto:neteler@osgeo.org)> wrote:

On Fri, Feb 16, 2018 at 9:42 AM, Markus Metz
<markus.metz.giswork@gmail.com mailto:[markus.metz.giswork@gmail.com](mailto:markus.metz.giswork@gmail.com)> wrote:

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

Yes, this helps. I didn’t submit the change, will you do that?

done in r72247

Even though everything seems to install alright, I get an error message:

g.extension r.pi
Fetching <r.pi> from GRASS GIS Addons repository (be patient)…
Compiling…
Installing…
make[1]: *** No rule to make target ‘install’. Stop.
Updating addons metadata file…
Installation of <r.pi> successfully finished

I imagine this due to the fact that I run GRASS directly from the source directory and not from ?

It seems that there is no mechanism to install a library as addon. It is also possible that something is missing in the Makefile for r.pi.library because that library is unknown to the GRASS make system.

But when I try to install it using the system-wide installation (Debian package, grass-dev is installed), I get:

g.extension r.pi
Fetching <r.pi> from GRASS GIS Addons repository (be patient)…
Compiling…
/usr/bin/ld: cannot open output file /usr/lib/grass74/lib/libgrass_rpi.7.4.0.so: Permission denied
collect2: error: ld returned 1 exit status
make[1]: *** [/usr/lib/grass74/lib/libgrass_rpi.7.4.0.so] Error 1
/bin/sh: 1: cannot create /usr/lib/grass74/error.log: Permission denied
make: *** [r.pi.library] Error 2
ERROR: Compilation failed, sorry. Please check above error messages.

i.e. it tries to install the lib into the system-wide installation directory, not the user .grass7/addons directory.

the addons directory is supposed to hold executables and scripts, not libraries. At least I could not find a mechanism in the grass startup script where LD_LIBRARY_PATH is adjusted to also include some directory within the addons directory. I am not sure if it is worth the trouble to modify the addons mechanism to support addon libraries, particularly if only the r.pi suite is affected.

Markus M

Removing also doesn’t seem to work:

g.extension r.pi op=remove -f
ERROR: Unable to remove file
‘/home/mlennert/.grass7/addons/docs/man/man1/man1/r.pi.corr.mw.1’
ERROR: Unable to remove file
‘/home/mlennert/.grass7/addons/docs/man/man1/man1/r.pi.lm.1’
ERROR: Unable to remove file
‘/home/mlennert/.grass7/addons/docs/man/man1/man1/r.pi.grow.1’
ERROR: Unable to remove file
‘/home/mlennert/.grass7/addons/docs/man/man1/man1/r.pi.rectangle.1’
Updating addons metadata file…
Extension <r.pi> successfully uninstalled.

but

ls .grass7/addons/bin/r.pi*
.grass7/addons/bin/r.pi.corearea .grass7/addons/bin/r.pi.graph .grass7/addons/bin/r.pi.nlm.circ
.grass7/addons/bin/r.pi.csr.mw .grass7/addons/bin/r.pi.graph.dec .grass7/addons/bin/r.pi.nlm.stats
.grass7/addons/bin/r.pi.energy .grass7/addons/bin/r.pi.graph.pr .grass7/addons/bin/r.pi.odc
.grass7/addons/bin/r.pi.energy.pr .grass7/addons/bin/r.pi.graph.red .grass7/addons/bin/r.pi.prob.mw
.grass7/addons/bin/r.pi.enn .grass7/addons/bin/r.pi.import .grass7/addons/bin/r.pi.prox
.grass7/addons/bin/r.pi.enn.pr .grass7/addons/bin/r.pi.index .grass7/addons/bin/r.pi.searchtime
.grass7/addons/bin/r.pi.export .grass7/addons/bin/r.pi.neigh .grass7/addons/bin/r.pi.searchtime.mw
.grass7/addons/bin/r.pi.fnn .grass7/addons/bin/r.pi.nlm .grass7/addons/bin/r.pi.searchtime.pr

I guess we need some more work on how to handle these suites…

Moritz

2018-02-16 17:56 GMT+02:00 Markus Metz <markus.metz.giswork@gmail.com>:

the addons directory is supposed to hold executables and scripts, not
libraries. At least I could not find a mechanism in the grass startup script
where LD_LIBRARY_PATH is adjusted to also include some directory within the
addons directory. I am not sure if it is worth the trouble to modify the
addons mechanism to support addon libraries, particularly if only the r.pi
suite is affected.

Then what is the solution? Moving all library code to each module?

Markus M

Māris.

On 17/02/18 08:42, Maris Nartiss wrote:

2018-02-16 17:56 GMT+02:00 Markus Metz <markus.metz.giswork@gmail.com>:

the addons directory is supposed to hold executables and scripts, not
libraries. At least I could not find a mechanism in the grass startup script
where LD_LIBRARY_PATH is adjusted to also include some directory within the
addons directory. I am not sure if it is worth the trouble to modify the
addons mechanism to support addon libraries, particularly if only the r.pi
suite is affected.

Then what is the solution? Moving all library code to each module?

Would it be possible to force all functions in the library to be inline ? Would that be a solution ?

Moritz