Getting gpt working on Mac OS

Hi there,

I have been using the Graph Processing Tool for processing some Sentinel 1 data through the GUI and need to get it working in the Mac terminal, for eventual use of scaling it up to much larger workflows on a Linux system.

However I am struggling to get it working, as the command snap --help is not recognised, (even though snap is correctly installed) and the gpt command is taken up by a partitioning software of the same name which is needed on this work laptop.

The snap directory itself is located in /Users/chris/.snap/ and the graph xmls themselves are further down the directory tree in graphs/User\ Graphs/*.xml

How can I get the snap gpt working on Mac in this situation? Or would a virtual machine/batch processing tool like pyroSAR be a better alternative?

Thanks in advance,

Chris.

The partitioning software hides SNAP gpt in your case. You need to use the full path instead.
By default SNAP is installed at /Applications/snap
So you need to invoke

/Applications/snap/bin/gpt -help

The directory /Users/chris/.snap/ you have mentioned is used for application data but does not contain the executables.

Many thanks for that, worked like a charm for the gpt graphs I have already.

Hi Chris and Marco,

I´m running a processDataset.bash file on a Mac terminal and I have got this retrieval:
zsh: command not found: processDataset.bash

I don´t know if it is appropriate for Mac or if there is any problem in the configuration of processDataset.

Could you tell me if the parameters are correctly configured?

processDataset.bash (1.8 KB)

Thanks

Marcela

Maybe you need to invoke it like

> ./ processDataset.bash

I have put it in the command line and it works. However, I have got another problem about realpath and gptpath.

./processDataset.bash: line 60: /Users/pereira/Applications/snap/bin/gpt: No such file or directory
./processDataset.bash: line 58: realpath: command not found

I have seen the topic “Bulk processing with GPT - command not found” and I´m working on it, but I think maybe the problem is on it:


Would it be possible?

Here I have no idea.
The path to gpt looks good, though.

Hi Marco,
I have tried on terminal :
/Applications/snap/bin/gpt –h

and I have obtained two warnings:

  • INFO: org.esa.s2tbx.dataio.gdal.activator.GDALDistributionInstaller: No distribution folder found on Macintosh.
  • java.lang.IllegalStateException: Operator SPI not found for operator [–h]
    I think that GDAL was installed by default with SNAP. Is it correct?

Have you got any idea?

Thanks in advance
Marcela

Hi,
I think it is not the minus sign before the ‘h’
Yours looks like this –h
When I write it, it looks like this: -h
So, please try a “different” minus.

GDAL libraries are installed along with the s2tbx.

Thanks Marco. It was the problem.

Marcela

Dear marpet, my OS is Macos. I have installed the SNAP graphical interface (.dmg package) and I would like to use gpt. However, when I run gpt help

I get this error message

(base) Luca@MacBook-Pro ~ % /Applications/snap/bin/gpt -h

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL 3.0.2 found on system. JNI driver will be used.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 3.0.2 set to be used by SNAP.
Native library load failed.
java.lang.UnsatisfiedLinkError: /Users/Luca/.snap/auxdata/gdal/gdal-3-0-X-jni/libgdalalljni.dylib: dlopen(/Users/Luca/.snap/auxdata/gdal/gdal-3-0-X-jni/libgdalalljni.dylib, 0x0001): Library not loaded: /usr/local/lib/libgdal.26.dylib
Referenced from: /Users/Luca/.snap/auxdata/gdal/gdal-3-0-X-jni/libgdalalljni.dylib
Reason: tried: ‘/usr/local/lib/libgdal.26.dylib’ (no such file), ‘/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libgdal.26.dylib’ (no such file), ‘/usr/local/lib/libgdal.26.dylib’ (no such file), ‘/usr/lib/libgdal.26.dylib’ (no such file, not in dyld cache)
SEVERE: org.esa.s2tbx.dataio.gdal.GDALLoader: Failed to initialize GDAL native drivers. GDAL readers and writers were disabled.java.lang.reflect.InvocationTargetException
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.
Usage:
gpt | [options] [ …]

How can I fix it?