Trying to install OTB through docker on M1 silicon
Configuration setup
My system: MacOS M1 pro Ventura 13.0.1 Version of the OTB: 9.0.0 I installed the OTB with: trying with Binaries, Docker
If relevant, you may also provide: QGIS version: 3.34.14 Python version: 3.6.8
Docker desktop is Installed
I also have XQuartz inside but from what I understood is not necessary
Description of my issue
I carry out the following procedure:
go on docker https://hub.docker.com/r/orfeotoolbox/otb and run the following in Terminal:
< docker run -it --platform=linux/amd64 orfeotoolbox/otb:9.1.0 >
A container is created, files are inside folder “app” specifically app/otb/bin and app/otb/lib/otb/applications
The files are successfully copied to my system. Then I add the paths to qgis: application path for folder applications and folder path for the binaries. I run ok, no error yet nothing shows in QGIS
In a different instance I managed to have the OTB commands inside qgis but they would not run giving me error on missing binaries
What am I missing? Feel it should be something simple but this has prevented me from working for 2 days. Any help would be greatly appreciated, As you may tell I am not an expert programmer.
I guess you are missing the copy of ea290baffb1a:/app/otb/lib which contains all the external libraries otb uses. We have never tried copying the binaries from docker to MacOS, Do you have Rosetta installed ? (the system that translates x86_64 instructions to ARM). I’m not sure it will work outside the docker image… You may try with the Linux binaries as MacOS has a Unix background, not sure how Rosetta can handle it.
We don’t know what is the best solution for QGIS with MacOS ARM platform and OTB, that’s why we only provide command line interface via the docker image.
There is a user that told us he managed to make otb available in MacPorts. You can try that! installing OTB and QGIS via macports Install orfeotoolbox on macOS with MacPorts
Thank you so much for your fast reply. In my humble understanding I thought that by copying the binaries and the applications it would work.
I know have copied what you suggested and have three folders
bin ea290baffb1a:/app/otb/bin
lib ea290baffb1a:/app/otb/lib
applications ea290baffb1a:/app/otb/lib/otb/applications
I tried switching the paths inside the Qgis providers folder and application folder; but does not seem to appear.
Rosetta is seemingly not installable “Installing Rosetta 2 on this system is not supported.”
“we only provide command line interface via the docker image.” shouldn’t this work?
I will now try with MacPorts. Again, thank you so much!
The problem may be with your environnement variables which are placed in concordance with the paths in the docker image. I think this is why QGIS does not find it… Without Rosetta It will not be possible to make it work as the binaries are made for x86_64 architecture (Intel or AMD).
Look at the file otbenv.profile, and adapt the path with the path to the copied lib/bin…
Update: I could partially manage with MacPorts, I downloaded the app and the Orfeo Toolbox. I set the entries the entries
‘OTB folder’ to ‘/opt/local’ and ‘OTB application folder’ to
‘/opt/local/lib/otb/applications’.
OTB functions do appear, but when running i.e. segmentation i get the following errors on qgis
ERROR: Could not find application “Segmentation”
ERROR: Module search path: none (check OTB_APPLICATION_PATH)
ERROR: Available modules: none.
It does execute the command! Just outside of QGIS. Then I load the created file to Qgis and it is visible. Same with Kmeans. I will try on with different functions. It’s just more cumbersome but seems to be working.
Hopefully there will be an easier interface in the future? thank you for the advice and all the hard work!
Can you check the access rights to this folder? Could be related to the problem.
If you get it working, we could open an issue on the gitlab to improve the documentation around QGIS and OTB on MacOS with ARM processors. The development team does not have an ARM Mac.
I tried (re)granting the access to Qgis but nothing. Running on Qgis, copying the command and pasting it on Terminal (with some changes to directories) works well for now
On the other hand I don’t get the correct syntax of the “field names for training features” of the TrainVectorClassifiers; I will make a new thread as this didn’t work