Installing OpenMP on Mac m1. 'clang: error: unsupported option '-fopenmp'' when running a setup.py

Viewed 624

I am using the Macbook pro M1.

I have a python package that I am trying to install which is compiling c files and has the setup.py file as

                 sources = ['*.c'],
                 include_dirs=['##Directory Name##'],
                 extra_compile_args=['-fopenmp'],
                 extra_link_args=['-lgomp'])

I have seen solutions online that say to invoke gcc-[version] but how do I build this file? If you have any solutions for a beginner to follow, please let me know.

I keep getting clang: error: unsupported option '-fopenmp'

Thanks

1 Answers

If you have homebrew installed in your mac, then do the following:

brew install libomp
Related