Open mkoeppe opened 2 years ago
Description changed:
---
+++
@@ -5,3 +5,8 @@
DESTDIR
is used twice in the -o
.
+
+DESTDIR
handling is coming from build/pkgs/suitesparse/patches/03-buildflags.patch
+
+We upgrade to 5.12.0 and pick up a fresh set of patches from Debian or another distro
+
https://github.com/DrTimothyAldenDavis/SuiteSparse/issues/86 - "build system: Support staged installs via DESTDIR"
My original spkg was always a quick and dirty job. It shouldn't be a surprise that some bugs appear.
I guess I should have a stab at this.
Way too many things are built by default. We can split the package or at least not building the big stuff that we do not need like graphblas and mongoose which are very specialised stuff.
I think our optional igraph
package uses graphblas
That's new and graphblas wasn't built before because I had removed all the subpackages using cmake at the time the initial suitesparse was included in sage. But if it can be used, why not.
In other news, DESTDIR
works properly in 6.0.1 after some basic testing.
Cannot see a dependency on GraphBLAS in igraph but if you can point to it, I'll certainly include it.
I am testing a first draft locally. The changes are big enough that none of the current patches actually apply or are meaningful. I will need your input for any tweaks you require for BLAS/LAPACK on OS X. It should be easy enough to figure out if something is needed.
Replying to François Bissey:
Cannot see a dependency on GraphBLAS in igraph but if you can point to it, I'll certainly include it.
Sorry for the noise - looks like I misremembered
Do we want to build and install static libraries?
No, only shared
Changed branch from u/mkoeppe/suitesparse__fix_destdir_bug to u/fbissey/suitsparse6.0.1
Author: François Bissey
Ready for inspection.
Changed branch from u/fbissey/suitsparse6.0.1 to trac/u/fbissey/suitsparse6.0.1
Changed branch from trac/u/fbissey/suitsparse6.0.1 to u/fbissey/suitesparse6.0.1
OK got the right branch name this time.
Builds OK on macOS
However it builds against the Accelerate framework, not our openblas:
otool -L local/lib/libumfpack.dylib git:t/34206/suitesparse6.0.1
local/lib/libumfpack.dylib:
@rpath/libumfpack.6.dylib (compatibility version 6.0.0, current version 6.0.1)
@rpath/libsuitesparseconfig.6.dylib (compatibility version 6.0.0, current version 6.0.1)
/usr/local/opt/libomp/lib/libomp.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
@rpath/libamd.3.dylib (compatibility version 3.0.0, current version 3.0.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
@rpath/libcholmod.4.dylib (compatibility version 4.0.0, current version 4.0.1)
That's what I thought could happen. I think, I can make it go for openblas easily, I found the doc for it, the other day.
This is also a relatively stripped down build like boost_cropped. I probably should add a few more sub-packages if we want to really dignify it with the full "suitesparse" name. And I also should write a few comments.
And upstream is preparing 6.0.2. But the bump would be trivial on this branch.
Branch pushed to git repo; I updated commit sha1. New commits:
8b32e70 | Enforce the use of openblas. Add comments. |
This gets openblas but not the right one on my macOS system.
[suitesparse-6.0.1] -- BLAS libraries: /opt/local/lib/libopenblas.dylib
[suitesparse-6.0.1] -- BLAS linker flags:
[suitesparse-6.0.1] -- LAPACK libraries: /opt/local/lib/libopenblas.dylib;/opt/local/lib/libopenblas.dylib
[suitesparse-6.0.1] -- LAPACK linker flags:
The following change fixes it for me:
diff --git a/build/pkgs/suitesparse/spkg-build.in b/build/pkgs/suitesparse/spkg-build.in
index b137a5ecb9..822519b078 100644
--- a/build/pkgs/suitesparse/spkg-build.in
+++ b/build/pkgs/suitesparse/spkg-build.in
@@ -11,7 +11,10 @@ for pkg in ${pkg_list}; do
# Enforce usage of OpenBlas
# No static libraries
# Verbose builds
- sdh_cmake -DBLA_VENDOR=OpenBLAS -DNSTATIC=ON -DCMAKE_VERBOSE_MAKEFILE=1 ..
+ sdh_cmake -DBLA_VENDOR=OpenBLAS \
+ -DBLAS_LIBRARIES="$(pkg-config --libs blas)" \
+ -DLAPACK_LIBRARIES="$(pkg-config --libs lapack)" \
+ -DNSTATIC=ON -DCMAKE_VERBOSE_MAKEFILE=1 ..
# Build
sdh_make
popd
Yes, system wide would be picked up first without a hint. Pushing shortly.
Branch pushed to git repo; I updated commit sha1. New commits:
b80a672 | Add hint to locate openblas used by sage |
Failing on centos-stream-9-python3.9-standard
(https://github.com/mkoeppe/sage/actions/runs/3662737597/jobs/6192051075)
CMake Error at CMakeLists.txt:14 (cmake_minimum_required):
CMake 3.22 or higher is required. You are running version 3.20.2
This will need an increased lower bound for system cmake - increased from #34746, which set 3.11)
Dependencies: #34746
On debian-sid-minimal
(https://github.com/mkoeppe/sage/actions/runs/3662737597/jobs/6200588473):
[suitesparse-6.0.1] /sage/local/var/tmp/sage/build/suitesparse-6.0.1/src/SuiteSparse_config/SuiteSparse_config.h:643:65: error: expected ')' before ',' token
[suitesparse-6.0.1] 643 | #define SUITESPARSE_BLAS(name,NAME) SUITESPARSE_FORTRAN(name,NAME)
[suitesparse-6.0.1] | ^
[suitesparse-6.0.1] /sage/local/var/tmp/sage/build/suitesparse-6.0.1/src/SuiteSparse_config/SuiteSparse_config.h:676:37: note: in expansion of macro 'SUITESPARSE_BLAS'
[suitesparse-6.0.1] 676 | #define SUITESPARSE_LAPACK_ZLARF SUITESPARSE_BLAS ( zlarf , ZLAR )
[suitesparse-6.0.1] | ^~~~~~~~~~~~~~~~
[suitesparse-6.0.1] /sage/local/var/tmp/sage/build/suitesparse-6.0.1/src/SuiteSparse_config/SuiteSparse_config.h:1434:6: note: in expansion of macro 'SUITESPARSE_LAPACK_ZLARF'
[suitesparse-6.0.1] 1434 | void SUITESPARSE_LAPACK_ZLARF // apply Householder reflector
[suitesparse-6.0.1] | ^~~~~~~~~~~~~~~~~~~~~~~~
[suitesparse-6.0.1] make[5]: *** [CMakeFiles/cholmod.dir/build.make:1465: CMakeFiles/cholmod.dir/Supernodal/cholmod_super_solve.c.o] Error 1
[suitesparse-6.0.1] make[5]: *** [CMakeFiles/cholmod.dir/build.make:1479: CMakeFiles/cholmod.dir/Supernodal/cholmod_super_symbolic.c.o] Error 1
[suitesparse-6.0.1] make[5]: Target 'CMakeFiles/cholmod.dir/build' not remade because of errors.
Can't seem to see the log from that run. What compiler is sid currently using?
That's gcc 12.2.0-9.1
Same on debian-bookworm-minimal
(https://github.com/mkoeppe/sage/actions/runs/3662737597/jobs/6200588437, docker run -it ghcr.io/mkoeppe/sage/sage-docker-debian-bookworm-minimal-with-targets-pre:9.5-107209-g31c5448dc1-failed bash
)
and on ubuntu-kinetic-minimal
and fedora-36-minimal
I wonder if it has to do with
-- Detecting Fortran/C Interface
Failed to compile
When cmake is run to configure cholmod. It looks like we are trying to mix C and Fortran and it is failing.
While it is annoying, we could turn off the bits needing blas/lapack which seem to be the one involved here. But really I suspect there is something fishy in the compiler.
tox -e docker-debian-bookworm-minimal-incremental -- suitesparse
gives the same errors
I am running out of ideas on what can cause this. Some compiler setting is the most obvious culprit, but what would it be. Can you get access to the docker instance to fish stuff out of it?
6.0.2 is just out, so I will bump that and we will see if it helps.
I've set up a separate GH Actions test at https://github.com/mkoeppe/SuiteSparse/actions/runs/3672968344
Branch pushed to git repo; I updated commit sha1. New commits:
2e7881d | move suitesparse to 6.0.2 |
(from #34203 comment:34)
DESTDIR
is used twice in the-o
.DESTDIR
handling is coming frombuild/pkgs/suitesparse/patches/03-buildflags.patch
We upgrade to 5.12.0 and pick up a fresh set of patches from Debian or another distro
Depends on #34746 Depends on #34835
CC: @kiwifb
Component: packages: standard
Author: François Bissey
Branch/Commit: u/mkoeppe/suitesparse6.0.1 @
424cb49
Issue created by migration from https://trac.sagemath.org/ticket/34206