matrix-profile-foundation / matrixprofile

A Python 3 library making time series data mining tasks, utilizing matrix profile algorithms, accessible to everyone.
https://matrixprofile.org
Apache License 2.0
362 stars 62 forks source link

Unable to install package - error: unsupported option '-fopenmp' #90

Open Lawiss opened 2 years ago

Lawiss commented 2 years ago

Describe the bug Hello, I'm trying to install tsfresh==0.19.0 on my macOS 12.1 (arm) but the installation fail when installing matrixprofile, at build step with the folliwing error :

clang: error: unsupported option '-fopenmp'
      error: command '/usr/bin/clang' failed with exit code 1

I tried with python 3.8 and 3.9, same error.

To Reproduce Steps to reproduce the behavior:

  1. Create a python 3.9 environment on macOS X 12.1 arm
  2. conda install llvmlite (pip install fails)
  3. pip install tsfresh
  4. See error

Expected behavior tsfresh installation without errors.

Desktop (please complete the following information):

jarhed commented 2 years ago

I've fixed this by following the directions here to install gcc and whatnot through brew then forced gcc to compile using:

CC=gcc pip install matrixprofile

Kinda proud of myself, this is way outside my wheelhouse :)

mdhanna commented 2 years ago

The solution above (CC=gcc pip install matrixprofile) did not work for me.

My problem was that I was attempting to install in a Python 3.10 environment and tsfresh only supports up to Python 3.9. I rolled my environment back to Python 3.9 and was able to install without any issues.

traddo commented 2 years ago

vi setup.py add

os.environ["CC"] = "/usr/local/Cellar/gcc/12.2.0/bin/g++-12"
os.environ["CXX"] = "/usr/local/Cellar/gcc/12.2.0/bin/g++-12"

add

language="c++",

into Extension(...)

arresejo commented 2 years ago

The solution I've found was to downgrade the Python version to 3.10.8 using pyenv in order to easily manage multiple Python versions (useful resource: https://opensource.com/article/19/5/python-3-default-mac).