[GRASS-dev] GRASS GIS installation on Mac OSX [was : Re: [GRASS GIS] #2942: Startup after Novice Install]

Anna Petrášová kratochanna at gmail.com
Thu Jun 29 05:16:01 PDT 2017


On Jun 29, 2017 3:38 AM, "Rainer Krug" <rainer_krug at icloud.com> wrote:


On 29 Jun 2017, at 06:09, Anna Petrášová <kratochanna at gmail.com> wrote:

On Wed, Jun 28, 2017 at 3:17 AM, Rainer Krug <rainer_krug at icloud.com> wrote:


On 27 Jun 2017, at 14:32, Anna Petrášová <kratochanna at gmail.com> wrote:

On Tue, Jun 27, 2017 at 3:26 AM, Moritz Lennert
<mlennert at club.worldonline.be> wrote:

On 27/06/17 01:02, GRASS GIS wrote:


#2942: Startup after Novice Install
------------------------+-------------------------
Reporter:  pactriglo  |      Owner:  grass-dev@…
    Type:  defect     |     Status:  new
Priority:  normal     |  Milestone:  7.0.6
Component:  Startup    |    Version:  7.0.3
Resolution:             |   Keywords:
     CPU:  OSX/Intel  |   Platform:  MacOSX
------------------------+-------------------------

Comment (by annakrat):

Use homebrew from osgeo4mac:

{{{
brew tap osgeo/osgeo4mac
brew install grass7
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2942#comment:5>
GRASS GIS <https://grass.osgeo.org>



Is this the official recommendation on how to install GRASS GIS on Mac OSX
these days ?


I was recommending this way in our recent workshops because it's the
only way which works with SIP enabled. It's far from ideal because it
doesn't always work, sometimes people have several Python
installations on Mac which complicates things


I have the system python, Python 2 (home-brew) and python-3 (also home-brew
install), and it installs without problems. Maybe because I have the hebrew
python install.

It usually get’s tricky if you are mixing different approaches of installing
programs (same on Linux). That is the reason why, where possible, am using
home-brew. I have, for example, no idea how home-brew / grass works together
with python installed via the apple way go MacPorts. This is something which
should be asked on the home-brew mailing list, or better, stackexchange.


also people have Anaconda these days. You have to be careful about the
order of Pythons in your PATH. (It sort of brings the actual meaning
of word python to my mind…)


I have the following python defined:

08:53:45 ~$ which python
/usr/local/bin/python
09:15:36 ~$ python --version
Python 2.7.13
09:15:43 ~$


which is the home-brew python.


Related to this, GRASS uses GRASS_PYTHON to force which Python is used.


GRASS 7.2.0 (grass):~ > echo $GRASS_PYTHON
python
[Raster MASK present]
GRASS 7.2.0 (grass):~ > which python
/usr/local/bin/python
[Raster MASK present]
GRASS 7.2.0 (grass):~ > python --version
Python 2.7.13
[Raster MASK present]
GRASS 7.2.0 (grass):~ >



and for some reason, ctypes don't work there (so no PyGRASS or digitizer or
3D view).


Never used them, but how can I test? Could you give me an example and I
could try on my machine.


Pretty simple, run any of the examples here:

https://grass.osgeo.org/grass73/manuals/libpython/pygrass_vector.html


OK - I am new to python (wrote my first lines of python code about two
weeks ago…). So I am getting

importError: No module named grass.pygrass.vector

in a fresh python session.


Do you run this in GRASS session? Outside it won't work.



The rest is to be tested in the GUI, digitizer and 3D view are
switched on in Map Display.



I see the following in the Map Display menu - does this mean, that they are
not working?




Sorry, I meant Map Display toolbar. There is drop down widget to select
digitizer and 3d view.



And the installation takes time on slower computers because it's compiling
everything.


Actually, there is a bottle (binary) available for grass 7 Sierra

09:02:43 ~$ brew info grass7
osgeo/osgeo4mac/grass7: stable 7.2.0 (bottled)
Geographic Resources Analysis Support System
http://grass.osgeo.org/
/usr/local/Cellar/grass7/7.2.0 (3,751 files, 69.6MB) *
 Poured from bottle on 2017-06-28 at 08:54:11
From:
https://github.com/osgeo/homebrew-osgeo4mac/blob/master/Formula/grass7.rb
==> Dependencies
Build: pkg-config ✔
Required: gettext ✔, readline ✔, flex ✔, bison ✔, lbzip2 ✔, gdal2 ✔, libtiff
✔, unixodbc ✔, fftw ✔, wxpython ✔, cairo ✔, ghostscript ✔
Optional: openblas ✔, liblas ✔, netcdf ✔, ffmpeg ✔
==> Requirements
Required: unlinkedgrass7 ✘, python ✔, numpy (python module) ✔, x11 ✔
Optional: postgresql ✔, mysql ✔
==> Options
--with-ffmpeg
Build with ffmpeg support
--with-gdal-1
Build with GDAL/OGR v1.x instead of v2.x
--with-liblas
Build with liblas support
--with-mysql
Build with mysql support
--with-netcdf
Build with netcdf support
--with-openblas
Build with openblas support
--with-postgresql
Build with postgresql support
--without-gui
Build without WxPython interface. Command line tools still available.
09:03:02 ~$


I just re-installed it. If you use non-default options, grass7 get’s usually
compiled - that is correct.


I see. On a recent workshop we did, a lot of people had problems with
installing GRASS with homebrew, and the most annoying part was that
they had all kinds of errors and we were able to figure out only some
of them.


Interesting. Did you raise these with Larry Shaffer https://github.com/dak
carto who is maintaining the osgeo4mac tap?

I will try to setup a VirtualBox VM running Sierra and go through the
complete install from the clean system. I will report back - please remind
if you don’t hear anything.



No, I should have, but most problems I encountered would be hard to
reproduce anyway and I didn't have access to their laptops. But the problem
with ctypes should be reproducible.




Michael's binaries work only when SIP is disabled. It's fairly easy to
disable it, but still, you have to boot into recovery system, open
command line and run a command there, so it looks little scary for
most people.


Absolutely - It makes sense to have SIP, and I am not prepared to disable it
if I can avoid it - which I can by using homebrew.


Even your own compilation is fairly difficult, one reason is that
official wxPython 3 mac package is old and new macs refuse to open and
install. So in general I am getting sick of this issue and
unfortunately I don't have time nor knowledge to do anything about it.


You are running into the same problems as with the pre-build binaries from
Michael. I managed to get it to compile and run, but it was hackisch and not
all features worked - so no options. If you gave instructions once on this
mailing list but don’t have the mails at hand.


I used this:
https://stackoverflow.com/a/34622956/1058453

I haven't tried the new wxPython Phoenix on Mac yet.


I have installed it from home-brew, if I am not completely mistaken:

$ pip2 search wx
...
wxPython-common (2.6.3.3)                       - Cross platform GUI
toolkit for Python
  INSTALLED: 3.0.2.0
  LATEST:    2.6.3.3


and


9:32:24 ~/tmp$ brew info wxpython
wxpython: stable 3.0.2.0 (bottled)
Python bindings for wxWidgets
https://www.wxwidgets.org/
/usr/local/Cellar/wxpython/3.0.2.0 (992 files, 40MB) *
  Poured from bottle on 2014-12-06 at 18:36:45
From: https://github.com/Homebrew/homebrew-core/blob/master/Formul
a/wxpython.rb
==> Dependencies
Required: wxmac ✔
09:34:42 ~/tmp$ brew info wxmac
wxmac: stable 3.0.2 (bottled), devel 3.1.0, HEAD
Cross-platform C++ GUI toolkit (wxWidgets for macOS)
https://www.wxwidgets.org
/usr/local/Cellar/wxmac/3.0.2_4 (810 files, 24.6MB) *
  Poured from bottle on 2016-11-02 at 19:08:02
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/wxmac.rb
==> Dependencies
Required: jpeg ✔, libpng ✔, libtiff ✔
==> Options
--with-static
build static libraries
--with-stl
use standard C++ classes for everything
--devel
Install development version 3.1.0
--HEAD
Install HEAD version
09:34:47 ~/tmp$



This is wxpython 3, the new one is 4.
Sorry, I am traveling, so I can give only limited response.

Anna



My students with MacOSX have been a bit confused about the different ways to
download GRASS GIS, especially when they were trying to install it in
parallel with QGIS for cross-usage (grass plugin and processing toolbox).


this is something I haven't even tried. If some of your students find
better ways of installing GRASS, let me know.


As far as I know, you have to install both via home-brew (and if you are
mentioning the long compilation times of GRASS, start the compilation of
QGIS in home-brew in the evening! QGIS is beast to install via homebrew).

But: I haven’t used QGIS in a long time.

So to sum up:

1) mixed installs (Apple;e approach (.pkg, .dmg, Frameworks, …) combined
with home-brew, you likely will have problems.
2) grass 7 installs via home-brew from a binary on Sierra without
compilation
3) QGIS - grass under home-brew should work if both are installed under
home-brew, otherwise ask on the QGIS mailing list.


Thanks for any testing/advice. We should probably update official
instructions on the main website if we agree on what they should be.


Yes - I am still wandering, why there is a SIP issue with a GIS program,
but Michael and others explained it a few times here and definitively have
a better understanding of this. Ih the long run, one should probably
address this issue in the code base of GRASS so that installation via the
official way is possible without hassles, but an approved / official
installation procedure for using home-brew should be available.

Rainer


Anna


Hope this helps,

Cheers,

Rainer


Anna


BTW, in the homebrew formula for grass7 [1] I see:

stable do
  url "https://grass.osgeo.org/grass72/source/grass-7.2.0.tar.gz"

i.e. 7.2.0, instead of 7.2.1.

Maybe we should create a symbolic link


https://grass.osgeo.org/grass72/source/current_stable.tar.gz ->
https://grass.osgeo.org/grass72/source/grass-7.2.1.tar.gz

?

Or even

https://grass.osgeo.org/current_stable.tar.gz ->
https://grass.osgeo.org/grass72/source/grass-7.2.1.tar.gz

to make it easier for build scripts such as these to always point to the
latest stable version ?


Moritz

[1]
https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/Formula/grass7.rb
_______________________________________________
grass-dev mailing list
grass-dev at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

_______________________________________________
grass-dev mailing list
grass-dev at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20170629/62f86f43/attachment-0001.html>


More information about the grass-dev mailing list