Re: [GRASS-user] Compiling GRASS 7.9 using zstandard source

2020-09-29 Thread Anna Petrášová
Hi,

perhaps you don't have to use zstd, just configure grass with
--without-zstd, GRASS will then use different compression.
Alternatively you would have to build it locally, not sure how difficult
that is.

Anna

On Sun, Sep 20, 2020 at 10:56 AM Massimiliano Alvioli 
wrote:

> Hi all,
>
> I have a question about installing 7.9 on a remote machine, in which I
> do not have superuser privileges (galileo@CINECA) - thus I can't
> install zstd packages. I downloaded zstd v1.45 from github, unpacked
> it, and realized this library is not so "standard", meaning that users
> are not supposed to compile it and place it in some location (in an
> easy way, at least: there is no configure script in there). This means
> that configuring GRASS with the following flags:
>
> --with-zstd \
>
> --with-zstd-includes=/galileo/home/userexternal/malvioli/local/zstd/lib \
> --with-zstd-libs=/galileo/home/userexternal/malvioli/local/zstd/lib
>
> does not work. Note that I used zstd/lib as "include" folder because
> zstd.h happens to be there; there is no include folder in the source
> tree whatsoever. By "does not work" I mean that compiling GRASS would
> give zillions of:
>
>
> /galileo/home/userexternal/malvioli/local/grass-7.9.0/dist.x86_64-pc-linux-gnu/lib/
> libgrass_gis.7.9.so:
> undefined reference to `ZSTD_isError'
>
> /galileo/home/userexternal/malvioli/local/grass-7.9.0/dist.x86_64-pc-linux-gnu/lib/
> libgrass_gis.7.9.so:
> undefined reference to `ZSTD_decompress'
>
> /galileo/home/userexternal/malvioli/local/grass-7.9.0/dist.x86_64-pc-linux-gnu/lib/
> libgrass_gis.7.9.so:
> undefined reference to `ZSTD_compress'
>
> /galileo/home/userexternal/malvioli/local/grass-7.9.0/dist.x86_64-pc-linux-gnu/lib/
> libgrass_gis.7.9.so:
> undefined reference to `ZSTD_getErrorName'
>
> /galileo/home/userexternal/malvioli/local/grass-7.9.0/dist.x86_64-pc-linux-gnu/lib/
> libgrass_gis.7.9.so:
> undefined reference to `ZSTD_compressBound'
>
> errors. Instructions on zstandard's github page say:
>
> "Presuming a project needs to integrate libzstd's source code (as
> opposed to linking a pre-compiled library), the /lib source directory
> can be copy/pasted into target project. Then the local build system
> must setup a few include directories. Some setups are automatically
> provided in prepared build scripts, such as Makefile, but any other
> 3rd party build system must do it on its own.
> This integration is now simplified, thanks to @felixhandte, by making
> all dependencies within /lib relative, meaning it’s only necessary to
> setup include directories for the *.h header files that are directly
> included into target project (typically zstd.h). Even that task can be
> circumvented by copy/pasting the *.h into already established include
> directories."
>
> I do not understand anything of that - any help is really appreciated.
>
>
> M
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Can someone help me troubleshoot GRASS on Windows 10

2020-09-29 Thread Eric Eagle
Thank you Helmut - can you tell me how I run those commands at command line in 
OSGEO shell?

Also the folder says Grass78

Thanks,
eric



> 
> From: Helmut Kudrnovsky 
> Sent: Tue Sep 29 23:21:45 CEST 2020
> To: 
> Subject: Re: [GRASS-user] Can someone help me troubleshoot GRASS on Windows   
> 10
> 
> 
> Eric Eagle wrote
> > Hi GRASS users,
> > 
> > Longtime GIS'er but newbie to GRASS.  I've never been able to get it to
> > work properly on my workstation and have always fallen back on Esri or,
> > QGIS built-in functions.  Now I am in a situation where I have to get
> > GRASS to work because it seems like the fastest way to do some hydro
> > things.  I am trying to use it inside of QGIS 3.12.
> > 
> > Here is my problem.  I have a UTM-projected DEM as input, I just want to
> > run r.flow and it fails, reporting:
> > 
> > "The following layers were not correctly generated. 
> > C:/Users/username/AppData/Local/Temp/1/processing_ipancU/89aab5fc64c6999046d99c2e0028b/flowaccumulation.tif
> > C:/Users/username/AppData/Local/Temp/1/processing_ipancU/bded4092193446b883446b88344c55272310fa8/flowlength.tif
> > C:/Users/username/AppData/Local/Temp/1/processing_ipancU/f4a65331b4ef4fa5a6b2ba826efdd9b4/flowline.gpkg
> > 
> > You can check the 'Log Messages Panel' in QGIS main window to find more
> > information about the execution of the algorithm."
> > 
> > 
> > However, when I check the log messages panel, here is what I see:
> > 
> > Grass7 tab: only INFO level messages showing the original command payload
> > 
> > all the other tabs: nothing
> > 
> > So, not much given to troubleshoot.  This behavior happens with *every*
> > GRASS tool I try to run, including even v.buffer.  So something is
> > definitely not right.
> > 
> > *About my setup*
> > 
> > I do not have admin access rights to my workstation as this is a
> > production box in a big enterprise.  However I do have access to write to
> > C:/ directories outside of the typical locked down stuff (Program Files,
> > Program Files (x86), etc).  I have QGIS currently installed to C:\QGIS_3
> > and GRASS sits under that.  The workstation is not connected to the
> > internet in case that matters.
> 
> some more details are needed:
> 
> * which GRASS GIS version used
> * g.proj -p output
> * g.region -p output
> * exact command failing
> 
> I guess it has nothing to do with windows 10. works here on several windows
> 10 boxes.
> 
> 
> 
> 
> -
> best regards
> Helmut
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Can someone help me troubleshoot GRASS on Windows 10

2020-09-29 Thread Helmut Kudrnovsky
Eric Eagle wrote
> Hi GRASS users,
> 
> Longtime GIS'er but newbie to GRASS.  I've never been able to get it to
> work properly on my workstation and have always fallen back on Esri or,
> QGIS built-in functions.  Now I am in a situation where I have to get
> GRASS to work because it seems like the fastest way to do some hydro
> things.  I am trying to use it inside of QGIS 3.12.
> 
> Here is my problem.  I have a UTM-projected DEM as input, I just want to
> run r.flow and it fails, reporting:
> 
> "The following layers were not correctly generated. 
> C:/Users/username/AppData/Local/Temp/1/processing_ipancU/89aab5fc64c6999046d99c2e0028b/flowaccumulation.tif
> C:/Users/username/AppData/Local/Temp/1/processing_ipancU/bded4092193446b883446b88344c55272310fa8/flowlength.tif
> C:/Users/username/AppData/Local/Temp/1/processing_ipancU/f4a65331b4ef4fa5a6b2ba826efdd9b4/flowline.gpkg
> 
> You can check the 'Log Messages Panel' in QGIS main window to find more
> information about the execution of the algorithm."
> 
> 
> However, when I check the log messages panel, here is what I see:
> 
> Grass7 tab: only INFO level messages showing the original command payload
> 
> all the other tabs: nothing
> 
> So, not much given to troubleshoot.  This behavior happens with *every*
> GRASS tool I try to run, including even v.buffer.  So something is
> definitely not right.
> 
> *About my setup*
> 
> I do not have admin access rights to my workstation as this is a
> production box in a big enterprise.  However I do have access to write to
> C:/ directories outside of the typical locked down stuff (Program Files,
> Program Files (x86), etc).  I have QGIS currently installed to C:\QGIS_3
> and GRASS sits under that.  The workstation is not connected to the
> internet in case that matters.

some more details are needed:

* which GRASS GIS version used
* g.proj -p output
* g.region -p output
* exact command failing

I guess it has nothing to do with windows 10. works here on several windows
10 boxes.




-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Can someone help me troubleshoot GRASS on Windows 10

2020-09-29 Thread Eric Eagle
Hi GRASS users,

Longtime GIS'er but newbie to GRASS.  I've never been able to get it to work 
properly on my workstation and have always fallen back on Esri or, QGIS 
built-in functions.  Now I am in a situation where I have to get GRASS to work 
because it seems like the fastest way to do some hydro things.  I am trying to 
use it inside of QGIS 3.12.

Here is my problem.  I have a UTM-projected DEM as input, I just want to run 
r.flow and it fails, reporting:

"The following layers were not correctly generated.  
C:/Users/username/AppData/Local/Temp/1/processing_ipancU/89aab5fc64c6999046d99c2e0028b/flowaccumulation.tif
 
C:/Users/username/AppData/Local/Temp/1/processing_ipancU/bded4092193446b883446b88344c55272310fa8/flowlength.tif
 
C:/Users/username/AppData/Local/Temp/1/processing_ipancU/f4a65331b4ef4fa5a6b2ba826efdd9b4/flowline.gpkg

You can check the 'Log Messages Panel' in QGIS main window to find more 
information about the execution of the algorithm."


However, when I check the log messages panel, here is what I see:

Grass7 tab: only INFO level messages showing the original command payload

all the other tabs: nothing

So, not much given to troubleshoot.  This behavior happens with *every* GRASS 
tool I try to run, including even v.buffer.  So something is definitely not 
right.

*About my setup*

I do not have admin access rights to my workstation as this is a production box 
in a big enterprise.  However I do have access to write to C:/ directories 
outside of the typical locked down stuff (Program Files, Program Files (x86), 
etc).  I have QGIS currently installed to C:\QGIS_3 and GRASS sits under that.  
The workstation is not connected to the internet in case that matters.

Thanks for any insight,
eric
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] R: exwcuting grass python script from php web page

2020-09-29 Thread Moritz Lennert

Hi Roberta,

I'm really no expert in this domain, so just doing some educated guessing.

On 28/09/20 18:37, roberta fagandini wrote:


On 28/09/20 17:51, roberta fagandini wrote:

Sorry, maybe I didn't explain myself well because actually, I don't get
any error from the php web page, simply the code related to grass is not 
executed.For instance gsetup.init(gisbase, gisdb, location, mapset) does 
not create any file in my /tmp/ folder and the print(gscript.gisenv()) 
is not printed.
I checked the import of the grass libraries (print(sys.modules)) and 
they seem to be correctly imported.


Have you checked your webservers error logs ?

I have already checked and this is the error in the webserver log file

File "importgrass.py", line 82, in 
     main()
   File "importgrass.py", line 71, in main
     rcfile = gsetup.init(gisbase, gisdb, location, mapset)
   File "/usr/lib/grass74/etc/python/grass/script/setup.py", line 170, 
in init

     config_dir = os.path.join(os.getenv('HOME'), config_dirname)
   File "/usr/lib/python3.6/posixpath.py", line 80, in join
     a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType


First of all, the importgrass.py you sent only has 72 lines, so I don't 
know what the line 82 reference in your above error points to.


But most importantly, I would really recommend that you upgrade to a 
newer version of GRASS GIS. Current stable is 7.8. There's been a lot of 
improvement in terms of python3 compatibility and maybe this is an issue 
that has already been resolved.


It sounds like an issue with a variable containing a path. Apparently it 
is of type NoneType...





How do you call the python script from PhP?

I tried  both with:


and



and

        $myfile = fopen("./tmp/script.sh", "w") or die("Unable to open 
file!");

        fwrite($myfile, $intestazione);
        fwrite($myfile, $command);
        fclose($myfile);
        echo exec("/bin/sh ./tmp/script.sh", $output, $return);
        print_r($output);
?>



What happens when you replace '/usr/bin/python3 importgrass.py ' by, for 
example '/usr/bin/grass --version', just to check if other executables 
work ?


Moritz
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user