Saram Abbas
Saram Abbas

Reputation: 43

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

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

Upvotes: 2

Views: 2608

Answers (1)

j23
j23

Reputation: 3530

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

brew install libomp

Upvotes: 1

Related Questions