diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 452f107..8ddb386 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -9,7 +9,7 @@ on: branches: - master jobs: - build: + build-mex: runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -33,12 +33,55 @@ jobs: name: mexfiles-${{ matrix.os }} path: | Solver/Mexfun/*.mex* + build-oct: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest,windows-latest,macos-latest,macos-14] + steps: + - 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 + octave_dir=o_lin + elif [ "${{ matrix.os }}" = windows-latest ]; then + choco install octave.portable + octave_dir=o_win + else + brew install octave + if [ "${{ matrix.os }}" = macos-latest ]; then + octave_dir=o_maci + else + octave_dir=o_maca + fi + fi + echo "OCTAVE_DIR=$octave_dir" >> $GITHUB_ENV + - name: Build Octave mex files + shell: bash + run: | + octave_dir=Solver/Mexfun/$OCTAVE_DIR + octave --eval 'computer' + octave --eval 'install_sdpt3 -rebuild' + mkdir -p $octave_dir + mv Solver/Mexfun/*.mex $octave_dir + - uses: actions/upload-artifact@v4 + with: + name: mexfiles-oct-${{ matrix.os }} + path: | + Solver/Mexfun/$OCTAVE_DIR/*.mex* package: - needs: build + needs: [build-mex,build-oct] runs-on: ubuntu-latest steps: - name: Retrieve the source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/download-artifact@v4 diff --git a/Solver/Mexfun/o_win/mexMatvec.mex b/Solver/Mexfun/o_win/mexMatvec.mex deleted file mode 100644 index e220568..0000000 Binary files a/Solver/Mexfun/o_win/mexMatvec.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexProd2.mex b/Solver/Mexfun/o_win/mexProd2.mex deleted file mode 100644 index 5e19a3a..0000000 Binary files a/Solver/Mexfun/o_win/mexProd2.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexProd2nz.mex b/Solver/Mexfun/o_win/mexProd2nz.mex deleted file mode 100644 index 4b311de..0000000 Binary files a/Solver/Mexfun/o_win/mexProd2nz.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexexpand.mex b/Solver/Mexfun/o_win/mexexpand.mex deleted file mode 100644 index 443ccda..0000000 Binary files a/Solver/Mexfun/o_win/mexexpand.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexinprod.mex b/Solver/Mexfun/o_win/mexinprod.mex deleted file mode 100644 index c2c2c3a..0000000 Binary files a/Solver/Mexfun/o_win/mexinprod.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexmat.mex b/Solver/Mexfun/o_win/mexmat.mex deleted file mode 100644 index 02d15b5..0000000 Binary files a/Solver/Mexfun/o_win/mexmat.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexnnz.mex b/Solver/Mexfun/o_win/mexnnz.mex deleted file mode 100644 index 8762e39..0000000 Binary files a/Solver/Mexfun/o_win/mexnnz.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexqops.mex b/Solver/Mexfun/o_win/mexqops.mex deleted file mode 100644 index bf039ec..0000000 Binary files a/Solver/Mexfun/o_win/mexqops.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexschur.mex b/Solver/Mexfun/o_win/mexschur.mex deleted file mode 100644 index 40550cf..0000000 Binary files a/Solver/Mexfun/o_win/mexschur.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexschurfun.mex b/Solver/Mexfun/o_win/mexschurfun.mex deleted file mode 100644 index b9ed5ed..0000000 Binary files a/Solver/Mexfun/o_win/mexschurfun.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexskron.mex b/Solver/Mexfun/o_win/mexskron.mex deleted file mode 100644 index 5639b79..0000000 Binary files a/Solver/Mexfun/o_win/mexskron.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexsmat.mex b/Solver/Mexfun/o_win/mexsmat.mex deleted file mode 100644 index 0864077..0000000 Binary files a/Solver/Mexfun/o_win/mexsmat.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mexsvec.mex b/Solver/Mexfun/o_win/mexsvec.mex deleted file mode 100644 index db4a3bd..0000000 Binary files a/Solver/Mexfun/o_win/mexsvec.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mextriang.mex b/Solver/Mexfun/o_win/mextriang.mex deleted file mode 100644 index d7abaab..0000000 Binary files a/Solver/Mexfun/o_win/mextriang.mex and /dev/null differ diff --git a/Solver/Mexfun/o_win/mextriangsp.mex b/Solver/Mexfun/o_win/mextriangsp.mex deleted file mode 100644 index c52d3cd..0000000 Binary files a/Solver/Mexfun/o_win/mextriangsp.mex and /dev/null differ diff --git a/install_sdpt3.m b/install_sdpt3.m index 796ad2e..df0c84a 100644 --- a/install_sdpt3.m +++ b/install_sdpt3.m @@ -45,6 +45,12 @@ function install_sdpt3( varargin ) mdir = ''; if ISOCTAVE && VERSION >= 4, 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 @@ -93,15 +99,20 @@ function install_sdpt3( varargin ) % Octave has mwSize and mwIndex hardcoded in mex.h as ints. % There is no definition for mwSignedIndex so include it here. % This means that Octave ignores the -largeArrayDims flag. + cmd = 'mkoctfile'; + flags{end+1} = '--mex'; + flags{end+1} = '--verbose'; if VERSION < 3.08, flags{end+1} = '-DmwSignedIndex=int'; end else + cmd = 'mex'; if ispc, flags = {'-DPC'}; elseif isunix, flags = {'-DUNIX'}; end + flags{end+1}={'-v'}; if strcmp(COMPUTER(end-1:end),'64') && ( VERSION >= 7.03 ), flags{end+1} = '-largeArrayDims'; elseif VERSION < 7.03, @@ -141,8 +152,9 @@ function install_sdpt3( varargin ) for i=1:length(targets64), targ = targets64{i}; mfile = [ targ(1:min(strfind(targ,'.'))), mext ]; - temp = [ 'mex ', flags, ' ', targets64{i}, '.c ', libs ]; - fprintf( ' %s: %s\n', mfile, targ ); + temp = [ cmd, flags, ' ', targets64{i}, '.c ', libs ]; + fprintf(' %s\n', temp); + % fprintf( ' %s: %s\n', mfile, targ ); eval( temp, 'failed=true;' ); %#ok end cd( olddir );