Compiling on macOS using MacPorts: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(Add page with compile/install instructions using MacPorts)
 
(Update with example from version 8.4.2)
 
(5 intermediate revisions by one other user not shown)
Line 8: Line 8:
</pre>
</pre>


Information on software, i.e. ''ports'', that can be installed can be retrieved with the '''info''' action, this is an example with the port '''grass7''':
Information on software, i.e. ''ports'', that can be installed can be retrieved with the '''info''' action, this is an example with the port '''grass''' (which is the latest version):
<pre>
<pre>
port info grass7
port info grass


grass7 @7.8.3_1 (gis)
grass @8.4.2 (gis)
Variants:            debug, ffmpeg, gui, mysql5, openblas, postgresql10, postgresql11, [+]postgresql12, proj4, [+]proj6, python35, python36, python37, [+]python38, sqlite, universal, zstd
Sub-ports:            grass-gui
Variants:            debug, debugoptimized, gui, mysql57, mysql8, openblas,
                      openmp, postgresql12, postgresql13, postgresql14,
                      postgresql15, postgresql16, [+]postgresql17, python310,
                      python311, python312, [+]python313, universal


Description:          GRASS is a Geographic Information System (GIS) used for geospatial data management and analysis.
Description:          GRASS offers powerful raster, vector, and geospatial
Homepage:            http://grass.osgeo.org/
                      processing engines in a single integrated software suite.
                      It includes tools for terrain and ecosystem modeling,
                      hydrology, visualization of raster and vector data,
                      management and analysis of geospatial data, and the
                      processing of satellite and aerial imagery. It comes with
                      a temporal framework for advanced time series processing
                      and a Python API for rapid geospatial programming. GRASS
                      has been optimized for performance and large geospatial
                      data analysis. Install the port `grass-gui` to enable
                      graphical user interface.
Homepage:            https://grass.osgeo.org


Build Dependencies:  pkgconfig
Build Dependencies:  bison, flex, pkgconfig
Library Dependencies: bzip2, freetype, fftw-3, gdal, pdal, geos, tiff, libpng, liblas, cairo, readline, python38, py38-Pillow, py38-numpy, py38-six, proj6, postgresql12
Library Dependencies: bzip2, cairo, fftw-3, freetype, gdal, geos, liblas, libpng,
Runtime Dependencies: py38-psycopg2
                      libsvm, pdal, proj, readline, sqlite3, tiff, zlib,
                      postgresql17, python313, py313-Pillow, py313-numpy,
                      py313-six
Runtime Dependencies: py313-psycopg2
Platforms:            darwin
Platforms:            darwin
License:              GPL-2+
License:              GPL-2+
Maintainers:          none
Maintainers:          Email: n_larsson yahoo com, GitHub: nilason
                      Policy: openmaintainer
</pre>
</pre>


Line 30: Line 48:
Installing GRASS with default variants:
Installing GRASS with default variants:
<pre>
<pre>
sudo port install grass7
sudo port install grass
</pre>
</pre>
will download, compile and install GRASS with dependencies ''postgresql12'', ''proj6'' and ''python38''.
will download, compile and install GRASS with dependencies ''postgresql17'' and ''python313''.


However, a customized installation may look like:
However, a customized installation may look like:
<pre>
<pre>
sudo port install grass7 +gui +python37 +zstd +sqlite
sudo port install grass +python312 +postgresql16
</pre>
</pre>
which will replace the default ''python38'' with ''python37'' and include also the ''gui'', ''sqlite'' and ''zstd'' dependencies. The default variants ''postgresql12'' and ''proj6'' will in this case also be included.
which will replace the default ''python313'' with ''python312''. The default variants ''postgresql16'' will in this case also be included.
 
'''Note:''' you need to add '''grass-gui''' port to install wxPython for GRASS graphical user interface, this in not included by default:
<pre>
sudo port install grass-gui
</pre>
 


To check if any of the installed ports (or dependencies) have been updated:
To check if any of the installed ports (or dependencies) have been updated:
<pre>
<pre>
sudo port selfupdate
port outdated
port outdated
</pre>
</pre>
Line 57: Line 82:
</pre>
</pre>


Presently, GRASS GIS installed with MacPorts can only be started from the terminal, with the command:
Installation with the port ''grass-gui'' will also install an app bundle at:
<pre>
<pre>
grass78
/Applications/MacPorts/GRASS-8.4.app
</pre>
 
You can start GRASS GIS from terminal with command:
<pre>
grass
</pre>
</pre>
or
or
<pre>
<pre>
/opt/local/bin/grass78
/opt/local/bin/grass
</pre>
</pre>
[[Category:Development]]
[[Category:Documentation]]
[[Category:Installation]]

Latest revision as of 17:48, 28 January 2026

Installing GRASS GIS with MacPorts

MacPorts is a package management system for macOS. It makes it easy to install and update any supported software — dependencies (that can be either executables or libraries) are installed and updated automatically. It is recommended to install the MacPort base software with the package installer available at macports.org where also detailed installation and usage instructions can be found. Note that Xcode is a prerequisite and that MacPorts is controlled through the Terminal with the port command.

Assuming you succeeded with the installation of the MacPorts base, the base software can be updated with:

sudo port selfupdate

Information on software, i.e. ports, that can be installed can be retrieved with the info action, this is an example with the port grass (which is the latest version):

port info grass

grass @8.4.2 (gis)
Sub-ports:            grass-gui
Variants:             debug, debugoptimized, gui, mysql57, mysql8, openblas,
                      openmp, postgresql12, postgresql13, postgresql14,
                      postgresql15, postgresql16, [+]postgresql17, python310,
                      python311, python312, [+]python313, universal

Description:          GRASS offers powerful raster, vector, and geospatial
                      processing engines in a single integrated software suite.
                      It includes tools for terrain and ecosystem modeling,
                      hydrology, visualization of raster and vector data,
                      management and analysis of geospatial data, and the
                      processing of satellite and aerial imagery. It comes with
                      a temporal framework for advanced time series processing
                      and a Python API for rapid geospatial programming. GRASS
                      has been optimized for performance and large geospatial
                      data analysis. Install the port `grass-gui` to enable
                      graphical user interface.
Homepage:             https://grass.osgeo.org

Build Dependencies:   bison, flex, pkgconfig
Library Dependencies: bzip2, cairo, fftw-3, freetype, gdal, geos, liblas, libpng,
                      libsvm, pdal, proj, readline, sqlite3, tiff, zlib,
                      postgresql17, python313, py313-Pillow, py313-numpy,
                      py313-six
Runtime Dependencies: py313-psycopg2
Platforms:            darwin
License:              GPL-2+
Maintainers:          Email: n_larsson yahoo com, GitHub: nilason
                      Policy: openmaintainer

The variants are options for a port that can be chosen at installation. The variants marked with a +, are included by default.

Installing GRASS with default variants:

sudo port install grass

will download, compile and install GRASS with dependencies postgresql17 and python313.

However, a customized installation may look like:

sudo port install grass +python312 +postgresql16

which will replace the default python313 with python312. The default variants postgresql16 will in this case also be included.

Note: you need to add grass-gui port to install wxPython for GRASS graphical user interface, this in not included by default:

sudo port install grass-gui


To check if any of the installed ports (or dependencies) have been updated:

sudo port selfupdate
port outdated

To update outdated ports:

sudo port upgrade outdated

Using GRASS GIS installed with MacPorts

A standard installation of MacPorts will install ports at:

/opt/local/

Installation with the port grass-gui will also install an app bundle at:

/Applications/MacPorts/GRASS-8.4.app

You can start GRASS GIS from terminal with command:

grass

or

/opt/local/bin/grass