Opened 2 years ago

Last modified 4 days ago

#30710 needs_work defect

local-conda-forge-ubuntu-standard: cvxopt build fails

Reported by: mkoeppe Owned by:
Priority: major Milestone:
Component: packages: standard Keywords:
Cc: dimpase, isuruf Merged in:
Authors: Matthias Koeppe Reviewers: https://github.com/mkoeppe/sage/runs/7666787900
Report Upstream: N/A Work issues:
Branch: u/mkoeppe/local_conda_forge_ubuntu_standard__cvxopt_build_fails (Commits, GitHub, GitLab) Commit: b2a8d0acb979f95a12e7180368712821b294f52b
Dependencies: Stopgaps:

Status badges

Description (last modified by mkoeppe)

https://github.com/mkoeppe/sage/runs/1201631449

  building 'umfpack' extension
  /home/runner/work/sage/sage/.tox/local-conda-forge-ubuntu-standard/conda/bin/x86_64-conda-linux-gnu-cc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/runner/work/sage/sage/.tox/local-conda-forge-ubuntu-standard/conda/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/runner/work/sage/sage/.tox/local-conda-forge-ubuntu-standard/conda/include -fPIC -I/usr/include -I/home/runner/work/sage/sage/.tox/local-conda-forge-ubuntu-standard/local/include -I/home/runner/work/sage/sage/.tox/local-conda-forge-ubuntu-standard/conda/include/python3.8 -c src/C/umfpack.c -o build/temp.linux-x86_64-3.8/src/C/umfpack.o
  In file included from /home/runner/work/sage/sage/.tox/local-conda-forge-ubuntu-standard/conda/include/python3.8/Python.h:11:0,
                   from src/C/cvxopt.h:22,
                   from src/C/umfpack.c:22:
  /usr/include/limits.h:26:10: fatal error: bits/libc-header-start.h: No such file or directory
   #include <bits/libc-header-start.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command '/home/runner/work/sage/sage/.tox/local-conda-forge-ubuntu-standard/conda/bin/x86_64-conda-linux-gnu-cc' failed with exit status 1
  Building wheel for cvxopt (setup.py): finished with status 'error'
  ERROR: Failed building wheel for cvxopt
  Running setup.py clean for cvxopt

We adjust cvxopt's install script, last changed in #31584

Change History (26)

comment:1 Changed 2 years ago by mkoeppe

Summary: local-conda-forge-ubuntu-standard:local-conda-forge-ubuntu-standard: cvxopt build fails

comment:3 Changed 2 years ago by mkoeppe

Milestone: sage-9.2sage-9.3

comment:4 Changed 2 years ago by isuruf

Issue is that somewhere, some code is adding /usr/include to include directories and that conflicts with conda's sysroot.

comment:5 in reply to:  4 Changed 2 years ago by dimpase

Replying to isuruf:

Issue is that somewhere, some code is adding /usr/include to include directories and that conflicts with conda's sysroot.

isn't this done by cvxopt's `setup.py` ? Probably it needs a patch to special-case conda. (Sage does a bit of patching of this file.)

comment:6 Changed 2 years ago by mkoeppe

We can try if upgrading cvxopt (#31467) helps

comment:7 Changed 21 months ago by mkoeppe

Milestone: sage-9.3sage-9.4

Moving to 9.4, as 9.3 has been released.

comment:8 Changed 18 months ago by mkoeppe

Milestone: sage-9.4sage-9.5

comment:9 Changed 12 months ago by chapoton

Milestone: sage-9.5sage-9.6

bump to 9.6

comment:10 Changed 9 months ago by mkoeppe

Milestone: sage-9.6sage-9.7

comment:11 Changed 6 months ago by mkoeppe

Same after upgrade to cvxopt 1.3.0 in #34150 (https://github.com/mkoeppe/sage/runs/7646124113)

comment:12 Changed 6 months ago by isuruf

The lines at https://github.com/sagemath/sage/blob/master/build/pkgs/cvxopt/spkg-install.in#L68-L71 should be changed to

export CVXOPT_SUITESPARSE_LIB_DIR="${SAGE_LOCAL}/lib"
export CVXOPT_SUITESPARSE_INC_DIR="${SAGE_LOCAL}/include"

even when suitesparse is coming from the system, so that setup.py doesn't add its default /usr/include.

comment:13 Changed 6 months ago by mkoeppe

Yes, good idea.

In https://trac.sagemath.org/ticket/31584#comment:10, I wrote:

We do not need to do this when we use system suitesparse, as we do not want to claim authority that our configure script's suitesparse-finding technique is better than the one in cvxopt's install script.

But as it turns out, our technique (= just relying on standard compiler/linker paths) is better.

comment:14 Changed 6 months ago by mkoeppe

Branch: u/mkoeppe/local_conda_forge_ubuntu_standard__cvxopt_build_fails

comment:15 Changed 6 months ago by mkoeppe

Authors: Matthias Koeppe
Commit: 5d3902e03da915eab65cd522e93107efe5dcf7e2
Status: newneeds_review

New commits:

5d3902ebuild/pkgs/cvxopt/spkg-install.in: Unconditionally set CVXOPT_SUITESPARSE_LIB_DIR, CVXOPT_SUITESPARSE_INC_DIR

comment:16 Changed 6 months ago by isuruf

Why export CVXOPT_SUITESPARSE_LIB_DIR="${SAGE_LOCAL}" instead of export CVXOPT_SUITESPARSE_LIB_DIR="${SAGE_LOCAL}/lib"?

comment:17 Changed 6 months ago by git

Commit: 5d3902e03da915eab65cd522e93107efe5dcf7e2b2a8d0acb979f95a12e7180368712821b294f52b

Branch pushed to git repo; I updated commit sha1. New commits:

b2a8d0abuild/pkgs/cvxopt/spkg-install.in: Fixup

comment:18 Changed 6 months ago by mkoeppe

Thanks. This made no sense. I've fixed the line below for GLPK, which made the same error. In the end it does not matter what we put there -- this directory is in the library search path anyway.

comment:19 Changed 6 months ago by isuruf

Looks good to me. Can you run the github actions for this?

comment:20 Changed 6 months ago by mkoeppe

Reviewers: https://github.com/mkoeppe/sage/runs/7666787900

comment:21 Changed 6 months ago by mkoeppe

This fixed it but it looks like it broke other platforms, including ubuntu-jammy

  gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-rpath-link,/sage/local/lib -L/sage/local/lib -Wl,-rpath,/sage/local/lib -Wl,-rpath-link,/sage/local/lib -L/sage/local/lib -Wl,-rpath,/sage/local/lib -g -O2 build/temp.linux-x86_64-cpython-310/src/C/lapack.o -L/usr/lib/x86_64-linux-gnu/openblas-pthread/ -L/usr/lib/x86_64-linux-gnu -lopenblas -lopenblas -o build/lib.linux-x86_64-cpython-310/cvxopt/lapack.cpython-310-x86_64-linux-gnu.so
  building 'umfpack' extension
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -O2 -fPIC -I/sage/local/include -I/sage/local/var/lib/sage/venv-python3.10/include -I/usr/include/python3.10 -c src/C/umfpack.c -o build/temp.linux-x86_64-cpython-310/src/C/umfpack.o
  src/C/umfpack.c:23:10: fatal error: umfpack.h: No such file or directory
     23 | #include "umfpack.h"
        |          ^~~~~~~~~~~
  compilation terminated.

https://github.com/mkoeppe/sage/runs/7682737008?check_suite_focus=true

comment:22 Changed 6 months ago by mkoeppe

Status: needs_reviewneeds_work

comment:23 Changed 6 months ago by mkoeppe

Description: modified (diff)

comment:24 Changed 6 months ago by mkoeppe

Related: #31905

comment:25 Changed 5 months ago by mkoeppe

Milestone: sage-9.7sage-9.8

comment:26 Changed 4 days ago by mkoeppe

Milestone: sage-9.8
Note: See TracTickets for help on using tickets.