function libPath = getBlasRtwLibPath
%GETBLASRTWLIBPATH Return blas library path for RTW build

%   Copyright 2013-2020 The MathWorks, Inc.


arch = computer('arch');
if ~ispc
    libPath = fullfile('$(MATLAB_ROOT)',...
        'bin', ...
        arch);
else
   % Retrieve cached mex compiler information
   compilerInfo = coder.internal.CompInfoCacheForCRL.getMexCompInfoCache;
   assert(~isempty(compilerInfo), 'getMexCompilerInfo should never return empty');
    if strncmpi(compilerInfo.comp.Name, 'lcc64', length('lcc64')) || ...
        strncmpi(compilerInfo.comp.Name, 'intel', 5)
    
        % for lcc64 and intel, use microsoft folder.
        compilerName = 'microsoft';
    elseif strncmpi(compilerInfo.comp.Name, 'mingw64', length('mingw64'))
        % for minGW64, use ming64 instead of gnu.
        compilerName = 'mingw64';
    else
        compilerName = lower(compilerInfo.comp.Manufacturer);
    end
    libPath = fullfile('$(MATLAB_ROOT)',...
        'extern',...
        'lib',...
        arch,...
        compilerName);
end

end% getBlasRtwLibPath

% LocalWords:  blas
