Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
483 views
in Technique[技术] by (71.8m points)

gcc - Configure FFTW `configure: error: don't know how to enable OpenMP`

I've been using FFTW3 for two months now. I've recently decided to try and implement some parallel aspects to it to speed up computation. However...

When I try to ./configure --enable-threads --enable-openmp --prefix=/$HOME/Desktop/FFTWLibParallel it runs for a while and then I am met with the following:

checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, no extra underscore
checking for OpenMP flag of C compiler... unknown
configure: error: don't know how to enable OpenMP

I have tried to run with ./configure CC=gcc-12.0.0 ..., however this returns

checking for gcc... gcc-12.0.0
checking whether the C compiler works... no
configure: error: in `/Users/USER/Desktop/fftw-3.3.9':
configure: error: C compiler cannot create executables
See `config.log' for more details 

The issue is evidently with using --enable-openmp, but I'm not really sure why or how to combat it. I've seen a few renditions of this question on here, but none have helped me fix my issue.

Thanks.

Edit:

I'm on a mac!

question from:https://stackoverflow.com/questions/65905837/configure-fftw-configure-error-dont-know-how-to-enable-openmp

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Coming back to this in case anyone, like me, encounters a similar issue and can't find the solution. After further probing, the following finally worked for me:

./configure CC=gfortran --enable-openmp --enable-threads CFLAGS="-fopenmp"

the crucial part being the CC=gfortran which in turn, unlike CC=gcc, enabled the use of CFLAGS="-fopenmp".


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...