[SOLVED] Installation on Apple Silicon

I have a partial conda openalea environment running, but I’m having trouble with plantgl.

When I run
from openalea.plantgl.all import *

I get errors like
dlopen(/Users/neilwhite/miniconda3/envs/openalea/lib/python3.10/site-packages/OpenAlea.PlantGL-3.20.1-py3.10.egg/openalea/plantgl/scenegraph/_pglsg.so, 0x0002): Library not loaded: @rpath/libjpeg.8.dylib

Any thoughts?

Cheers

Neil

1 Like

Hi Neil,
Thank you for your question!

I think @rvezy works with Openalea on Apple Silicon - he might know how to help you.

However, probably you need to wait a little bit because many people are now on holiday

Hey @Neil_White, yes PlantGL is not compiled for Apple Silicon yet. Thomas just prepared a docker image for that. I’ll test it by the end of the week and I’ll let you know.

1 Like

Thanks for the update I look forward to the Docker image.

1 Like

Hi @Neil_White, @thomasA found a way to install it directly using conda. We can run plantscan3d on Apple Silicon via rosetta.

You just have to create a new environment that is defined with the x64 architecture, and install the corresponding Python version:

CONDA_SUBDIR=osx-64 conda create -n PS3D python=3.10
conda activate PS3D
conda config --env --set subdir osx-64
conda install -c fredboudon -c conda-forge openalea.plantgl openalea.mtg pyqglviewer -y
conda install -c fredboudon -c conda-forge openalea.plantscan3d -y

Now that your environment is created, you can run plantscan3d like with any other architecture:

conda activate PS3D # do this only if not activated yet
plantscan3d

The docker image is coming soon, but there are still some issues. But using conda directly should be even faster.

1 Like

Hi @rvezy , it finally works!
However, it was quite tricky to install.
Somehow, plantscan3d needs the dynamic library libjpeg.8.dylib and with the code you shared, version 9 gets installed. Furthermore, it needs the libjpeg.8.dylib x86-64 version and not the ARM one. So I had to manually install libjpeg.8.dylib using Rosetta2 to install it with x86-64 architecture, and it finally worked.

None of these changes would have been possible without the help of GPT-4

Hi @Michele_Butturini

Could you provide instructions for installing this with Rosetta2?

1 Like

Hi Niel,
sure

I don’t fully remember… but this what i remember
first you do what @rvezy suggested

CONDA_SUBDIR=osx-64 conda create -n PS3D python=3.10
conda activate PS3D
conda config --env --set subdir osx-64
conda install -c fredboudon -c conda-forge openalea.plantgl openalea.mtg pyqglviewer -y
conda install -c fredboudon -c conda-forge openalea.plantscan3d -y

then your remove the libjpeg.9.dylib (look for it in the directory)

then you enable rosetta by ticking Open Using Rosetta.

Download 8d version → Directory Listing of /files

Then

softwareupdate --install-rosetta --agree-to-license

arch -x86_64 /bin/bash

cd jpeg-8d
./configure
make
sudo make install
cp ./.libs/libjpeg.8.dylib /usr/local/lib/libjpeg.8.dylib

In my case more or less this was the procedure

However try placing the errors you might get in chat gpt

Let us know how it goes!

I have the plot of the plantframe running. Thanks everybody that had a hand in this. I’m seeing the following error, which looks like a typo

Is this something I can fix? Ignoring it is working for now.

1 Like

I never noticed that - is this happening using plantscan3d?

Yes, I get it after following the installation recipe shown earlier

@Neil_White do you still encounter this problem? I am sorry I cannot help. Maybe you could consider to directly contact the developers

Thank you for checking, the PS3D approach solved the issue for me.