[GRASS-dev] problem compiling addons

Hi devs,

I'm trying to compile addons against my local GRASS installation. On
my machine Python2 doesn't exist so I don't have python command, so I
cannot compile because It cannot find python

if [ "/home/lucadelu/installati/grass78/scripts/t.rast.what.aggr" !=
"" ] ; then GISRC=/home/lucadelu/installati/grass78/demolocation/.grassrc78
GISBASE=/home/lucadelu/installati/grass78
PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:$PATH"
PYTHONPATH="/home/lucadelu/installati/grass78/etc/python:/home/lucadelu/installati/grass78/gui/wxpython:$PYTHONPATH"
LD_LIBRARY_PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:/home/lucadelu/installati/grass78/lib:/home/lucadelu/installati/grass78/lib:"
LC_ALL=C LANG=C LANGUAGE=C
/home/lucadelu/installati/grass78/scripts/t.rast.what.aggr
--html-description < /dev/null | grep -v '</body>\|</html>' >
t.rast.what.aggr.tmp.html ; fi
/usr/bin/env: 'python': No such file or directory
make: *** [/home/lucadelu/installati/grass78//include/Make/Html.make:14:
t.rast.what.aggr.tmp.html] Error 1
rm t.rast.what.aggr.tmp.html

If add create python command a symbol link of python3 I have another problem

gmake78
if [ "/home/lucadelu/installati/grass78/scripts/t.rast.what.aggr" !=
"" ] ; then GISRC=/home/lucadelu/installati/grass78/demolocation/.grassrc78
GISBASE=/home/lucadelu/installati/grass78
PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:$PATH"
PYTHONPATH="/home/lucadelu/installati/grass78/etc/python:/home/lucadelu/installati/grass78/gui/wxpython:$PYTHONPATH"
LD_LIBRARY_PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:/home/lucadelu/installati/grass78/lib:/home/lucadelu/installati/grass78/lib:"
LC_ALL=C LANG=C LANGUAGE=C
/home/lucadelu/installati/grass78/scripts/t.rast.what.aggr
--html-description < /dev/null | grep -v '</body>\|</html>' >
t.rast.what.aggr.tmp.html ; fi
VERSION_NUMBER=7.8.6dev VERSION_DATE=2021
MODULE_TOPDIR=/home/lucadelu/installati/grass78/ \
        python3 /home/lucadelu/installati/grass78/tools/mkhtml.py
t.rast.what.aggr >
/home/lucadelu/installati/grass78/docs/html/t.rast.what.aggr.html
VERSION_NUMBER=7.8.6dev
/home/lucadelu/installati/grass78/tools/g.html2man.py
"/home/lucadelu/installati/grass78/docs/html/t.rast.what.aggr.html"
"/home/lucadelu/installati/grass78/docs/man/man1/t.rast.what.aggr.1"
GISRC=/home/lucadelu/installati/grass78/demolocation/.grassrc78
GISBASE=/home/lucadelu/installati/grass78
PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:$PATH"
PYTHONPATH="/home/lucadelu/installati/grass78/etc/python:/home/lucadelu/installati/grass78/gui/wxpython:$PYTHONPATH"
LD_LIBRARY_PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:/home/lucadelu/installati/grass78/lib:/home/lucadelu/installati/grass78/lib:"
LC_ALL=C LANG=C LANGUAGE=C g.parser -t t.rast.what.aggr.py | sed
s/\"/\\\\\"/g | sed 's/.*/_("&")/' >
/home/lucadelu/installati/grass78/locale/scriptstrings/t.rast.what.aggr_to_translate.c
/bin/sh: 1: cannot create
/home/lucadelu/installati/grass78/locale/scriptstrings/t.rast.what.aggr_to_translate.c:
Directory nonexistent
make: [/home/lucadelu/installati/grass78//include/Make/ScriptRules.make:28:
/home/lucadelu/installati/grass78/locale/scriptstrings/t.rast.what.aggr_to_translate.c]
Error 2 (ignored)
rm t.rast.what.aggr.tmp.html

I cannot understand what is doing, the problem seems related to
`scriptstrings` directory doesn't exist in locale directory

thanks

--
ciao
Luca

www.lucadelu.org

Hi Luca,

On Mon, Mar 29, 2021 at 8:47 AM Luca Delucchi <lucadeluge@gmail.com> wrote:

Hi devs,

I'm trying to compile addons against my local GRASS installation. On
my machine Python2 doesn't exist so I don't have python command, so I
cannot compile because It cannot find python

if [ "/home/lucadelu/installati/grass78/scripts/t.rast.what.aggr" !=

...

/home/lucadelu/installati/grass78/scripts/t.rast.what.aggr
--html-description < /dev/null | grep -v '</body>\|</html>' >
t.rast.what.aggr.tmp.html ; fi
/usr/bin/env: 'python': No such file or directory

Did you try (Ubuntu/Debian/...):

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
?

...

If add create python command a symbol link of python3 I have another problem

gmake78
if [ "/home/lucadelu/installati/grass78/scripts/t.rast.what.aggr" !=

...

GISBASE=/home/lucadelu/installati/grass78
PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:$PATH"
PYTHONPATH="/home/lucadelu/installati/grass78/etc/python:/home/lucadelu/installati/grass78/gui/wxpython:$PYTHONPATH"
LD_LIBRARY_PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:/home/lucadelu/installati/grass78/lib:/home/lucadelu/installati/grass78/lib:"
LC_ALL=C LANG=C LANGUAGE=C g.parser -t t.rast.what.aggr.py | sed
s/\"/\\\\\"/g | sed 's/.*/_("&")/' >
/home/lucadelu/installati/grass78/locale/scriptstrings/t.rast.what.aggr_to_translate.c
/bin/sh: 1: cannot create
/home/lucadelu/installati/grass78/locale/scriptstrings/t.rast.what.aggr_to_translate.c:
Directory nonexistent

Confirmed, I had the same issue here.

...

I cannot understand what is doing,

It is needed for gettext extraction.

the problem seems related to
`scriptstrings` directory doesn't exist in locale directory

Yes, I had to create it, so it would be

mkdir -p /home/lucadelu/installati/grass78/locale/scriptstrings/

Not sure why this happens occasionally. Perhaps you have configured
the source code --without-nls? Maybe then the subdir is not generated
but better to always have it present?

Markus

On Mon, 29 Mar 2021 at 14:45, Markus Neteler <neteler@osgeo.org> wrote:

Hi Luca,

Hi Markus,

On Mon, Mar 29, 2021 at 8:47 AM Luca Delucchi <lucadeluge@gmail.com> wrote:
>
> Hi devs,
>
> I'm trying to compile addons against my local GRASS installation. On
> my machine Python2 doesn't exist so I don't have python command, so I
> cannot compile because It cannot find python
>
> if [ "/home/lucadelu/installati/grass78/scripts/t.rast.what.aggr" !=
...
> /home/lucadelu/installati/grass78/scripts/t.rast.what.aggr
> --html-description < /dev/null | grep -v '</body>\|</html>' >
> t.rast.what.aggr.tmp.html ; fi
> /usr/bin/env: 'python': No such file or directory

Did you try (Ubuntu/Debian/...):

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
?

yes, nothing changed

...
> If add create python command a symbol link of python3 I have another problem
>
> gmake78
> if [ "/home/lucadelu/installati/grass78/scripts/t.rast.what.aggr" !=
...
> GISBASE=/home/lucadelu/installati/grass78
> PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:$PATH"
> PYTHONPATH="/home/lucadelu/installati/grass78/etc/python:/home/lucadelu/installati/grass78/gui/wxpython:$PYTHONPATH"
> LD_LIBRARY_PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:/home/lucadelu/installati/grass78/lib:/home/lucadelu/installati/grass78/lib:"
> LC_ALL=C LANG=C LANGUAGE=C g.parser -t t.rast.what.aggr.py | sed
> s/\"/\\\\\"/g | sed 's/.*/_("&")/' >
> /home/lucadelu/installati/grass78/locale/scriptstrings/t.rast.what.aggr_to_translate.c
> /bin/sh: 1: cannot create
> /home/lucadelu/installati/grass78/locale/scriptstrings/t.rast.what.aggr_to_translate.c:
> Directory nonexistent

Confirmed, I had the same issue here.

...
> I cannot understand what is doing,

It is needed for gettext extraction.

> the problem seems related to
> `scriptstrings` directory doesn't exist in locale directory

Yes, I had to create it, so it would be

mkdir -p /home/lucadelu/installati/grass78/locale/scriptstrings/

ok, this is solving also for me

Not sure why this happens occasionally. Perhaps you have configured
the source code --without-nls? Maybe then the subdir is not generated
but better to always have it present?

no, I double checked and I didn't set --without-nls
maybe it could be useful, at the end it is just a directory

Markus

--
ciao
Luca

www.lucadelu.org

Hi Luca, all,

On Mon, Apr 5, 2021 at 7:33 AM Luca Delucchi <lucadeluge@gmail.com> wrote:

On Mon, 29 Mar 2021 at 14:45, Markus Neteler <neteler@osgeo.org> wrote:

...

> > If add create python command a symbol link of python3 I have another problem
> >
> > gmake78
> > if [ "/home/lucadelu/installati/grass78/scripts/t.rast.what.aggr" !=
> ...
> > GISBASE=/home/lucadelu/installati/grass78
> > PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:$PATH"
> > PYTHONPATH="/home/lucadelu/installati/grass78/etc/python:/home/lucadelu/installati/grass78/gui/wxpython:$PYTHONPATH"
> > LD_LIBRARY_PATH="/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/bin:/home/lucadelu/installati/grass78/scripts:/home/lucadelu/installati/grass78/lib:/home/lucadelu/installati/grass78/lib:"
> > LC_ALL=C LANG=C LANGUAGE=C g.parser -t t.rast.what.aggr.py | sed
> > s/\"/\\\\\"/g | sed 's/.*/_("&")/' >
> > /home/lucadelu/installati/grass78/locale/scriptstrings/t.rast.what.aggr_to_translate.c
> > /bin/sh: 1: cannot create
> > /home/lucadelu/installati/grass78/locale/scriptstrings/t.rast.what.aggr_to_translate.c:
> > Directory nonexistent
>
> Confirmed, I had the same issue here.
>
> ...
> > I cannot understand what is doing,
>
> It is needed for gettext extraction.
>
> > the problem seems related to
> > `scriptstrings` directory doesn't exist in locale directory
>
> Yes, I had to create it, so it would be
>
> mkdir -p /home/lucadelu/installati/grass78/locale/scriptstrings/
>

ok, this is solving also for me

Wild guess:

index d6730c2f4..ff56bcd33 100644
--- a/include/Make/ShScriptRules.make
+++ b/include/Make/ShScriptRules.make
@@ -9,9 +9,12 @@ $(SCRIPTDIR)/%: %.sh | $(SCRIPTDIR)
$(SCRIPTDIR)/%.sh: %.sh | $(SCRIPTDIR)
        $(INSTALL) $< $@

-$(SCRIPTDIR):
+$(SCRIPTDIR): $(STRINGDIR)
        $(MKDIR) $(SCRIPTDIR)

+$(STRINGDIR):
+ $(MKDIR) $(STRINGDIR)
+
$(ETCDIR)/%: % | $(ETCDIR)
        $(INSTALL_DATA) $< $@

Can you try this ? (I cannot reproduce the error at time)

ciao,
Markus