2
votes

I am trying to compile fftw3 with the openmp option under mac os Lion. As exposed in http://www.fftw.org/release-notes.html, I use the following command line ./configure --enable-openmp

The configure stops at the line: checking for OpenMP flag of C compiler... unknown configure: error: don't know how to enable OpenMP

I know that openmp is given with xcode but I don't know how to give it to configure option, does anybody can help me please? I have already succeed in using openmp in other programs.

I hope this is enough information for helping me.

Thank you,

Note: I have Xcode 4.2, gcc 4.2.1.

In the section "Output variables" of config.log, I find:

CFLAGS='-O3 -fomit-frame-pointer -mtune=native -fstrict-aliasing -ffast-math'

The failure seems to be (in the config.log):

configure:18427: gcc -std=gnu99 -o conftest conftest.c -lm >&5
Undefined symbols for architecture x86_64:
"_omp_set_num_threads", referenced from _main in ccfUItzL.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
configure:18427: $? = 1
configure: failed program was: /.../

1
Can you provide the CFLAGS value, and the point of failure, in the config.log file?Brett Hale
I provide the required information, is it enough?user1180921
for gcc the openmp flag is -fopenmp, you can provide it with an export CFLAGSBort
I did ./configure --enable-openmp CFLAGS="-fopenmp" but I got the same resultuser1180921
Sorry, I did: I did ./configure --enable-openmp CFLAGS=-fopenmp but I got the same resultuser1180921

1 Answers

1
votes

Looking closely, I don't think I understand how fftw3's configure test for openmp is supposed to work.

Edit the configure script; replace the two occurances of omp_set_num_threads() to omp_get_num_threads() and re-run the configure as ./configure --enable-openmp. Having done that, it seems to build and pass most of the tests in make check on my Macbook Pro with Lion and Xcode 4.2.1.

Keep in mind that gcc 4.2's OpenMP support wasn't very good or performant, so you may not get the most out of your multicores with fftw3 this way.