Main Content

coder.LAPACKCallback.getHeaderFilename

Class: coder.LAPACKCallback
Namespace: coder

Return file name of LAPACKE header file

Syntax

coder.LAPACKCallback.getHeaderFilename()

Description

coder.LAPACKCallback.getHeaderFilename() returns the file name of the LAPACKE header file that defines the C interface to a specific LAPACK library.

coder.LAPACKCallback is an abstract class for defining a LAPACK callback class. A LAPACK callback class specifies the LAPACK library and LAPACKE header file to use for LAPACK calls in code generated from MATLAB® code. At code generation time, if you specify a LAPACK callback class, for certain linear algebra function calls, the code generator produces LAPACK calls in standalone code.

The code generator uses the LAPACKE header file name to generate a #include statement.

Examples

expand all

This example shows how to write a getHeaderFilename method to return the name of the LAPACKE header file.

In a class that derives from coder.LAPACKCallback, write a method getHeaderFilename that returns the name of the LAPACKE header file as a character vector. For example, in this class definition, getHeaderFilename returns 'mylapacke_custom.h'.

classdef useMyLAPACK < coder.LAPACKCallback
    methods (Static)
        function hn = getHeaderFilename()
            hn = 'mylapacke_custom.h';
        end
        function updateBuildInfo(buildInfo, buildctx)
            buildInfo.addIncludePaths(fullfile(pwd,'include'));
            libName = 'mylapack';
            libPath = fullfile(pwd,'lib');
            [~,linkLibExt] = buildctx.getStdLibInfo();
            buildInfo.addLinkObjects([libName linkLibExt], libPath, ...
                '', true, true);
            buildInfo.addDefines('HAVE_LAPACK_CONFIG_H');
            buildInfo.addDefines('LAPACK_COMPLEX_STRUCTURE');
            buildInfo.addDefines('LAPACK_ILP64'); 
        end
    end
end