Skip to content

Commit

Permalink
remove mex files, add buliding to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mcg1969 committed Apr 10, 2024
1 parent 4a91f13 commit fce2d10
Show file tree
Hide file tree
Showing 172 changed files with 119 additions and 134 deletions.
206 changes: 80 additions & 126 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,132 +1,86 @@
name: Basic SeDuMi tests

# Controls when the action will run.
name: CI
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ master ]
branches:
- master
tags:
- '*'
pull_request:
branches: [ master ]

workflow_dispatch:

branches:
- master
jobs:

matlab:
name: Matlab (latest) on Ubuntu (latest)
runs-on: ubuntu-latest

build-mex:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest,windows-latest,macos-latest,macos-14]
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1

- name: Run basic SeDuMi tests
uses: matlab-actions/run-command@v1
with:
command: cd examples; test_sedumi(1, 1);


macos-octave:
name: Octave (latest) on macOS (latest)
runs-on: macos-latest

- name: Retrieve the source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ matrix.os == 'macos-14' && 'R2023b' || ( matrix.os == 'windows-latest' && 'R2021b' || 'R2021a' ) }}
- name: Build MATLAB MEX files
uses: matlab-actions/run-command@v2
with:
command: install_sedumi -rebuild
- name: Run test
uses: matlab-actions/run-command@v2
with:
command: "install_sedumi; cd examples; test_sedumi(1, 1)"
- name: Upload MATLAB MEX files
uses: actions/upload-artifact@v4
with:
name: mexfiles-${{ matrix.os }}
path: *.mex*
build-oct:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest,windows-latest,macos-latest,macos-14]
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install Octave by homebrew
run: brew install octave

- name: Run basic SeDuMi tests
run: octave --eval "cd examples; test_sedumi(1, 1);"


windows-octave:
name: Octave (latest) on MS Windows (latest)
runs-on: windows-latest

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install Octave by Chocolatey
run: choco install octave.portable

- name: Run basic SeDuMi tests
run: octave-cli.exe --eval "cd examples; test_sedumi(1, 1);"


ubuntu-20_04-octave:
name: Octave 5.2.0 on Ubuntu 20.04
runs-on: ubuntu-20.04

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install Octave
run: |
sudo apt-get -y update
sudo apt-get -y install octave liboctave-dev libopenblas-dev
- name: Run basic SeDuMi tests
run: octave --eval "cd examples; test_sedumi(1, 1);"


ubuntu-18_04-octave:
name: Octave 4.2.2 on Ubuntu 18.04
runs-on: ubuntu-18.04

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install Octave
run: |
sudo apt-get -y update
sudo apt-get -y install octave liboctave-dev libopenblas-dev
- name: Run basic SeDuMi tests
run: octave --eval "cd examples; test_sedumi(1, 1);"


flatpak-octave:
name: Octave (latest) on Flatpak (latest)
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install Octave
run: |
sudo apt-get -y update
sudo apt-get -y install flatpak
flatpak remote-add --user --if-not-exists \
flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user -y flathub org.octave.Octave
- name: Run basic SeDuMi tests
run: |
flatpak run org.octave.Octave --eval "cd examples; test_sedumi(1, 1);"
snap-octave:
name: Octave (latest) on Snap (latest)
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install Octave
run: |
sudo apt-get -y update
sudo apt-get -y install snapd
sudo snap install octave
- name: Run basic SeDuMi tests
run: snap run octave --eval "cd examples; test_sedumi(1, 1);"
- name: Retrieve the source code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Octave
shell: bash
run: |
if [ "${{ matrix.os }}" = ubuntu-latest ]; then
sudo apt update
sudo apt install --no-install-recommends octave liboctave-dev
elif [ "${{ matrix.os }}" = windows-latest ]; then
choco install octave.portable
else
brew install octave
fi
- name: Build Octave MEX files
if: matrix.os != 'windows-latest'
run: octave --eval "install_sedumi -rebuild"
- name: Build Octave MEX files
if: matrix.os == 'windows-latest'
shell: cmd
run: |
set PATH=C:\ProgramData\chocolatey\bin;%PATH%
which octave-cli.exe
octave-cli.exe --no-gui --eval "install_sedumi -rebuild"
if %errorlevel% neq 0 exit /b %errorlevel%
- name: Run test
if: matrix.os != 'windows-latest'
run: octave --eval "install_sedumi; test_sedumi(1, 1)"
- name: Run test
if: matrix.os == 'windows-latest'
shell: cmd
run: |
set PATH=C:\ProgramData\chocolatey\bin;%PATH%
octave-cli.exe --no-gui --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
- name: Upload Octave MEX files
uses: actions/upload-artifact@v4
with:
name: mexfiles-oct-${{ matrix.os }}
path: *.mex
Binary file removed adendotd.mexa64
Binary file not shown.
Binary file removed adendotd.mexglx
Binary file not shown.
Binary file removed adendotd.mexmaci64
Binary file not shown.
Binary file removed adendotd.mexw32
Binary file not shown.
Binary file removed adendotd.mexw64
Binary file not shown.
Binary file removed adenscale.mexa64
Binary file not shown.
Binary file removed adenscale.mexglx
Binary file not shown.
Binary file removed adenscale.mexmaci64
Binary file not shown.
Binary file removed adenscale.mexw32
Binary file not shown.
Binary file removed adenscale.mexw64
Binary file not shown.
Binary file removed blkchol.mexa64
Binary file not shown.
Binary file removed blkchol.mexglx
Binary file not shown.
Binary file removed blkchol.mexmaci64
Binary file not shown.
Binary file removed blkchol.mexw32
Binary file not shown.
Binary file removed blkchol.mexw64
Binary file not shown.
Binary file removed bwblkslv.mexa64
Binary file not shown.
Binary file removed bwblkslv.mexglx
Binary file not shown.
Binary file removed bwblkslv.mexmaci64
Binary file not shown.
Binary file removed bwblkslv.mexw32
Binary file not shown.
Binary file removed bwblkslv.mexw64
Binary file not shown.
Binary file removed bwdpr1.mexa64
Binary file not shown.
Binary file removed bwdpr1.mexglx
Binary file not shown.
Binary file removed bwdpr1.mexmaci64
Binary file not shown.
Binary file removed bwdpr1.mexw32
Binary file not shown.
Binary file removed bwdpr1.mexw64
Binary file not shown.
Binary file removed cholsplit.mexa64
Binary file not shown.
Binary file removed cholsplit.mexglx
Binary file not shown.
Binary file removed cholsplit.mexmaci64
Binary file not shown.
Binary file removed cholsplit.mexw32
Binary file not shown.
Binary file removed cholsplit.mexw64
Binary file not shown.
Binary file removed choltmpsiz.mexa64
Binary file not shown.
Binary file removed choltmpsiz.mexglx
Binary file not shown.
Binary file removed choltmpsiz.mexmaci64
Binary file not shown.
Binary file removed choltmpsiz.mexw32
Binary file not shown.
Binary file removed choltmpsiz.mexw64
Binary file not shown.
Binary file removed ddot.mexa64
Binary file not shown.
Binary file removed ddot.mexglx
Binary file not shown.
Binary file removed ddot.mexmaci64
Binary file not shown.
Binary file removed ddot.mexw32
Binary file not shown.
Binary file removed ddot.mexw64
Binary file not shown.
Binary file removed dpr1fact.mexa64
Binary file not shown.
Binary file removed dpr1fact.mexglx
Binary file not shown.
Binary file removed dpr1fact.mexmaci64
Binary file not shown.
Binary file removed dpr1fact.mexw32
Binary file not shown.
Binary file removed dpr1fact.mexw64
Binary file not shown.
Binary file removed extractA.mexa64
Binary file not shown.
Binary file removed extractA.mexglx
Binary file not shown.
Binary file removed extractA.mexmaci64
Binary file not shown.
Binary file removed extractA.mexw32
Binary file not shown.
Binary file removed extractA.mexw64
Binary file not shown.
Binary file removed findblks.mexa64
Binary file not shown.
Binary file removed findblks.mexglx
Binary file not shown.
Binary file removed findblks.mexmaci64
Binary file not shown.
Binary file removed findblks.mexw32
Binary file not shown.
Binary file removed findblks.mexw64
Binary file not shown.
Binary file removed finsymbden.mexa64
Binary file not shown.
Binary file removed finsymbden.mexglx
Binary file not shown.
Binary file removed finsymbden.mexmaci64
Binary file not shown.
Binary file removed finsymbden.mexw32
Binary file not shown.
Binary file removed finsymbden.mexw64
Binary file not shown.
Binary file removed fwblkslv.mexa64
Binary file not shown.
Binary file removed fwblkslv.mexglx
Binary file not shown.
Binary file removed fwblkslv.mexmaci64
Binary file not shown.
Binary file removed fwblkslv.mexw32
Binary file not shown.
Binary file removed fwblkslv.mexw64
Binary file not shown.
Binary file removed fwdpr1.mexa64
Binary file not shown.
Binary file removed fwdpr1.mexglx
Binary file not shown.
Binary file removed fwdpr1.mexmaci64
Binary file not shown.
Binary file removed fwdpr1.mexw32
Binary file not shown.
Binary file removed fwdpr1.mexw64
Binary file not shown.
Binary file removed getada1.mexa64
Binary file not shown.
Binary file removed getada1.mexglx
Binary file not shown.
Binary file removed getada1.mexmaci64
Binary file not shown.
Binary file removed getada1.mexw32
Binary file not shown.
Binary file removed getada1.mexw64
Binary file not shown.
Binary file removed getada2.mexa64
Binary file not shown.
Binary file removed getada2.mexglx
Binary file not shown.
Binary file removed getada2.mexmaci64
Binary file not shown.
Binary file removed getada2.mexw32
Binary file not shown.
Binary file removed getada2.mexw64
Binary file not shown.
Binary file removed getada3.mexa64
Binary file not shown.
Binary file removed getada3.mexglx
Binary file not shown.
Binary file removed getada3.mexmaci64
Binary file not shown.
Binary file removed getada3.mexw32
Binary file not shown.
Binary file removed getada3.mexw64
Binary file not shown.
Binary file removed givensrot.mexa64
Binary file not shown.
Binary file removed givensrot.mexglx
Binary file not shown.
Binary file removed givensrot.mexmaci64
Binary file not shown.
Binary file removed givensrot.mexw32
Binary file not shown.
Binary file removed givensrot.mexw64
Binary file not shown.
Binary file removed incorder.mexa64
Binary file not shown.
Binary file removed incorder.mexglx
Binary file not shown.
Binary file removed incorder.mexmaci64
Binary file not shown.
Binary file removed incorder.mexw32
Binary file not shown.
Binary file removed incorder.mexw64
Binary file not shown.
47 changes: 39 additions & 8 deletions install_sedumi.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,34 @@ function install_sedumi( varargin )
% Get first file of "targets64" and replace ".c" with mex-extension.
% Keep order of "targets64".
mex_binaries = cellfun (@strtok, targets64, 'UniformOutput', false);
mex_binaries = cellfun (@(x) strrep (x, '.c', ['.', mexext()]), ...
mex_binaries = cellfun (@(x) strrep (x, '.c', ['.', mext]), ...
mex_binaries, 'UniformOutput', false);

sedumi_path = mfilename ('fullpath');
sedumi_path = sedumi_path(1:max ([1, strfind(sedumi_path, filesep ())]) - 1);

% Note the use of 0.01 here. That's because version 7 had more than 10
% minor releases, so 7.10-7.14 need to be ordered after 7.01-7.09.
VERSION = [1, 0.01] * sscanf (version (), '%d.%d');
COMPUTER = computer ();
ISOCTAVE = (exist ('OCTAVE_VERSION', 'builtin') == 5);
if (ISOCTAVE)
prog = 'Octave';
page_output_immediately (true, 'local');
switch COMPUTER
case 'x86_64-pc-linux-gnu'
mdir = 'o_lin';
case 'x86_64-apple-darwin21.6.0'
mdir = 'o_maci';
case 'aarch64-apple-darwin23.4.0'
mdir = 'o_maca';
case 'i686-w64-mingw32'
mdir = 'o_win';
end
mext = 'mex';
else
prog = 'Matlab';
mext = mexext;
end

% Helper function to lookup existing mex binaries.
Expand All @@ -141,11 +157,19 @@ function install_sedumi( varargin )
% guarantee that rebuilding will work.
if (~need_rebuild)
fprintf ('Looking for existing binaries...');
nfound = count_mex_binaries ();
if (nfound == 0)
nfound = [0, 0];
for k = 1 : length(targets64)
targ = mex_binaries{k};
if exist( [ sedumi_path, fs, targ ], 'file' )
nfound(1) = nfound(1) + 1;
elseif ~isempty(mdir) && exist( [ sedumi_path, fs, mdir, fs, targ ], 'file' )
nfound(2) = nfound(2) + 1;
end
end
if sum(nfound) == 0
fprintf ('none found; building...\n');
need_rebuild = true;
elseif (nfound < length(targets64))
elseif sum(nfound) < length(targets64)
fprintf ('incomplete set found.\n');
disp (line_sep);
error (['%s\n', ...
Expand All @@ -163,6 +187,7 @@ function install_sedumi( varargin )
end

if (need_rebuild)
mdir = ''
disp ('Attempting to recompile the SeDuMi binaries:');

% Customization by providing a mex template.
Expand All @@ -173,6 +198,7 @@ function install_sedumi( varargin )
if (ISOCTAVE)
% Matlab mex optimization '-O' corresponds to gcc '-O2',
% whereas calling '-O' would result in gcc '-O1'.
flags{end+1} = '--mex';
flags{end+1} = '-O2';
flags{end+1} = '-DOCTAVE';
flags{end+1} = '-Wall';
Expand All @@ -189,10 +215,6 @@ function install_sedumi( varargin )
flags{end+1} = '-I/usr/include/openblas';
end
else % Matlab
% Note the use of 0.01 here. That's because version 7 had more than 10
% minor releases, so 7.10-7.14 need to be ordered after 7.01-7.09.
VERSION = [1, 0.01] * sscanf (version (), '%d.%d');
COMPUTER = computer ();
% The last Matlab release with a 32 bit version was R2015b.
IS64BIT = strcmp (COMPUTER(end-1:end), '64');
flags{end+1} = '-O'; % optimize
Expand Down Expand Up @@ -273,6 +295,15 @@ function install_sedumi( varargin )
else
fprintf ('already there.\n');
end
if (ISOCTAVE && ~isempty(mdir))
fprintf (' Octave MEX directory... ');
if (~is_on_search_path (fullfile(sedumi_path, mdir)))
addpath (fullfile(sedumi_path, mdir));
fprintf ('added.\n');
else
fprintf ('already there.\n');
end
end
fprintf (' Conversion directory... ');
if (~is_on_search_path (fullfile (sedumi_path, 'conversion')))
addpath (fullfile (sedumi_path, 'conversion'));
Expand Down
Binary file removed invcholfac.mexa64
Binary file not shown.
Binary file removed invcholfac.mexglx
Binary file not shown.
Binary file removed invcholfac.mexmaci64
Binary file not shown.
Binary file removed invcholfac.mexw32
Binary file not shown.
Binary file removed invcholfac.mexw64
Binary file not shown.
Binary file removed iswnbr.mexa64
Binary file not shown.
Binary file removed iswnbr.mexglx
Binary file not shown.
Binary file removed iswnbr.mexmaci64
Binary file not shown.
Binary file removed iswnbr.mexw32
Binary file not shown.
Binary file removed iswnbr.mexw64
Binary file not shown.
Binary file removed ordmmdmex.mexa64
Binary file not shown.
Binary file removed ordmmdmex.mexglx
Binary file not shown.
Binary file removed ordmmdmex.mexmaci64
Binary file not shown.
Binary file removed ordmmdmex.mexw32
Binary file not shown.
Binary file removed ordmmdmex.mexw64
Binary file not shown.
Binary file removed partitA.mexa64
Binary file not shown.
Binary file removed partitA.mexglx
Binary file not shown.
Binary file removed partitA.mexmaci64
Binary file not shown.
Binary file removed partitA.mexw32
Binary file not shown.
Binary file removed partitA.mexw64
Binary file not shown.
Binary file removed psdframeit.mexa64
Binary file not shown.
Binary file removed psdframeit.mexglx
Binary file not shown.
Binary file removed psdframeit.mexmaci64
Binary file not shown.
Binary file removed psdframeit.mexw32
Binary file not shown.
Binary file removed psdframeit.mexw64
Binary file not shown.
Binary file removed psdinvjmul.mexa64
Binary file not shown.
Binary file removed psdinvjmul.mexglx
Binary file not shown.
Binary file removed psdinvjmul.mexmaci64
Binary file not shown.
Binary file removed psdinvjmul.mexw32
Binary file not shown.
Binary file removed psdinvjmul.mexw64
Binary file not shown.
Binary file removed qblkmul.mexa64
Binary file not shown.
Binary file removed qblkmul.mexglx
Binary file not shown.
Binary file removed qblkmul.mexmaci64
Binary file not shown.
Binary file removed qblkmul.mexw32
Binary file not shown.
Binary file removed qblkmul.mexw64
Binary file not shown.
Binary file removed qrK.mexa64
Binary file not shown.
Binary file removed qrK.mexglx
Binary file not shown.
Binary file removed qrK.mexmaci64
Binary file not shown.
Binary file removed qrK.mexw32
Binary file not shown.
Binary file removed qrK.mexw64
Binary file not shown.
Binary file removed quadadd.mexa64
Binary file not shown.
Binary file removed quadadd.mexglx
Binary file not shown.
Binary file removed quadadd.mexmaci64
Binary file not shown.
Binary file removed quadadd.mexw32
Binary file not shown.
Binary file removed quadadd.mexw64
Binary file not shown.
Binary file removed sortnnz.mexa64
Binary file not shown.
Binary file removed sortnnz.mexglx
Binary file not shown.
Binary file removed sortnnz.mexmaci64
Binary file not shown.
Binary file removed sortnnz.mexw32
Binary file not shown.
Binary file removed sortnnz.mexw64
Binary file not shown.
Binary file removed sqrtinv.mexa64
Binary file not shown.
Binary file removed sqrtinv.mexglx
Binary file not shown.
Binary file removed sqrtinv.mexmaci64
Binary file not shown.
Binary file removed sqrtinv.mexw32
Binary file not shown.
Binary file removed sqrtinv.mexw64
Binary file not shown.
Binary file removed symbfwblk.mexa64
Binary file not shown.
Binary file removed symbfwblk.mexglx
Binary file not shown.
Binary file removed symbfwblk.mexmaci64
Binary file not shown.
Binary file removed symbfwblk.mexw32
Binary file not shown.
Binary file removed symbfwblk.mexw64
Binary file not shown.
Binary file removed symfctmex.mexa64
Binary file not shown.
Binary file removed symfctmex.mexglx
Binary file not shown.
Binary file removed symfctmex.mexmaci64
Binary file not shown.
Binary file removed symfctmex.mexw32
Binary file not shown.
Binary file removed symfctmex.mexw64
Binary file not shown.
Binary file removed urotorder.mexa64
Binary file not shown.
Binary file removed urotorder.mexglx
Binary file not shown.
Binary file removed urotorder.mexmaci64
Binary file not shown.
Binary file removed urotorder.mexw32
Binary file not shown.
Binary file removed urotorder.mexw64
Binary file not shown.
Binary file removed vecsym.mexa64
Binary file not shown.
Binary file removed vecsym.mexglx
Binary file not shown.
Binary file removed vecsym.mexmaci64
Binary file not shown.
Binary file removed vecsym.mexw32
Binary file not shown.
Binary file removed vecsym.mexw64
Binary file not shown.

0 comments on commit fce2d10

Please sign in to comment.