Rate This Document
Findability
Accuracy
Completeness
Readability

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.)

  1. 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>.
  2. Replace -lfftw/-lfftwf with -lkfft/-lkfftf in the compilation options.
  3. 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.)

  1. Use the RPM package to install the KML.
    rpm -ivh boostkit-kml-xxxx.aarch64.rpm
  2. Download the open-source adaptation layer of the KML.
  3. Perform the compilation in the kml_fft_adapter directory.
    cd kml_fft_adapter
    sh build.sh
  4. 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.
  5. 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.