Opened 13 months ago
Last modified 2 months ago
#31905 new defect
Fix suitesparse / cvxopt path configuration for Apple Silicon, Alpine Linux
Reported by: | kcrisman | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-9.7 |
Component: | porting | Keywords: | |
Cc: | dimpase, mkoeppe, mjo, fbissey | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | Reported upstream. No feedback yet. | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
I was able to successfully build Sage on M1 (see #30592) but had two main types of doctest errors.
> However, I did see some of this type as well in the sage/numerical tests: > > ImportError: dlopen(/Users/karl.crisman/Downloads/BrewSage/sage-9.4.beta0/local/lib/python3.9/site-packages/cvxopt/cholmod.cpython-39-darwin.so, 2): Symbol not found: _cholmod_l_allocate_dense > Referenced from: /Users/karl.crisman/Downloads/BrewSage/sage-9.4.beta0/local/lib/python3.9/site-packages/cvxopt/cholmod.cpython-39-darwin.so > Expected in: flat namespace > in /Users/karl.crisman/Downloads/BrewSage/sage-9.4.beta0/local/lib/python3.9/site-packages/cvxopt/cholmod.cpython-39-darwin.so otool -L /Users/karl.crisman/Downloads/BrewSage/sage-9.4.beta0/local/lib/python3.9/site-packages/cvxopt/cholmod.cpython-39-darwin.so /Users/karl.crisman/Downloads/BrewSage/sage-9.4.beta0/local/lib/python3.9/site-packages/cvxopt/cholmod.cpython-39-darwin.so: /opt/homebrew/opt/openblas/lib/libopenblas.0.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)
This apparently requires a change in the setup.py (see this sage-devel discussion):
if sys.platform.startswith("darwin"): SUITESPARSE_LIB_DIR = '/usr/local/lib' SUITESPARSE_INC_DIR = '/usr/local/include'
to allow /opt/homebrew
.
Change History (9)
comment:1 Changed 13 months ago by
comment:2 follow-up: ↓ 3 Changed 13 months ago by
Upstream report...
comment:3 in reply to: ↑ 2 Changed 13 months ago by
Upstream report...
Will they see this as a bug? I already asked about whether to report upstream here.
comment:4 Changed 13 months ago by
- Report Upstream changed from N/A to Reported upstream. No feedback yet.
comment:5 Changed 10 months ago by
- Milestone changed from sage-9.4 to sage-9.5
comment:6 Changed 6 months ago by
- Cc mjo fbissey added
These defaults in cvxopt's setup.py can be overridden using environment variables
CVXOPT_SUITESPARSE_INC_DIR
, CVXOPT_SUITESPARSE_LIB_DIR
.
We already set these variables when we build our own suitesparse
(then SAGE_SUITESPARSE_PREFIX
is nonempty).
On macOS, we could just set these variables also (to something arbitrary) when system suitesparse is in use.
See also https://trac.sagemath.org/ticket/33083#comment:40 - a related issue on alpine
.
comment:7 Changed 6 months ago by
- Summary changed from cvxopt links wrong M1 directory to Fix suitesparse / cvxopt path configuration for Apple Silicon, Alpine Linux
comment:8 Changed 5 months ago by
- Milestone changed from sage-9.5 to sage-9.6
comment:9 Changed 2 months ago by
- Milestone changed from sage-9.6 to sage-9.7
The following diff works and fixes the bad doctests for me (except some unrelated ones for graphics).
build/pkgs/cvxopt/patches/libsuitesparse_path.patch
index d312416..4fa14c4 100644I am not currently in a position to make a proper branch with this testing setup, my apologies, and in any case it needs some additional logic to test for which version of MacOS we have and/or if homebrew is being used.