Main Content

coder.fftw.StandaloneFFTW3Interface.updateBuildInfo

Class: coder.fftw.StandaloneFFTW3Interface
Package: coder.fftw

Update the build information for linking to a specific FFTW library

Syntax

coder.fftw.StandaloneFFTW3Interface.updateBuildInfo(buildInfo, ctx)

Description

coder.fftw.StandaloneFFTW3Interface.updateBuildInfo(buildInfo, ctx) updates the build information to link to a specific FFTW library.

An FFT library callback class that derives from a coder.fftw.StandaloneFFTW3Interface class specifies the FFTW library.

Input Arguments

expand all

After code generation, the build information object contains standard project, build option, and dependency information. In the updateBuildInfo method, to add the information for linking to a specific FFTW library, use build information methods.

Implement the coder.BuildConfig getStdLibInfo method to get the platform-specific file extension to use at link time.

Examples

expand all

In a class that derives from coder.fft.StandaloneFFTW3Interface, implement a method updateBuildInfo that updates the build information to link to a specific FFTW library.

Use the updateBuildInfo method in this example coder.fftw.StandaloneFFTW3Interface class as a template.

% copyright 2017 The MathWorks, Inc.

classdef useMyFFTW < coder.fftw.StandaloneFFTW3Interface
     
    methods (Static)
        function th = getNumThreads
            coder.inline('always');
            th = int32(coder.const(1));
        end
                
        function updateBuildInfo(buildInfo, ctx)
            fftwLocation = '/usr/lib/fftw';
            includePath = fullfile(fftwLocation, 'include');
            buildInfo.addIncludePaths(includePath);
            libPath = fullfile(fftwLocation, 'lib');
            
            %Double
            libName1 = 'libfftw3-3';
            [~, libExt] = ctx.getStdLibInfo();
            libName1 = [libName1 libExt];
            addLinkObjects(buildInfo, libName1, libPath, 1000, true, true);
            
            %Single
             libName2 = 'libfftw3f-3';
            [~, libExt] = ctx.getStdLibInfo();
            libName2 = [libName2 libExt];
            addLinkObjects(buildInfo, libName2, libPath, 1000, true, true);
        end
    end           
end

In your updateBuildInfo method, set:

  • fftwLocation to the full path for your installation of the library.

  • includePath to the full path of the folder that contains the FFTW library header file.

  • libPath to the full path of the folder that contains the library files.

Introduced in R2017b