raidionics / Raidionics

Software for automatic segmentation and generation of standardized clinical reports of brain tumors from MRI volumes

Home Page:https://raidionics.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: macOS ARM CI build fails due to dylib not found

andreped opened this issue · comments

Describe the bug
Bug: macOS ARM CI build fails. This happened after adding RT-Struct, which introduced OpenCV, which in-turn depends on ffmpeg. It seems like after installing the latest artifact, the program fails as Raidionics fails to find the necessary *.dylib files that comes with ffmpeg. There is likely a hook issue that needs to be addressed.

Computer settings (please complete the following information):

  • Operating System: [e.g., Windows 10] macOS
  • Processor (CPU) type: [e.g., Intel i5] ARM (M1)
  • Python (version): 3.8.10

Error log:
In the workflow log, the below can be observed:

37735 DEBUG: Collecting submodules for cv2
32 DEBUG: collect_submodules - scanning (sub)package cv2
283 WARNING: Failed to collect submodules for 'cv2' because importing 'cv2' raised: ImportError: dlopen(/Users/medtek/Documents/Raidionics/actions-runner/_work/Raidionics/Raidionics/tmp/venv/lib/python3.8/site-packages/cv2/cv2.cpython-38-darwin.so, 0x0002): Library not loaded: /opt/homebrew/opt/ffmpeg/lib/libavcodec.58.dylib
  Referenced from: /Users/medtek/Documents/Raidionics/actions-runner/_work/Raidionics/Raidionics/tmp/venv/lib/python3.8/site-packages/cv2/cv2.cpython-38-darwin.so
  Reason: tried: '/opt/homebrew/opt/ffmpeg/lib/libavcodec.58.dylib' (no such file), '/usr/local/lib/libavcodec.58.dylib' (no such file), '/usr/lib/libavcodec.58.dylib' (no such file)
38105 DEBUG: collect_submodules - found submodules: []
38105 DEBUG: Collecting data files for cv2
38106 DEBUG: collect_data_files - Found files: []

The exact same issue has been observed on M1 before (see here).

This was because ffmpeg was not installed, but Im not sure that is the main reason here.

It was observed a linking issue for macOS in opencv-python, which seems to have been resolved now (see here). Thus, simply upgrading opencv-python might be the way to go. This fix was made in October 2021, but the opencv-python version used today in Raidionics is from July 2021, hence, upgrading may fix this!

Fixed in 7f40002.

But should verify that this works locally on all respective OS, @dbouget (as we upgraded opencv-python, althought not by much).