Clear Filters
Clear Filters

OpenBLAS callback does not work well

5 views (last 30 days)
Semih Furkan Kilic
Semih Furkan Kilic on 28 Dec 2021
Hello everyone,
I am trying BLAS calls in my C code generated from the Simulink model. For this I use Intel MKL BLAS and OpenBLAS. MKL BLAS works well. But OpenBLAS is not called correctly. In order to get BLAS-Calls I'm using the templates which are in the following link:
My Intel MKL BLAS-Callback:
classdef IntelMKLBLAS < coder.BLASCallback
methods (Static)
function updateBuildInfo(buildInfo, ~)
libPath = fullfile('C:\','Program Files (x86)','Intel', ...
'oneAPI','mkl','2021.4.0','lib','intel64');
libPriority = '';
libPreCompiled = true;
libLinkOnly = true;
libs = {'mkl_intel_ilp64.lib' ...
'mkl_sequential.lib' ...
'mkl_core.lib'};
buildInfo.addLinkObjects(libs, libPath, libPriority, libPreCompiled, ...
libLinkOnly);
buildInfo.addIncludePaths(fullfile('C:\','Program Files (x86)', ...
'Intel','oneAPI','mkl','2021.4.0','include'));
buildInfo.addDefines('-DMKL_ILP64');
end
function headerName = getHeaderFilename()
headerName = 'mkl_cblas.h';
end
function intTypeName = getBLASIntTypeName()
intTypeName = 'MKL_INT';
end
end
end
and OpenBLAS-Callback:
classdef OpenBLAS < coder.BLASCallback
methods (Static)
function updateBuildInfo(buildInfo, ~)
buildInfo.addIncludePaths(fullfile('C:\','OpenBLAS-0.3.19','include'));
buildInfo.addLinkFlags('-lpthread');
libPriority = '';
libPreCompiled = true;
libLinkOnly = true;
libName = 'libopenblas.lib';
libPath = fullfile('C:\','OpenBLAS-0.3.19','lib');
buildInfo.addLinkObjects(libName, libPath, ...
libPriority, libPreCompiled, libLinkOnly);
end
function headerName = getHeaderFilename()
headerName = 'cblas.h';
end
function intTypeName = getBLASIntTypeName()
intTypeName = 'blasint';
end
end
end
I can not get any solution from OpenBLAS-Calls. I think there is a problem with the .lib file I am using in OpenBLAS. But unlike Intel MKL, OpenBLAS does not have any extra .lib files. I use the the latest version of OpenBLAS in following link:
Should I use same .lib files like in Intel MKL?
Or I would be pleased for any advice how to complete the OpenBLAS calls.
Thanks

Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!