diff --git a/giac-cocoalib.patch b/giac-cocoalib.patch new file mode 100644 index 0000000..e2f37ad --- /dev/null +++ b/giac-cocoalib.patch @@ -0,0 +1,123 @@ +--- configure.in.orig 2018-12-03 02:01:53.000000000 -0700 ++++ configure.in 2020-03-20 08:52:36.439222107 -0600 +@@ -249,7 +249,7 @@ AC_ARG_ENABLE([cocoa], + [if test "$enableval" = "no"; then CONFIG_COCOA="no"; fi], []) + + if test "$CONFIG_COCOA" = "yes"; then +- AC_CHECK_HEADER(CoCoA/io.H, [], [CONFIG_COCOA="no"]) ++ AC_CHECK_HEADER(CoCoA/BigInt.H, [], [CONFIG_COCOA="no"]) + fi + if test "$CONFIG_COCOA" = "yes"; then + save_LIBS="$LIBS" +--- configure.orig 2018-12-03 02:05:57.000000000 -0700 ++++ configure 2020-03-20 08:54:03.561091098 -0600 +@@ -16356,8 +16356,8 @@ fi + + + if test "$CONFIG_COCOA" = "yes"; then +- ac_fn_cxx_check_header_mongrel "$LINENO" "CoCoA/io.H" "ac_cv_header_CoCoA_io_H" "$ac_includes_default" +-if test "x$ac_cv_header_CoCoA_io_H" = xyes; then : ++ ac_fn_cxx_check_header_mongrel "$LINENO" "CoCoA/BigInt.H" "ac_cv_header_CoCoA_BigInt_H" "$ac_includes_default" ++if test "x$ac_cv_header_CoCoA_BigInt_H" = xyes; then : + + else + CONFIG_COCOA="no" +--- src/TmpLESystemSolver.C.orig 2019-11-03 11:20:03.000000000 -0700 ++++ src/TmpLESystemSolver.C 2020-03-20 11:01:06.088180089 -0600 +@@ -29,6 +29,7 @@ + #include "CoCoA/matrix.H" + #include "CoCoA/ring.H" + #include "CoCoA/error.H" ++#include "CoCoA/MachineInt.H" + + // #include // Included by DenseMatrix.H + using std::vector; +@@ -50,7 +51,11 @@ namespace CoCoADortmund + + for (size_t row = 0; row < NumRowsMSource; ++row) + for (size_t col = 0; col < NumColsMSource; ++col) +- SetEntry(MTarget, row, col, MSource(row, col)); ++ { ++ const MachineInt rowInt(static_cast(row)); ++ const MachineInt colInt(static_cast(col)); ++ SetEntry(MTarget, row, col, MSource(rowInt, colInt)); ++ } + } + + // Solve the linear system M*x = b by using Gauss' algorithm +@@ -60,6 +65,7 @@ namespace CoCoADortmund + const size_t NumColsM = NumCols(M); + const size_t NumRowsb = NumRows(b); + const size_t NumColsb = NumCols(b); ++ const MachineInt zInt(0); + + // Dimension check + if (NumRowsM != NumRowsb) +@@ -91,13 +97,17 @@ namespace CoCoADortmund + size_t row = 0; + for (size_t col = 0; col < NumColsM && row < NumRowsM; ++col) + { ++ const MachineInt rowInt(static_cast(row)); ++ const MachineInt colInt(static_cast(col)); ++ + // Check if current column contains an element != 0 +- if (IsZero(MCopy(row, col))) ++ if (IsZero(MCopy(rowInt, colInt))) + { + size_t i = row+1; + for ( ; i < NumRowsM; ++i) + { +- if (!IsZero(MCopy(i, col))) ++ const MachineInt iInt(static_cast(i)); ++ if (!IsZero(MCopy(iInt, colInt))) + { + // Switch MCopy and bCopy rows + MCopy->mySwapRows(i, row); +@@ -113,13 +123,14 @@ namespace CoCoADortmund + positions.push_back(make_pair(row, col)); + + // Found an element != 0 in current column; apply elemination +- c = MCopy(row, col); ++ c = MCopy(rowInt, colInt); + + for (size_t i = row+1; i < NumRowsM; ++i) + { + // Transform MCopy and bCopy +- bCopy->myAddRowMul(i, row, -MCopy(i, col)/c); +- MCopy->myAddRowMul(i, row, -MCopy(i, col)/c); ++ const MachineInt iInt(static_cast(i)); ++ bCopy->myAddRowMul(i, row, -MCopy(iInt, colInt)/c); ++ MCopy->myAddRowMul(i, row, -MCopy(iInt, colInt)/c); + } + + ++row; +@@ -128,7 +139,8 @@ namespace CoCoADortmund + // row = rank(MCopy); check if a solution for the equation system exists + for (size_t i = row; i < NumRowsb; ++i) + { +- if (!IsZero(bCopy(i, 0))) ++ const MachineInt iInt(static_cast(i)); ++ if (!IsZero(bCopy(iInt, zInt))) + return false; + } + +@@ -138,13 +150,16 @@ namespace CoCoADortmund + while (!positions.empty()) + { + const size_t i = positions.back().first, j = positions.back().second; ++ const MachineInt iInt(static_cast(i)); ++ const MachineInt jInt(static_cast(j)); + +- RingElem x(bCopy(i, 0)); ++ RingElem x(bCopy(iInt, zInt)); + for (size_t k = j + 1; k < NumColsM; ++k) + { +- x -= MCopy(i, k) * x0Tmp(k, 0); ++ const MachineInt kInt(static_cast(k)); ++ x -= MCopy(iInt, kInt) * x0Tmp(kInt, zInt); + } +- SetEntry(x0Tmp, j, 0, x/MCopy(i, j)); ++ SetEntry(x0Tmp, j, 0, x/MCopy(iInt, jInt)); + + positions.pop_back(); + } diff --git a/giac.spec b/giac.spec index 1707b80..ecf3ce6 100644 --- a/giac.spec +++ b/giac.spec @@ -7,7 +7,7 @@ Name: giac Summary: Computer Algebra System, Symbolic calculus, Geometry Version: 1.5.0%{subversion} -Release: 1%{?dist} +Release: 2%{?dist} # LGPLv3+: src/Fl_GDI_Printer.cxx, src/Flv_List.cc, src/Flv_Table.cc # BSD: src/tinymt32* License: GPLv3+ @@ -22,13 +22,18 @@ Source2: xcas.appdata.xml # Recent math.h adds an iszero macro, but giac has an iszero function Patch0: %{name}-iszero.patch +# Adapt to cocoalib 0.99700 +Patch1: %{name}-cocoalib.patch + BuildRequires: readline-devel BuildRequires: gettext-devel BuildRequires: gcc-c++ BuildRequires: cocoalib-devel BuildRequires: glpk-devel BuildRequires: gmp-devel +BuildRequires: gmp-ecm-devel BuildRequires: gsl-devel +BuildRequires: libnauty-devel BuildRequires: mpfr-devel BuildRequires: ntl-devel BuildRequires: pari-devel @@ -36,8 +41,10 @@ BuildRequires: lapack-devel BuildRequires: mpfi-devel BuildRequires: mesa-libGL-devel BuildRequires: libao-devel +BuildRequires: libcurl-devel BuildRequires: libpng-devel BuildRequires: libjpeg-devel +BuildRequires: libsamplerate-devel BuildRequires: fltk-devel BuildRequires: libXinerama-devel BuildRequires: desktop-file-utils @@ -380,6 +387,11 @@ make -C check check %{_datadir}/giac/examples/ %changelog +* Fri Mar 20 2020 Jerry James - 1.5.0.85-2 +- Rebuild for CoCoAlib 0.99700 +- Add cocoalib patch +- Build with gmp-ecm, libcurl, libsamplerate, and nauty support + * Tue Feb 04 2020 Antonio Trande 1.5.0.85-1 - Update to 1.5.0 sub-85