[CLAM] fftw and configure

Rhywek rhywek at o2.pl
Tue Jul 5 04:57:36 PDT 2005


Miguel Ramírez Jávega wrote:

>>Hey!
>>Unfortunatelly, this did not work... After I did this configure (+make,
>>+make install), the CLAM configure did not detect the fftw (nor sfftw).
>>    
>>
>
>That's very weird. Did you issue a 'make clean' command after
>re-configuring fftw and trying to build it again?
>
>  
>
>>But in the mean time I came up with the following solution:
>>I executed "./configure --enable-shared" in fftw-2.1.5 dir, then "make".
>>Then I created a directory "CLAM_DIR/../fftw" and two subdirs: "include"
>>and "lib". I copied all the header files from fftw-2.1.5 subdirs to
>>"CLAM_DIR/../fftw/include/" and all the files containing "so" in name to
>>"CLAM_DIR/../fftw/lib/", because I noticed that this is where configure
>>script looks for them as sandboxed. Then I executed CLAM's configure
>>(this is the one in build dir) and it detected the fftw fully and all
>>steps about fftw were successful. Now I still need sfftw probably, don't
>>I? Is this solution OK?
>>Now: am I correct that the stuff named "fftw" is double precision and
>>"sfftw" is single precision? If yes, I am now planing on: going into
>>fftw-2.1.5 and doing "make clean", "./configure --enable-shared
>>--enable-type-prefix --enable-float" and then make and again copying
>>every header file to "CLAM_DIR/../fftw/include/" and every file with
>>"so" in name to "CLAM_DIR/../fftw/lib/", since I noticed that the
>>sandbox file is the same for sfftw and fftw.
>>The only thing that stops me for the moment is that some of the files
>>would be overwritten, as they have the same name. Will it be safe to do
>>this? And another hesitation: are "*so*" files enough in
>>"CLAM_DIR/../fftw/lib/", or some other should also be there?
>>
>>    
>>
>
>You should not have to copy by hand the header and binaries to the
>'sandbox' fftw folders: that's what's the configure --prefix option is
>for. If you follow these steps (inside the fftw sources folder):
>
>$ ./configure --prefix=/usr --enable-float --enable-type-prefix
>$ make clean
>$ make
># make install ( as the superuser )
> 
>the library files should be installed on /usr/include and /usr/lib. If
>you prefer to use your sandbox for holding the library change the
>--prefix argument from '/usr' to 'CLAM_DIR/../fftw'. Note that the
>latter requires you to add to the LD_LIBRARY_PATH environment variable
>the path 'CLAM_DIR/fftw/lib'.
>
>Miquel Ramírez.
>
>
>
>  
>
OK, this is what I do, step by step:
1: Remove "CLAM_DIR/../fftw", so that configure script does not detect
it in sandbox.
2: Go to fftw-2.1.5 dir (extracted tarball from fftw.org)
3: ./configure --prefix=/usr --enable-float --enable-type-prefix

4: make clean
5: make
After this step i check what interesting has been created:
6: find . -name '*.h'
And I see the nice header files.
7: find . -name '*so*'
And I see no shared libraries at all. From what I have experienced with the CLAM configure script, it needs '.so' files. So maybe I should add --enable-shared in step 3?
Now to check what is installed already (should be nothing, as I purged previous installs):
8: ls /usr/lib/*fftw*
And it gives nothing, so it is OK.
9: su
10: make install
Again I check:
11: ls /usr/lib/*fftw*
And now it gives:
/usr/lib/libsfftw.a /usr/lib/libsrfftw.a /usr/lib/libsfftw.la /usr/lib/libsrfftw.la
So something is added.
Now I go to CLAM_DIR/build/ (the 0.8.0_pre2 version) and do:
12: ./configure |grep -i fftw

The output is:
which: no setenv in (/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6
/bin:/usr/bin/xerces-c_2_6_0-redhat_80-gcc_32/bin:/home/bart/bin)
cpp_preprocessor_variable.cxx:1:42: xercesc/util/XercesVersion.hpp: No such fi
le or directory
configure: WARNING: TODO: improve dll extension test
checking fftw usage specified... yes (default)
checking fftw in sandbox... searching headers
checking fftw.h for fftw in sandbox... no
checking fftw header(s) found in sandbox... no
checking fftw has pkg-config... no
checking fftw.h usability... no
checking fftw.h presence... no
checking for fftw.h... no
checking fftw.h for fftw in standard locations... no
checking fftw header(s) found in standard locations... no
checking sfftw usage specified... yes (default)
checking sfftw in sandbox... searching headers
checking fftw.h for sfftw in sandbox... no
checking sfftw header(s) found in sandbox... no
checking sfftw has pkg-config... no
checking for fftw.h... (cached) no
checking fftw.h for sfftw in standard locations... no
checking sfftw header(s) found in standard locations... no
checking compiling, linking and running with fftw... failed
checking compiling, linking and running with sfftw... failed
fftw         YES     FAILED       HAS_FFTW=0 , USE_FFTW
sfftw        YES     FAILED       HAS_SFFTW=0 , USE_SFFTW

So as you can see it cannot find fftw and sfftw anywhere now. Similarly with 0.7.0 version of CLAM I get:

which: no setenv in (/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/bin/xerces-c_2_6_0-redhat_80-gcc_32/bin:/home/bart/bin)
cpp_preprocessor_variable.cxx:1:42: xercesc/util/XercesVersion.hpp: No such file or directory
configure: WARNING: TODO: improve dll extension test
checking fftw usage specified... yes (default)
checking fftw in sandbox... searching headers
checking fftw.h for fftw in sandbox... no
checking fftw header(s) found in sandbox... no
checking fftw has pkg-config... no
checking fftw.h usability... no
checking fftw.h presence... no
checking for fftw.h... no
checking fftw.h for fftw in standard locations... no
checking fftw header(s) found in standard locations... no
checking sfftw usage specified... yes (default)
checking sfftw in sandbox... searching headers
checking fftw.h for sfftw in sandbox... no
checking sfftw header(s) found in sandbox... no
checking sfftw has pkg-config... no
checking for fftw.h... (cached) no
checking fftw.h for sfftw in standard locations... no
checking sfftw header(s) found in standard locations... no
checking compiling, linking and running with fftw... failed
configure: error:
Configure-checks for fftw failed.
Please check the configure output to see which checks failed, and the
config.log file for more details.
Note that you can disable the use of fftw altogether, running configure
with the
  --without-fftw
option.

See `config.log' for more details.

OK, so it does not seem to work :-(
But I have changed this a little, i.e. step 3 (fftw configure) into:
3_new: ./configure --prefix=/usr --enable-shared

And now CLAM configure can detect it! And it gives SUCCESS for fftw.

Things that I don't understand:
Why didn't you add this --enable-shared in fftw configure? From what I see CLAM needs .so files, so it seems necessary for me.
Why do you give --enable-float and --enable-type-prefix? I would expect that it will build the fftw with single instead of double precision and it will be called sfftw instead of fftw. Actually I believe this is one correct step of two, i.e. I still need double precision, right? (I would very much prefer it)
So I should probably do fftw configure twice (with several make xxx of course), as here:
To get fftw libs: ./configure --prefix=/usr --enable-shared
To get sfftw libs: ./configure --prefix=/usr --enable-shared --enable-float --enable-type-prefix
Where the first one will be double precision fftw named fftw and the second one single precision fftw named sfftw.
The only problem I can see here is that even though the libraries have distinct names, the header files have the same names and sfftw headers would overwrite fftw headers... for example (after making both, here is the diff of them):

40c40
< /* #undef FFTW_ENABLE_FLOAT */
---
> #define FFTW_ENABLE_FLOAT 1

So in /usr/include/fftw.h would be the single precision version of the header. Of course if I swap the order of installation and I first install single precision and then double precision, then it will be the double precision header that will reside in /usr/include.
Do I need both version? The manual says that I do, but how can I resolve this issue with header files?

Is this configure script a good thing to run at all (CLAM_DIR/build/configure)? Do I need to autoconf -f before every configure?

Greetings,
Rhywek.







More information about the clam-users mailing list