BreezeWhite / oemer

End-to-end Optical Music Recognition (OMR) system. Transcribe phone-taken music sheet image into MusicXML, which can be edited and converted to MIDI.
https://breezewhite.github.io/oemer/
MIT License
394 stars 46 forks source link

Installation Issue - Mac M1 #16

Closed rreben closed 1 year ago

rreben commented 2 years ago

Describe the bug Oemer can not be installed via pip install oemer

Input Image I tried to install oemer on MacOS 12.6 M1 Chip. Clean virtual environment with the python3.9 interpreter. pip install breaks see error log below. Any help appreciated.

Full Traceback

-install-x2b00w4b/numpy_1e2ede17ae15448f90cb34a16c221a6a/numpy/distutils/command/build_src.py", line 378, in generate_sources
                source = func(extension, build_dir)
              File "numpy/core/setup.py", line 663, in get_mathlib_info
                raise RuntimeError("Broken toolchain: cannot link a simple C program")
            RuntimeError: Broken toolchain: cannot link a simple C program
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: metadata-generation-failed

      × Encountered error while generating package metadata.
      ╰─> See above for output.

      note: This is an issue with the package mentioned above, not pip.
      hint: See above for details.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Command You Execute pip install oemer on clean virtual environment with python3.9

BreezeWhite commented 2 years ago

Hi, did you try downgrade to python 3.8 as pointed out in another issue? I also searched the numpy error RuntimeError: Broken toolchain: cannot link a simple C program, and found a similar solution here.

Sorry I don't have M1 Mac to test and debug.

ThomasPosen commented 2 years ago

I am having problems installing on my M1 Mac. I get this error: " clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly" Which I guess originated from this command: "extra options: '-faltivec -I/System/Library/Frameworks/vecLib.framework/Headers'"

Any idea if this can be fixed?

BreezeWhite commented 1 year ago

I have figured out the root cause and fixed the issue in the new version v0.1.5. The root cause is the incompatibility of the old scikit-learn version with the new Mac M-series chip, which requires to re-compile the old version numpy to work on the new chip architecture. After upgrading to use the newest scikit-learn, the problem solved.