summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD31
-rw-r--r--flint-3.patch62
-rw-r--r--llvm-shared.patch66
4 files changed, 159 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f9257395aa3c..f5ac2cf9afec 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = symengine-git
pkgdesc = Fast symbolic manipulation library, written in C++
- pkgver = 0.8.1.r101.g8be879dd
+ pkgver = 0.11.1.r9.g9b2526ffe
pkgrel = 1
url = http://sympy.org/
arch = x86_64
@@ -8,14 +8,22 @@ pkgbase = symengine-git
makedepends = cmake
makedepends = git
makedepends = boost
- depends = arb
+ makedepends = cereal
depends = boost-libs
+ depends = flint
depends = gmp
+ depends = gmp-ecm
depends = gperftools
+ depends = libmpc
+ depends = mpfr
depends = primesieve
provides = symengine
conflicts = symengine
source = git+https://github.com/sympy/symengine.git
+ source = llvm-shared.patch
+ source = flint-3.patch
sha256sums = SKIP
+ sha256sums = ef05a806139b35e0336f00cb6960ef6cf483f11b0041e436a99ab1f46bdcb11c
+ sha256sums = d82743b3893ca208ec63b1f7722b54c065c9d821bf612e99b0cdf7c5c7da8700
pkgname = symengine-git
diff --git a/PKGBUILD b/PKGBUILD
index c7ee14e70e2b..1eb4f143eb77 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,38 +1,49 @@
# Maintainer: Michael Schubert <mschu.dev at gmail> github.com/mschubert/PKGBUILDs
pkgname=symengine-git
_pkgname=${pkgname%-git}
-pkgver=0.8.1.r101.g8be879dd
+pkgver=0.11.1.r9.g9b2526ffe
pkgrel=1
pkgdesc="Fast symbolic manipulation library, written in C++"
url="http://sympy.org/"
arch=(x86_64)
license=(MIT)
-depends=(arb boost-libs gmp gperftools primesieve)
-makedepends=(cmake git boost)
+depends=(boost-libs flint gmp gmp-ecm gperftools libmpc mpfr primesieve)
+makedepends=(cmake git boost cereal)
conflicts=(symengine)
provides=(symengine)
-source=(git+https://github.com/sympy/symengine.git)
-sha256sums=(SKIP)
+source=(git+https://github.com/sympy/symengine.git
+ llvm-shared.patch
+ flint-3.patch)
+sha256sums=('SKIP'
+ 'ef05a806139b35e0336f00cb6960ef6cf483f11b0041e436a99ab1f46bdcb11c'
+ 'd82743b3893ca208ec63b1f7722b54c065c9d821bf612e99b0cdf7c5c7da8700')
pkgver() {
cd $_pkgname
git describe --long --tags | sed 's/^v//;s/-/.r/;s/-/./'
}
+prepare() {
+ patch -d $_pkgname -p1 < llvm-shared.patch # Use shared LLVM (Gentoo)
+ patch -d $_pkgname -p1 < flint-3.patch # Fix build with flint 3
+}
+
build() {
cmake -B build -S $_pkgname \
- -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=ON \
-DWITH_TCMALLOC=ON \
-DWITH_PTHREAD=ON \
-DWITH_SYMENGINE_THREAD_SAFE=ON \
-DWITH_ARB=ON \
- -DWITH_BOOST=ON \
+ -DWITH_ECM=ON \
+ -DWITH_LLVM=OFF \
+ -DWITH_MPFR=ON \
+ -DWITH_MPC=ON \
-DWITH_PRIMESIEVE=ON \
- -DWITH_LLVM=ON \
- -DWITH_COTIRE=OFF
+ -DWITH_BOOST=ON \
+ -DWITH_COTIRE=OFF \
+ -DWITH_SYSTEM_CEREAL=ON
cmake --build build
}
diff --git a/flint-3.patch b/flint-3.patch
new file mode 100644
index 000000000000..5a6ac375a457
--- /dev/null
+++ b/flint-3.patch
@@ -0,0 +1,62 @@
+diff --git a/cmake/FindARB.cmake b/cmake/FindARB.cmake
+index 281c5bea..f0428e9c 100644
+--- a/cmake/FindARB.cmake
++++ b/cmake/FindARB.cmake
+@@ -1,7 +1,7 @@
+ include(LibFindMacros)
+
+-libfind_include(arb.h arb)
+-libfind_library(arb arb flint-arb)
++libfind_include(flint/arb.h arb)
++libfind_library(arb arb flint-arb flint)
+
+ set(ARB_LIBRARIES ${ARB_LIBRARY})
+ set(ARB_INCLUDE_DIRS ${ARB_INCLUDE_DIR})
+diff --git a/symengine/eval_arb.h b/symengine/eval_arb.h
+index 8d6f00c1..e162a9ff 100644
+--- a/symengine/eval_arb.h
++++ b/symengine/eval_arb.h
+@@ -11,6 +11,7 @@
+
+ #ifdef HAVE_SYMENGINE_ARB
+ #include <symengine/basic.h>
++#include <mpfr.h>
+ #include <arb.h>
+
+ namespace SymEngine
+diff --git a/symengine/flint_wrapper.h b/symengine/flint_wrapper.h
+index 21cfcef0..edf07e22 100644
+--- a/symengine/flint_wrapper.h
++++ b/symengine/flint_wrapper.h
+@@ -5,6 +5,8 @@
+ #include <gmp.h>
+
+ #include <flint/fmpz.h>
++#include <flint/fmpz_poly.h>
++#include <flint/fmpz_poly_factor.h>
+ #include <flint/fmpq.h>
+ #include <flint/fmpq_poly.h>
+
+diff --git a/symengine/ntheory.cpp b/symengine/ntheory.cpp
+index 6108bf2c..7c6d08a1 100644
+--- a/symengine/ntheory.cpp
++++ b/symengine/ntheory.cpp
+@@ -17,6 +17,7 @@
+ #include "arb.h"
+ #include "bernoulli.h"
+ #include "rational.h"
++#include <flint/fmpq.h>
+ #endif // HAVE_SYMENGINE_ARB
+ #ifndef HAVE_SYMENGINE_GMP
+ #include <boost/random/uniform_int.hpp>
+diff --git a/symengine/tests/eval/test_eval_arb.cpp b/symengine/tests/eval/test_eval_arb.cpp
+index df9bb61f..0eecf647 100644
+--- a/symengine/tests/eval/test_eval_arb.cpp
++++ b/symengine/tests/eval/test_eval_arb.cpp
+@@ -947,4 +947,4 @@ TEST_CASE("Zeta: eval_arb", "[eval_arb]")
+ REQUIRE(arb_contains_mpfr(a, f));
+ mpfr_clear(f);
+ arb_clear(a);
+-}
+\ No newline at end of file
++}
diff --git a/llvm-shared.patch b/llvm-shared.patch
new file mode 100644
index 000000000000..1a5c21efd405
--- /dev/null
+++ b/llvm-shared.patch
@@ -0,0 +1,66 @@
+From: Matthias Maier <tamiko@43-1.org>
+Date: Sat, 11 Jun 2022 01:44:54 -0500
+Subject: [PATCH] Fix cmake configure for shared LLVM libraries
+
+Gentoo builds LLVM into a combined shared library. The CMake
+configuration shipped with LLVM is evidently broken in this case, see
+
+ https://github.com/llvm/llvm-project/issues/34593
+ https://bugs.gentoo.org/745915
+
+We work around this issue by simply linking against the monolithic
+"LLVM" target.
+---
+ CMakeLists.txt | 23 +----------------------
+ 1 file changed, 1 insertion(+), 22 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cf5ab3b..dfa6605 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -402,28 +402,7 @@ if (WITH_LLVM)
+ endforeach()
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
+
+- llvm_map_components_to_libnames(llvm_libs_direct ${SYMENGINE_LLVM_COMPONENTS})
+- llvm_expand_dependencies(llvm_libs ${llvm_libs_direct})
+-
+- if (BUILD_SHARED_LIBS)
+- set(SYMENGINE_LLVM_LINK_DOWNSTREAM_DEFAULT False)
+- foreach(LLVM_LIB ${llvm_libs})
+- get_target_property(${LLVM_LIB}_IMPORT_LOCATION ${LLVM_LIB} LOCATION)
+- if (NOT "${${LLVM_LIB}_IMPORT_LOCATION}" MATCHES "NOTFOUND")
+- if (NOT "${${LLVM_LIB}_IMPORT_LOCATION}" MATCHES ".a$|.lib$")
+- set(SYMENGINE_LLVM_LINK_DOWNSTREAM_DEFAULT True)
+- endif()
+- endif()
+- endforeach()
+- else()
+- set(SYMENGINE_LLVM_LINK_DOWNSTREAM_DEFAULT True)
+- endif()
+- set(SYMENGINE_LLVM_LINK_DOWNSTREAM ${SYMENGINE_LLVM_LINK_DOWNSTREAM_DEFAULT}
+- CACHE INTERNAL "Link to llvm in SymEngineConfig.cmake")
+- if (NOT SYMENGINE_LLVM_LINK_DOWNSTREAM)
+- unset(SYMENGINE_LLVM_COMPONENTS)
+- endif ()
+- set(LIBS ${LIBS} ${llvm_libs})
++ set(LIBS ${LIBS} LLVM)
+ include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
+ set(HAVE_SYMENGINE_LLVM yes)
+ set(PKGS ${PKGS} "LLVM")
+diff --git a/cmake/SymEngineConfig.cmake.in b/cmake/SymEngineConfig.cmake.in
+index b01ef9b..6d82c10 100644
+--- a/cmake/SymEngineConfig.cmake.in
++++ b/cmake/SymEngineConfig.cmake.in
+@@ -67,9 +67,7 @@ set(SYMENGINE_LLVM_COMPONENTS @SYMENGINE_LLVM_COMPONENTS@)
+
+ if (NOT "${SYMENGINE_LLVM_COMPONENTS}" STREQUAL "")
+ find_package(LLVM REQUIRED ${SYMENGINE_LLVM_COMPONENTS} HINTS @LLVM_DIR@)
+- llvm_map_components_to_libnames(llvm_libs_direct ${SYMENGINE_LLVM_COMPONENTS})
+- llvm_expand_dependencies(llvm_libs ${llvm_libs_direct})
+- set(SYMENGINE_LIBRARIES ${SYMENGINE_LIBRARIES} ${llvm_libs})
++ set(SYMENGINE_LIBRARIES ${SYMENGINE_LIBRARIES} LLVM)
+ else()
+ set(SYMENGINE_LLVM_INCLUDE_DIRS)
+ endif()
+--