Skip to content

Commit 77197be

Browse files
committed
remove mex files, add buliding to CI
1 parent 4a91f13 commit 77197be

File tree

172 files changed

+121
-135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+121
-135
lines changed

.github/workflows/ci.yml

Lines changed: 80 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,86 @@
1-
name: Basic SeDuMi tests
2-
3-
# Controls when the action will run.
1+
name: CI
42
on:
5-
# Triggers the workflow on push or pull request events but only for the main branch
63
push:
7-
branches: [ master ]
4+
branches:
5+
- master
6+
tags:
7+
- '*'
88
pull_request:
9-
branches: [ master ]
10-
11-
workflow_dispatch:
12-
9+
branches:
10+
- master
1311
jobs:
14-
15-
matlab:
16-
name: Matlab (latest) on Ubuntu (latest)
17-
runs-on: ubuntu-latest
18-
12+
build-mex:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest,windows-latest,macos-latest,macos-14]
1918
steps:
20-
- name: Check out repository
21-
uses: actions/checkout@v3
22-
23-
- name: Install MATLAB
24-
uses: matlab-actions/setup-matlab@v1
25-
26-
- name: Run basic SeDuMi tests
27-
uses: matlab-actions/run-command@v1
28-
with:
29-
command: cd examples; test_sedumi(1, 1);
30-
31-
32-
macos-octave:
33-
name: Octave (latest) on macOS (latest)
34-
runs-on: macos-latest
35-
19+
- name: Retrieve the source code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Install MATLAB
24+
uses: matlab-actions/setup-matlab@v2
25+
with:
26+
release: ${{ matrix.os == 'macos-14' && 'R2023b' || ( matrix.os == 'windows-latest' && 'R2021b' || 'R2021a' ) }}
27+
- name: Build MATLAB MEX files
28+
uses: matlab-actions/run-command@v2
29+
with:
30+
command: install_sedumi -rebuild
31+
- name: Run test
32+
uses: matlab-actions/run-command@v2
33+
with:
34+
command: "install_sedumi; cd examples; test_sedumi(1, 1)"
35+
- name: Upload MATLAB MEX files
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: mexfiles-${{ matrix.os }}
39+
path: "*.mex*"
40+
build-oct:
41+
runs-on: ${{ matrix.os }}
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
os: [ubuntu-latest,windows-latest,macos-latest,macos-14]
3646
steps:
37-
- name: Check out repository
38-
uses: actions/checkout@v3
39-
40-
- name: Install Octave by homebrew
41-
run: brew install octave
42-
43-
- name: Run basic SeDuMi tests
44-
run: octave --eval "cd examples; test_sedumi(1, 1);"
45-
46-
47-
windows-octave:
48-
name: Octave (latest) on MS Windows (latest)
49-
runs-on: windows-latest
50-
51-
steps:
52-
- name: Check out repository
53-
uses: actions/checkout@v3
54-
55-
- name: Install Octave by Chocolatey
56-
run: choco install octave.portable
57-
58-
- name: Run basic SeDuMi tests
59-
run: octave-cli.exe --eval "cd examples; test_sedumi(1, 1);"
60-
61-
62-
ubuntu-20_04-octave:
63-
name: Octave 5.2.0 on Ubuntu 20.04
64-
runs-on: ubuntu-20.04
65-
66-
steps:
67-
- name: Check out repository
68-
uses: actions/checkout@v3
69-
70-
- name: Install Octave
71-
run: |
72-
sudo apt-get -y update
73-
sudo apt-get -y install octave liboctave-dev libopenblas-dev
74-
75-
- name: Run basic SeDuMi tests
76-
run: octave --eval "cd examples; test_sedumi(1, 1);"
77-
78-
79-
ubuntu-18_04-octave:
80-
name: Octave 4.2.2 on Ubuntu 18.04
81-
runs-on: ubuntu-18.04
82-
83-
steps:
84-
- name: Check out repository
85-
uses: actions/checkout@v3
86-
87-
- name: Install Octave
88-
run: |
89-
sudo apt-get -y update
90-
sudo apt-get -y install octave liboctave-dev libopenblas-dev
91-
92-
- name: Run basic SeDuMi tests
93-
run: octave --eval "cd examples; test_sedumi(1, 1);"
94-
95-
96-
flatpak-octave:
97-
name: Octave (latest) on Flatpak (latest)
98-
runs-on: ubuntu-latest
99-
100-
steps:
101-
- name: Check out repository
102-
uses: actions/checkout@v3
103-
104-
- name: Install Octave
105-
run: |
106-
sudo apt-get -y update
107-
sudo apt-get -y install flatpak
108-
flatpak remote-add --user --if-not-exists \
109-
flathub https://flathub.org/repo/flathub.flatpakrepo
110-
flatpak install --user -y flathub org.octave.Octave
111-
112-
- name: Run basic SeDuMi tests
113-
run: |
114-
flatpak run org.octave.Octave --eval "cd examples; test_sedumi(1, 1);"
115-
116-
117-
snap-octave:
118-
name: Octave (latest) on Snap (latest)
119-
runs-on: ubuntu-latest
120-
121-
steps:
122-
- name: Check out repository
123-
uses: actions/checkout@v3
124-
125-
- name: Install Octave
126-
run: |
127-
sudo apt-get -y update
128-
sudo apt-get -y install snapd
129-
sudo snap install octave
130-
131-
- name: Run basic SeDuMi tests
132-
run: snap run octave --eval "cd examples; test_sedumi(1, 1);"
47+
- name: Retrieve the source code
48+
uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 0
51+
- name: Install Octave
52+
shell: bash
53+
run: |
54+
if [ "${{ matrix.os }}" = ubuntu-latest ]; then
55+
sudo apt update
56+
sudo apt install --no-install-recommends octave liboctave-dev
57+
elif [ "${{ matrix.os }}" = windows-latest ]; then
58+
choco install octave.portable
59+
else
60+
brew install octave
61+
fi
62+
- name: Build Octave MEX files
63+
if: matrix.os != 'windows-latest'
64+
run: octave --eval "install_sedumi -rebuild"
65+
- name: Build Octave MEX files
66+
if: matrix.os == 'windows-latest'
67+
shell: cmd
68+
run: |
69+
set PATH=C:\ProgramData\chocolatey\bin;%PATH%
70+
which octave-cli.exe
71+
octave-cli.exe --no-gui --eval "install_sedumi -rebuild"
72+
if %errorlevel% neq 0 exit /b %errorlevel%
73+
- name: Run test
74+
if: matrix.os != 'windows-latest'
75+
run: octave --eval "install_sedumi; test_sedumi(1, 1)"
76+
- name: Run test
77+
if: matrix.os == 'windows-latest'
78+
shell: cmd
79+
run: |
80+
set PATH=C:\ProgramData\chocolatey\bin;%PATH%
81+
octave-cli.exe --no-gui --eval "install_sedumi; cd examples; test_sedumi(1, 1)"
82+
- name: Upload Octave MEX files
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: mexfiles-oct-${{ matrix.os }}
86+
path: "*.mex"

adendotd.mexa64

-11.1 KB
Binary file not shown.

adendotd.mexglx

-8.74 KB
Binary file not shown.

adendotd.mexmaci64

-12.6 KB
Binary file not shown.

adendotd.mexw32

-15 KB
Binary file not shown.

adendotd.mexw64

-42.5 KB
Binary file not shown.

adenscale.mexa64

-7.77 KB
Binary file not shown.

adenscale.mexglx

-6.09 KB
Binary file not shown.

adenscale.mexmaci64

-8.48 KB
Binary file not shown.

adenscale.mexw32

-11 KB
Binary file not shown.

adenscale.mexw64

-38 KB
Binary file not shown.

blkchol.mexa64

-16 KB
Binary file not shown.

blkchol.mexglx

-13.8 KB
Binary file not shown.

blkchol.mexmaci64

-17.4 KB
Binary file not shown.

blkchol.mexw32

-19 KB
Binary file not shown.

blkchol.mexw64

-47 KB
Binary file not shown.

bwblkslv.mexa64

-10.4 KB
Binary file not shown.

bwblkslv.mexglx

-8.47 KB
Binary file not shown.

bwblkslv.mexmaci64

-12.8 KB
Binary file not shown.

bwblkslv.mexw32

-13 KB
Binary file not shown.

bwblkslv.mexw64

-41 KB
Binary file not shown.

bwdpr1.mexa64

-11.3 KB
Binary file not shown.

bwdpr1.mexglx

-9.16 KB
Binary file not shown.

bwdpr1.mexmaci64

-12.8 KB
Binary file not shown.

bwdpr1.mexw32

-15 KB
Binary file not shown.

bwdpr1.mexw64

-43 KB
Binary file not shown.

cholsplit.mexa64

-7.98 KB
Binary file not shown.

cholsplit.mexglx

-6.28 KB
Binary file not shown.

cholsplit.mexmaci64

-8.61 KB
Binary file not shown.

cholsplit.mexw32

-11 KB
Binary file not shown.

cholsplit.mexw64

-39 KB
Binary file not shown.

choltmpsiz.mexa64

-7.73 KB
Binary file not shown.

choltmpsiz.mexglx

-6.07 KB
Binary file not shown.

choltmpsiz.mexmaci64

-8.53 KB
Binary file not shown.

choltmpsiz.mexw32

-11 KB
Binary file not shown.

choltmpsiz.mexw64

-38 KB
Binary file not shown.

ddot.mexa64

-13.9 KB
Binary file not shown.

ddot.mexglx

-10.5 KB
Binary file not shown.

ddot.mexmaci64

-13.3 KB
Binary file not shown.

ddot.mexw32

-14.5 KB
Binary file not shown.

ddot.mexw64

-43 KB
Binary file not shown.

dpr1fact.mexa64

-20.5 KB
Binary file not shown.

dpr1fact.mexglx

-17.6 KB
Binary file not shown.

dpr1fact.mexmaci64

-21.9 KB
Binary file not shown.

dpr1fact.mexw32

-22.5 KB
Binary file not shown.

dpr1fact.mexw64

-54 KB
Binary file not shown.

extractA.mexa64

-8.91 KB
Binary file not shown.

extractA.mexglx

-6.49 KB
Binary file not shown.

extractA.mexmaci64

-8.56 KB
Binary file not shown.

extractA.mexw32

-11.5 KB
Binary file not shown.

extractA.mexw64

-39 KB
Binary file not shown.

findblks.mexa64

-13.7 KB
Binary file not shown.

findblks.mexglx

-10.4 KB
Binary file not shown.

findblks.mexmaci64

-13.1 KB
Binary file not shown.

findblks.mexw32

-15.5 KB
Binary file not shown.

findblks.mexw64

-44.5 KB
Binary file not shown.

finsymbden.mexa64

-10.5 KB
Binary file not shown.

finsymbden.mexglx

-8.44 KB
Binary file not shown.

finsymbden.mexmaci64

-13 KB
Binary file not shown.

finsymbden.mexw32

-13 KB
Binary file not shown.

finsymbden.mexw64

-42 KB
Binary file not shown.

fwblkslv.mexa64

-11.3 KB
Binary file not shown.

fwblkslv.mexglx

-9.22 KB
Binary file not shown.

fwblkslv.mexmaci64

-12.9 KB
Binary file not shown.

fwblkslv.mexw32

-12.5 KB
Binary file not shown.

fwblkslv.mexw64

-40.5 KB
Binary file not shown.

fwdpr1.mexa64

-11.8 KB
Binary file not shown.

fwdpr1.mexglx

-9.62 KB
Binary file not shown.

fwdpr1.mexmaci64

-12.9 KB
Binary file not shown.

fwdpr1.mexw32

-15 KB
Binary file not shown.

fwdpr1.mexw64

-43 KB
Binary file not shown.

getada1.mexa64

-9.18 KB
Binary file not shown.

getada1.mexglx

-7.27 KB
Binary file not shown.

getada1.mexmaci64

-8.62 KB
Binary file not shown.

getada1.mexw32

-12.5 KB
Binary file not shown.

getada1.mexw64

-40.5 KB
Binary file not shown.

getada2.mexa64

-11.1 KB
Binary file not shown.

getada2.mexglx

-8.86 KB
Binary file not shown.

getada2.mexmaci64

-12.8 KB
Binary file not shown.

getada2.mexw32

-14 KB
Binary file not shown.

getada2.mexw64

-42 KB
Binary file not shown.

getada3.mexa64

-21.5 KB
Binary file not shown.

getada3.mexglx

-18.2 KB
Binary file not shown.

getada3.mexmaci64

-21.7 KB
Binary file not shown.

getada3.mexw32

-24.5 KB
Binary file not shown.

getada3.mexw64

-55 KB
Binary file not shown.

givensrot.mexa64

-11.4 KB
Binary file not shown.

givensrot.mexglx

-9.07 KB
Binary file not shown.

givensrot.mexmaci64

-12.7 KB
Binary file not shown.

givensrot.mexw32

-13.5 KB
Binary file not shown.

givensrot.mexw64

-41.5 KB
Binary file not shown.

incorder.mexa64

-10.1 KB
Binary file not shown.

incorder.mexglx

-8.08 KB
Binary file not shown.

incorder.mexmaci64

-13 KB
Binary file not shown.

incorder.mexw32

-12.5 KB
Binary file not shown.

incorder.mexw64

-40.5 KB
Binary file not shown.

install_sedumi.m

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,34 @@ function install_sedumi( varargin )
111111

112112
% Get first file of "targets64" and replace ".c" with mex-extension.
113113
% Keep order of "targets64".
114+
mext = mexext;
114115
mex_binaries = cellfun (@strtok, targets64, 'UniformOutput', false);
115-
mex_binaries = cellfun (@(x) strrep (x, '.c', ['.', mexext()]), ...
116+
mex_binaries = cellfun (@(x) strrep (x, '.c', ['.', mext]), ...
116117
mex_binaries, 'UniformOutput', false);
117118

119+
fs = filesep();
118120
sedumi_path = mfilename ('fullpath');
119-
sedumi_path = sedumi_path(1:max ([1, strfind(sedumi_path, filesep ())]) - 1);
121+
sedumi_path = sedumi_path(1:max ([1, strfind(sedumi_path, fs)]) - 1);
120122

123+
% Note the use of 0.01 here. That's because version 7 had more than 10
124+
% minor releases, so 7.10-7.14 need to be ordered after 7.01-7.09.
125+
VERSION = [1, 0.01] * sscanf (version (), '%d.%d');
126+
COMPUTER = computer ();
121127
ISOCTAVE = (exist ('OCTAVE_VERSION', 'builtin') == 5);
128+
mdir = '';
122129
if (ISOCTAVE)
123130
prog = 'Octave';
124131
page_output_immediately (true, 'local');
132+
switch COMPUTER
133+
case 'x86_64-pc-linux-gnu'
134+
mdir = 'o_lin';
135+
case 'x86_64-apple-darwin21.6.0'
136+
mdir = 'o_maci';
137+
case 'aarch64-apple-darwin23.4.0'
138+
mdir = 'o_maca';
139+
case 'i686-w64-mingw32'
140+
mdir = 'o_win';
141+
end
125142
else
126143
prog = 'Matlab';
127144
end
@@ -141,11 +158,19 @@ function install_sedumi( varargin )
141158
% guarantee that rebuilding will work.
142159
if (~need_rebuild)
143160
fprintf ('Looking for existing binaries...');
144-
nfound = count_mex_binaries ();
145-
if (nfound == 0)
161+
nfound = [0, 0];
162+
for k = 1 : length(targets64)
163+
targ = mex_binaries{k};
164+
if exist( [ sedumi_path, fs, targ ], 'file' )
165+
nfound(1) = nfound(1) + 1;
166+
elseif ~isempty(mdir) && exist( [ sedumi_path, fs, mdir, fs, targ ], 'file' )
167+
nfound(2) = nfound(2) + 1;
168+
end
169+
end
170+
if sum(nfound) == 0
146171
fprintf ('none found; building...\n');
147172
need_rebuild = true;
148-
elseif (nfound < length(targets64))
173+
elseif sum(nfound) < length(targets64)
149174
fprintf ('incomplete set found.\n');
150175
disp (line_sep);
151176
error (['%s\n', ...
@@ -163,6 +188,7 @@ function install_sedumi( varargin )
163188
end
164189

165190
if (need_rebuild)
191+
mdir = ''
166192
disp ('Attempting to recompile the SeDuMi binaries:');
167193

168194
% Customization by providing a mex template.
@@ -173,6 +199,7 @@ function install_sedumi( varargin )
173199
if (ISOCTAVE)
174200
% Matlab mex optimization '-O' corresponds to gcc '-O2',
175201
% whereas calling '-O' would result in gcc '-O1'.
202+
flags{end+1} = '--mex';
176203
flags{end+1} = '-O2';
177204
flags{end+1} = '-DOCTAVE';
178205
flags{end+1} = '-Wall';
@@ -189,10 +216,6 @@ function install_sedumi( varargin )
189216
flags{end+1} = '-I/usr/include/openblas';
190217
end
191218
else % Matlab
192-
% Note the use of 0.01 here. That's because version 7 had more than 10
193-
% minor releases, so 7.10-7.14 need to be ordered after 7.01-7.09.
194-
VERSION = [1, 0.01] * sscanf (version (), '%d.%d');
195-
COMPUTER = computer ();
196219
% The last Matlab release with a 32 bit version was R2015b.
197220
IS64BIT = strcmp (COMPUTER(end-1:end), '64');
198221
flags{end+1} = '-O'; % optimize
@@ -273,6 +296,15 @@ function install_sedumi( varargin )
273296
else
274297
fprintf ('already there.\n');
275298
end
299+
if (ISOCTAVE && ~isempty(mdir))
300+
fprintf (' Octave MEX directory... ');
301+
if (~is_on_search_path (fullfile(sedumi_path, mdir)))
302+
addpath (fullfile(sedumi_path, mdir));
303+
fprintf ('added.\n');
304+
else
305+
fprintf ('already there.\n');
306+
end
307+
end
276308
fprintf (' Conversion directory... ');
277309
if (~is_on_search_path (fullfile (sedumi_path, 'conversion')))
278310
addpath (fullfile (sedumi_path, 'conversion'));

invcholfac.mexa64

-21.8 KB
Binary file not shown.

invcholfac.mexglx

-18.3 KB
Binary file not shown.

invcholfac.mexmaci64

-21.5 KB
Binary file not shown.

invcholfac.mexw32

-22 KB
Binary file not shown.

invcholfac.mexw64

-51.5 KB
Binary file not shown.

iswnbr.mexa64

-9.47 KB
Binary file not shown.

iswnbr.mexglx

-7.67 KB
Binary file not shown.

iswnbr.mexmaci64

-8.59 KB
Binary file not shown.

iswnbr.mexw32

-12 KB
Binary file not shown.

iswnbr.mexw64

-40 KB
Binary file not shown.

ordmmdmex.mexa64

-15.7 KB
Binary file not shown.

ordmmdmex.mexglx

-13.5 KB
Binary file not shown.

ordmmdmex.mexmaci64

-18.2 KB
Binary file not shown.

ordmmdmex.mexw32

-17 KB
Binary file not shown.

ordmmdmex.mexw64

-44 KB
Binary file not shown.

partitA.mexa64

-9.26 KB
Binary file not shown.

partitA.mexglx

-7.42 KB
Binary file not shown.

partitA.mexmaci64

-8.71 KB
Binary file not shown.

partitA.mexw32

-12 KB
Binary file not shown.

partitA.mexw64

-40.5 KB
Binary file not shown.

psdframeit.mexa64

-15.9 KB
Binary file not shown.

psdframeit.mexglx

-13.5 KB
Binary file not shown.

psdframeit.mexmaci64

-17.2 KB
Binary file not shown.

psdframeit.mexw32

-16.5 KB
Binary file not shown.

psdframeit.mexw64

-46 KB
Binary file not shown.

psdinvjmul.mexa64

-17.1 KB
Binary file not shown.

psdinvjmul.mexglx

-14.6 KB
Binary file not shown.

psdinvjmul.mexmaci64

-17.3 KB
Binary file not shown.

psdinvjmul.mexw32

-18 KB
Binary file not shown.

psdinvjmul.mexw64

-49 KB
Binary file not shown.

qblkmul.mexa64

-7.68 KB
Binary file not shown.

qblkmul.mexglx

-6.11 KB
Binary file not shown.

qblkmul.mexmaci64

-8.54 KB
Binary file not shown.

qblkmul.mexw32

-9.5 KB
Binary file not shown.

qblkmul.mexw64

-37.5 KB
Binary file not shown.

qrK.mexa64

-13.6 KB
Binary file not shown.

qrK.mexglx

-10.5 KB
Binary file not shown.

qrK.mexmaci64

-12.9 KB
Binary file not shown.

qrK.mexw32

-14.5 KB
Binary file not shown.

qrK.mexw64

-44.5 KB
Binary file not shown.

quadadd.mexa64

-6.97 KB
Binary file not shown.

quadadd.mexglx

-5.45 KB
Binary file not shown.

quadadd.mexmaci64

-8.37 KB
Binary file not shown.

quadadd.mexw32

-9.5 KB
Binary file not shown.

quadadd.mexw64

-37.5 KB
Binary file not shown.

sortnnz.mexa64

-9.21 KB
Binary file not shown.

sortnnz.mexglx

-7.35 KB
Binary file not shown.

sortnnz.mexmaci64

-8.73 KB
Binary file not shown.

sortnnz.mexw32

-12 KB
Binary file not shown.

sortnnz.mexw64

-40.5 KB
Binary file not shown.

sqrtinv.mexa64

-9.81 KB
Binary file not shown.

sqrtinv.mexglx

-7.72 KB
Binary file not shown.

sqrtinv.mexmaci64

-12.5 KB
Binary file not shown.

sqrtinv.mexw32

-12 KB
Binary file not shown.

sqrtinv.mexw64

-41 KB
Binary file not shown.

symbfwblk.mexa64

-9.97 KB
Binary file not shown.

symbfwblk.mexglx

-8.07 KB
Binary file not shown.

symbfwblk.mexmaci64

-12.9 KB
Binary file not shown.

symbfwblk.mexw32

-13 KB
Binary file not shown.

symbfwblk.mexw64

-40.5 KB
Binary file not shown.

symfctmex.mexa64

-20 KB
Binary file not shown.

symfctmex.mexglx

-17 KB
Binary file not shown.

symfctmex.mexmaci64

-19 KB
Binary file not shown.

symfctmex.mexw32

-20 KB
Binary file not shown.

symfctmex.mexw64

-47.5 KB
Binary file not shown.

urotorder.mexa64

-18 KB
Binary file not shown.

urotorder.mexglx

-14.1 KB
Binary file not shown.

urotorder.mexmaci64

-17.2 KB
Binary file not shown.

urotorder.mexw32

-17.5 KB
Binary file not shown.

urotorder.mexw64

-47.5 KB
Binary file not shown.

vecsym.mexa64

-9.85 KB
Binary file not shown.

vecsym.mexglx

-7.9 KB
Binary file not shown.

vecsym.mexmaci64

-12.6 KB
Binary file not shown.

vecsym.mexw32

-12.5 KB
Binary file not shown.

vecsym.mexw64

-40 KB
Binary file not shown.

0 commit comments

Comments
 (0)