openPupil / PyPupilEXT

PyPupilEXT allows to detect the pupil diameter in images captured by stereo- and mono camera systems. The pupil diameter can be detected using one of the state-of-the-art open-source algorithms, Starburst, Swirski2D, ExCuSe, ElSe, PuRe and PuReST.
Other
33 stars 6 forks source link

ARM/Silicon Mac Install Instructions #9

Closed williamwiebe closed 1 month ago

williamwiebe commented 1 year ago

Hardware: Apple M1 Max MacBook Pro (2021) System: Ventura 13.6.2

Apple clang version 15.0.0 (clang-1500.0.40.1) Target: arm64-apple-darwin22.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

  1. I installed the following packages with homebrew (specified here), after having issues with cmake and nasm which caused the ffmpeg install to fail:

        brew install pkg-config
        brew install cmake
        brew install nasm
        brew install gcc
        brew install llvm
        brew install libomp
        brew install libmpc
        brew install tree
  2. After cloning the repository in installation step 1B, I pulled the current master of oneTBB and replaced the submodule downloaded at PyPupilEXT/3rdparty/oneTBB. This was necessary because the Apple clang compiler failed with this issue, which has been fixed in subsequent releases.

  3. My build finally compiled! Except when I tried to run the files, it threw an [ImportError: dlopen(): Symbol not found:.... Expected in: flat namespace] like this and this. I take it it was because PyPupilEXT specifies x86_64/x64 architectures for the compilers, but my clang was compiling for arm64.

And now it's running. I think those are all my emendations. Hope this is useful to someone!

BZandi commented 1 month ago

Thank you very much for the instructions! I have updated the CMakeLists.txt and the setup.py. The build process should now work on Apple Silicon out of the box. See the install instructions in the readme for more information.