-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
spkg-configure for suitesparse #29502
Comments
This comment has been minimized.
This comment has been minimized.
Attachment: umfpack.m4.gz |
comment:3
Thanks! I do not know anything about macro m4 and autotools, but I already tried to work on this. For that, I borrowed a file umfpack.m4 from the Dune project, before they switched to cmake. It is released under a GPL license. Please see the attachment if it could help. |
comment:4
please try this branch (not tested much, though) New commits:
|
Commit: |
comment:5
Configure is OK for iml and suitesparse: Checking whether SageMath should install SPKG iml... checking whether any of gmp mpir openblas is installed or will be installed as SPKG... no checking for iml.h... yes checking for library containing nonsingSolvLlhsMM... -liml configure: will use system package and not install SPKG iml ... Checking whether SageMath should install SPKG suitesparse... checking whether any of openblas is installed or will be installed as SPKG... no checking suitesparse/SuiteSparse_config.h usability... yes checking suitesparse/SuiteSparse_config.h presence... yes checking for suitesparse/SuiteSparse_config.h... yes checking for library containing cholmod_speye... -lcholmod configure: will use system package and not install SPKG suitesparse ... iml-1.0.4p1.p2: using system package; SPKG will not be installed ... suitesparse-5.6.0: using system package; SPKG will not be installed But now cvxopt fails: [cvxopt-1.2.3] src/C/umfpack.c:23:10: fatal error: 'umfpack.h' file not found [cvxopt-1.2.3] #include "umfpack.h" Note: on FreeBSD umfpack.h is located under /usr/local/include/suitesparse/umfpack.h. Just let me know if I fix it for FreeBSD or if the same failure could occur on other systems. |
comment:6
On Debian the location of the header is also prefixed. |
comment:7
On Debian, the following hack makes things work: --- a/build/pkgs/cvxopt/spkg-install.in
+++ b/build/pkgs/cvxopt/spkg-install.in
@@ -21,8 +21,8 @@ export CVXOPT_BLAS_LIB="$(pkg_libs blas)"
export CVXOPT_BLAS_LIB_DIR="$(pkg-config --variable=libdir blas)"
export CVXOPT_LAPACK_LIB="$(pkg_libs lapack)"
-export CVXOPT_SUITESPARSE_LIB_DIR="${SAGE_LOCAL}"
-export CVXOPT_SUITESPARSE_INC_DIR="${SAGE_LOCAL}/include"
+# export CVXOPT_SUITESPARSE_LIB_DIR="${SAGE_LOCAL}"
+# export CVXOPT_SUITESPARSE_INC_DIR="${SAGE_LOCAL}/include"
export CVXOPT_BUILD_GLPK=1
export CVXOPT_GLPK_LIB_DIR="${SAGE_LOCAL}" I'll do a proper fix later, but this should get one |
comment:8
A naive work-around (just adding -I /usr/local/include/suitesparse) was sufficient to build everything. I'm going to test your patch to check if it works for me. Note about u/dimpase/packages/suitesparseconf: actually cvxopt produces 3 python libraries, site-packages/cvxopt/amd.so, site-packages/cvxopt/cholmod.so and site-packages/cvxopt/umfpack.so, and they are linked to libamd.so.2, libsuitesparseconfig.so.5 and libumfpack.so.5 from suitesparse; maybe you would check if they are available in its spkg-configure.m4? |
comment:9
Replying to @thierry-FreeBSD:
AMD, COLAMD, CCOLAMD are dependencies of CHOLMOD in SuiteSparse, so it apparently suffices to add a check for UMFPACK (and suitesparseconfig - which presumably is always there, but OK). |
comment:10
Same error on FreeBSD with the Debian's patch of build/pkgs/cvxopt/spkg-install.in : umfpack.h is not found. I would set something like: export CVXOPT_SUITESPARSE_INC_DIR="${LOCALBASE}/suitesparse/include" but $LOCALBASE is not set! Would it be possible to modify build/pkgs/suitesparse/spkg-configure.m4 so that it sets a variable of the include path where SuiteSparse_config.h has been found? |
comment:11
Replying to @thierry-FreeBSD:
getting a full include path is always a pain, and should not be needed as long as it is in the default compiler path for headers. Doesn't FreeBSD's clang look in |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Author: Dima Pasechnik |
This comment has been minimized.
This comment has been minimized.
comment:14
So the FreeBSD question is whether adding |
comment:17
Great! The missing part was SAGE_SUITESPARSE_PREFIX. |
comment:18
tests being run here: https://github.com/dimpase/sage/actions?query=workflow%3A%22Run+SAGE_ROOT%2Ftox.ini%22 looks good (modulo unrelated things, e.g. problems with brial on Fedora, etc) |
comment:19
perhaps this can make it into 9.1? |
comment:42
Replying to @orlitzky:
Yes, you don't want to do that. That code would be executed if either of the headers were to be found, so the variable would be defined even if one is missing. You would be better to check for |
comment:43
Another option is to set the "headers found" variable to "yes" by default, and then use the action-if-not-found branch of |
comment:44
Replying to @orlitzky:
Sounds valid. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:46
this appears to fix the use of AC_CHECK_HEADERS - thanks for catching this. |
comment:47
Looks good now. One last nitpick; you should add quotes here for the people who have spaces in their sage path:
And while the two are equivalent, I think using
avoids some duplication and uses the |
comment:48
I am not trying to compute and pass the prefix of the installation of suitesparse. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:50
Replying to @dimpase:
Is it just supposed to be a boolean? I guess what I'm asking is, why define |
comment:51
yes, it is a boolean |
comment:52
Replying to @dimpase:
It think it would make more sense to set it to "yes" rather than "$SAGE_LOCAL" in that case? Either way, it works fine on Gentoo with suitesparse-5.4.0. Should we merge it and cross our fingers, or run it though github first to make sure all of the other distros have usable versions of suitesparse? |
comment:53
I would suggest to defer this to 9.2 |
comment:54
Replying to @orlitzky:
Yes please |
comment:55
Replying to @mkoeppe:
I did this https://github.com/dimpase/sage/actions/runs/88161666 |
Reviewer: Michael Orlitzky |
comment:57
The spkg-install for cvxopt is doing some weird stuff, but I can't find any immediate problems (and don't think we need to fix them here, in any case). For example,
is unconditionally adding those two library/include paths to the command line as These calls to pkg-config share the same risk,
but so long as any SPKG that is installed and provides a *.pc file must be used (ignoring |
Changed branch from u/dimpase/packages/suitesparseconf to |
Changed commit from |
comment:59
Follow-up: #30052 ubuntu-eoan-i386: cvxopt build fails |
Different distos use different subsets of SuiteSparse,
but this is needed to be done. Apparently all we need is CHOLMOD (with its dependencies),UMFRACK and suitesparseconfig.
CC: @mkoeppe @orlitzky @thierry-FreeBSD @kiwifb
Component: build: configure
Author: Dima Pasechnik
Branch:
f2cc5b4
Reviewer: Michael Orlitzky
Issue created by migration from https://trac.sagemath.org/ticket/29502
The text was updated successfully, but these errors were encountered: