Migration Procedure
Migrating the Library That Uses the C Language
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 an environment variable. /PATH_TO_KFFT indicates the KML_FFT installation path.
export LD_LIBRARY_PATH=/PATH_TO_KFFT:$LD_LIBRARY_PATH
Method 2: Migration through the open-source adaptation layer (This method is recommended because the source code does not need to be modified.)
- Use the RPM package to install the KML.
rpm -ivh boostkit-kml-xxxx.aarch64.rpm
- Download the open-source adaptation layer of the KML.
- Perform the compilation in the kml_fft_adapter directory.
cd kml_fft_adapter sh build.sh
- The adapted dynamic libraries libfftw3f.so and libfftw3.so are generated in the build directory. You can use the dynamic libraries to replace the linked fftw library in the software.
- Add an environment variable. /PATH_TO_FFT_ADAPTER/build indicates the installation path of the dynamic libraries at the open-source adaptation layer.
export LD_LIBRARY_PATH=/PATH_TO_FFT_ADAPTER/build:$LD_LIBRARY_PATH
Migrating the Library That Uses the Fortran Interface
FFTW includes f77, f90, and f03 interfaces. The definition of f77 interfaces is different from that of Fortran interfaces provided by KML_FFT. However, the internal implementation logic is basically the same. The header file adapted to f77 needs to be encapsulated at the outer layer of KML_FFT.
Parent topic: Migration from FFTW to KML_FFT