Difference between revisions of "Compiling on macOS using Homebrew"

From GRASS-Wiki
Jump to: navigation, search
(How to install GRASS GIS 7.1 SVN Head)
(How to install GRASS GIS 7.1 SVN Head)
Line 28: Line 28:
 
       brew update
 
       brew update
  
Finally, GRASS 7.1 SVN can be installed by
+
If you want to use the option '''--with-liblas''' make sure that liblas is build using the correct installed version of gdal by running
  
       brew install grass-71
+
       brew install libblas
 +
      brew install --build-from-source libblas
  
This should be it.
+
The first comand installs from bottles (binary) when available, and the second command reinstalls libblas by building it from source, therby using installed dependencies.
  
When using the option '''--with-liblas''', it is possible that you get the following error:
+
Otherwise you might get the following error when using the option '''--with-liblas''':
  
 
       checking whether to use libLAS... yes
 
       checking whether to use libLAS... yes
Line 40: Line 41:
 
       configure: error: *** Unable to locate libLAS library.
 
       configure: error: *** Unable to locate libLAS library.
  
Thanks to Glynn Clements, there is a solution (see [http://article.gmane.org/gmane.comp.gis.grass.devel/65254 the mail on gmane]): liblas was build against a non-installed gdal version.
+
Thanks to Glynn Clements for identifying this error (see [http://article.gmane.org/gmane.comp.gis.grass.devel/65254 the mail on gmane]).
  
The solution is simple: force homebrew to install from source, even when a bottle exists. So:
+
Finally, GRASS 7.1 SVN can be installed by
  
       brew reinstall --build-from-source liblas
+
       brew install grass-71
 
 
and try to install grass-71 again. Now it should work, even with the optin '''--with-liblas'''.
 
  
 +
This should be it.
  
 
If this does not work, please leave comments at [https://github.com/rkrug/homebrew-head-only/issues the issues page of the tap] or at the grass-dev mailing list.
 
If this does not work, please leave comments at [https://github.com/rkrug/homebrew-head-only/issues the issues page of the tap] or at the grass-dev mailing list.

Revision as of 07:32, 6 August 2015

What is homebrew and why use it

To quote from their website:

Homebrew is the missing package manager for OS X:

  • easy to install
  • does not need administrator privileges
  • installs packages to their own directory and then symlinks their files into /usr/local

For further information to install it and how to use it, see the Homebrew website and the Wiki.

The formulas to install programs are called recipes and they make it possible to install several version of the same program (as well as HEAD of different Version Control Systems) at the same time which can then be symlinked. This makes it perfect for the purpose of in=stalling HEAD of GRASS GIS for testing purposes.

How to install GRASS GIS 7.1 SVN Head

I assume that homebrew is installed and working.

Different recipes are organized in so called taps which need to be added to homebrew by using brew tap command. The GRASS GIS 7.1 recipes are in the following github repo:

https://github.com/rkrug/homebrew-head-only

In addition, GRASS GIS has dependencies which can be found in the homebrew/science tap.

To add these two to homebrew, one has to use the commands

     brew tap rkrug/head-only  
     brew tap homebrew/science
     brew update

If you want to use the option --with-liblas make sure that liblas is build using the correct installed version of gdal by running

     brew install libblas
     brew install --build-from-source libblas

The first comand installs from bottles (binary) when available, and the second command reinstalls libblas by building it from source, therby using installed dependencies.

Otherwise you might get the following error when using the option --with-liblas:

     checking whether to use libLAS... yes
     checking for liblas-config... /usr/local/opt/liblas/bin/liblas-config
     configure: error: *** Unable to locate libLAS library.

Thanks to Glynn Clements for identifying this error (see the mail on gmane).

Finally, GRASS 7.1 SVN can be installed by

     brew install grass-71

This should be it.

If this does not work, please leave comments at the issues page of the tap or at the grass-dev mailing list.

From here

  • There is an osgeo4mac which contains recipes for GRASS GIS 6.4 and 7.0 and other GIS tools - highly re=commendable tap!
  • by running
     brew test -v grass-71

you can run GRASS GIS tests but they are not implemented as they should be - work in progress.