lyst / lightfm

A Python implementation of LightFM, a hybrid recommendation algorithm.
Apache License 2.0
4.67k stars 679 forks source link

Broken installation from pip on Mac M1 (with miniconda) #622

Open andrealesani opened 2 years ago

andrealesani commented 2 years ago

Hello,

I am sorry I'm quite new on GitHub, feel free to correct me or my issue if something's wrong.

I just wanted to highlight that when installing lightfm with pip install lightfm on Apple Silicon using an arm64-miniconda environment, the installation fails with the error:

clang: error: the clang compiler does not support '-march=native'.

I see that in setup.py there is an apposite check for Anaconda

  if "anaconda" not in sys.version.lower():
            compile_args.append("-march=native")

but it looks like it's not working for miniconda or something.

So I just cloned the repo, switched that compile argument to -mcpu=apple-m1 and then installation went smoothly.

Hope you can fix it for future noobs like me :)

SimonCW commented 2 years ago

Hey, I opened https://github.com/lyst/lightfm/pull/623, but I got some failing tests. I won't be available to work on it for the next few weeks, though.

Generally, installing through conda-forge gives quite good support for Apple Silicone. You should also be able to install LightFM from there.

Btw, there is also a native installer: https://github.com/conda-forge/miniforge.