C.Marsden
C.Marsden

Reputation: 53

Compiling FFTW, don't know how to enable OpenMP

So I'm trying to compile FFTW with shared and OpenMP enabled, like this:

./configure --enable-shared --enable-openmp

And I'm getting the error:

checking for OpenMP flag of C compiler... unknown
configure: error: don't know how to enable OpenMP

I'm a little new to this kind of thing, but I'm fairly sure that whatever compiler the script is using can't see OpenMP, but it's beyond my skill to know how to change it right now. This is on OSX High Sierra.

What is happening here, and how do I fix it?

Upvotes: 1

Views: 1486

Answers (1)

C.Marsden
C.Marsden

Reputation: 53

So solved this myself after poking around, but it may be relevant for somebody with the same problem. My understanding is as follows: it turns out the default OSX version of gcc has OpenMP disabled; if you re-install gcc using brew:

brew reinstall gcc --without-multilib

This installs in /usr/local/bin, as gcc- (mine was gcc-7). If you then run:

./configure CC=gcc-7 --enable-shared --enable-openmp

With your version number, it compiles correctly. This manually sets the version of gcc, which is the version that you just reinstalled and is allowed to talk to OpenMP, instead of the default which has this option disabled.

Upvotes: 1

Related Questions