Add suitesparse
PATCH 1/1 Add suitesparse
---
SuiteSparse is a sparse matrix processing library. It is used by e.g. python3-cvxopt (which I am also submitting a patch for) to do things like convex optimization.
This is my first submission to meta-openembedded, so please give me feedback if there is anything I can improve.
...XXFLAGS-from-environment-in-Mongoose.patch | 43 +++++++++++ ...serve-links-when-installing-libmetis.patch | 22 ++++++ ...-Add-version-information-to-libmetis.patch | 49 ++++++++++++ .../suitesparse/suitesparse_5.8.1.bb | 77 +++++++++++++++++++ 4 files changed, 191 insertions(+) create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse/0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patch create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse/0002-Preserve-links-when-installing-libmetis.patch create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse/0003-Add-version-information-to-libmetis.patch create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse_5.8.1.bb
meta-oe/recipes-devtools/suitesparse/suitesparse/0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patch new file +43 -0
@@ -0,0 +1,43 @@ +From 83628b471a1a79dae50bb158fca9448b668dd3a6 Mon Sep 17 00:00:00 2001 +From: Gregory Anders <[email protected]> +Date: Wed, 21 Oct 2020 10:43:16 -0600 +Subject: [PATCH] Preserve CXXFLAGS from environment in Mongoose + +This allows CXXFLAGS set in the environment to also be used in the CMake +build process, instead of overwriting them. This is useful in a cross +compile context where the CXXFLAGS variable might contain necessary +flags for cross compiling. +--- + Mongoose/CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Mongoose/CMakeLists.txt b/Mongoose/CMakeLists.txt +index 7e134ab..91a7f70 100644 +--- a/Mongoose/CMakeLists.txt ++++ b/Mongoose/CMakeLists.txt +@@ -321,14 +321,14 @@ add_test(Unit_Test_EdgeSep ./tests/mongoose_unit_test_edgesep) + message(STATUS "CMAKE_CXX_COMPILER: " ${BoldBlue} ${CMAKE_CXX_COMPILER_ID} ${ColourReset}) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") + # using Clang +- SET(CMAKE_CXX_FLAGS "-O3 -fwrapv") ++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fwrapv") + # Debug flags for Clang + SET(CMAKE_CXX_FLAGS_DEBUG "--coverage -g -fwrapv") + SET(CMAKE_C_FLAGS_DEBUG "--coverage -g") + SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "--coverage -g") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # using GCC +- SET(CMAKE_CXX_FLAGS "-O3 -fwrapv") ++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fwrapv") + # Debug flags for GCC + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.6") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +@@ -339,7 +339,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + # using Intel C++ +- SET(CMAKE_CXX_FLAGS "-O3 -no-prec-div -xHOST -ipo -fwrapv") ++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -no-prec-div -xHOST -ipo -fwrapv") + # Debug flags for Intel + SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -fwrapv") + SET(CMAKE_C_FLAGS_DEBUG "-g -O0 -Wall")
meta-oe/recipes-devtools/suitesparse/suitesparse/0002-Preserve-links-when-installing-libmetis.patch new file +22 -0
@@ -0,0 +1,22 @@ +From 31175fb408a4f5e85e39a9aabd4a29f9d9c1fe25 Mon Sep 17 00:00:00 2001 +From: Gregory Anders <[email protected]> +Date: Wed, 21 Oct 2020 15:26:52 -0600 +Subject: [PATCH] Preserve links when installing libmetis + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 7631955..57fd022 100644 +--- a/Makefile ++++ b/Makefile +@@ -76,7 +76,7 @@ ifeq (,$(MY_METIS_LIB)) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) +- - $(CP) lib/libmetis.* $(INSTALL_LIB) ++ - $(CP) -d lib/libmetis.* $(INSTALL_LIB) + - $(CP) metis-5.1.0/manual/manual.pdf $(INSTALL_DOC)/METIS_manual.pdf + - $(CP) metis-5.1.0/README.txt $(INSTALL_DOC)/METIS_README.txt + # the following is needed only on the Mac, so *.dylib is hardcoded:
meta-oe/recipes-devtools/suitesparse/suitesparse/0003-Add-version-information-to-libmetis.patch new file +49 -0
49 lines not on this page · raw message
meta-oe/recipes-devtools/suitesparse/suitesparse_5.8.1.bb new file +77 -0
77 lines not on this page · raw message
Signature · 1 line
2.29.2
I don't have strong opinion, but when I was adding suitesparse to meta-ros a while ago, it was a bit easier to build each library separately as in:
https://github.com/ros/meta-ros/commit/1242e0ce3c84a05363fc11244a8a6ac0e08de4e9
not sure if that changed between 5.4 and 5.8. It might be still useful to package them separately.
If all works fine now with 5.8 I will be happy to drop it from meta-ros once this is merged in meta-oe.
Quoted 270 lines · Gregory Anders
---
SuiteSparse is a sparse matrix processing library. It is used by e.g. python3-cvxopt (which I am also submitting a patch for) to do things like convex optimization.This is my first submission to meta-openembedded, so please give me feedback if there is anything I can improve.
...XXFLAGS-from-environment-in-Mongoose.patch | 43 +++++++++++ ...serve-links-when-installing-libmetis.patch | 22 ++++++ ...-Add-version-information-to-libmetis.patch | 49 ++++++++++++ .../suitesparse/suitesparse_5.8.1.bb | 77 +++++++++++++++++++ 4 files changed, 191 insertions(+) create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse/0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patch create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse/0002-Preserve-links-when-installing-libmetis.patch create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse/0003-Add-version-information-to-libmetis.patch create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse_5.8.1.bb
diff --git
a/meta-oe/recipes-devtools/suitesparse/suitesparse/0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patchb/meta-oe/recipes-devtools/suitesparse/suitesparse/0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patchnew file mode 100644
index 000000000..c955b5fa7
---/dev/null
+++b/meta-oe/recipes-devtools/suitesparse/suitesparse/0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patchmeta-oe/recipes-devtools/suitesparse/suitesparse/0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patch new file +18
-0@@ -0,0 +1,43 @@ +From 83628b471a1a79dae50bb158fca9448b668dd3a6 Mon Sep 17 00:00:00 2001 +From: Gregory Anders <[email protected]> +Date: Wed, 21 Oct 2020 10:43:16 -0600 +Subject: [PATCH] Preserve CXXFLAGS from environment in Mongoose + +This allows CXXFLAGS set in the environment to also be used in the CMake +build process, instead of overwriting them. This is useful in a cross +compile context where the CXXFLAGS variable might contain necessary +flags for cross compiling. +--- + Mongoose/CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Mongoose/CMakeLists.txt b/Mongoose/CMakeLists.txt +index 7e134ab..91a7f70 100644 +--- a/Mongoose/CMakeLists.txt ++++ b/Mongoose/CMakeLists.txt +@@ -321,14 +321,14 @@ add_test(Unit_Test_EdgeSep./tests/mongoose_unit_test_edgesep)
+message(STATUS "CMAKE_CXX_COMPILER: " ${BoldBlue} ${CMAKE_CXX_COMPILER_ID} ${ColourReset})
+ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")meta-oe/recipes-devtools/suitesparse/suitesparse/0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patch new file +23
-1+ # using Clang +- SET(CMAKE_CXX_FLAGS "-O3 -fwrapv") ++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fwrapv") + # Debug flags for Clang + SET(CMAKE_CXX_FLAGS_DEBUG "--coverage -g -fwrapv") + SET(CMAKE_C_FLAGS_DEBUG "--coverage -g") + SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "--coverage -g") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # using GCC +- SET(CMAKE_CXX_FLAGS "-O3 -fwrapv") ++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fwrapv") + # Debug flags for GCC + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.6") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +@@ -339,7 +339,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + # using Intel C++ +- SET(CMAKE_CXX_FLAGS "-O3 -no-prec-div -xHOST -ipo -fwrapv") ++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -no-prec-div -xHOST -ipo -fwrapv") + # Debug flags for Intel + SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -fwrapv") + SET(CMAKE_C_FLAGS_DEBUG "-g -O0 -Wall")diff --git
a/meta-oe/recipes-devtools/suitesparse/suitesparse/0002-Preserve-links-when-installing-libmetis.patchb/meta-oe/recipes-devtools/suitesparse/suitesparse/0002-Preserve-links-when-installing-libmetis.patchnew file mode 100644
index 000000000..190eaf164
---/dev/null
+++b/meta-oe/recipes-devtools/suitesparse/suitesparse/0002-Preserve-links-when-installing-libmetis.patchmeta-oe/recipes-devtools/suitesparse/suitesparse/0002-Preserve-links-when-installing-libmetis.patch new file +20
-0@@ -0,0 +1,22 @@ +From 31175fb408a4f5e85e39a9aabd4a29f9d9c1fe25 Mon Sep 17 00:00:00 2001 +From: Gregory Anders <[email protected]> +Date: Wed, 21 Oct 2020 15:26:52 -0600 +Subject: [PATCH] Preserve links when installing libmetis + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 7631955..57fd022 100644 +--- a/Makefile ++++ b/Makefile +@@ -76,7 +76,7 @@ ifeq (,$(MY_METIS_LIB)) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) +- - $(CP) lib/libmetis.* $(INSTALL_LIB) ++ - $(CP) -d lib/libmetis.* $(INSTALL_LIB) + - $(CP) metis-5.1.0/manual/manual.pdf$(INSTALL_DOC)/METIS_manual.pdf
(quoted diff) +2
-0+ - $(CP) metis-5.1.0/README.txt $(INSTALL_DOC)/METIS_README.txt + # the following is needed only on the Mac, so *.dylib ishardcoded:
diff --gita/meta-oe/recipes-devtools/suitesparse/suitesparse/0003-Add-version-information-to-libmetis.patchb/meta-oe/recipes-devtools/suitesparse/suitesparse/0003-Add-version-information-to-libmetis.patchnew file mode 100644
index 000000000..dee6039a8
---/dev/null
+++b/meta-oe/recipes-devtools/suitesparse/suitesparse/0003-Add-version-information-to-libmetis.patchmeta-oe/recipes-devtools/suitesparse/suitesparse/0003-Add-version-information-to-libmetis.patch new file +38
-0@@ -0,0 +1,49 @@ +From 11ab355fdda93b762fcc07ac3f7c6ab1be0a5f5a Mon Sep 17 00:00:00 2001 +From: Gregory Anders <[email protected]> +Date: Wed, 21 Oct 2020 15:27:07 -0600 +Subject: [PATCH] Add version information to libmetis + +--- + metis-5.1.0/Makefile | 8 ++++---- + metis-5.1.0/libmetis/CMakeLists.txt | 1 + + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/metis-5.1.0/Makefile b/metis-5.1.0/Makefile +index 9cc03b9..c445d85 100644 +--- a/metis-5.1.0/Makefile ++++ b/metis-5.1.0/Makefile +@@ -18,8 +18,11 @@ systype = $(shell uname -s) + + BUILDDIR = build/$(systype)-$(cputype) + ++VERNUM=5.1.0 ++PKGNAME=metis-$(VERNUM) ++ + # Process configuration options. +-CONFIG_FLAGS = ++CONFIG_FLAGS = -DMETIS_VERSION=$(VERNUM) + ifeq ($(gklib_path), not-set) + gklib_path = GKlib + endif +@@ -52,9 +55,6 @@ ifneq ($(cc), not-set) + CONFIG_FLAGS += -DCMAKE_C_COMPILER=$(cc) + endif + +-VERNUM=5.1.0 +-PKGNAME=metis-$(VERNUM) +- + JOBS ?= 1 + + define run-config +diff --git a/metis-5.1.0/libmetis/CMakeLists.txt
b/metis-5.1.0/libmetis/CMakeLists.txt
+index 120e94d..11bde87 100644
+---a/metis-5.1.0/libmetis/CMakeLists.txt
++++b/metis-5.1.0/libmetis/CMakeLists.txt
+@@ -4,6 +4,7 @@include_directories(.)
+file(GLOB metis_sources *.c)
+ # Build libmetis.
+add_library(metis ${METIS_LIBRARY_TYPE} ${GKlib_sources} ${metis_sources})
++set_target_properties(metis PROPERTIES VERSION ${METIS_VERSION})
+ if(UNIX)meta-oe/recipes-devtools/suitesparse/suitesparse/0003-Add-version-information-to-libmetis.patch new file +2
-0+ target_link_libraries(metis m) + endif()meta-oe/recipes-devtools/suitesparse/suitesparse_5.8.1.bb new file +2
-0@@ -0,0 +1,77 @@ +LICENSE = "GPLv2 & GPLv3 & BSD-3-Clause & LGPL-2.0 & Apache-2.0" +LIC_FILES_CHKSUM ="file://LICENSE.txt;md5=f9f2b9d61cb769a67c4cd079e1166de7" +SRC_URI = "
git://github.com/DrTimothyAldenDavis/SuiteSparse;protocol=https \meta-oe/recipes-devtools/suitesparse/suitesparse_5.8.1.bb new file +7
-0+ file://0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patch \ + file://0002-Preserve-links-when-installing-libmetis.patch \ + file://0003-Add-version-information-to-libmetis.patch \ + " + +SRC_URI[md5sum] = "c414679bbc9432a3def01b31ad921140" +SRC_URI[sha256sum] ="
06726e471fbaa55f792578f9b4ab282ea9d008cf39ddcc3b42b73400acddef40"meta-oe/recipes-devtools/suitesparse/suitesparse_5.8.1.bb new file +11
-0+ +SRCREV = "v${PV}" + +S = "${WORKDIR}/git" + +DEPENDS = "cmake-native lapack gmp mpfr chrpath-native" + +PROVIDES = "mongoose graphblas" +RPROVIDES_${PN} = "mongoose graphblas" + +# The values of $CC, $CXX, and $LD that Bitbake uses have spaces in themwhich
+# causes problems when the SuiteSparse Makefiles try to pass these values on
+# the command line. To get around this problem, set these variables to only the
+# program name and prepend the rest of the value onto the corresponding FLAGSmeta-oe/recipes-devtools/suitesparse/suitesparse_5.8.1.bb new file +53
-1+# variable. +CFLAGS_prepend := "${@" ".join(d.getVar('CC', True).split()[1:])} " +export CC := "${@d.getVar('CC', True).split()[0]}" + +CXXFLAGS_prepend := "${@" ".join(d.getVar('CXX', True).split()[1:])} " +export CXX := "${@d.getVar('CXX', True).split()[0]}" + +LDFLAGS_prepend := "${@" ".join(d.getVar('LD', True).split()[1:])} " +export LD := "${@d.getVar('LD', True).split()[0]}" + +export CMAKE_OPTIONS = " \ + -DCMAKE_INSTALL_PREFIX=${D}${prefix} \ + -DCMAKE_INSTALL_LIBDIR=${baselib} \ +" + +do_compile () { + oe_runmake library +} + +do_install () { + oe_runmake prefix=${D}${prefix} INSTALL=${D}${prefix} install + + # Remove runtime paths from shared libraries + for file in ${D}${libdir}/*.so.*; do + if [ ! -L "$file" ]; then + chrpath -d "$file" + fi + done +} + +FILES_${PN} += " \ + ${libdir}/libmongoose.so.* \ + ${libdir}/libgraphblas.so.* \ + ${libdir}/libmetis.so.* \ + ${libdir}/libsuitesparseconfig.so.* \ + ${libdir}/libamd.so.* \ + ${libdir}/libbtf.so.* \ + ${libdir}/libcamd.so.* \ + ${libdir}/libccolamd.so.* \ + ${libdir}/libcolamd.so.* \ + ${libdir}/libcholmod.so.* \ + ${libdir}/libcxsparse.so.* \ + ${libdir}/libldl.so.* \ + ${libdir}/libklu.so.* \ + ${libdir}/libumfpack.so.* \ + ${libdir}/librbio.so.* \ + ${libdir}/libspqr.so.* \ + ${libdir}/libsliplu.so.* \ + ${bindir}/mongoose \ +" + +FILES_${PN}-staticdev += "${libdir}/libmongoose.a" +FILES_${PN}-dev += "${includedir} ${libdir}/*.so" --2.29.2
Re: ?utf-8?q?_=5Boe=5D?= [meta-oe][PATCH] Add suitesparse
Quoted 9 lines · Martin Jansa
I don't have strong opinion, but when I was adding suitesparse to meta-ros a while ago, it was a bit easier to build each library separately as in:
https://github.com/ros/meta-ros/commit/1242e0ce3c84a05363fc11244a8a6ac0e08de4e9
not sure if that changed between 5.4 and 5.8. It might be still useful to package them separately.If all works fine now with 5.8 I will be happy to drop it from meta-ros once this is merged in meta-oe.
Granted, I've only tested it against compiling python3-cvxopt, but it seems to work for me. I did have to make a few patches in order to get the compiler and linker flags to pass through to the SuiteSparse build step and also to correctly generate a versioned .so file for one of the libraries, but those were the only issues I ran into.
I do not use meta-ros (and I have to admit that I was ignorant to its existence before your email), so it would be worth testing my recipe against any other recipes in meta-ros that depend on SuiteSparse to ensure it works as expected.
- G
Quoted 9 lines · Gregory Anders
---
SuiteSparse is a sparse matrix processing library. It is used by e.g. python3-cvxopt (which I am also submitting a patch for) to do things like convex optimization.This is my first submission to meta-openembedded, so please give me feedback if there is anything I can improve.
since this is a new recipe please add it to meta-oe/recipes-core/packagegroups/packagegroup-meta-oe.bb in appropriate packagegroup as well.
Quoted 231 lines
...XXFLAGS-from-environment-in-Mongoose.patch | 43 +++++++++++ ...serve-links-when-installing-libmetis.patch | 22 ++++++ ...-Add-version-information-to-libmetis.patch | 49 ++++++++++++ .../suitesparse/suitesparse_5.8.1.bb | 77 +++++++++++++++++++ 4 files changed, 191 insertions(+) create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse/0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patch create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse/0002-Preserve-links-when-installing-libmetis.patch create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse/0003-Add-version-information-to-libmetis.patch create mode 100644 meta-oe/recipes-devtools/suitesparse/suitesparse_5.8.1.bbmeta-oe/recipes-devtools/suitesparse/suitesparse/0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patch new file +43
-0@@ -0,0 +1,43 @@ +From 83628b471a1a79dae50bb158fca9448b668dd3a6 Mon Sep 17 00:00:00 2001 +From: Gregory Anders <[email protected]> +Date: Wed, 21 Oct 2020 10:43:16 -0600 +Subject: [PATCH] Preserve CXXFLAGS from environment in Mongoose + +This allows CXXFLAGS set in the environment to also be used in the CMake +build process, instead of overwriting them. This is useful in a cross +compile context where the CXXFLAGS variable might contain necessary +flags for cross compiling. +--- + Mongoose/CMakeLists.txt | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Mongoose/CMakeLists.txt b/Mongoose/CMakeLists.txt +index 7e134ab..91a7f70 100644 +--- a/Mongoose/CMakeLists.txt ++++ b/Mongoose/CMakeLists.txt +@@ -321,14 +321,14 @@ add_test(Unit_Test_EdgeSep ./tests/mongoose_unit_test_edgesep) + message(STATUS "CMAKE_CXX_COMPILER: " ${BoldBlue} ${CMAKE_CXX_COMPILER_ID} ${ColourReset}) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") + # using Clang +- SET(CMAKE_CXX_FLAGS "-O3 -fwrapv") ++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fwrapv") + # Debug flags for Clang + SET(CMAKE_CXX_FLAGS_DEBUG "--coverage -g -fwrapv") + SET(CMAKE_C_FLAGS_DEBUG "--coverage -g") + SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "--coverage -g") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # using GCC +- SET(CMAKE_CXX_FLAGS "-O3 -fwrapv") ++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fwrapv") + # Debug flags for GCC + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.6") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +@@ -339,7 +339,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + # using Intel C++ +- SET(CMAKE_CXX_FLAGS "-O3 -no-prec-div -xHOST -ipo -fwrapv") ++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -no-prec-div -xHOST -ipo -fwrapv") + # Debug flags for Intel + SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -fwrapv") + SET(CMAKE_C_FLAGS_DEBUG "-g -O0 -Wall")meta-oe/recipes-devtools/suitesparse/suitesparse/0002-Preserve-links-when-installing-libmetis.patch new file +22
-0@@ -0,0 +1,22 @@ +From 31175fb408a4f5e85e39a9aabd4a29f9d9c1fe25 Mon Sep 17 00:00:00 2001 +From: Gregory Anders <[email protected]> +Date: Wed, 21 Oct 2020 15:26:52 -0600 +Subject: [PATCH] Preserve links when installing libmetis + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 7631955..57fd022 100644 +--- a/Makefile ++++ b/Makefile +@@ -76,7 +76,7 @@ ifeq (,$(MY_METIS_LIB)) + @mkdir -p $(INSTALL_LIB) + @mkdir -p $(INSTALL_INCLUDE) + @mkdir -p $(INSTALL_DOC) +- - $(CP) lib/libmetis.* $(INSTALL_LIB) ++ - $(CP) -d lib/libmetis.* $(INSTALL_LIB) + - $(CP) metis-5.1.0/manual/manual.pdf $(INSTALL_DOC)/METIS_manual.pdf + - $(CP) metis-5.1.0/README.txt $(INSTALL_DOC)/METIS_README.txt + # the following is needed only on the Mac, so *.dylib is hardcoded:meta-oe/recipes-devtools/suitesparse/suitesparse/0003-Add-version-information-to-libmetis.patch new file +49
-0@@ -0,0 +1,49 @@ +From 11ab355fdda93b762fcc07ac3f7c6ab1be0a5f5a Mon Sep 17 00:00:00 2001 +From: Gregory Anders <[email protected]> +Date: Wed, 21 Oct 2020 15:27:07 -0600 +Subject: [PATCH] Add version information to libmetis + +--- + metis-5.1.0/Makefile | 8 ++++---- + metis-5.1.0/libmetis/CMakeLists.txt | 1 + + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/metis-5.1.0/Makefile b/metis-5.1.0/Makefile +index 9cc03b9..c445d85 100644 +--- a/metis-5.1.0/Makefile ++++ b/metis-5.1.0/Makefile +@@ -18,8 +18,11 @@ systype = $(shell uname -s) + + BUILDDIR = build/$(systype)-$(cputype) + ++VERNUM=5.1.0 ++PKGNAME=metis-$(VERNUM) ++ + # Process configuration options. +-CONFIG_FLAGS = ++CONFIG_FLAGS = -DMETIS_VERSION=$(VERNUM) + ifeq ($(gklib_path), not-set) + gklib_path = GKlib + endif +@@ -52,9 +55,6 @@ ifneq ($(cc), not-set) + CONFIG_FLAGS += -DCMAKE_C_COMPILER=$(cc) + endif + +-VERNUM=5.1.0 +-PKGNAME=metis-$(VERNUM) +- + JOBS ?= 1 + + define run-config +diff --git a/metis-5.1.0/libmetis/CMakeLists.txt b/metis-5.1.0/libmetis/CMakeLists.txt +index 120e94d..11bde87 100644 +--- a/metis-5.1.0/libmetis/CMakeLists.txt ++++ b/metis-5.1.0/libmetis/CMakeLists.txt +@@ -4,6 +4,7 @@ include_directories(.) + file(GLOB metis_sources *.c) + # Build libmetis. + add_library(metis ${METIS_LIBRARY_TYPE} ${GKlib_sources} ${metis_sources}) ++set_target_properties(metis PROPERTIES VERSION ${METIS_VERSION}) + if(UNIX) + target_link_libraries(metis m) + endif()meta-oe/recipes-devtools/suitesparse/suitesparse_5.8.1.bb new file +77
-1@@ -0,0 +1,77 @@ +LICENSE = "GPLv2 & GPLv3 & BSD-3-Clause & LGPL-2.0 & Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f9f2b9d61cb769a67c4cd079e1166de7" +SRC_URI = "git://github.com/DrTimothyAldenDavis/SuiteSparse;protocol=https \ + file://0001-Preserve-CXXFLAGS-from-environment-in-Mongoose.patch \ + file://0002-Preserve-links-when-installing-libmetis.patch \ + file://0003-Add-version-information-to-libmetis.patch \ + " + +SRC_URI[md5sum] = "c414679bbc9432a3def01b31ad921140" +SRC_URI[sha256sum] = "06726e471fbaa55f792578f9b4ab282ea9d008cf39ddcc3b42b73400acddef40" + +SRCREV = "v${PV}" + +S = "${WORKDIR}/git" + +DEPENDS = "cmake-native lapack gmp mpfr chrpath-native" + +PROVIDES = "mongoose graphblas" +RPROVIDES_${PN} = "mongoose graphblas" + +# The values of $CC, $CXX, and $LD that Bitbake uses have spaces in them which +# causes problems when the SuiteSparse Makefiles try to pass these values on +# the command line. To get around this problem, set these variables to only the +# program name and prepend the rest of the value onto the corresponding FLAGS +# variable. +CFLAGS_prepend := "${@" ".join(d.getVar('CC', True).split()[1:])} " +export CC := "${@d.getVar('CC', True).split()[0]}" + +CXXFLAGS_prepend := "${@" ".join(d.getVar('CXX', True).split()[1:])} " +export CXX := "${@d.getVar('CXX', True).split()[0]}" + +LDFLAGS_prepend := "${@" ".join(d.getVar('LD', True).split()[1:])} " +export LD := "${@d.getVar('LD', True).split()[0]}" + +export CMAKE_OPTIONS = " \ + -DCMAKE_INSTALL_PREFIX=${D}${prefix} \ + -DCMAKE_INSTALL_LIBDIR=${baselib} \ +" + +do_compile () { + oe_runmake library +} + +do_install () { + oe_runmake prefix=${D}${prefix} INSTALL=${D}${prefix} install + + # Remove runtime paths from shared libraries + for file in ${D}${libdir}/*.so.*; do + if [ ! -L "$file" ]; then + chrpath -d "$file" + fi + done +} + +FILES_${PN} += " \ + ${libdir}/libmongoose.so.* \ + ${libdir}/libgraphblas.so.* \ + ${libdir}/libmetis.so.* \ + ${libdir}/libsuitesparseconfig.so.* \ + ${libdir}/libamd.so.* \ + ${libdir}/libbtf.so.* \ + ${libdir}/libcamd.so.* \ + ${libdir}/libccolamd.so.* \ + ${libdir}/libcolamd.so.* \ + ${libdir}/libcholmod.so.* \ + ${libdir}/libcxsparse.so.* \ + ${libdir}/libldl.so.* \ + ${libdir}/libklu.so.* \ + ${libdir}/libumfpack.so.* \ + ${libdir}/librbio.so.* \ + ${libdir}/libspqr.so.* \ + ${libdir}/libsliplu.so.* \ + ${bindir}/mongoose \ +" + +FILES_${PN}-staticdev += "${libdir}/libmongoose.a" +FILES_${PN}-dev += "${includedir} ${libdir}/*.so" --2.29.2