tir38
tir38

Reputation: 10421

compiling FFTW3 for multiple threads, linux, gcc

I'm trying to compile FFTW (3.3) on my linux machine using GCC. I was not using multi-threads and everything worked great. Now I want to switch to using OpenMP and multi-threading. So, I recompile FFTW3 for use with threads, per these instructions:

http://www.fftw.org/doc/Installation-on-Unix.html#Installation-on-Unix

sudo ./configure CFLAGS=-enable-threads
sudo make
sudo make install

If I then search for the fftw3_threads.h library, I find none:

find / -name fftw3_*
.... nothing

This is the same if I try to compile and enable openmp

sudo ./configure CFLAGS=-enable-openmp
sudo make
sudo make install

The compiler doesn't fail. Everything seems to be working. However, when I try to include either of the libraries, my code won't compile.

#include <fftw3_threads.h>
#include <fftw3_omp.h>

I get an "error no such file or directory"

So, several questions:

1.) why do I only need one '-' symbol when listing the CFLAGS? Why does FFTW manual list all of the flags beginning with '--'. (I realize this might not be a FFTW-related question).

2.) What am I doing wrong?

3.) I see from the manual that, "By default, the threads routines are not compiled." If I leave out the "includes" from my code, it compiles and these methods don't produce faults:

int dummy = fftw_init_threads();
fftw_plan_with_nthreads(omp_get_max_threads()); // setup for multithreading

even though they should produce faults, right?

Upvotes: 2

Views: 3683

Answers (1)

nat chouf
nat chouf

Reputation: 756

enable-openmp and enable-threads are not CFLAGS. Try this instead:

sudo ./configure --enable-openmp
sudo make
sudo make install

Upvotes: 4

Related Questions