[flint] New upstream release.
Jerry James
jjames at fedoraproject.org
Thu Feb 13 17:21:44 UTC 2014
commit 629edecb35013eb8bdd5139c6e25bc6c6a5517d8
Author: Jerry James <jamesjer at betterlinux.com>
Date: Thu Feb 13 10:21:27 2014 -0700
New upstream release.
Also:
- Enable C++ interface
- Tests now work on 32-bit systems
- Minimize the set of LaTeX BRs
- Enable verbose build
- Link with Fedora LDFLAGS
.gitignore | 2 +-
flint-cpimport.patch | 28 --------
flint-docgen.patch | 171 --------------------------------------------------
flint-rpmbuild.patch | 86 ++++++++++++-------------
flint.spec | 95 +++++++++++++++------------
sources | 2 +-
6 files changed, 97 insertions(+), 287 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 72ab5f3..c3087de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-/flint-1.6.tgz
/flint-2.3-4b383e2.tar.gz
+/flint-2.4.1.tar.gz
diff --git a/flint-rpmbuild.patch b/flint-rpmbuild.patch
index f4af887..f967384 100644
--- a/flint-rpmbuild.patch
+++ b/flint-rpmbuild.patch
@@ -1,7 +1,7 @@
diff -up ./configure.orig ./configure
---- ./configure.orig 2013-08-01 20:46:20.753615620 -0300
-+++ ./configure 2013-08-01 20:46:24.087615748 -0300
-@@ -100,6 +100,9 @@ while [ "$1" != "" ]; do
+--- configure.orig 2014-01-02 12:08:34.000000000 -0700
++++ configure 2014-02-12 20:00:00.000000000 -0700
+@@ -111,6 +111,9 @@ while [ "$1" != "" ]; do
FLINT_CPIMPORT_DIR="$PREFIX/share/flint"
FLINT_CPIMPORT="$FLINT_CPIMPORT_DIR/CPimport.txt"
;;
@@ -11,17 +11,20 @@ diff -up ./configure.orig ./configure
--enable-shared)
SHARED=1
;;
-@@ -142,6 +145,9 @@ while [ "$1" != "" ]; do
+@@ -171,6 +174,12 @@ while [ "$1" != "" ]; do
CFLAGS)
CFLAGS="$VALUE"
;;
+ CXXFLAGS)
+ CXXFLAGS="$VALUE"
+ ;;
++ LDFLAGS)
++ LDFLAGS="$VALUE"
++ ;;
ABI)
ABI="$VALUE"
;;
-@@ -157,15 +163,12 @@ done
+@@ -186,15 +195,12 @@ done
LIBS="m"
@@ -41,9 +44,9 @@ diff -up ./configure.orig ./configure
else
echo "Invalid GMP directory"
exit 1
-@@ -174,18 +177,12 @@ LIB_DIRS="${LIB_DIRS} ${GMP_LIB_DIR}"
+@@ -203,18 +209,12 @@ LIB_DIRS="${LIB_DIRS} ${GMP_LIB_DIR}"
INC_DIRS="${INC_DIRS} ${GMP_INC_DIR}"
- LIBS="gmp ${LIBS}"
+ LIBS="${LIBS} gmp"
-if [ -d "${MPFR_DIR}/lib" ]; then
- MPFR_LIB_DIR="${MPFR_DIR}/lib"
@@ -64,7 +67,7 @@ diff -up ./configure.orig ./configure
else
echo "Invalid MPFR directory"
exit 1
-@@ -197,12 +194,9 @@ LIBS="mpfr ${LIBS}"
+@@ -226,12 +226,9 @@ LIBS="${LIBS} mpfr"
#configure extra libraries
if [ "$WANT_NTL" = "1" ]; then
@@ -80,7 +83,7 @@ diff -up ./configure.orig ./configure
else
echo "Invalid NTL directory"
exit 1
-@@ -524,6 +518,7 @@ echo "FLINT_SHARED=$SHARED" >> Makefile
+@@ -616,6 +613,7 @@ echo "FLINT_SHARED=$SHARED" >> Makefile
echo "FLINT_LIB=$FLINT_LIB" >> Makefile
echo "EXEEXT=$EXEEXT" >> Makefile
echo "PREFIX=$PREFIX" >> Makefile
@@ -88,46 +91,32 @@ diff -up ./configure.orig ./configure
echo "" >> Makefile
echo "WANT_NTL=$WANT_NTL" >> Makefile
echo "" >> Makefile
-@@ -539,6 +534,7 @@ echo "CXX=$CXX" >> Makefile
+@@ -631,6 +629,8 @@ echo "CXX=$CXX" >> Makefile
echo "AR=$AR" >> Makefile
echo "" >> Makefile
echo "CFLAGS=$CFLAGS" >> Makefile
+echo "CXXFLAGS=$CXXFLAGS" >> Makefile
++echo "LDFLAGS=$LDFLAGS" >> Makefile
echo "ABI_FLAG=$ABI_FLAG" >> Makefile
echo "PIC_FLAG=$PIC_FLAG" >> Makefile
echo "" >> Makefile
-diff -up ./flint.h.orig ./flint.h
---- ./flint.h.orig 2013-08-01 20:46:20.763615621 -0300
-+++ ./flint.h 2013-08-01 20:46:24.090615748 -0300
-@@ -202,9 +202,9 @@ void mpn_tdiv_q(mp_ptr qp,
- mp_srcptr np, mp_size_t nn,
- mp_srcptr dp, mp_size_t dn)
- {
-- mp_ptr _scratch = flint_malloc(dn * sizeof(mp_limb_t));
-+ mp_ptr _scratch = (mp_ptr)flint_malloc(dn * sizeof(mp_limb_t));
- mpn_tdiv_qr(qp, _scratch, 0, np, nn, dp, dn);
-- flint_free(_scratch);
-+ flint_free((void *)_scratch);
- }
- #endif
-
diff -up ./Makefile.in.orig ./Makefile.in
---- ./Makefile.in.orig 2013-08-01 20:46:20.758615621 -0300
-+++ ./Makefile.in 2013-08-01 20:46:55.454616949 -0300
-@@ -92,10 +92,10 @@ $(FLINT_LIB): $(LOBJS) $(LIB_SOURCES) $(
- $(AT)$(foreach dir, $(BUILD_DIRS), mkdir -p build/$(dir); export BUILD_DIR=../build/$(dir); export MOD_DIR=$(dir); $(MAKE) -f ../Makefile.subdirs -C $(dir) shared || exit $$?;)
+--- Makefile.in.orig 2014-01-02 12:08:34.000000000 -0700
++++ Makefile.in 2014-02-12 20:00:00.000000000 -0700
+@@ -102,10 +102,10 @@
+ $(AT)$(foreach dir, $(BUILD_DIRS), mkdir -p build/$(dir); BUILD_DIR=../build/$(dir); export BUILD_DIR; MOD_DIR=$(dir); export MOD_DIR; $(MAKE) -f ../Makefile.subdirs -C $(dir) shared || exit $$?;)
$(AT)if [ "$(WANT_NTL)" -eq "1" ]; then \
$(MAKE) build/interfaces/NTL-interface.lo; \
- $(CXX) $(ABI_FLAG) -shared build/interfaces/NTL-interface.lo $(LOBJS) $(MOD_LOBJS) $(EXT_OBJS) $(LIBS2) -o $(FLINT_LIB); \
-+ $(CXX) $(ABI_FLAG) -shared build/interfaces/NTL-interface.lo $(LOBJS) $(MOD_LOBJS) $(LIBS2) -o $(FLINT_LIB) -Wl,-h,$(FLINT_LIB); \
++ $(CXX) $(ABI_FLAG) -shared build/interfaces/NTL-interface.lo $(LDFLAGS) $(LOBJS) $(MOD_LOBJS) $(LIBS2) -o $(FLINT_LIB) -Wl,-h,$(FLINT_LIB); \
fi
$(AT)if [ "$(WANT_NTL)" -ne "1" ]; then \
- $(CC) $(ABI_FLAG) -shared $(LOBJS) $(MOD_LOBJS) $(EXT_OBJS) $(LIBS2) -o $(FLINT_LIB); \
-+ $(CC) $(ABI_FLAG) -shared $(LOBJS) $(MOD_LOBJS) $(LIBS2) -o $(FLINT_LIB) -Wl,-h,$(FLINT_LIB); \
++ $(CC) $(ABI_FLAG) -shared $(LDFLAGS) $(LOBJS) $(MOD_LOBJS) $(LIBS2) -o $(FLINT_LIB) -Wl,-h,$(FLINT_LIB); \
fi
libflint.a: $(OBJS) $(LIB_SOURCES) $(EXT_SOURCES) $(HEADERS) $(EXT_HEADERS) | build build/interfaces
-@@ -150,18 +150,21 @@ else
+@@ -169,23 +169,26 @@
endif
install: library
@@ -136,30 +125,39 @@ diff -up ./Makefile.in.orig ./Makefile.in
mkdir -p $(DESTDIR)$(PREFIX)/include/flint
$(AT)if [ "$(FLINT_SHARED)" -eq "1" ]; then \
- cp $(FLINT_LIB) $(DESTDIR)$(PREFIX)/lib; \
-+ cp $(FLINT_LIB) $(DESTDIR)$(LIBDIR); \
++ cp -p $(FLINT_LIB) $(DESTDIR)$(LIBDIR); \
fi
$(AT)if [ "$(FLINT_STATIC)" -eq "1" ]; then \
- cp libflint.a $(DESTDIR)$(PREFIX)/lib; \
-+ cp libflint.a $(DESTDIR)$(LIBDIR); \
++ cp -p libflint.a $(DESTDIR)$(LIBDIR); \
fi
cp $(HEADERS) $(DESTDIR)$(PREFIX)/include/flint
$(AT)if [ ! -z $(EXT_HEADERS) ]; then \
- cp $(EXT_HEADERS) $(DESTDIR)$(PREFIX)/include/flint; \
- fi
-+ $(AT)if [ "$(WANT_NTL)" -eq "1" ]; then \
-+ cp NTL-interface.h $(DESTDIR)$(PREFIX)/include/flint; \
+- cp $(EXT_HEADERS) $(DESTDIR)$(PREFIX)/include/flint; \
++ cp -p $(EXT_HEADERS) $(DESTDIR)$(PREFIX)/include/flint; \
+ fi
++ $(AT)if [ "$(WANT_NTL)" -eq "1" ]; then \
++ cp -p NTL-interface.h $(DESTDIR)$(PREFIX)/include/flint; \
+ fi
mkdir -p $(DESTDIR)$(FLINT_CPIMPORT_DIR)
- cp qadic/CPimport.txt $(DESTDIR)$(FLINT_CPIMPORT_DIR)
+- cp qadic/CPimport.txt $(DESTDIR)$(FLINT_CPIMPORT_DIR)
++ cp -p qadic/CPimport.txt $(DESTDIR)$(FLINT_CPIMPORT_DIR)
+ mkdir -p $(DESTDIR)$(PREFIX)/include/flint/flintxx
+- cp flintxx/*.h $(DESTDIR)$(PREFIX)/include/flint/flintxx
+- cp *xx.h $(DESTDIR)$(PREFIX)/include/flint
++ cp -p flintxx/*.h $(DESTDIR)$(PREFIX)/include/flint/flintxx
++ cp -p *xx.h $(DESTDIR)$(PREFIX)/include/flint
-@@ -184,13 +187,13 @@ build/interfaces:
+ build:
+ mkdir -p build
+@@ -206,13 +209,13 @@
mkdir -p build/interfaces
- build/interfaces/NTL-interface.lo: interfaces/NTL-interface.cpp
+ build/interfaces/NTL-interface.lo: interfaces/NTL-interface.cpp NTL-interface.h
- $(QUIET_CXX) $(CXX) $(PIC_FLAG) $(CFLAGS) $(INCS) -c $< -o $@;
+ $(QUIET_CXX) $(CXX) $(PIC_FLAG) $(CXXFLAGS) $(INCS) -c $< -o $@;
- build/interfaces/NTL-interface.o: interfaces/NTL-interface.cpp
+ build/interfaces/NTL-interface.o: interfaces/NTL-interface.cpp NTL-interface.h
- $(QUIET_CXX) $(CXX) $(CFLAGS) $(INCS) -c $< -o $@;
+ $(QUIET_CXX) $(CXX) $(CXXFLAGS) $(INCS) -c $< -o $@;
@@ -167,5 +165,5 @@ diff -up ./Makefile.in.orig ./Makefile.in
- $(QUIET_CXX) $(CXX) $(CFLAGS) $(INCS) $< build/interfaces/NTL-interface.o -o $@ $(LIBS);
+ $(QUIET_CXX) $(CXX) $(CXXFLAGS) $(INCS) $< build/interfaces/NTL-interface.o -o $@ $(LIBS);
- .PHONY: profile library shared static clean examples tune check tests distclean dist install all
-
+ print-%:
+ @echo '$*=$($*)'
diff --git a/flint.spec b/flint.spec
index 05bd39f..87da3e3 100644
--- a/flint.spec
+++ b/flint.spec
@@ -1,4 +1,4 @@
-%global with_snapshot 1
+%global with_snapshot 0
%if %{with_snapshot}
%global commit 4b383e23b39099f5ba09f7758023440e76277fc1
@@ -11,7 +11,7 @@
%endif
Name: flint
-Version: 2.3
+Version: 2.4.1
Release: 1%{snapshot}%{?dist}
Summary: Fast Library for Number Theory
Group: Applications/Engineering
@@ -20,29 +20,25 @@ URL: http://www.flintlib.org/
%if %{with_snapshot}
Source0: https://github.com/wbhart/flint2/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
%else
-Source0: http://www.flintlib.org/flint-%{version}.tar.gz
+Source0: http://www.flintlib.org/%{name}-%{version}.tar.gz
%endif
# Minor changes to configure and Makefile.in for proper use of ${_lib}
# and generation of a shared library with a soname
Patch0: %{name}-rpmbuild.patch
-# Workaround bug in the create_doc build program that triggers an error
-# for lines with 79 width under special conditions
-Patch1: %{name}-docgen.patch
-
-# Add extra check for environment variable if not finding data file
-# to avoid make check failure if not already installed
-Patch2: %{name}-cpimport.patch
-
BuildRequires: gmp-devel
BuildRequires: mpfr-devel
BuildRequires: ntl-devel
BuildRequires: tex(latex)
-BuildRequires: texlive-collection-latexextra
-BuildRequires: texlive-collection-pictures
+BuildRequires: tex(cases.sty)
+BuildRequires: tex(epigraph.sty)
+BuildRequires: tex(multirow.sty)
+BuildRequires: tex(sectsty.sty)
+BuildRequires: tex(tocloft.sty)
+BuildRequires: tex(xy.sty)
-%global sover %(echo %{version} | cut -d. -f 1)
+%global sover %(cut -d. -f 1 <<< %{version})
%description
@@ -82,21 +78,32 @@ developing applications that use %{name}.
%endif
%patch0
-%patch1
-%patch2
+
+fixtimestamp() {
+ touch -r $1.orig $1
+ rm -f $1.orig
+}
# sanitize header files
ln -sf $PWD flint
-sed -e 's@\(#[[:space:]]*include\)[[:space:]*]"\([^"]*\)"@\1 <flint/\2>@' \
- -i `find . -name \*.c -o -name \*.h`
-# revert some buggy ones
-sed -e 's|#include <mpir.h>|#include <gmp.h>|' \
- -e 's|#include <flint/gmp.h>|#include <gmp.h>|' \
- -e 's|#include <flint/mpir.h>|#include <gmp.h>|' \
- -e 's|#include <flint/mpfr.h>|#include <mpfr.h>|' \
- -e 's|#include <flint/math.h>|#include <math.h>|' \
- -e 's|#include <flint/stdlib.h>|#include <stdlib.h>|' \
- -i `find . -name \*.c -o -name \*.h`
+for fil in $(find flintxx -name \*.c -o -name \*.h); do
+ sed -e 's@"flint\.h"@<flint/flint.h>@' \
+ -e 's@"\(flintxx/[^"]*\)"@<\1>@' \
+ -e 's@\(#[[:space:]]*include\)[[:space:]]*"../\([^"]*\)"@\1 <flint/\2>@' \
+ -e 's@\(#[[:space:]]*include\)[[:space:]]*"\([^"]*\)"@\1 <flint/flintxx/\2>@' \
+ -i.orig $fil
+ fixtimestamp $fil
+done
+for fil in $(find . -name \*.c -o -name \*.h); do
+ sed -e 's/\\\?"gmp\.h\\\?"/<gmp.h>/' \
+ -e 's/"gc\.h"/<gc.h>/' \
+ -e 's/"limits\.h"/<limits.h>/' \
+ -e 's/"math\.h"/<math.h>/' \
+ -e 's/"stdlib\.h"/<stdlib.h>/' \
+ -e 's@\(#[[:space:]]*include\)[[:space:]*]"\([^"]*\)"@\1 <flint/\2>@' \
+ -i.orig $fil
+ fixtimestamp $fil
+done
%build
OS=Linux \
@@ -108,30 +115,26 @@ sh -x ./configure \
--with-gmp=%{_libdir} \
--with-mpfr=%{_libdir} \
--with-ntl=%{_libdir} \
- CFLAGS="%{optflags}"
-make %{?_smp_mflags}
+ --enable-cxx \
+ CFLAGS="%{optflags}" \
+ CXXFLAGS="%{optflags}" \
+ LDFLAGS="-Wl,--as-needed $RPM_LD_FLAGS"
+make %{?_smp_mflags} verbose
# Build the documentation
-pushd doc/latex
- make manual
-popd
+ln -sf . doc/latex/flint
+make -C doc/latex manual CFLAGS="%{optflags} -I$PWD/doc/latex"
%install
make DESTDIR=%{buildroot} install
-pushd %{buildroot}%{_libdir}
- ln -s libflint.so.%{sover} libflint.so
-popd
+ln -s libflint.so.%{sover} %{buildroot}%{_libdir}/libflint.so
+# Fix permissions
+chmod 0755 %{buildroot}%{_libdir}/libflint.so.%{sover}
%check
-if [ %{__isa_bits} = "64" ]; then
- make check FLINT_CPIMPORT=$PWD/qadic/CPimport.txt
-else
- # (possible) infinite loop attempting to shift by more than 31 bits
- /bin/true
-fi
-
+make check
%post -p /sbin/ldconfig
@@ -145,7 +148,7 @@ fi
%files devel
-%doc INSTALL doc/latex/%{name}-manual.pdf
+%doc doc/latex/%{name}-manual.pdf
%{_includedir}/flint
%{_libdir}/libflint.so
@@ -155,6 +158,14 @@ fi
%changelog
+* Mon Feb 10 2014 Jerry James <loganjerry at gmail.com> - 2.4.1-1
+- New upstream release
+- Enable C++ interface
+- Tests now work on 32-bit systems
+- Minimize the set of LaTeX BRs
+- Enable verbose build
+- Link with Fedora LDFLAGS
+
* Mon Aug 5 2013 pcpa <paulo.cesar.pereira.de.andrade at gmail.com> - 2.3-1.20130801git4b383e2
- Update to pre 2.4 snapshot that supports gmp, required by sagemath 5.10
diff --git a/sources b/sources
index d792cad..e9acd2e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-e320f3e09dd19baf4fe59295d41927b5 flint-2.3-4b383e2.tar.gz
+3b9bc754ef9e974ad4d0cf808d9809df flint-2.4.1.tar.gz
More information about the scm-commits
mailing list