[GRASS-user] can not install addons with g.extension

Dear GRASS-List,

using GRASS 7.0 from the ppa:grass-devel on ubuntu 14.01 I am not able to
compile addons with g.extension

I use today’s daily GRASS built (7.0.0+1svn64508~ubuntu14.04.1)
and the packages grass70, grass70-core, grass70-dev, grass70-doc, grass70-gui
  
As standard user I am not allowed to create the directory
/usr/lib/grass70/docs/man
(see step 1 below)

This directory can be created if GRASS is run as ROOT.
The built fails then because it can not find g.html2man.py
(see step 2 below)

After creating a symbolic link (ln -s g.html2man g.html2man.py)
g.extension fails because it can not find the python module html:
ImportError: No module named html
(see step 3 below)

slightly desperate
  Robert

1. as Standard User

GRASS 7.0.0 (test_location):~ > g.extension extension=r.grow.shrink --verbose
Fetching <r.grow.shrink> from GRASS-Addons SVN repository (be patient)...
A r.grow.shrink/DEPRECATED
A r.grow.shrink/main.c
A r.grow.shrink/Makefile
A r.grow.shrink/r.grow.shrink.html
U r.grow.shrink
Checked out revision 64528.
Compiling...
mkdir -p /tmp/tmpPA2tld/r.grow.shrink/bin
mkdir -p /tmp/tmpPA2tld/r.grow.shrink/etc
mkdir -p /tmp/tmpPA2tld/r.grow.shrink/docs/html
mkdir -p /usr/lib/grass70/docs/man
mkdir: cannot create directory '/usr/lib/grass70/docs/man': Permission denied
make: *** [/usr/lib/grass70/docs/man] Error 1
ERROR: Compilation failed, sorry. Please check above error messages.

2. as ROOT (sudo -i)

GRASS 7.0.0 (test_location):~ > g.extension extension=r.grow.shrink --verbose
Fetching <r.grow.shrink> from GRASS-Addons SVN repository (be patient)...
A r.grow.shrink/DEPRECATED
A r.grow.shrink/main.c
A r.grow.shrink/Makefile
A r.grow.shrink/r.grow.shrink.html
U r.grow.shrink
Checked out revision 64528.
Compiling...
mkdir -p /tmp/tmptZNptI/r.grow.shrink/bin
mkdir -p /tmp/tmptZNptI/r.grow.shrink/etc
mkdir -p /tmp/tmptZNptI/r.grow.shrink/docs/html
mkdir -p /usr/lib/grass70/docs/man
mkdir -p /tmp/tmptZNptI/r.grow.shrink/docs/man/man1
test -d OBJ.x86_64-pc-linux-gnu || mkdir -p OBJ.x86_64-pc-linux-gnu
gcc -Wall -g -O -I/usr/lib/grass70/include -I/usr/lib/grass70/include -
DPACKAGE=\""grassmods"\" -I/usr/lib/grass70/include -
I/usr/lib/grass70/include -DRELDIR=\"/tmp/tmptZNptI/r.grow.shrink\" -o
OBJ.x86_64-pc-linux-gnu/main.o -c main.c
: && gcc -L/usr/lib/grass70/lib -L/usr/lib/grass70/lib -Wl,--export-dynamic -
Wl,-rpath-link,/usr/lib/grass70/lib -o
/tmp/tmptZNptI/r.grow.shrink/bin/r.grow.shrink OBJ.x86_64-pc-linux-gnu/main.o
-lgrass_gis.7.0.0svn -lgrass_raster.7.0.0svn -lm
if [ "/tmp/tmptZNptI/r.grow.shrink/bin/r.grow.shrink" != "" ] ; then
GISRC=/tmp/grass7-root-15037/gisrc GISBASE=/usr/lib/grass70
PATH="/usr/lib/grass70/bin:/usr/lib/grass70/bin:/usr/lib/grass70/scripts:
$PATH" PYTHONPATH="/usr/lib/grass70/etc/python:/usr/lib/grass70/gui/wxpython:
$PYTHONPATH"
LD_LIBRARY_PATH="/tmp/tmptZNptI/r.grow.shrink/bin:/usr/lib/grass70/scripts:/usr/lib/grass70/lib:/usr/lib/grass70/lib:/usr/lib/grass70/lib"
LC_ALL=C /tmp/tmptZNptI/r.grow.shrink/bin/r.grow.shrink --html-description <
/dev/null | grep -v '</body>\|</html>' > r.grow.shrink.tmp.html ; fi
VERSION_NUMBER=7.0.0svn VERSION_DATE=2015 \
        python /usr/lib/grass70/tools/mkhtml.py r.grow.shrink >
/tmp/tmptZNptI/r.grow.shrink/docs/html/r.grow.shrink.html
VERSION_NUMBER=7.0.0svn /usr/lib/grass70/tools/g.html2man.py
/tmp/tmptZNptI/r.grow.shrink/docs/html/r.grow.shrink.html
/tmp/tmptZNptI/r.grow.shrink/docs/man/man1/r.grow.shrink.1
/bin/sh: 1: /usr/lib/grass70/tools/g.html2man.py: not found
make: *** [/tmp/tmptZNptI/r.grow.shrink/docs/man/man1/r.grow.shrink.1] Error
127
rm r.grow.shrink.tmp.html
ERROR: Compilation failed, sorry. Please check above error messages.

3. as ROOT after symlink for g.html2man.py

GRASS 7.0.0 (test_location):/usr/lib/grass70/tools > g.extension
extension=r.grow.shrink --verbose
Fetching <r.grow.shrink> from GRASS-Addons SVN repository (be patient)...
A r.grow.shrink/DEPRECATED
A r.grow.shrink/main.c
A r.grow.shrink/Makefile
A r.grow.shrink/r.grow.shrink.html
U r.grow.shrink
Checked out revision 64530.
Compiling...
mkdir -p /tmp/tmpcAwQMc/r.grow.shrink/bin
mkdir -p /tmp/tmpcAwQMc/r.grow.shrink/etc
mkdir -p /tmp/tmpcAwQMc/r.grow.shrink/docs/html
mkdir -p /tmp/tmpcAwQMc/r.grow.shrink/docs/man/man1
test -d OBJ.x86_64-pc-linux-gnu || mkdir -p OBJ.x86_64-pc-linux-gnu
gcc -Wall -g -O -I/usr/lib/grass70/include -I/usr/lib/grass70/include -
DPACKAGE=\""grassmods"\" -I/usr/lib/grass70/include -
I/usr/lib/grass70/include -DRELDIR=\"/tmp/tmpcAwQMc/r.grow.shrink\" -o
OBJ.x86_64-pc-linux-gnu/main.o -c main.c
: && gcc -L/usr/lib/grass70/lib -L/usr/lib/grass70/lib -Wl,--export-dynamic -
Wl,-rpath-link,/usr/lib/grass70/lib -o
/tmp/tmpcAwQMc/r.grow.shrink/bin/r.grow.shrink OBJ.x86_64-pc-linux-gnu/main.o
-lgrass_gis.7.0.0svn -lgrass_raster.7.0.0svn -lm
if [ "/tmp/tmpcAwQMc/r.grow.shrink/bin/r.grow.shrink" != "" ] ; then
GISRC=/tmp/grass7-root-15392/gisrc GISBASE=/usr/lib/grass70
PATH="/usr/lib/grass70/bin:/usr/lib/grass70/bin:/usr/lib/grass70/scripts:
$PATH" PYTHONPATH="/usr/lib/grass70/etc/python:/usr/lib/grass70/gui/wxpython:
$PYTHONPATH"
LD_LIBRARY_PATH="/tmp/tmpcAwQMc/r.grow.shrink/bin:/usr/lib/grass70/scripts:/usr/lib/grass70/lib:/usr/lib/grass70/lib:/usr/lib/grass70/lib"
LC_ALL=C /tmp/tmpcAwQMc/r.grow.shrink/bin/r.grow.shrink --html-description <
/dev/null | grep -v '</body>\|</html>' > r.grow.shrink.tmp.html ; fi
VERSION_NUMBER=7.0.0svn VERSION_DATE=2015 \
        python /usr/lib/grass70/tools/mkhtml.py r.grow.shrink >
/tmp/tmpcAwQMc/r.grow.shrink/docs/html/r.grow.shrink.html
VERSION_NUMBER=7.0.0svn /usr/lib/grass70/tools/g.html2man.py
/tmp/tmpcAwQMc/r.grow.shrink/docs/html/r.grow.shrink.html
/tmp/tmpcAwQMc/r.grow.shrink/docs/man/man1/r.grow.shrink.1
Traceback (most recent call last):
  File "/usr/lib/grass70/tools/g.html2man.py", line 4, in <module>
    from html import HTMLParser, HTMLParseError
ImportError: No module named html
make: *** [/tmp/tmpcAwQMc/r.grow.shrink/docs/man/man1/r.grow.shrink.1] Error 1
rm r.grow.shrink.tmp.html
ERROR: Compilation failed, sorry. Please check above error messages.

Hi,

2015-02-09 16:10 GMT+01:00 Robert Nuske <rnuske@gwdg.de>:

mkdir -p /usr/lib/grass70/docs/man
mkdir: cannot create directory '/usr/lib/grass70/docs/man': Permission denied
make: *** [/usr/lib/grass70/docs/man] Error 1
ERROR: Compilation failed, sorry. Please check above error messages.

I fixed this bug in r64534 (trunk only), after some testing I will
backport it to relbr70.

VERSION_NUMBER=7.0.0svn /usr/lib/grass70/tools/g.html2man.py
/tmp/tmptZNptI/r.grow.shrink/docs/html/r.grow.shrink.html
/tmp/tmptZNptI/r.grow.shrink/docs/man/man1/r.grow.shrink.1
/bin/sh: 1: /usr/lib/grass70/tools/g.html2man.py: not found
make: *** [/tmp/tmptZNptI/r.grow.shrink/docs/man/man1/r.grow.shrink.1] Error
127

Right, `/usr/lib/grass70/tools/` contains `g.html2man`. This is
probably related to the packaging, my local sample installation (make
install from source code) contains `g.html2man.py` in the `tools`
directory.

Martin

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.eu/mentors/landa

Hi Martin,

thanks for looking into this!

2015-02-09 16:10 GMT+01:00 Robert Nuske <rnuske@gwdg.de>:
> mkdir -p /usr/lib/grass70/docs/man
> mkdir: cannot create directory '/usr/lib/grass70/docs/man': Permission
> denied make: *** [/usr/lib/grass70/docs/man] Error 1
> ERROR: Compilation failed, sorry. Please check above error messages.

I fixed this bug in r64534 (trunk only), after some testing I will
backport it to relbr70.

I will test again when the patch landed in relbr70

> VERSION_NUMBER=7.0.0svn /usr/lib/grass70/tools/g.html2man.py
> /tmp/tmptZNptI/r.grow.shrink/docs/html/r.grow.shrink.html
> /tmp/tmptZNptI/r.grow.shrink/docs/man/man1/r.grow.shrink.1
> /bin/sh: 1: /usr/lib/grass70/tools/g.html2man.py: not found
> make: *** [/tmp/tmptZNptI/r.grow.shrink/docs/man/man1/r.grow.shrink.1]
> Error 127

Right, `/usr/lib/grass70/tools/` contains `g.html2man`. This is
probably related to the packaging, my local sample installation (make
install from source code) contains `g.html2man.py` in the `tools`
directory.

weird
g.html2man.py loses its '.py' but mkhtml.py stays untouched

Any clue about the missing python module 'html' reported by g.html2man.py?

Traceback (most recent call last):
  File "/usr/lib/grass70/tools/g.html2man.py", line 4, in <module>
    from html import HTMLParser, HTMLParseError
ImportError: No module named html

cheers
  robert

Hi Robert,

On Tue, Feb 10, 2015 at 9:05 AM, Robert Nuske <rnuske@gwdg.de> wrote:

Any clue about the missing python module 'html' reported by g.html2man.py?

Traceback (most recent call last):
  File "/usr/lib/grass70/tools/g.html2man.py", line 4, in <module>
    from html import HTMLParser, HTMLParseError
ImportError: No module named html

Which version of python are you using?

Pietro

Hi Pietro

On Tue, Feb 10, 2015 at 9:05 AM, Robert Nuske <rnuske@gwdg.de> wrote:
> Any clue about the missing python module 'html' reported by g.html2man.py?
>
> Traceback (most recent call last):
> File "/usr/lib/grass70/tools/g.html2man.py", line 4, in <module>
>
> from html import HTMLParser, HTMLParseError
>
> ImportError: No module named html

Which version of python are you using?

$ python --version
Python 2.7.6

cheers
  robert

Hi Martin,

> mkdir -p /usr/lib/grass70/docs/man
> mkdir: cannot create directory '/usr/lib/grass70/docs/man': Permission
> denied make: *** [/usr/lib/grass70/docs/man] Error 1
> ERROR: Compilation failed, sorry. Please check above error messages.

I fixed this bug in r64534 (trunk only), after some testing I will
backport it to relbr70.

Thanks for the fix.
Since the fix was recently added to relbr7 and the patch is in today’s daily
launchpad build of GRASS 7, I tested g.extension again on my ubuntu box.

System: ubuntu 14.04 64bit
Python: 2.7.6
GRASS Package: 7.0.0+1svn64600~ubuntu14.04.1

Findings:
- The problem with writing to /usr/lib is fixed :slight_smile:
- g.html2man.py is still not found
  The Python script is named g.html2man (see below 1.)
- After creating a symlink for g.html2man.py: Python Module "html" not found
  ImportError: No module named html (see below 2.)

cheers
  robert

1. Test as Standard User

GRASS 7.0.0 (test_location):~ > g.extension extension=r.grow.shrink --verbose
Fetching <r.grow.shrink> from GRASS-Addons SVN repository (be patient)...
A r.grow.shrink/DEPRECATED
A r.grow.shrink/main.c
A r.grow.shrink/Makefile
A r.grow.shrink/r.grow.shrink.html
U r.grow.shrink
Checked out revision 64604.
Compiling...
mkdir -p /tmp/tmpPv5j8I/r.grow.shrink/bin
mkdir -p /tmp/tmpPv5j8I/r.grow.shrink/etc
mkdir -p /tmp/tmpPv5j8I/r.grow.shrink/docs/html
mkdir -p /tmp/tmpPv5j8I/r.grow.shrink/docs/man
mkdir -p /tmp/tmpPv5j8I/r.grow.shrink/docs/man/man1
test -d OBJ.x86_64-pc-linux-gnu || mkdir -p OBJ.x86_64-pc-linux-gnu
gcc -Wall -g -O -I/usr/lib/grass70/include -I/usr/lib/grass70/include -
DPACKAGE=\""grassmods"\" -I/usr/lib/grass70/include -
I/usr/lib/grass70/include -DRELDIR=\"/tmp/tmpPv5j8I/r.grow.shrink\" -o
OBJ.x86_64-pc-linux-gnu/main.o -c main.c
: && gcc -L/usr/lib/grass70/lib -L/usr/lib/grass70/lib -Wl,--export-dynamic -
Wl,-rpath-link,/usr/lib/grass70/lib -o
/tmp/tmpPv5j8I/r.grow.shrink/bin/r.grow.shrink OBJ.x86_64-pc-linux-gnu/main.o
-lgrass_gis.7.0.0svn -lgrass_raster.7.0.0svn -lm
if [ "/tmp/tmpPv5j8I/r.grow.shrink/bin/r.grow.shrink" != "" ] ; then
GISRC=/tmp/grass7-rnuske-27453/gisrc GISBASE=/usr/lib/grass70
PATH="/usr/lib/grass70/bin:/usr/lib/grass70/bin:/usr/lib/grass70/scripts:
$PATH" PYTHONPATH="/usr/lib/grass70/etc/python:/usr/lib/grass70/gui/wxpython:
$PYTHONPATH"
LD_LIBRARY_PATH="/tmp/tmpPv5j8I/r.grow.shrink/bin:/usr/lib/grass70/scripts:/usr/lib/grass70/lib:/usr/lib/grass70/lib:/usr/lib/grass70/lib"
LC_ALL=C /tmp/tmpPv5j8I/r.grow.shrink/bin/r.grow.shrink --html-description <
/dev/null | grep -v '</body>\|</html>' > r.grow.shrink.tmp.html ; fi
VERSION_NUMBER=7.0.0svn VERSION_DATE=2015 \
        python /usr/lib/grass70/tools/mkhtml.py r.grow.shrink >
/tmp/tmpPv5j8I/r.grow.shrink/docs/html/r.grow.shrink.html
VERSION_NUMBER=7.0.0svn /usr/lib/grass70/tools/g.html2man.py
/tmp/tmpPv5j8I/r.grow.shrink/docs/html/r.grow.shrink.html
/tmp/tmpPv5j8I/r.grow.shrink/docs/man/man1/r.grow.shrink.1
/bin/sh: 1: /usr/lib/grass70/tools/g.html2man.py: not found
make: *** [/tmp/tmpPv5j8I/r.grow.shrink/docs/man/man1/r.grow.shrink.1] Error
127
rm r.grow.shrink.tmp.html
ERROR: Compilation failed, sorry. Please check above error messages.

2. Test as Standard User after symlink (ln -s g.html2man g.html2man.py)

GRASS 7.0.0 (test_location):~ > g.extension extension=r.grow.shrink --verbose
Fetching <r.grow.shrink> from GRASS-Addons SVN repository (be patient)...
A r.grow.shrink/DEPRECATED
A r.grow.shrink/main.c
A r.grow.shrink/Makefile
A r.grow.shrink/r.grow.shrink.html
U r.grow.shrink
Checked out revision 64604.
Compiling...
mkdir -p /tmp/tmpRVkTQj/r.grow.shrink/bin
mkdir -p /tmp/tmpRVkTQj/r.grow.shrink/etc
mkdir -p /tmp/tmpRVkTQj/r.grow.shrink/docs/html
mkdir -p /tmp/tmpRVkTQj/r.grow.shrink/docs/man
mkdir -p /tmp/tmpRVkTQj/r.grow.shrink/docs/man/man1
test -d OBJ.x86_64-pc-linux-gnu || mkdir -p OBJ.x86_64-pc-linux-gnu
gcc -Wall -g -O -I/usr/lib/grass70/include -I/usr/lib/grass70/include -
DPACKAGE=\""grassmods"\" -I/usr/lib/grass70/include -
I/usr/lib/grass70/include -DRELDIR=\"/tmp/tmpRVkTQj/r.grow.shrink\" -o
OBJ.x86_64-pc-linux-gnu/main.o -c main.c
: && gcc -L/usr/lib/grass70/lib -L/usr/lib/grass70/lib -Wl,--export-dynamic -
Wl,-rpath-link,/usr/lib/grass70/lib -o
/tmp/tmpRVkTQj/r.grow.shrink/bin/r.grow.shrink OBJ.x86_64-pc-linux-gnu/main.o
-lgrass_gis.7.0.0svn -lgrass_raster.7.0.0svn -lm
if [ "/tmp/tmpRVkTQj/r.grow.shrink/bin/r.grow.shrink" != "" ] ; then
GISRC=/tmp/grass7-rnuske-27604/gisrc GISBASE=/usr/lib/grass70
PATH="/usr/lib/grass70/bin:/usr/lib/grass70/bin:/usr/lib/grass70/scripts:
$PATH" PYTHONPATH="/usr/lib/grass70/etc/python:/usr/lib/grass70/gui/wxpython:
$PYTHONPATH"
LD_LIBRARY_PATH="/tmp/tmpRVkTQj/r.grow.shrink/bin:/usr/lib/grass70/scripts:/usr/lib/grass70/lib:/usr/lib/grass70/lib:/usr/lib/grass70/lib"
LC_ALL=C /tmp/tmpRVkTQj/r.grow.shrink/bin/r.grow.shrink --html-description <
/dev/null | grep -v '</body>\|</html>' > r.grow.shrink.tmp.html ; fi
VERSION_NUMBER=7.0.0svn VERSION_DATE=2015 \
        python /usr/lib/grass70/tools/mkhtml.py r.grow.shrink >
/tmp/tmpRVkTQj/r.grow.shrink/docs/html/r.grow.shrink.html
VERSION_NUMBER=7.0.0svn /usr/lib/grass70/tools/g.html2man.py
/tmp/tmpRVkTQj/r.grow.shrink/docs/html/r.grow.shrink.html
/tmp/tmpRVkTQj/r.grow.shrink/docs/man/man1/r.grow.shrink.1
Traceback (most recent call last):
  File "/usr/lib/grass70/tools/g.html2man.py", line 4, in <module>
    from html import HTMLParser, HTMLParseError
ImportError: No module named html
make: *** [/tmp/tmpRVkTQj/r.grow.shrink/docs/man/man1/r.grow.shrink.1] Error 1
rm r.grow.shrink.tmp.html
ERROR: Compilation failed, sorry. Please check above error messages.

> VERSION_NUMBER=7.0.0svn /usr/lib/grass70/tools/g.html2man.py
> /tmp/tmptZNptI/r.grow.shrink/docs/html/r.grow.shrink.html
> /tmp/tmptZNptI/r.grow.shrink/docs/man/man1/r.grow.shrink.1
> /bin/sh: 1: /usr/lib/grass70/tools/g.html2man.py: not found
> make: *** [/tmp/tmptZNptI/r.grow.shrink/docs/man/man1/r.grow.shrink.1]
> Error 127

Right, `/usr/lib/grass70/tools/` contains `g.html2man`. This is
probably related to the packaging, my local sample installation (make
install from source code) contains `g.html2man.py` in the `tools`
directory.