raidionics / Raidionics

Software for automatic segmentation and generation of standardized clinical reports of brain tumors from MRI volumes
https://raidionics.github.io/
BSD 2-Clause "Simplified" License
31 stars 4 forks source link

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

Closed andreped closed 11 months ago

andreped commented 11 months ago

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):

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: []
andreped commented 11 months ago

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!

andreped commented 11 months ago

Fixed in 7f40002ffd986950f83b0c4d4041fcd2d611e8f1.

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