summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-20 18:48:09 +0100
committerKhem Raj <raj.khem@gmail.com>2025-06-25 06:44:51 -0700
commit188491dd2b349d2dc7c0d40b9ee8d870228704f3 (patch)
tree54dbcfa399ebfec2b2d2ad060f52205b561b5948
parenteebf8c78db2e5923a85582efb30722341705693d (diff)
downloadmeta-openembedded-188491dd2b349d2dc7c0d40b9ee8d870228704f3.tar.gz
suitesparse: Update after toolchain selection changes
The toolchain selection changes mean CC is not set until after the recipe is parsed, breaking the manipulations made by this recipe. Replace it with code to inherit the cmake class, which correctly configures cmake to use the right compiler/compiler flags. We need to patch the makefiles to avoid those options being added incorrectly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/suitesparse/suitesparse/makefile-quoting.patch32
-rw-r--r--meta-oe/recipes-devtools/suitesparse/suitesparse_5.10.1.bb17
2 files changed, 37 insertions, 12 deletions
diff --git a/meta-oe/recipes-devtools/suitesparse/suitesparse/makefile-quoting.patch b/meta-oe/recipes-devtools/suitesparse/suitesparse/makefile-quoting.patch
new file mode 100644
index 0000000000..6bd2ffbb55
--- /dev/null
+++ b/meta-oe/recipes-devtools/suitesparse/suitesparse/makefile-quoting.patch
@@ -0,0 +1,32 @@
1OE's CC and CXX contain spaces and extra options which is incompatible with
2cmake way of handling them. Remove passing the compiler options this way in
3favour of our normal cmake toolchain files added elsewhere.
4
5Upstream-Status: Pending
6
7Index: git/Makefile
8===================================================================
9--- git.orig/Makefile
10+++ git/Makefile
11@@ -282,7 +282,7 @@ metis: include/metis.h
12 # hardcoded below.
13 include/metis.h:
14 ifeq (,$(MY_METIS_LIB))
15- - ( cd metis-5.1.0 && $(MAKE) config shared=1 prefix=$(SUITESPARSE) cc=$(CC) )
16+ - ( cd metis-5.1.0 && $(MAKE) config shared=1 prefix=$(SUITESPARSE) )
17 - ( cd metis-5.1.0 && $(MAKE) )
18 - ( cd metis-5.1.0 && $(MAKE) install )
19 - $(SO_INSTALL_NAME) $(SUITESPARSE)/lib/libmetis.dylib \
20Index: git/SuiteSparse_config/SuiteSparse_config.mk
21===================================================================
22--- git.orig/SuiteSparse_config/SuiteSparse_config.mk
23+++ git/SuiteSparse_config/SuiteSparse_config.mk
24@@ -146,7 +146,7 @@ SUITESPARSE_VERSION = 5.10.1
25 endif
26 endif
27
28- CMAKE_OPTIONS += -DCMAKE_CXX_COMPILER=$(CXX) -DCMAKE_C_COMPILER=$(CC)
29+ #CMAKE_OPTIONS += -DCMAKE_CXX_COMPILER=$(CXX) -DCMAKE_C_COMPILER=$(CC)
30
31 #---------------------------------------------------------------------------
32 # CFLAGS for the C/C++ compiler
diff --git a/meta-oe/recipes-devtools/suitesparse/suitesparse_5.10.1.bb b/meta-oe/recipes-devtools/suitesparse/suitesparse_5.10.1.bb
index 13e6fd066c..29f114a9dc 100644
--- a/meta-oe/recipes-devtools/suitesparse/suitesparse_5.10.1.bb
+++ b/meta-oe/recipes-devtools/suitesparse/suitesparse_5.10.1.bb
@@ -4,6 +4,7 @@ SRC_URI = "git://github.com/DrTimothyAldenDavis/SuiteSparse;protocol=https;branc
4 file://0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patch \ 4 file://0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patch \
5 file://0002-Preserve-links-when-installing-libmetis.patch \ 5 file://0002-Preserve-links-when-installing-libmetis.patch \
6 file://0003-Add-version-information-to-libmetis.patch \ 6 file://0003-Add-version-information-to-libmetis.patch \
7 file://makefile-quoting.patch \
7 " 8 "
8SRCREV = "538273cfd53720a10e34a3d80d3779b607e1ac26" 9SRCREV = "538273cfd53720a10e34a3d80d3779b607e1ac26"
9 10
@@ -14,25 +15,17 @@ DEPENDS = "cmake-native lapack gmp mpfr chrpath-native"
14PROVIDES = "mongoose graphblas" 15PROVIDES = "mongoose graphblas"
15RPROVIDES:${PN} = "mongoose graphblas" 16RPROVIDES:${PN} = "mongoose graphblas"
16 17
17# The values of $CC, $CXX, and $LD that Bitbake uses have spaces in them which 18inherit cmake
18# causes problems when the SuiteSparse Makefiles try to pass these values on
19# the command line. To get around this problem, set these variables to only the
20# program name and prepend the rest of the value onto the corresponding FLAGS
21# variable.
22CFLAGS:prepend := "${@" ".join(d.getVar('CC').split()[1:])} "
23export CC := "${@d.getVar('CC').split()[0]}"
24 19
25CXXFLAGS:prepend := "${@" ".join(d.getVar('CXX').split()[1:])} " 20B = "${S}"
26export CXX := "${@d.getVar('CXX').split()[0]}"
27
28LDFLAGS:prepend := "${@" ".join(d.getVar('LD').split()[1:])} "
29export LD := "${@d.getVar('LD').split()[0]}"
30 21
31export CMAKE_OPTIONS = " \ 22export CMAKE_OPTIONS = " \
32 -DCMAKE_INSTALL_PREFIX=${D}${prefix} \ 23 -DCMAKE_INSTALL_PREFIX=${D}${prefix} \
33 -DCMAKE_INSTALL_LIBDIR=${baselib} \ 24 -DCMAKE_INSTALL_LIBDIR=${baselib} \
34" 25"
35 26
27OECMAKE_SOURCEPATH = "${S}/Mongoose ${S}/metis-5.1.0 ${S}/GraphBLAS"
28
36do_compile () { 29do_compile () {
37 oe_runmake library 30 oe_runmake library
38} 31}