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

Upgrades to SuiteSparse 7.70 #11

Merged
merged 10 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
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
11 changes: 6 additions & 5 deletions .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
KVXOPT_BUILD_GLPK: 1
KVXOPT_BUILD_DSDP: 1
KVXOPT_BUILD_OSQP: 1
SUITESPARSE_VERSION: 7.2.1
SUITESPARSE_SHA256: 304e959a163ff74f8f4055dade3e0b5498d9aa3b1c483633bb400620f521509f
SUITESPARSE_VERSION: 7.7.0
SUITESPARSE_SHA256: 529b067f5d80981f45ddf6766627b8fc5af619822f068f342aab776e683df4f3
OSQP_VERSION: 0.6.3

strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11']
suite-sparse: [lib_suitesparse]

steps:
Expand Down Expand Up @@ -81,12 +81,13 @@ jobs:
pytest --cov=kvxopt --cov-report=xml tests/

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
directory: ./coverage/reports/
env_vars: OS,PYTHON
files: ./coverage.xml
fail_ci_if_error: true
flags: unittests
name: codecov-kvxopt
token: ${{ secrets.CODECOV_TOKEN }}
slug: sanurielf/kvxopt
verbose: true
8 changes: 4 additions & 4 deletions .github/workflows/macos_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
KVXOPT_BUILD_GLPK: 1
KVXOPT_BUILD_OSQP: 1
KVXOPT_BUILD_DSDP: 0
SUITESPARSE_VERSION: 7.2.1
SUITESPARSE_SHA256: 304e959a163ff74f8f4055dade3e0b5498d9aa3b1c483633bb400620f521509f
SUITESPARSE_VERSION: 7.7.0
SUITESPARSE_SHA256: 529b067f5d80981f45ddf6766627b8fc5af619822f068f342aab776e683df4f3

strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11']
suite-sparse: [lib_suitesparse]

steps:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
run: |
brew install suite-sparse
brew list suite-sparse
echo "KVXOPT_SUITESPARSE_INC_DIR=$(brew --prefix)/include" >> $GITHUB_ENV
echo "KVXOPT_SUITESPARSE_INC_DIR=$(brew --prefix)/include/suitesparse" >> $GITHUB_ENV
echo "KVXOPT_SUITESPARSE_LIB_DIR=$(brew --prefix)/lib" >> $GITHUB_ENV

if: ${{ matrix.suite-sparse == 'lib_suitesparse' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ jobs:
KVXOPT_BUILD_DSDP: 0
KVXOPT_MSVC: 1
KVXOPT_BUILD_OSQP: 1
SUITESPARSE_VERSION: 7.2.1
SUITESPARSE_SHA256: 304e959a163ff74f8f4055dade3e0b5498d9aa3b1c483633bb400620f521509f
SUITESPARSE_VERSION: 7.7.0
SUITESPARSE_SHA256: 529b067f5d80981f45ddf6766627b8fc5af619822f068f342aab776e683df4f3
OPENBLAS_VERSION: 0.3.23
FFTW_VERSION: 3.3.5

Expand Down
4 changes: 2 additions & 2 deletions doc/html/c-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<span id="c-capi"></span><h1>C API<a class="headerlink" href="#c-api" title="Permalink to this heading"></a></h1>
<p>The API can be used to extend CVXOPT with interfaces to external C routines
and libraries. A C program that creates or manipulates the dense or sparse
matrix objects defined in CVXOPT must include the <code class="xref py py-const docutils literal notranslate"><span class="pre">cvxopt.h</span></code> header
matrix objects defined in CVXOPT must include the <code class="xref py py-const docutils literal notranslate"><span class="pre">kvxopt.h</span></code> header
file in the <code class="xref py py-const docutils literal notranslate"><span class="pre">src</span></code> directory of the distribution.</p>
<p>Before the C API can be used in an extension module it must be initialized
by calling the macro <code class="xref c c-macro docutils literal notranslate"><span class="pre">import_cvxopt</span></code>. As an example we show the
Expand Down Expand Up @@ -127,7 +127,7 @@
</div>
<section id="dense-matrices">
<h2>Dense Matrices<a class="headerlink" href="#dense-matrices" title="Permalink to this heading"></a></h2>
<p>As can be seen from the header file <code class="xref py py-const docutils literal notranslate"><span class="pre">cvxopt.h</span></code>, a <code class="xref py py-class docutils literal notranslate"><span class="pre">matrix</span></code> is
<p>As can be seen from the header file <code class="xref py py-const docutils literal notranslate"><span class="pre">kvxopt.h</span></code>, a <code class="xref py py-class docutils literal notranslate"><span class="pre">matrix</span></code> is
essentially a structure with four fields. The fields <code class="xref c c-member docutils literal notranslate"><span class="pre">nrows</span></code> and
<code class="xref c c-member docutils literal notranslate"><span class="pre">ncols</span></code> are two integers that specify the dimensions. The
<code class="xref c c-member docutils literal notranslate"><span class="pre">id</span></code> field controls the type of the matrix and can have values
Expand Down
93 changes: 70 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@
DLONG = False



# Macros
MACROS = []
if BLAS_NOUNDERSCORES: MACROS.append(('BLAS_NO_UNDERSCORE',''))
Expand Down Expand Up @@ -293,25 +292,70 @@
SUITESPARSE_SRC_DIR + '/SuiteSparse_config/SuiteSparse_config.c']

if DLONG:
klu_sources += \
glob(SUITESPARSE_SRC_DIR + '/AMD/Source/*_l*.c') +\
glob(SUITESPARSE_SRC_DIR + '/BTF/Source/*_l_*.c') +\
[SUITESPARSE_SRC_DIR + '/COLAMD/Source/colamd_l.c'] +\
[SUITESPARSE_SRC_DIR + '/KLU/Source/klu_l.c'] +\
glob(SUITESPARSE_SRC_DIR + '/KLU/Source/klu_l*.c') +\
glob(SUITESPARSE_SRC_DIR + '/KLU/Source/klu_zl*.c')
klu_sources += (
glob(SUITESPARSE_SRC_DIR + "/AMD/Source/*_l*.c")
+ glob(SUITESPARSE_SRC_DIR + "/BTF/Source/*_l_*.c")
+ [SUITESPARSE_SRC_DIR + "/COLAMD/Source/colamd_l.c"]
+ [
SUITESPARSE_SRC_DIR + "/KLU/Source/" + x + ".c"
for x in [
"klu_l",
"klu_zl",
"klu_l_memory",
"klu_l_analyze_given",
"klu_l_scale",
"klu_zl_scale",
"klu_l_kernel",
"klu_zl_kernel",
"klu_zl_factor",
"klu_zl_solve",
"klu_l_free_numeric",
"klu_zl_free_numeric",
"klu_l_analyze",
"klu_l_defaults",
"klu_l_solve",
"klu_l_factor",
"klu_zl_extract",
"klu_zl_tsolve",
"klu_l_tsolve",
"klu_l_free_symbolic",
"klu_l_extract",
]
]
)
else:
klu_sources += \
glob(SUITESPARSE_SRC_DIR + '/AMD/Source/*[!_l]*.c') +\
glob(SUITESPARSE_SRC_DIR + '/BTF/Source/*[!_l_]*.c') +\
[SUITESPARSE_SRC_DIR + '/COLAMD/Source/colamd.c'] +\
[SUITESPARSE_SRC_DIR + '/KLU/Source/klu.c'] +\
list(set(glob(SUITESPARSE_SRC_DIR + '/KLU/Source/klu_[!l]*.c')) &
set(glob(SUITESPARSE_SRC_DIR + '/KLU/Source/klu_[!zl]*.c'))) +\
[SUITESPARSE_SRC_DIR + '/KLU/Source/klu_z.c'] +\
glob(SUITESPARSE_SRC_DIR + '/KLU/Source/klu_z_*.c')

print(klu_sources)
klu_sources += (
glob(SUITESPARSE_SRC_DIR + "/AMD/Source/*[!_l]*.c")
+ glob(SUITESPARSE_SRC_DIR + "/BTF/Source/*[!_l_]*.c")
+ [SUITESPARSE_SRC_DIR + "/COLAMD/Source/colamd.c"]
+ [
SUITESPARSE_SRC_DIR + "/KLU/Source/" + x + ".c"
for x in [
"klu",
"klu_z",
"klu_memory",
"klu_analyze_given",
"klu_scale",
"klu_z_scale",
"klu_analyze",
"klu_kernel",
"klu_z_kernel",
"klu_free_numeric",
"klu_z_free_numeric",
"klu_defaults",
"klu_solve",
"klu_tsolve",
"klu_z_solve",
"klu_z_tsolve",
"klu_factor",
"klu_z_factor",
"klu_extract",
"klu_z_extract",
"klu_free_symbolic",
]
]
)

klu = Extension('klu',
include_dirs = [ SUITESPARSE_SRC_DIR + '/KLU/Include',
SUITESPARSE_SRC_DIR + '/KLU/Source',
Expand Down Expand Up @@ -339,9 +383,13 @@
library_dirs = [SUITESPARSE_LIB_DIR, BLAS_LIB_DIR],
sources = [ 'src/C/cholmod.c' ])
else:
cholmod_sources = [ 'src/C/cholmod.c' ] +\
[SUITESPARSE_SRC_DIR + '/SuiteSparse_config/SuiteSparse_config.c'] +\
[SUITESPARSE_SRC_DIR + '/CHOLMOD/Check/cholmod_check.c']
cholmod_sources = (
["src/C/cholmod.c"]
+ [SUITESPARSE_SRC_DIR + "/SuiteSparse_config/SuiteSparse_config.c"]
+ glob(SUITESPARSE_SRC_DIR + "/CHOLMOD/Check/cholmod_*.c")
+ glob(SUITESPARSE_SRC_DIR + "/CHOLMOD/Utility/cholmod_*.c")
+ glob(SUITESPARSE_SRC_DIR + "/CHOLMOD/MatrixOps/cholmod_*.c")
)

if DLONG:
cholmod_sources += \
Expand All @@ -358,7 +406,6 @@
glob(SUITESPARSE_SRC_DIR + '/CHOLMOD/Cholesky/cholmod_[!l_]*.c') +\
glob(SUITESPARSE_SRC_DIR + '/CHOLMOD/Supernodal/cholmod_[!l_]*.c')


cholmod = Extension('cholmod',
library_dirs = [ BLAS_LIB_DIR ],
libraries = LAPACK_LIB + BLAS_LIB,
Expand Down
2 changes: 1 addition & 1 deletion src/C/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "cvxopt.h"
#include "kvxopt.h"
#include "amd.h"
#include "misc.h"

Expand Down
2 changes: 1 addition & 1 deletion src/C/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define BASE_MODULE

#include "Python.h"
#include "cvxopt.h"
#include "kvxopt.h"
#include "misc.h"

#include <complexobject.h>
Expand Down
2 changes: 1 addition & 1 deletion src/C/blas.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

#include "Python.h"
#include "cvxopt.h"
#include "kvxopt.h"
#include "misc.h"

#ifndef _MSC_VER
Expand Down
2 changes: 1 addition & 1 deletion src/C/cholmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#define NO_ANSI99_COMPLEX

#include "cvxopt.h"
#include "kvxopt.h"
#include "misc.h"
#include "cholmod.h"
#include "complex.h"
Expand Down
2 changes: 1 addition & 1 deletion src/C/dense.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define BASE_MODULE

#include "Python.h"
#include "cvxopt.h"
#include "kvxopt.h"
#include "misc.h"
#include <complexobject.h>
#include <limits.h>
Expand Down
2 changes: 1 addition & 1 deletion src/C/dsdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "cvxopt.h"
#include "kvxopt.h"
#include "misc.h"
#include "dsdp5.h"
#include "math.h"
Expand Down
2 changes: 1 addition & 1 deletion src/C/fftw.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "cvxopt.h"
#include "kvxopt.h"
#include "misc.h"
#include <fftw3.h>

Expand Down
2 changes: 1 addition & 1 deletion src/C/glpk.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "cvxopt.h"
#include "kvxopt.h"
#include "misc.h"
#include <glpk.h>
#include <float.h>
Expand Down
2 changes: 1 addition & 1 deletion src/C/gsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "cvxopt.h"
#include "kvxopt.h"

#include <complex.h>

Expand Down
2 changes: 1 addition & 1 deletion src/C/gurobi.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "cvxopt.h"
#include "kvxopt.h"
#include "gurobi_c.h"
#include "misc.h"

Expand Down
3 changes: 1 addition & 2 deletions src/C/klu.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
*/


#include "cvxopt.h"
#include "kvxopt.h"
#include "klu.h"
#include "misc.h"


// KLU functions and types/structures
#if (SIZEOF_INT < SIZEOF_SIZE_T)
#define KLUD(name) klu_l_ ## name
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/C/lapack.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

#include "Python.h"
#include "cvxopt.h"
#include "kvxopt.h"
#include "misc.h"

#ifndef _MSC_VER
Expand Down
2 changes: 1 addition & 1 deletion src/C/misc_solvers.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

#include "Python.h"
#include "cvxopt.h"
#include "kvxopt.h"
#include "misc.h"
#include "math.h"
#include "float.h"
Expand Down
2 changes: 1 addition & 1 deletion src/C/osqp.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "osqp.h"

#include "cs.h"
#include "cvxopt.h"
#include "kvxopt.h"
#include "misc.h"

#define xstr(s) str(s)
Expand Down
2 changes: 1 addition & 1 deletion src/C/sparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define BASE_MODULE

#include "Python.h"
#include "cvxopt.h"
#include "kvxopt.h"
#include "misc.h"

#include <complexobject.h>
Expand Down
2 changes: 1 addition & 1 deletion src/C/umfpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "cvxopt.h"
#include "kvxopt.h"
#include "umfpack.h"
#include "misc.h"

Expand Down
Loading