Skip to content

Commit

Permalink
Merge pull request #49 from nvitucci/fix-#17, closes #17.
Browse files Browse the repository at this point in the history
Added -obpath parameter to install_sedumi.m
  • Loading branch information
siko1056 authored Jul 24, 2019
2 parents d559b73 + 563e5fe commit 8a3796f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions install_sedumi.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ function install_sedumi( varargin )

need_rebuild = any( strcmp( varargin, '-rebuild' ) );
no_path = any( strcmp( varargin, '-nopath' ) );
openblas_path = '';
for v = 1:length(varargin)
ob_NM = regexp( varargin{v}, '-obpath=(?<path>.*)', 'names' );
if ~isempty(ob_NM) && ~isempty(ob_NM.path)
openblas_path = ob_NM.path;
end
end

targets64={...
'bwblkslv.c sdmauxFill.c sdmauxRdot.c',...
Expand Down Expand Up @@ -156,6 +163,18 @@ function install_sedumi( varargin )
IS64BIT = ~ISOCTAVE & strcmp(COMPUTER(end-1:end),'64');
flags = {};
libs = {};

if ~isempty(openblas_path)
if exist (openblas_path, "dir") ~= 7
disp('Please set the correct OpenBLAS include path with');
disp(' install_sedumi -obpath=/path/to/openblas/headers');
disp('(the directory where the f77blas.h file is located).');
return;
else
flags{end+1} = strcat('-I', openblas_path);
end
end

if ISOCTAVE,
% Octave has mwSize and mwIndex hardcoded in mex.h as ints.
% There is no definition for mwSignedIndex so include it here.
Expand All @@ -166,6 +185,10 @@ function install_sedumi( varargin )
flags{end+1} = '-O';
flags{end+1} = '-DOCTAVE';
libs{end+1} = '-lblas';

if isempty(openblas_path)
flags{end+1} = strcat('-I', '/usr/include/openblas');
end
else
flags{end+1} = '-O';
if IS64BIT && ( VERSION >= 7.03 ),
Expand Down Expand Up @@ -225,6 +248,8 @@ function install_sedumi( varargin )
disp( line );
disp( 'SeDuMi was not successfully installed.' );
disp( 'Please attempt to correct the errors and try again.' );
disp( 'For example, try setting the OpenBLAS include path with' );
disp(' install_sedumi -obpath=/path/to/openblas/headers');
elseif ~no_path,
disp( line );
fprintf( 'Adding SeDuMi to the %s path:\n', prog );
Expand Down

0 comments on commit 8a3796f

Please sign in to comment.