From 73ce3d555a746ab1f2a8ff5fc5997d84ebc66e0f Mon Sep 17 00:00:00 2001 From: Jerry James Date: Feb 01 2024 16:18:35 +0000 Subject: Version 4.3.2p8 - Drop upstreamed -alias and -c99 patches - Stop building for 32-bit x86 - Build with ccluster and spasm support - Build docs only on x86_64 and ppc64le architectures --- diff --git a/Singular-alias.patch b/Singular-alias.patch deleted file mode 100644 index 08dbe3f..0000000 --- a/Singular-alias.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- singular-4.1.1/Singular/links/ndbm.cc.orig 2018-07-31 07:05:52.000000000 -0600 -+++ singular-4.1.1/Singular/links/ndbm.cc 2018-10-24 08:39:16.614020655 -0600 -@@ -280,7 +280,7 @@ datum dbm_nextkey(DBM *db) - db->dbm_flags |= _DBM_IOERR; - #endif - } -- if (((short *)db->dbm_pagbuf)[0] != 0) -+ if (db->dbm_pagbuf[0] != 0 || db->dbm_pagbuf[1] != 0) - { - item = makdatum(db->dbm_pagbuf, db->dbm_keyptr); - if (item.dptr != NULL) diff --git a/Singular-c99.patch b/Singular-c99.patch deleted file mode 100644 index f238862..0000000 --- a/Singular-c99.patch +++ /dev/null @@ -1,41 +0,0 @@ -commit b6647a741b9091b82021ff46d4c112099d175d57 -Author: Michael Orlitzky -Date: Thu Nov 10 20:59:00 2022 -0500 - - omalloc/omAllocSystem.c: add another include for malloc.h. - - There are two branches in this file, one for HAVE_MALLOC_SIZE and one - for HAVE_MALLOC_USABLE_SIZE. The former includes malloc.h, and the - latter needs to too; otherwise, malloc_usable_size() is undefined. - - This is caught by -Werror=implicit-function-declaration, which is - likely to be enabled by default in future versions of GCC and clang. - -diff --git a/omalloc/omAllocSystem.c b/omalloc/omAllocSystem.c -index b70a6292acf8ed80..62e20a57b8b53472 100644 ---- a/omalloc/omAllocSystem.c -+++ b/omalloc/omAllocSystem.c -@@ -30,15 +30,19 @@ - * - *******************************************************************/ - /* allocation of large addr */ --#if defined(HAVE_MALLOC_SIZE) -+ -+#if defined(HAVE_MALLOC_SIZE) || defined(HAVE_MALLOC_USABLE_SIZE) -+ #include - #ifdef HAVE_MALLOC_H -- #include -+ #include - #elif defined(HAVE_MALLOC_MALLOC_H) -- #include -+ #include - #endif -+#endif -+ -+#if defined(HAVE_MALLOC_SIZE) - #define _omSizeOfLargeAddr(addr) (malloc_size(addr)) - #elif defined(HAVE_MALLOC_USABLE_SIZE) -- #include - #define _omSizeOfLargeAddr(addr) (malloc_usable_size(addr)) - #else - void* omAllocLarge(size_t size) diff --git a/Singular-polymake-lib.patch b/Singular-polymake-lib.patch new file mode 100644 index 0000000..f5a5d52 --- /dev/null +++ b/Singular-polymake-lib.patch @@ -0,0 +1,10 @@ +--- singular-4.3.2/Singular/LIB/polymake.lib.orig 2023-09-06 02:51:20.000000000 -0600 ++++ singular-4.3.2/Singular/LIB/polymake.lib 2024-02-01 08:44:42.076075304 -0700 +@@ -226,7 +226,6 @@ EXAMPLE: example triangulations; shows + if ((p2t[i]=="}") and (p2t[i+1]=="}")) + { + np2t=np2t+"))"; +- i++; + } + else + { diff --git a/Singular-use-after-free.patch b/Singular-use-after-free.patch index 2438a25..1da71e9 100644 --- a/Singular-use-after-free.patch +++ b/Singular-use-after-free.patch @@ -21,8 +21,8 @@ longrat.cc:573:40: note: unnamed temporary defined here 573 | mpf_t *f = ((gmp_complex*)from)->real()._mpfp(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~ ---- Singular-Release-4-2-1p3/factory/cfModGcd.cc.orig 2021-12-17 11:35:18.000000000 -0700 -+++ Singular-Release-4-2-1p3/factory/cfModGcd.cc 2022-07-25 14:53:41.944360644 -0600 +--- singular-4.3.2/factory/cfModGcd.cc.orig 2023-09-06 02:51:20.000000000 -0600 ++++ singular-4.3.2/factory/cfModGcd.cc 2024-02-01 08:40:42.663437275 -0700 @@ -1825,7 +1825,6 @@ gaussianElimFq (CFMatrix& M, CFArray& L, #else factoryError("NTL/FLINT missing: gaussianElimFq"); @@ -31,130 +31,15 @@ longrat.cc:573:40: note: unnamed temporary defined here M= (*N) (1, M.rows(), 1, M.columns()); L= CFArray (M.rows()); ---- Singular-Release-4-2-1p3/libpolys/coeffs/longrat.cc.orig 2021-12-17 11:35:18.000000000 -0700 -+++ Singular-Release-4-2-1p3/libpolys/coeffs/longrat.cc 2022-07-25 10:59:58.720085578 -0600 +--- singular-4.3.2/libpolys/coeffs/longrat.cc.orig 2024-02-01 08:40:42.664437261 -0700 ++++ singular-4.3.2/libpolys/coeffs/longrat.cc 2024-02-01 08:41:54.573427454 -0700 @@ -570,7 +570,8 @@ static number nlMapC(number from, const return INT_TO_SR(0); } - + - mpf_t *f = ((gmp_complex*)from)->real()._mpfp(); + gmp_float gfl = ((gmp_complex*)from)->real(); + mpf_t *f = gfl._mpfp(); number res; mpz_ptr dest,ndest; ---- Singular-Release-4-2-1p3/Singular/countedref.cc.orig 2021-12-17 11:35:18.000000000 -0700 -+++ Singular-Release-4-2-1p3/Singular/countedref.cc 2022-07-25 14:51:02.519890787 -0600 -@@ -317,13 +317,17 @@ public: - /// Recover the actual object from Singular interpreter object - static self cast(leftv arg) { - assume(arg != NULL); assume(is_ref(arg)); -- return self::cast(arg->Data()); -+ auto d = arg->Data(); -+ return self::cast(d); - } - - /// If necessary dereference. - static BOOLEAN resolve(leftv arg) { - assume(arg != NULL); -- while (is_ref(arg)) { if(CountedRef::cast(arg).dereference(arg)) return TRUE; }; -+ while (is_ref(arg)) { -+ CountedRef ref = CountedRef::cast(arg); -+ if (ref.dereference(arg)) return TRUE; -+ } - return (arg->next != NULL) && resolve(arg->next); - } - -@@ -369,8 +373,9 @@ char* countedref_String(blackbox */*b*/, - /// blackbox support - copy element - void* countedref_Copy(blackbox*/*b*/, void* ptr) - { -- if (ptr) return CountedRef::cast(ptr).outcast(); -- return NULL; -+ if (!ptr) return NULL; -+ CountedRef ref = CountedRef::cast(ptr); -+ return ref.outcast(); - } - - /// blackbox support - assign element -@@ -383,12 +388,16 @@ BOOLEAN countedref_Assign(leftv result, - } - - // Case: copy reference -- if (result->Typ() == arg->Typ()) -- return CountedRef::cast(arg).outcast(result); -+ if (result->Typ() == arg->Typ()) { -+ CountedRef ref = CountedRef::cast(arg); -+ return ref.outcast(result); -+ } - - // Case: new reference -- if ((arg->rtyp == IDHDL) || CountedRef::is_ref(arg)) -- return CountedRef(arg).outcast(result); -+ if ((arg->rtyp == IDHDL) || CountedRef::is_ref(arg)) { -+ CountedRef ref(arg); -+ return ref.outcast(result); -+ } - - WerrorS("Can only take reference from identifier"); - return TRUE; -@@ -483,7 +492,10 @@ BOOLEAN countedref_Op3(int op, leftv res - /// blackbox support - destruction - void countedref_destroy(blackbox */*b*/, void* ptr) - { -- if (ptr) CountedRef::cast(ptr).destruct(); -+ if (ptr) { -+ CountedRef ref = CountedRef::cast(ptr); -+ ref.destruct(); -+ } - } - - -@@ -539,7 +551,8 @@ public: - /// Blackbox support - generate initialized, but all-zero - shared data - void* countedref_InitShared(blackbox*) - { -- return CountedRefShared().outcast(); -+ auto ref = CountedRefShared(); -+ return ref.outcast(); - } - - /// Blackbox support - unary operation for shared data -@@ -656,23 +669,31 @@ BOOLEAN countedref_AssignShared(leftv re - /// Case: new reference to already shared data - if (result->Typ() == arg->Typ()) - { -- if (result->Data() != NULL) -- CountedRefShared::cast(result).destruct(); -- return CountedRefShared::cast(arg).outcast(result); -+ if (result->Data() != NULL) { -+ CountedRefShared ref = CountedRefShared::cast(result); -+ ref.destruct(); -+ } -+ CountedRefShared ref = CountedRefShared::cast(arg); -+ return ref.outcast(result); - } - if(CountedRefShared::cast(result).unassigned()) - { -- return CountedRefShared::cast(result).assign(result, arg); -+ CountedRefShared ref = CountedRefShared::cast(result); -+ return ref.assign(result, arg); - } - - /// Case: new shared data -- return CountedRefShared(arg).outcast(result); -+ CountedRefShared ref(arg); -+ return ref.outcast(result); - } - - /// blackbox support - destruction - void countedref_destroyShared(blackbox */*b*/, void* ptr) - { -- if (ptr) CountedRefShared::cast(ptr).destruct(); -+ if (ptr) { -+ CountedRefShared ref = CountedRefShared::cast(ptr); -+ ref.destruct(); -+ } - } - - diff --git a/Singular.spec b/Singular.spec index fe83f18..b6b22f9 100644 --- a/Singular.spec +++ b/Singular.spec @@ -1,7 +1,7 @@ %global singulardir %{_libdir}/Singular -%global upstreamver 4-3-1 +%global upstreamver 4-3-2 %global downstreamver %(tr - . <<< %{upstreamver}) -%global patchver p1 +%global patchver p8 %bcond_with python @@ -14,9 +14,21 @@ # of Singular cannot be installed. %bcond_with bootstrap +# Starting with the 4.3.1p3 release, doc building has become problematic. The +# s390x build usually fails: while building the examples, Singular eventually +# attempts to fork, gets back ENOMEM, and then doesn't handle the failure well. +# The result is that the build stalls. To avoid all this, we only build docs +# for aarch64, x86_64, and ppc64le. If you really need docs for s390x, help me +# figure out how to avoid the problem described above. +%ifarch %{arm64} x86_64 %{power64} +%bcond_without docs +%else +%bcond_with docs +%endif + Name: Singular Version: %{downstreamver}%{?patchver} -Release: 5%{?dist} +Release: 1%{?dist} Summary: Computer Algebra System for polynomial computations # License analysis: # - The project as a whole is GPL-2.0-only OR GPL-3.0-only @@ -38,6 +50,7 @@ BuildRequires: boost-devel %if %{with python} BuildRequires: boost-python2-devel %endif +BuildRequires: ccluster-devel BuildRequires: cddlib-devel BuildRequires: desktop-file-utils BuildRequires: doxygen @@ -55,6 +68,7 @@ BuildRequires: javapackages-tools %endif BuildRequires: libgfan-devel BuildRequires: libnormaliz-devel +BuildRequires: libspasm-devel BuildRequires: libtool BuildRequires: lrcalc BuildRequires: make @@ -93,9 +107,12 @@ Provides: Singular-polymake = %{version}-%{release} # This can be removed when F41 reaches EOL Obsoletes: Singular-surfex < 4.3.1-1 +# See https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval +ExcludeArch: %{ix86} + # Support S390(x) architectures Patch0: %{name}-arches.patch -# Fix both underlinking and overlinking +# Fix overlinking Patch1: %{name}-link.patch # Fix the desktop files Patch2: %{name}-desktop.patch @@ -107,23 +124,24 @@ Patch4: %{name}-format.patch Patch5: %{name}-parens.patch # Unbundle gfanlib Patch6: %{name}-gfanlib.patch -# Fix code that violates the strict aliasing rules -Patch7: %{name}-alias.patch # Let ESingular read a compressed singular.info file -Patch8: %{name}-emacs.patch +Patch7: %{name}-emacs.patch # Fix a sequence point error -Patch9: %{name}-sequence-point.patch +# https://github.com/Singular/Singular/pull/1200 +Patch8: %{name}-sequence-point.patch # Avoid an unnecessary array comparison -Patch10: %{name}-array-compare.patch +Patch9: %{name}-array-compare.patch # Fix several "use after free" scenarios due to temporary objects -Patch11: %{name}-use-after-free.patch +# https://github.com/Singular/Singular/pull/1201 +Patch10: %{name}-use-after-free.patch # Fix mismatched type declarations -Patch12: %{name}-type-mismatch.patch +Patch11: %{name}-type-mismatch.patch # Change little-endian-specific code to endian-agnostic code -Patch13: %{name}-endian.patch +Patch12: %{name}-endian.patch # Disable examples that use the network to avoid hangs on the koji builders -Patch14: %{name}-doc-hang.patch -Patch15: Singular-c99.patch +Patch13: %{name}-doc-hang.patch +# Fix an off-by-one error in polymake.lib that leads to failed examples +Patch14: %{name}-polymake-lib.patch %description Singular is a computer algebra system for polynomial computations, with @@ -219,6 +237,9 @@ sed -ri 's/(lboost_python)-\$\{PYTHON_VERSION\}/\1%{python2_version_nodots}/' \ # Do not force the use of c++11, since the polymake code requires c++14 sed -i 's/-std=c++11//' m4/ntl-check.m4 +# Do not add an rpath for ccluster +sed -i 's@ -Wl,-rpath,\${CCLUSTER_HOME}/lib@@' m4/ccluster-check.m4 + # Regenerate configure due to patches 0, 1, and 6 autoreconf -fi @@ -227,7 +248,7 @@ sed -i '/countedref\.cc/s/\$(CXXFLAGS)/& -fno-strict-aliasing/g' Singular/Makefi %build -export CPPFLAGS='-I%{_includedir}/flint -I%{_includedir}/gfanlib' +export CPPFLAGS='-I%{_includedir}/arb -I%{_includedir}/flint -I%{_includedir}/gfanlib' %if %{with python} pyincdir=$(python2 -Esc "import sysconfig; print(sysconfig.get_paths()['include'])") CPPFLAGS="$CPPFLAGS -I$pyincdir" @@ -248,16 +269,13 @@ module load lrcalc-%{_arch} --enable-bigintm-module \ --enable-gfanlib-module \ --enable-Order-module \ -%if %{with polymake} --enable-polymake-module \ -%else - --disable-polymake-module \ -%endif %if %{with python} --enable-python-module \ %else --disable-python-module \ %endif + --enable-sispasm-module \ --enable-streamio \ --with-gmp \ --with-ntl \ @@ -269,14 +287,13 @@ module load lrcalc-%{_arch} --without-python \ %endif --with-readline \ - --enable-doc \ +%if %{with docs} + --enable-doc-build \ +%endif --with-malloc=system %make_build %make_build -C dox html -%make_build -C Singular libparse -make -C doc -j1 -f Makefile-docbuild singular.idx -make -C doc -j1 all-local %install @@ -314,9 +331,11 @@ mkdir -p %{buildroot}%{_mandir}/man1 for cmd in ESingular Singular TSingular; do cp -p Singular/$cmd.man %{buildroot}%{_mandir}/man1/$cmd.1 done +%if %{with docs} cp -a doc/{html,singular.idx} %{buildroot}%{_datadir}/singular mkdir -p %{buildroot}%{_infodir} cp -p doc/singular.info %{buildroot}%{_infodir} +%endif # remove script that calls surf; we don't ship it rm -f %{buildroot}%{singulardir}/singularsurf @@ -368,7 +387,6 @@ make check %doc README.md %{_bindir}/Singular %{_bindir}/TSingular -%{_infodir}/singular.info* %{_mandir}/man1/Singular.1* %{_mandir}/man1/TSingular.1* %{_datadir}/applications/Singular.desktop @@ -376,8 +394,12 @@ make check %{_datadir}/ml_python/ %{_datadir}/ml_singular/ %{_datadir}/singular/singular.idx +%{_infodir}/singular.info* +%if %{with docs} %docdir %{_datadir}/singular/html/ %{_datadir}/singular/html/ +%{singulardir}/libparse +%endif %dir %{singulardir} %{singulardir}/Singular %{singulardir}/TSingular @@ -458,6 +480,13 @@ make check %changelog +* Thu Feb 1 2024 Jerry James - 4.3.2p8-1 +- Version 4.3.2p8 +- Drop upstreamed -alias and -c99 patches +- Stop building for 32-bit x86 +- Build with ccluster and spasm support +- Build docs only on x86_64 and ppc64le architectures + * Mon Jan 22 2024 Fedora Release Engineering - 4.3.1p1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index 16b536e..61cc71a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (singular-4.3.1p1.tar.gz) = d27d8e042ea085e49aed6a0697056c36e78e62ea0b9d17751cdf4c556cf4f6efce3b34b411c77aef97c6d90675bea11c97651eb7009634cb8a9b630ec820a06e +SHA512 (singular-4.3.2p8.tar.gz) = e848110323d2b00d739a6feafef4514fffa14e2905be7a3c9419f33e47234207b1cef8c97b382ce72fc26e06b1407eca0d365a6241d1747a2a5d06e1a69a23af