How to link FFTW?????

Issue #11 resolved
Former user created an issue

Hey Guys, I would like to try out SHTns because I read everywhere that it is blazingly fast, but for now the installation turns out to be blazingly problematic, which might be related to the lack of documentation.

However, I try to follow the README file by typing:

./configure –prefix=/$HOME/install_shtns/ --exec-prefix=/$HOME/install_shtns/ --enable-verbose=3 LDFLAGS=-L/$HOME/FFTW/FFTW_libs/lib/ CPPFLAGS=-I/$HOME/FFTW/FFTW_libs/include/

with the first two I try to link the installation directory and with the last two I try to link my FFTW libraries.

The configuration produces a lot of checking something... yes and some checking something... no:

  • checking c_asm.h usability... no
  • checking c_asm.h presence... no
  • checking for c_asm.h... no
  • checking intrinsics.h usability... no
  • checking intrinsics.h presence... no
  • checking for intrinsics.h... no
  • checking mach/mach_time.h usability... no
  • checking mach/mach_time.h presence... no
  • checking for mach/mach_time.h... no
  • checking for hrtime_t... no
  • checking for gethrtime... no
  • checking for read_real_time... no
  • checking for time_base_to_time... no
  • checking for clock_gettime... yes
  • checking for mach_absolute_time... no
  • checking for _rtc intrinsic... no

Is that any problem? Since there is no error I assume not. Next step as shown in the README is typing: make … which gives an error:

  • /bin/sh: hg: command not found
  • In file included from SHT.c:31:0:
  • sht_private.h:29:19: fatal error: fftw3.h: No such file or directory
  • compilation terminated.
  • make: *** [SHT.o] Error 1

The file fftw3.h is definitely in the linked folder: /$HOME/FFTW/FFTW_libs/include/ but somehow the linking fails. So how do I link FFTW??????

Thank you very much for any help. chris

Comments (3)

  1. Nathanaël Schaeffer repo owner

    Hello, Here is a blazingly fast response, which may be blazingly wrong, but worth trying:

    Can you try by replacing CPPFLAGS=$HOME/... with CFLAGS=$HOME/..., because shtns is written in C, so the CFLAGS variable is read, not the CPPFLAGS.

    If it does not work, can you try just: ./configure --prefix=$HOME/FFTW/FFTW_libs and then make ?

    Ultimately, if this still does not work for some obscure reason, open Makefile and add your "-L$HOME/FFTW/FFTW_libs/lib" and "-I$HOME/FFTW/FFTW_libs/include" to the "go=..." line

  2. Naveen Yadav

    Hello Nathanael,

    I got into the same problem with FFTW3 library. The solution:

    ./configure --prefix=$HOME/FFTW/FFTW_libs or Editing Makefile.in and adding "-L$HOME/FFTW/FFTW_libs/lib" and "-I$HOME/FFTW/FFTW_libs/include" to the "go=..." line

    didn't work. I could correct the configuration by doing:

    FFTW_HOME=path-to-fftw-installation ./configure LDFLAGS=-L$FFTW_HOME/lib CFLAGS=-I$FFTW_HOME/include --prefix=$HOME/.local/ --enable-openmp --enable-python

    Thanks a lot for the library. Cheers

  3. Log in to comment