Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added -obpath parameter to install_sedumi.m #49

Merged
merged 7 commits into from
Jul 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = '';
nvitucci marked this conversation as resolved.
Show resolved Hide resolved
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