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

Hopefully fixes builds on 3.12. #70

Merged
merged 56 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
352fe5f
Hopefully fixes builds on 3.12.
enzbus Oct 7, 2023
752a8d6
Update Makefile
enzbus Oct 7, 2023
7225748
Update Makefile
enzbus Oct 7, 2023
ae09b24
trying to switch to meson
enzbus Oct 8, 2023
a8dc9ee
Merge branch 'master' of github.com:enzbus/scs-python
enzbus Oct 8, 2023
73946fb
trying to get a meson build
enzbus Oct 8, 2023
951ce78
Makefile superflous
enzbus Oct 8, 2023
a7d0868
moved vendored scs folder to avoid naming conflict
enzbus Oct 8, 2023
5895b15
basic build working
enzbus Oct 8, 2023
6672832
@rgommers comments, macros, and trying blas link
enzbus Oct 8, 2023
b5a3641
added indirect
enzbus Oct 8, 2023
e88be4f
indirect compiles (was missing flags)
enzbus Oct 8, 2023
c2f36be
pip installation works, including __init__.py
enzbus Oct 8, 2023
ae00033
pip installatin works, only blas/lapack linking missing (probably typ…
enzbus Oct 8, 2023
d29c051
Error out with a clear message if the SCS git submodule is missing
rgommers Oct 8, 2023
7601bc6
Remove -O3; that's the default in meson-python, and isn't portable.
rgommers Oct 8, 2023
3fdab57
Merge pull request #1 from rgommers/meson-fixes
enzbus Oct 8, 2023
321755c
Silence -Wunused-result warnings
rgommers Oct 8, 2023
16f1b02
blas linking works, thanks @rgommers
enzbus Oct 8, 2023
fc83dcc
Merge branch 'meson-fixes' into master
enzbus Oct 8, 2023
97f26c9
Use Accelerate as BLAS library on macOS
rgommers Oct 8, 2023
85f1079
Merge pull request #2 from rgommers/use-accelerate
enzbus Oct 8, 2023
5ab81ab
fixed OLD_setup.py to match new directories name
enzbus Oct 8, 2023
c2685c4
disabled 3.12 on github yamml jobs that are not recoverable
enzbus Oct 8, 2023
fc28677
edited github yamml with OLD_setup.py and new build
enzbus Oct 8, 2023
88264c3
black gh checker on oldsetup.py
Oct 25, 2023
a7690a1
added pyproject.toml target to bumpversion
Oct 25, 2023
f90a6a3
added ddlong flags at @bodono request
Oct 25, 2023
6cec24a
moved from https://github.com/rickstaa/action-black to official psf/b…
Oct 25, 2023
d7099ff
fixing github yaml fails
Oct 25, 2023
3fd0561
last failure of stupid black I want to see
Oct 25, 2023
fb8c217
was missing conda install on 3.12 builds
Oct 25, 2023
f07a83c
made non-darwin blas linked statically so linux wheels dont require b…
enzbus Nov 1, 2023
33b3145
made static linkage for non-darwin a meson option
enzbus Nov 2, 2023
577cfa2
added blas link build opts to github yaml
enzbus Nov 2, 2023
82644d1
debugging blas linking on windows via github ci
enzbus Nov 2, 2023
fb5dcc8
spacing on github yaml
enzbus Nov 2, 2023
41481de
trying to get windows build
Nov 2, 2023
5c3d16c
numpy.show_config changed api
enzbus Nov 2, 2023
72140e5
typo
enzbus Nov 2, 2023
580477d
one more try
enzbus Nov 2, 2023
ef655a2
miniconda lib location for windows on github ci
enzbus Nov 2, 2023
ee9017b
typo
enzbus Nov 2, 2023
538b995
maybe inverted slash?
enzbus Nov 2, 2023
a859327
maybe inverted slash?
enzbus Nov 2, 2023
e59e496
with same mixed spelling returned by np.show_config
enzbus Nov 2, 2023
bcacd76
some debugging information
enzbus Nov 2, 2023
f23e144
it was openblas.lib!
enzbus Nov 2, 2023
6d70a6b
fixed @rgommers comments on meson.build
enzbus Nov 3, 2023
4b081e6
switched from macos-10.15 to macos-latest in github ci
enzbus Nov 3, 2023
b893196
renamed OLD_setup.py to legacy_setup.py
enzbus Nov 3, 2023
12d45d4
if clause wasnt right
enzbus Nov 3, 2023
f7e2e98
removed bunch of conda installs that should not be needed (revert if …
enzbus Nov 3, 2023
a0fb593
typo
enzbus Nov 3, 2023
6036646
we needed numpy
enzbus Nov 3, 2023
9b7bbc1
problems with conda env and pip, better to restore same conda install…
enzbus Nov 3, 2023
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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-10.15 ] # windows-latest not finding MKL
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ]
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]

env:
PYTHON_VERSION: ${{ matrix.python-version }}
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ]
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]

env:
PYTHON_VERSION: ${{ matrix.python-version }}
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-10.15, windows-latest ]
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ]
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]

env:
PYTHON_VERSION: ${{ matrix.python-version }}
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-10.15 ]
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11" ]
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]

env:
RUNNER_OS: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "scs"]
path = scs
path = scs_source
url = https://github.com/cvxgrp/scs.git
2 changes: 2 additions & 0 deletions setup.py → OLD_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@


def get_infos():
if sys.version_info >= (3, 12):
return {}, {}
import numpy
from numpy.distutils.system_info import get_info

Expand Down
73 changes: 73 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
project('scs', 'c')

py = import('python').find_installation(pure: false)

# This uses the path as is, and avoids running the interpreter.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: this comment is a left-over and doesn't apply, so best to clean it up.

incdir_numpy = run_command(py,
[
'-c',
'''import os
import numpy as np
incdir = np.get_include()
print(incdir)
'''
],
check: true
).stdout().strip()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the one annoying thing you have to do indeed - I will get around to replacing all this with a simple dependency('numpy') at some point.

For now, I'd recommend to include the relpath bit from SciPy: https://github.com/scipy/scipy/blob/166e1f2b1ea0a1a2c3d7b030bd829549f8a5844a/scipy/meson.build#L54-L57

That will ensure things work fine with an in-tree virtual environment (so numpy is inside your source tree from Meson's perspective).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I guess fixed (there are more try/except there that I don't understand).


incdir = include_directories('scs_source/include')
pyincdir = include_directories('src')
linsysinc = include_directories('scs_source/linsys')
directinc = include_directories('scs_source/linsys/cpu/direct')
qdldlinc = include_directories('scs_source/linsys/external/qdldl')
amdinc = include_directories('scs_source/linsys/external/amd')


# meson doesn't support wildcards
# https://mesonbuild.com/FAQ.html#why-cant-i-specify-target-files-with-a-wildcard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably can be cleaned up as well now?


py.extension_module(
'_scs_direct',
enzbus marked this conversation as resolved.
Show resolved Hide resolved

'src/scspy.c',
'scs_source/linsys/cpu/direct/private.c',

# scs_source/src:
'scs_source/src/aa.c',
'scs_source/src/cones.c',
'scs_source/src/ctrlc.c',
'scs_source/src/exp_cone.c',
'scs_source/src/linalg.c',
'scs_source/src/normalize.c',
'scs_source/src/rw.c',
'scs_source/src/scs_version.c',
'scs_source/src/scs.c',
'scs_source/src/util.c',

# scs_source/linsys:
'scs_source/linsys/scs_matrix.c',
'scs_source/linsys/csparse.c',

# scs_source/linsys/external/qdldl:
'scs_source/linsys/external/qdldl/qdldl.c',

# scs_source/linsys/external/amd:
'scs_source/linsys/external/amd/amd_1.c',
'scs_source/linsys/external/amd/amd_2.c',
'scs_source/linsys/external/amd/amd_aat.c',
'scs_source/linsys/external/amd/amd_control.c',
'scs_source/linsys/external/amd/amd_defaults.c',
'scs_source/linsys/external/amd/amd_dump.c',
'scs_source/linsys/external/amd/amd_global.c',
'scs_source/linsys/external/amd/amd_info.c',
'scs_source/linsys/external/amd/amd_order.c',
'scs_source/linsys/external/amd/amd_post_tree.c',
'scs_source/linsys/external/amd/amd_postorder.c',
'scs_source/linsys/external/amd/amd_preprocess.c',
'scs_source/linsys/external/amd/amd_valid.c',
'scs_source/linsys/external/amd/SuiteSparse_config.c',

include_directories : [
incdir, pyincdir, linsysinc, directinc, qdldlinc, amdinc, incdir_numpy],
install: true,
)
19 changes: 13 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
[build-system]
requires = [
"setuptools<65.6.0",
"wheel",
"oldest-supported-numpy",
]
build-backend = "setuptools.build_meta"
build-backend = 'mesonpy'
requires = ['meson-python', 'numpy']

[project]
name = 'scs'
version = "3.2.3"
enzbus marked this conversation as resolved.
Show resolved Hide resolved
description = 'Splitting conic solver'
readme = 'README.md'
requires-python = '>=3.8'
license = {file = 'LICENSE'}
authors = [
{name = "Brendan O'Donoghue", email = "[email protected]"},
]
Loading