2

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!

  • It may help if you were to provide the version of your Fortran compiler. – Hristo Iliev Jan 26 '21 at 19:09
  • @HristoIliev gfortran --version spits out `GNU Fortran (GCC) 8.2.0 `. Edit: I also have Xcode 12.2. Build version 12B45b if that's necessary. – FairyLiquid Jan 26 '21 at 19:22
  • Since it seems you are on a Mac, as you mention XCode (something it would have been useful to say!) your "gcc" may well be the xcode alias for that which is really clang, but without OpenMP enabled. In which case you need a better C compiler. – Jim Cownie Jan 27 '21 at 14:26
  • @JimCownie I've used brew install gcc prior to this, since I read there were some openMP issues with clang, but it didn't seem to do anything. Do I need to somehow redirect it to that version of gcc rather than the clang? – FairyLiquid Jan 28 '21 at 12:52
  • "gcc --version" should show you what you're using. (And "which gcc" in bash, at least, where it came from). IIRC brew gives some hints when installing compilers... – Jim Cownie Jan 28 '21 at 14:47

1 Answers1

2

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".