david-cortes / hpfrec

Python implementation of 'Scalable Recommendation with Hierarchical Poisson Factorization'.
http://hpfrec.readthedocs.io
BSD 2-Clause "Simplified" License
79 stars 19 forks source link

hpfrec on Python 3.8 vs Python 3.9 #13

Closed ayunus22198 closed 2 years ago

ayunus22198 commented 2 years ago

Hey David, hope your day is going well. We encountered an issue when pip installing hpfrec on Python 3.9. On Python 3.8, the package works great. We made a video here so that you can take a look. Cheers!

https://user-images.githubusercontent.com/31936436/169630312-2513cd39-5efa-4058-80c5-46d5bea1bb1e.mp4

david-cortes commented 2 years ago

Thanks for the bug report. Looks like your python 3.9 environment has a different compiler configuration than the one in 3.8, and in particular, it is not configured to have the directory with your OpenMP headers in its search path, even though it accepts the correct OpenMP compilation arguments. I am able to reproduce the issue in a recent macOS setup, but it is not up to this particular package to fix that - I guess it should be an issue with setuptools or with cython.

I guess this package could avoid using OpenMP when this happens, in which case it will not have any parallelization and will thus run much slower.

In the mean time, you can try installing it with GCC from brew - for example:

brew install gcc libomp

Then

CC="gcc-11" pip install hpfrec