Re: [GRASS-dev] Run time errors on windows - grass 7.4

2018-11-22 Thread Helmut Kudrnovsky
>Python executable is not present in the directory >"C:\OSGeo4W64\bin"
directory. 

have you activated Python in osgeo4w?

how did you start the grass executable from "C:\OSGeo4W64\bin" directory.?

activate the grass package in osgeo4w and see if the package start.



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

Re: [GRASS-dev] [GRASS-SVN] r73692 - grass/trunk/lib/init

2018-11-22 Thread Vaclav Petras
On Thu, Nov 22, 2018 at 10:57 AM Markus Metz 
wrote:

>
>
> On Thu, Nov 22, 2018 at 3:31 PM Vaclav Petras 
> wrote:
> >
> >
> >
> > On Wed, Nov 21, 2018 at 2:12 PM Martin Landa 
> wrote:
> >>
> >> Hi,
> >>
> >> st 21. 11. 2018 v 20:05 odesílatel  napsal:
> >> > +# clean the sqlite db
> >> > +from grass.script import db as gdb
> >> > +from grass.script import core as gcore
> >> > +conn = gdb.db_connection()
> >> > +if conn and conn['driver'] == 'sqlite':
> >> > +   # check if db exists
> >> > +   gisenv = gcore.gisenv()
> >> > +   database = conn['database']
> >> > +   database = database.replace('$GISDBASE',
> gisenv['GISDBASE'])
> >> > +   database = database.replace('$LOCATION_NAME',
> gisenv['LOCATION_NAME'])
> >> > +   database = database.replace('$MAPSET', gisenv['MAPSET'])
> >> > +   if os.path.exists(database):
> >> > +   message(_("Cleaning up sqlite database ..."))
> >> > +   gcore.start_command('db.execute', sql = 'VACUUM')
> >>
> >> a small note, the added code could be probably moved to new a fn eg.
> >> clean_db(), Ma
> >
> >
> > Yes, ideally to grass.script.setup.
>
> But this is only initializing a GRASS session, without any mechanism to
> terminate a session. Basic usage in the documentation:
>
> # ... use GRASS modules here
> # remove the session's gisrc file to end the session
> os.remove(gisrc)
>
> maybe a new fn to terminate a session is needed? This fn could clean temp
> files like clean_temp() in grass.py and also clean any default sqlite db
> when terminating the grass session.
>

That's all correct. There would have to be more to make it the same
procedure as in grass.py, but eventually we need to do that.

What I meant to add it to grass.script.setup module where we should
eventually put all the functions needed to setup a proper GRASS session (or
in some other module, but setup seems to be something good enough for now
and moving things around while keeping the API is easy in Python).
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] Run time errors on windows - grass 7.4

2018-11-22 Thread Veronica Andreo
Maybe this thread is related:
http://osgeo-org.1560.x6.nabble.com/OSGeo4W-winGRASS-using-bash-in-console-scripts-not-working-td5382999.html#a5386454
?

El jue., 22 nov. 2018 a las 19:45, CM Reddy ()
escribió:

> Hi All,
>
> I am trying to compile Grass 7.4 stable version on Windows and followed
> the steps listed in the following link.
>
> https://trac.osgeo.org/grass/wiki/CompileOnWindows
>
> After successful compilation of Grass 7.4, I ran the grass executable from
> "C:\OSGeo4W64\bin" directory. However, it failed with the following error.
>
> '"C:\OSGEO4~1\bin\python.exe"' is not recognized as an internal or
> external command,
> operable program or batch file.
>
> Python executable is not present in the directory "C:\OSGeo4W64\bin"
> directory.
>
> Please let me know the any missing steps to fix this issue.
>
> Thanks in advance for your help.
>
> - CM
>
>
>
> ___
> grass-dev mailing list
> grass-dev@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-dev
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] Run time errors on windows - grass 7.4

2018-11-22 Thread CM Reddy
Hi All,

I am trying to compile Grass 7.4 stable version on Windows and followed the 
steps listed in the following link.

https://trac.osgeo.org/grass/wiki/CompileOnWindows

After successful compilation of Grass 7.4, I ran the grass executable from 
"C:\OSGeo4W64\bin" directory. However, it failed with the following error.

'"C:\OSGEO4~1\bin\python.exe"' is not recognized as an internal or external 
command,
operable program or batch file.

Python executable is not present in the directory "C:\OSGeo4W64\bin" directory.

Please let me know the any missing steps to fix this issue.

Thanks in advance for your help.

- CM


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

Re: [GRASS-dev] GRASS 7.4.2 won't configure on Mac

2018-11-22 Thread Markus Neteler
Am Do., 22. Nov. 2018, 17:28 hat Michael Barton 
geschrieben:

> Such is my plan B. Just hoping to shortcut it with an inquiry to all if
> anyone knows of a recent change to GRASS source that might cause this.
>
> No obvious change to my system, but may be something not obvious of course
>


Usually before RC1 the configure stuff is updated. But I doubt that it
causes the problem.

Markus
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GRASS 7.4.2 won't configure on Mac

2018-11-22 Thread Michael Barton
Such is my plan B. Just hoping to shortcut it with an inquiry to all if anyone 
knows of a recent change to GRASS source that might cause this.

No obvious change to my system, but may be something not obvious of course

Michael

Michael Barton
School of Human Evolution &Social Change
Center for Social Dynamics & Complexity
Arizona State University

...Sent from my iPad

On Nov 22, 2018, at 7:30 AM, Vaclav Petras 
mailto:wenzesl...@gmail.com>> wrote:



On Wed, Nov 21, 2018 at 4:22 PM Michael Barton 
mailto:michael.bar...@asu.edu>> wrote:

As far as I can tell, I do not have cpp anywhere in any of the Mac binaries 
I've done, although I do have a C++ compiler installed. All previous versions 
compiled and built without this error, and they run fine. So what was changed 
between 8 October and the release of 7.4.2 that makes configure fail if cpp is 
not found? Where should I look?

Do you mean a change in GRASS GIS source code or your system configuration 
(e.g. updates)? How to decide between them is to configure the last version of 
GRASS GIS which worked for you. If you can configure and compile from scratch 
that old version but not the new one, you can try a version in between these 
two, the go to beginning of this sentence (aka bisect). This way you find the 
change in GRASS GIS. In case both the old and the new version don't configure, 
the change is in your system.




On Nov 12, 2018, at 9:04 PM, Vaclav Petras 
mailto:wenzesl...@gmail.com>> wrote:

Since it's complaining about /lib/cpp,

./configure: line 5164: /lib/cpp: No such file or directory

I would say the problem is not zlib, but missing C++ compiler (at least on my 
machine, /lib/cpp eventually points to /usr/bin/cpp-5), although I don't know 
why ./configure would catch that problem earlier since a successful report 
contains:

  C compiler: clang -O2 -Wall -pedantic -Wextra
  C++ compiler:   clang++ -std=c++14 -fexceptions

The checking phase reports only about C compiler, so the difference is perhaps 
there.

checking for gcc... clang
checking whether the C compiler (clang -O2 -Wall -pedantic -Wextra -s) works... 
yes
checking whether the C compiler (clang -O2 -Wall -pedantic -Wextra -s) is a 
cross-compiler... no
checking whether we are using GNU C... yes
checking whether clang accepts -g... yes



On Fri, Nov 9, 2018 at 10:58 PM Michael Barton 
mailto:michael.bar...@asu.edu>> wrote:
>
> I could see that it could not find zlib in the configure output. I don't know 
> why, since I DO have zlib in the appropriate place
>
> MIchael
>
> On Nov 9, 2018, at 4:21 PM, Markus Neteler 
> mailto:nete...@osgeo.org>> wrote:
>
> Just scroll to the end of the file.
>
>
> ; return 0; }
> configure:5066: checking for socket in -lsocket
> configure:5083:
> /Applications/GRASS-7.4.2.app/Contents/Resources/bin/clang -o conftest
> -g -O2-I/Applications/GRASS-7.4.2.app/Contents/Resources/include
> -L/Applications/GRASS-7.4.2.app/Contents/Resources/lib conftest.c
> -lsocket   1>&5
> ld: library not found for -lsocket
> clang-4.0: error: linker command failed with exit code 1 (use -v to
> see invocation)
> configure: failed program was:
> #line 5072 "configure"
> #include "confdefs.h"
> /* Override any gcc2 internal prototype to avoid an error.  */
> /* We use char because int might match the return type of a gcc2
>builtin and then its argument prototype would still apply.  */
> char socket();
>
> int main() {
> socket()
> ; return 0; }
> configure:5131: checking for location of zlib includes
> configure:5157: checking for zlib.h
> configure:5165: /lib/cpp
> -I/Applications/GRASS-7.4.2.app/Contents/Resources/include conftest.c
>
> /dev/null 2>conftest.out
>
> ./configure: line 5164: /lib/cpp: No such file or directory
> configure: failed program was:
> #line 5160 "configure"
> #include "confdefs.h"
> #include 

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

Re: [GRASS-dev] [GRASS-SVN] r73692 - grass/trunk/lib/init

2018-11-22 Thread Markus Metz
On Thu, Nov 22, 2018 at 3:31 PM Vaclav Petras  wrote:
>
>
>
> On Wed, Nov 21, 2018 at 2:12 PM Martin Landa 
wrote:
>>
>> Hi,
>>
>> st 21. 11. 2018 v 20:05 odesílatel  napsal:
>> > +# clean the sqlite db
>> > +from grass.script import db as gdb
>> > +from grass.script import core as gcore
>> > +conn = gdb.db_connection()
>> > +if conn and conn['driver'] == 'sqlite':
>> > +   # check if db exists
>> > +   gisenv = gcore.gisenv()
>> > +   database = conn['database']
>> > +   database = database.replace('$GISDBASE',
gisenv['GISDBASE'])
>> > +   database = database.replace('$LOCATION_NAME',
gisenv['LOCATION_NAME'])
>> > +   database = database.replace('$MAPSET', gisenv['MAPSET'])
>> > +   if os.path.exists(database):
>> > +   message(_("Cleaning up sqlite database ..."))
>> > +   gcore.start_command('db.execute', sql = 'VACUUM')
>>
>> a small note, the added code could be probably moved to new a fn eg.
>> clean_db(), Ma
>
>
> Yes, ideally to grass.script.setup.

But this is only initializing a GRASS session, without any mechanism to
terminate a session. Basic usage in the documentation:

# ... use GRASS modules here
# remove the session's gisrc file to end the session
os.remove(gisrc)

maybe a new fn to terminate a session is needed? This fn could clean temp
files like clean_temp() in grass.py and also clean any default sqlite db
when terminating the grass session.

Markus M
>
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] [GRASS-SVN] r73692 - grass/trunk/lib/init

2018-11-22 Thread Vaclav Petras
On Wed, Nov 21, 2018 at 2:12 PM Martin Landa  wrote:

> Hi,
>
> st 21. 11. 2018 v 20:05 odesílatel  napsal:
> > +# clean the sqlite db
> > +from grass.script import db as gdb
> > +from grass.script import core as gcore
> > +conn = gdb.db_connection()
> > +if conn and conn['driver'] == 'sqlite':
> > +   # check if db exists
> > +   gisenv = gcore.gisenv()
> > +   database = conn['database']
> > +   database = database.replace('$GISDBASE', gisenv['GISDBASE'])
> > +   database = database.replace('$LOCATION_NAME',
> gisenv['LOCATION_NAME'])
> > +   database = database.replace('$MAPSET', gisenv['MAPSET'])
> > +   if os.path.exists(database):
> > +   message(_("Cleaning up sqlite database ..."))
> > +   gcore.start_command('db.execute', sql = 'VACUUM')
>
> a small note, the added code could be probably moved to new a fn eg.
> clean_db(), Ma
>

Yes, ideally to grass.script.setup.
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] GRASS 7.4.2 won't configure on Mac

2018-11-22 Thread Vaclav Petras
On Wed, Nov 21, 2018 at 4:22 PM Michael Barton 
wrote:

>
> As far as I can tell, I do not have cpp anywhere in any of the Mac
> binaries I've done, although I do have a C++ compiler installed. All
> previous versions compiled and built without this error, and they run fine.
> So what was changed between 8 October and the release of 7.4.2 that makes
> configure fail if cpp is not found? Where should I look?
>

Do you mean a change in GRASS GIS source code or your system configuration
(e.g. updates)? How to decide between them is to configure the last version
of GRASS GIS which worked for you. If you can configure and compile from
scratch that old version but not the new one, you can try a version in
between these two, the go to beginning of this sentence (aka bisect). This
way you find the change in GRASS GIS. In case both the old and the new
version don't configure, the change is in your system.



>
>
> On Nov 12, 2018, at 9:04 PM, Vaclav Petras  wrote:
>
> Since it's complaining about /lib/cpp,
>
> ./configure: line 5164: /lib/cpp: No such file or directory
>
> I would say the problem is not zlib, but missing C++ compiler (at least on
> my machine, /lib/cpp eventually points to /usr/bin/cpp-5), although I don't
> know why ./configure would catch that problem earlier since a successful
> report contains:
>
>   C compiler: clang -O2 -Wall -pedantic -Wextra
>   C++ compiler:   clang++ -std=c++14 -fexceptions
>
> The checking phase reports only about C compiler, so the difference is
> perhaps there.
>
> checking for gcc... clang
> checking whether the C compiler (clang -O2 -Wall -pedantic -Wextra -s)
> works... yes
> checking whether the C compiler (clang -O2 -Wall -pedantic -Wextra -s) is
> a cross-compiler... no
> checking whether we are using GNU C... yes
> checking whether clang accepts -g... yes
>
>
>
> On Fri, Nov 9, 2018 at 10:58 PM Michael Barton 
> wrote:
> >
> > I could see that it could not find zlib in the configure output. I don't
> know why, since I DO have zlib in the appropriate place
> >
> > MIchael
> >
> > On Nov 9, 2018, at 4:21 PM, Markus Neteler  wrote:
> >
> > Just scroll to the end of the file.
> >
> >
> > ; return 0; }
> > configure:5066: checking for socket in -lsocket
> > configure:5083:
> > /Applications/GRASS-7.4.2.app/Contents/Resources/bin/clang -o conftest
> > -g -O2-I/Applications/GRASS-7.4.2.app/Contents/Resources/include
> > -L/Applications/GRASS-7.4.2.app/Contents/Resources/lib conftest.c
> > -lsocket   1>&5
> > ld: library not found for -lsocket
> > clang-4.0: error: linker command failed with exit code 1 (use -v to
> > see invocation)
> > configure: failed program was:
> > #line 5072 "configure"
> > #include "confdefs.h"
> > /* Override any gcc2 internal prototype to avoid an error.  */
> > /* We use char because int might match the return type of a gcc2
> >builtin and then its argument prototype would still apply.  */
> > char socket();
> >
> > int main() {
> > socket()
> > ; return 0; }
> > configure:5131: checking for location of zlib includes
> > configure:5157: checking for zlib.h
> > configure:5165: /lib/cpp
> > -I/Applications/GRASS-7.4.2.app/Contents/Resources/include conftest.c
> >
> > /dev/null 2>conftest.out
> >
> > ./configure: line 5164: /lib/cpp: No such file or directory
> > configure: failed program was:
> > #line 5160 "configure"
> > #include "confdefs.h"
> > #include 
>
>
>
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev