FFTW3

Ajouté par Jan Vabek il y a environ un mois

Hello,

is there any with an experience compiling a c code using fftw3? I probably don't know only which modules I need to load...

The fftw3 is included in my c-program by #include<fftw3.h>

I'm compiling with:

gcc -O2 -c *.c
gcc *.o -lfftw3 -lm prog.out

And the errors I have:
tools.c:6:18: error: fftw3.h: No such file or directory (the line 6:18: is the with #include<fftw3.h>)
...
bunch of errors in lines, where I use fftw3 functions
...
/usr/bin/ld: cannot find -lfftw3
collect2: ld returned 1 exit status

I tried load some modules that I expect may be relevant (all in the list starting with fftw3/), but neither helped.

The code is compiled fine and works on my local machine.

Thank you!


Réponses (1)

RE: FFTW3 - Ajouté par Alexandra Darrieutort il y a 30 jours

Hi,

Maybe if you add in your gcc command this options "gcc -I$FFTWINCLUDE -L$FFTWDIR ..." it will work.
Environment variables FFTWINCLUDE and FFTWDIR are defined in modulefiles of fftw3.

[aldarrie@avakas-frontend2 ]$ cat /cm/shared/modulefiles/fftw3/gcc/64/3.2.2
#%Module -*- tcl -*-
##
## dot modulefile
##
proc ModulesHelp { } {
  puts stderr "\tAdds FFTW3 library for 64 bits to your environment." 
  puts stderr "\tDirectory:/cm/shared/apps/fftw/gcc/64/3.2.2" 
}

module-whatis "Adds FFTW library for 64 bits to your environment" 

set              root              /cm/shared/apps/fftw/gcc/64/3.2.2

append-path      LD_RUN_PATH       $root/lib/
append-path      LD_LIBRARY_PATH   $root/lib/
append-path      MANPATH           $root/share/man/

setenv           FFTWDIR          $root/lib
setenv           FFTWINCLUDE      $root/include
setenv           FFTWLIB          fftw3

Alexandra

(1-1/1)