ABI-Software / abics

ABI comfort simulator.
4 stars 3 forks source link

Running on Mac OSX #3

Open natbutter opened 2 years ago

natbutter commented 2 years ago

Is anyone successfully running this on any version of OS X?

I cannot get it to run.

After installing the conda environment, and launching, I got this error dialog popping up with the splash screen dlopen(/Users/admin/opt/miniconda3/envs/abics_env/lib/python3.7/site-packages/opencmiss/zinc/_context.so, 2): Library not loaded: /Library/Frameworks/Python.framework/Versions/3.7/Python Referenced from: /Users/admin/opt/miniconda3/envs/abics_env/lib/python3.7/site-packages/opencmiss/zinc/_context.so Reason: image not found Install or contact your administrator

Which seemed to indicate that opencmiss.zinc is trying to use the system Python (which did not exist) rather than conda.

So I installed a system version of Python in /Library/Frameworks to keep it happy, but then am faced with the next error: dlopen(/Users/admin/opt/miniconda3/envs/abics_env/lib/python3.7/site-packages/opencmiss/zinc/_context.so, 2): Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.9.dylib Referenced from: /Users/admin/opt/miniconda3/envs/abics_env/lib/python3.7/site-packages/opencmiss/zinc/libzinc.3.dylib Reason: image not found Install or contact your administrator

Rather than chasing dependencies on this, does anyone have a solution?

I have tried many different version combinations of python, pyqt, opencmiss.zinc, and OSX. At best I get the above results, at worst I just get a segmentaion fault.

Windows works fine, but would like to get the Mac version working too.

hsorby commented 2 years ago

Running: otool -L /Users/admin/opt/miniconda3/envs/abics_env/lib/python3.7/site-packages/opencmiss/zinc/_context.so should hopefully shed some light on what has gone wrong.

natbutter commented 2 years ago

Hey thanks for following up!

Output is as below:

/Library/Frameworks/Python.framework/Versions/3.7/Python (compatibility version 3.7.0, current version 3.7.0)
@rpath/libzinc.3.dylib (compatibility version 3.0.0, current version 3.6.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 800.7.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)

Not sure what to look for here.

I did end up installing the libjpeg dependency and that just led to consistent segfaults on launch (without reaching the splash screen). Debug output of the segfault:

$ python userinterface/ABICS.py 
loading userinterface
Qt WebEngine seems to be initialized from a plugin. Please set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute before constructing QGuiApplication.
Fatal Python error: Segmentation fault

Current thread 0x00007fff97be3380 (most recent call first):
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1043 in create_module
  File "<frozen importlib._bootstrap>", line 583 in module_from_spec
  File "<frozen importlib._bootstrap>", line 670 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1035 in _handle_fromlist
  File "/Users/admin/opt/miniconda3/envs/abics_env/lib/python3.7/site-packages/opencmiss/zinc/context.py", line 13 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 728 in exec_module
  File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "/Users/admin/Desktop/NATWORK/abics/userinterface/RadiationFluxWizard.py", line 48 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 728 in exec_module
  File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "/Users/admin/Desktop/NATWORK/abics/userinterface/Simulator.py", line 47 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 728 in exec_module
  File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "userinterface/ABICS.py", line 103 in <module>
Segmentation fault: 11

Please let me know if you have any advice.

hsorby commented 2 years ago

Do you have a Python 3 that is at least version 3.7 that is not an Anaconde/miniconda Python? If you do can you try:

python3 -m venv venv_test
source venv_test/bin/activate
pip install opencmiss.zinc

Then try:

python
>>> from opencmiss.zinc.context import Context
natbutter commented 2 years ago

Thanks, this imported successfully... but then same Segmentation fault: 11 when trying to run.