From 7a725dcb13754b5ed755956f874a16e1b3ad286a Mon Sep 17 00:00:00 2001 From: Jerry James Date: Jan 15 2015 20:51:37 +0000 Subject: Rebuild for ntl 8.1.0. Also: - Add Singular-ntl8.patch to adapt. --- diff --git a/Singular-ntl8.patch b/Singular-ntl8.patch new file mode 100644 index 0000000..28a27d7 --- /dev/null +++ b/Singular-ntl8.patch @@ -0,0 +1,84 @@ +--- Singular-3-1-6/factory/NTLconvert.cc.orig 2012-12-19 14:01:16.000000000 -0700 ++++ Singular-3-1-6/factory/NTLconvert.cc 2015-01-12 20:00:00.000000000 -0700 +@@ -55,6 +55,63 @@ + NTL_CLIENT + #endif + ++// Needed explicit template instantiations for NTL 8.x.x ++template mat_zz_p::Mat(const mat_zz_p&); ++template mat_zz_pE::Mat(const mat_zz_pE&); ++ ++template class Vec >; ++template class Vec >; ++template class Vec >; ++template class Vec >; ++template class Vec >; ++template class Vec >; ++template class Vec >; ++template class Vec >; ++template class Vec >; ++template class Vec; ++template class Vec; ++ ++template long operator==(const vec_zz_p&, const vec_zz_p&); ++ ++template void BlockConstruct >(Pair* p, long n); ++template void BlockConstruct >(Pair* p, long n); ++template void BlockConstruct >(Pair* p, long n); ++template void BlockConstruct >(Pair* p, long n); ++template void BlockConstruct >(Pair* p, long n); ++template void BlockConstruct >(Pair* p, long n); ++template void BlockConstruct >(Pair* p, long n); ++template void BlockConstruct >(Vec* p, long n); ++template void BlockConstruct >(Vec* p, long n); ++template void BlockConstruct(zz_pEX* p, long n); ++ ++template void BlockConstructFromVec >(Pair* p, long n, const Pair* q); ++template void BlockConstructFromVec >(Pair* p, long n, const Pair* q); ++template void BlockConstructFromVec >(Pair* p, long n, const Pair* q); ++template void BlockConstructFromVec >(Pair* p, long n, const Pair* q); ++template void BlockConstructFromVec >(Pair* p, long n, const Pair* q); ++template void BlockConstructFromVec >(Pair* p, long n, const Pair* q); ++template void BlockConstructFromVec >(Pair* p, long n, const Pair* q); ++template void BlockConstructFromVec >(Vec* p, long n, const Vec* q); ++template void BlockConstructFromVec >(Vec* p, long n, const Vec* q); ++template void BlockConstructFromVec(zz_p* p, long n, const zz_p* q); ++template void BlockConstructFromVec(zz_pE* p, long n, const zz_pE* q); ++template void BlockConstructFromVec(zz_pEX* p, long n, const zz_pEX* q); ++ ++template void BlockConstructFromObj >(Pair* p, long n, const Pair& q); ++template void BlockConstructFromObj >(Pair* p, long n, const Pair& q); ++template void BlockConstructFromObj >(Pair* p, long n, const Pair& q); ++template void BlockConstructFromObj >(Pair* p, long n, const Pair& q); ++template void BlockConstructFromObj >(Pair* p, long n, const Pair& q); ++template void BlockConstructFromObj >(Pair* p, long n, const Pair& q); ++template void BlockConstructFromObj >(Pair* p, long n, const Pair& q); ++template void BlockConstructFromObj >(Vec* p, long n, const Vec& q); ++template void BlockConstructFromObj >(Vec* p, long n, const Vec& q); ++template void BlockConstructFromObj(zz_pEX* p, long n, const zz_pEX& q); ++ ++template SmartPtr MakeSmart(const GF2X &ptr); ++template SmartPtr MakeSmart(const zz_pX &ptr); ++template SmartPtr MakeSmart(const ZZ &ptr); ++ + //////////////////////////////////////////////////////////////////////////////// + // NAME: convertFacCF2NTLZZpX // + // // +@@ -511,7 +568,7 @@ + } + else + { +- long sizeofrep= ((long *) a.rep) [1]; ++ long sizeofrep= ((long *) &a) [1]; + bool lessZero= false; + if (sizeofrep < 0) + { +@@ -529,7 +586,7 @@ + cf_stringtemp_l= sizeofrep*sizeof(mp_limb_t)*2; + cf_stringtemp= (unsigned char*) Alloc (cf_stringtemp_l); + } +- int cc= mpn_get_str (cf_stringtemp, 16, (mp_limb_t *) (((long *) (a.rep)) + 2), sizeofrep); ++ int cc= mpn_get_str (cf_stringtemp, 16, (mp_limb_t *) (((long *) &a) + 2), sizeofrep); + + char* cf_stringtemp2; + if (lessZero) diff --git a/Singular.spec b/Singular.spec index 079f721..77ad034 100644 --- a/Singular.spec +++ b/Singular.spec @@ -1,8 +1,12 @@ %global singulardir %{_libdir}/Singular %global upstreamver 3-1-6 -%if 0%{?fedora} > 18 -%define ntl6 1 +%if 0%{?fedora} > 20 +%global ntl8 1 +%else +%if 0%{?fedora} +%global ntl6 1 +%endif %endif # If a library used by both polymake and Singular is updated, neither can be @@ -13,7 +17,7 @@ Name: Singular Version: %(tr - . <<<%{upstreamver}) -Release: 8%{?dist} +Release: 9%{?dist} Summary: Computer Algebra System for polynomial computations Group: Applications/Engineering License: BSD and LGPLv2+ and GPLv2+ @@ -28,7 +32,7 @@ BuildRequires: flint-devel BuildRequires: gmp-devel BuildRequires: libxml2-devel BuildRequires: ncurses-devel -BuildRequires: ntl-devel%{?ntl6: >= 6.0} +BuildRequires: ntl-devel%{?ntl8: >= 8.0}%{?ntl6: >= 6.0} %if %{with polymake} BuildRequires: polymake-devel %endif @@ -68,6 +72,8 @@ Patch12: Singular-ntl6.patch Patch13: Singular-arches.patch # Adapt to changes in flint 2.4 Patch14: Singular-flint24.patch +# Adapt to new template code in NTL 8 +Patch15: Singular-ntl8.patch ## Macaulay2 patches Patch20: Singular-M2_factory.patch @@ -172,6 +178,9 @@ Emacs mode for Singular. %endif %patch13 -p1 %patch14 -p1 -b .flint24 +%if 0%{?ntl8:1} +%patch15 -p1 +%endif #patch20 -p1 -b .M2_factory #patch21 -p1 -b .M2_memutil_debuggging @@ -270,6 +279,11 @@ make %{?_smp_mflags} -C gfanlib %endif pushd factory +CFLAGS="%{optflags} -fPIC -fsigned-char -I%{_includedir}/cddlib -I%{_includedir}/flint" +CXXFLAGS=$CFLAGS +LDFLAGS="$RPM_LD_FLAGS -Wl,--as-needed -L$PWD/gfanlib" +LIBS="-lpthread -ldl" + %configure \ --bindir=%{singulardir} \ --includedir=%{_includedir}/factory \ @@ -421,6 +435,11 @@ pushd factory make DESTDIR=$RPM_BUILD_ROOT install # make a version without singular defined make clean + CFLAGS="%{optflags} -fPIC -fsigned-char -I%{_includedir}/cddlib -I%{_includedir}/flint" + CXXFLAGS=$CFLAGS + LDFLAGS="$RPM_LD_FLAGS -Wl,--as-needed -L$PWD/gfanlib" + LIBS="-lpthread -ldl" + %configure \ --bindir=%{singulardir} \ --includedir=%{_includedir}/factory \ @@ -520,6 +539,10 @@ sed -e 's|<\(cf_gmp.h>\)| - 3.1.6-9 +- Rebuild for ntl 8.1.0 +- Add Singular-ntl8.patch to adapt + * Tue Oct 28 2014 Jerry James - 3.1.6-8 - Rebuild for ntl 6.2.1