Migration from FFTW to KML_FFT
Replaceability
All interfaces can be replaced.
Migrating the C-based Library
You can use either of the following methods to migrate FFTW to KML_FFT.
Method 1: Direct migration (some code needs to be modified).
- Globally, replace the interface prefix fftw with the kml_fft prefix and the interface prefix fftwf with the kml_fftf prefix. If the macro definition constant defined in the FFTW header file is used, replace the FFTW prefix with the KML_FFT prefix. Replace #include <fftw.h> with #include <kfft.h>.
- Replace -lfftw/-lfftwf with -lkfft/-lkfftf in the compilation options.
- Add environment variables. /PATH_TO_KFFT indicates the KML_FFT installation path.
export LD_LIBRARY_PATH=/PATH_TO_KFFT:$LD_LIBRARY_PATH
Method 2: Migration through the adaptation layer (Recommended, as the source code does not need to be modified.)
- Add environment variables and apply the adaptation layer .so file to replace the linked fftw library in the software.
export LD_LIBRARY_PATH=/PATH_TO_KML_ADAPTER/:$LD_LIBRARY_PATH
- Add environment variables and use kfft to link to the adaptation layer.
export LD_LIBRARY_PATH=/PATH_TO_KML_FFT/:$LD_LIBRARY_PATH
Migrating the Fortran-based Library
FFTW includes f77, f90, and f03 interfaces. The definition of f77 interfaces is different from that of Fortran interfaces provided by KML_FFT. However, their internal implementation logics are basically the same. The header file adapted to f77 needs to be encapsulated at the outer layer of KML_FFT.