[arch-commits] Commit in lcalc/repos (8 files)
Felix Yan
felixonmars at archlinux.org
Tue Jul 7 16:46:29 UTC 2020
Date: Tuesday, July 7, 2020 @ 16:46:28
Author: felixonmars
Revision: 659403
archrelease: copy trunk to community-staging-x86_64
Added:
lcalc/repos/community-staging-x86_64/
lcalc/repos/community-staging-x86_64/Lcommon.h.patch
(from rev 659401, lcalc/trunk/Lcommon.h.patch)
lcalc/repos/community-staging-x86_64/PKGBUILD
(from rev 659401, lcalc/trunk/PKGBUILD)
lcalc/repos/community-staging-x86_64/gcc-4.9.patch
(from rev 659401, lcalc/trunk/gcc-4.9.patch)
lcalc/repos/community-staging-x86_64/gcc-5.patch
(from rev 659401, lcalc/trunk/gcc-5.patch)
lcalc/repos/community-staging-x86_64/lcalc-c++11.patch
(from rev 659401, lcalc/trunk/lcalc-c++11.patch)
lcalc/repos/community-staging-x86_64/lcalc-system-cflags.patch
(from rev 659401, lcalc/trunk/lcalc-system-cflags.patch)
lcalc/repos/community-staging-x86_64/pari-2.7.patch
(from rev 659401, lcalc/trunk/pari-2.7.patch)
---------------------------+
Lcommon.h.patch | 23 +++++++++++++++
PKGBUILD | 50 ++++++++++++++++++++++++++++++++
gcc-4.9.patch | 24 +++++++++++++++
gcc-5.patch | 56 ++++++++++++++++++++++++++++++++++++
lcalc-c++11.patch | 51 +++++++++++++++++++++++++++++++++
lcalc-system-cflags.patch | 32 +++++++++++++++++++++
pari-2.7.patch | 67 ++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 303 insertions(+)
Copied: lcalc/repos/community-staging-x86_64/Lcommon.h.patch (from rev 659401, lcalc/trunk/Lcommon.h.patch)
===================================================================
--- community-staging-x86_64/Lcommon.h.patch (rev 0)
+++ community-staging-x86_64/Lcommon.h.patch 2020-07-07 16:46:28 UTC (rev 659403)
@@ -0,0 +1,23 @@
+--- L-1.23/include/Lcommon.h.orig 2011-04-09 04:09:25.984121006 -0300
++++ L-1.23/include/Lcommon.h 2011-04-09 04:09:58.750265003 -0300
+@@ -25,6 +25,8 @@ inline double lcalc_to_double(const Doub
+ #ifdef USE_MPFR
+ inline double lcalc_to_double(const double& x) { return x; }
+ #endif
++
++#if 0
+ //inline double lcalc_to_double(const long double& x) { return x; }
+ inline double lcalc_to_double(const int& x) { return x; }
+ inline double lcalc_to_double(const long long& x) { return x; }
+@@ -33,6 +35,10 @@ inline double lcalc_to_double(const char
+ inline double lcalc_to_double(const long int& x) { return x; }
+ inline double lcalc_to_double(const unsigned int& x) { return x; }
+ inline double lcalc_to_double(const long unsigned int& x) { return x; }
++#else
++# define lcalc_to_double(x) ((double)(x))
++#endif
++
+ #define Int(x) (int)(lcalc_to_double(x))
+ #define Long(x) (Long)(lcalc_to_double(x))
+ #define double(x) (double)(lcalc_to_double(x))
+
\ No newline at end of file
Copied: lcalc/repos/community-staging-x86_64/PKGBUILD (from rev 659401, lcalc/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2020-07-07 16:46:28 UTC (rev 659403)
@@ -0,0 +1,50 @@
+# Maintainer: Antonio Rojas <arojas at archlinux.org>
+
+pkgname=lcalc
+pkgver=1.23
+pkgrel=20
+pkgdesc="C++ L-function class library and command line interface"
+arch=(x86_64)
+url="http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/L.html"
+license=(GPL2)
+depends=(pari)
+makedepends=(chrpath)
+#source=("http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/CODE/L-$pkgver.tar.gz"
+source=("https://mirrors.mit.edu/sage/spkg/upstream/lcalc/lcalc-$pkgver.tar.bz2"
+ Lcommon.h.patch gcc-4.9.patch pari-2.7.patch gcc-5.patch lcalc-c++11.patch lcalc-system-cflags.patch)
+sha256sums=('83d4253ec2f38553b21190d6d0c6b71bab7ea14717f6dde5bd18f60775d3cdb0'
+ 'cad59ddc93f6fecf238d56e09ab29e59d8b8129d2c8dc10f32b643e86eb1cce1'
+ '55c6c9f969593f24c75a85e7a150b876671356aa68ceb8e77c563a645897643e'
+ '437e3870342ef4cb5749398ead9381504403e7e1f99efadab95f4a607678b400'
+ '66bfa8df3a7cadbe9cfc9f7f05e0dedd0195e68db048e05ce4e1a96d25946aef'
+ '89820d96a0106365875246c36d4adf86f4464cba80bf03095c9a21e2fccb8e69'
+ '045604ebff18ea126c597f076b7c22f331e5767a8c59f4d726d7e9dd7aef8fc7')
+
+prepare() {
+ cd $pkgname-$pkgver
+ patch -p1 -i ../Lcommon.h.patch
+ patch -p1 -i ../gcc-4.9.patch
+ patch -p1 -i ../gcc-5.patch
+# port to PARI 2.7 API
+ patch -p1 -i ../pari-2.7.patch
+# make headers C++11 compliant
+ patch -p1 -i ../lcalc-c++11.patch
+# use system CFLAGS/LDFLAGS
+ patch -p1 -i ../lcalc-system-cflags.patch
+}
+
+build() {
+ cd $pkgname-$pkgver/src
+ make PARI_DEFINE="-DINCLUDE_PARI" LOCATION_PARI_H="/usr/include/pari" LOCATION_PARI_LIBRARY="/usr/lib" all
+}
+
+package() {
+ cd $pkgname-$pkgver/src
+ mkdir -p "$pkgdir"/usr/{bin,include,lib}
+ make INSTALL_DIR="$pkgdir"/usr install
+
+# fix wrong permissions
+ chmod 644 "$pkgdir"/usr/include/Lfunction/Ldokchitser.h
+# fix insecure rpath
+ chrpath -d "$pkgdir"/usr/bin/lcalc
+}
Copied: lcalc/repos/community-staging-x86_64/gcc-4.9.patch (from rev 659401, lcalc/trunk/gcc-4.9.patch)
===================================================================
--- community-staging-x86_64/gcc-4.9.patch (rev 0)
+++ community-staging-x86_64/gcc-4.9.patch 2020-07-07 16:46:28 UTC (rev 659403)
@@ -0,0 +1,24 @@
+diff -Naur lcalc-1.23-vanilla/include/Ldirichlet_series.h lcalc-1.23-fixed-gcc.4.9/include/Ldirichlet_series.h
+--- lcalc-1.23-vanilla/include/Ldirichlet_series.h 2012-08-08 23:21:55.000000000 +0200
++++ lcalc-1.23-fixed-gcc.4.9/include/Ldirichlet_series.h 2014-04-21 14:37:59.027464849 +0200
+@@ -43,7 +43,7 @@
+ //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+ template <class ttype>
+ Complex L_function <ttype>::
+-dirichlet_series(Complex s, long long N=-1)
++dirichlet_series(Complex s, long long N)
+ {
+ Complex z=0.;
+ long long m,n;
+diff -Naur lcalc-1.23-vanilla/include/L.h lcalc-1.23-fixed-gcc.4.9/include/L.h
+--- lcalc-1.23-vanilla/include/L.h 2012-08-08 23:21:55.000000000 +0200
++++ lcalc-1.23-fixed-gcc.4.9/include/L.h 2014-04-21 14:32:04.003467348 +0200
+@@ -491,7 +491,7 @@
+
+ //#include "Ldirichlet_series.h" //for computing Dirichlet series
+ Complex partial_dirichlet_series(Complex s, long long N1, long long N2);
+- Complex dirichlet_series(Complex s, long long N);
++ Complex dirichlet_series(Complex s, long long N=-1LL);
+
+ //#include "Ltaylor_series.h" //for computing taylor series for Dirichlet series
+ //void compute_taylor_series(int N, int K, Complex s_0, Complex *series);
Copied: lcalc/repos/community-staging-x86_64/gcc-5.patch (from rev 659401, lcalc/trunk/gcc-5.patch)
===================================================================
--- community-staging-x86_64/gcc-5.patch (rev 0)
+++ community-staging-x86_64/gcc-5.patch 2020-07-07 16:46:28 UTC (rev 659403)
@@ -0,0 +1,56 @@
+--- lcalc-1.23/include/Lgamma.h 2012-08-08 23:21:55.000000000 +0200
++++ lcalc-1.23/include/Lgamma.h 2014-05-18 21:15:27.786889718 +0200
+@@ -77,7 +77,7 @@
+ //n=0 should just give log_GAMMA(z)... thus making log_GAMMA
+ //code obsolete. But leave log_GAMMA intact anyways.
+ template <class ttype>
+-precise(ttype) log_GAMMA (ttype z,int n=0)
++precise(ttype) log_GAMMA (ttype z,int n)
+ {
+ int M;
+ precise(ttype) log_G,r,r2,y;
+@@ -230,7 +230,7 @@
+ //value exp_w which holds exp(-w)
+ //computes G(z,w), so there's an extra w^(-z) factor.
+ template <class ttype>
+-Complex inc_GAMMA (ttype z,ttype w, const char *method="temme", ttype exp_w = 0, bool recycle=false)
++Complex inc_GAMMA (ttype z,ttype w, const char *method, ttype exp_w, bool recycle)
+ {
+
+ Complex G;
+@@ -334,7 +334,7 @@
+
+
+ template <class ttype>
+-ttype cfrac_GAMMA (ttype z,ttype w, ttype exp_w=0, bool recycle=false) //computes G(z,w) via continued fraction
++ttype cfrac_GAMMA (ttype z,ttype w, ttype exp_w, bool recycle) //computes G(z,w) via continued fraction
+ {
+
+ ttype G;
+@@ -424,7 +424,7 @@
+ }
+
+ template <class ttype>
+-ttype asympt_GAMMA (ttype z,ttype w, ttype exp_w = 0, bool recycle=false) //computes G(z,w) via asymptotic series
++ttype asympt_GAMMA (ttype z,ttype w, ttype exp_w, bool recycle) //computes G(z,w) via asymptotic series
+ {
+
+ if(my_verbose>3) cout << "called asympt_GAMMA("<<z<<","<<w<<")"<< endl;
+@@ -446,7 +446,7 @@
+
+
+ template <class ttype>
+-ttype comp_inc_GAMMA (ttype z,ttype w,ttype exp_w = 0, bool recycle=false) //computes g(z,w)
++ttype comp_inc_GAMMA (ttype z,ttype w,ttype exp_w, bool recycle) //computes g(z,w)
+ {
+
+ ttype g;
+@@ -604,7 +604,7 @@
+ }
+
+ template <class ttype>
+-Complex gamma_sum(Complex s, int what_type, ttype *coeff, int N, Double g, Complex l, Double Q, Long Period, Complex delta=1, const char *method="temme")
++Complex gamma_sum(Complex s, int what_type, ttype *coeff, int N, Double g, Complex l, Double Q, Long Period, Complex delta, const char *method)
+ {
+ Complex SUM=0;
+
Copied: lcalc/repos/community-staging-x86_64/lcalc-c++11.patch (from rev 659401, lcalc/trunk/lcalc-c++11.patch)
===================================================================
--- community-staging-x86_64/lcalc-c++11.patch (rev 0)
+++ community-staging-x86_64/lcalc-c++11.patch 2020-07-07 16:46:28 UTC (rev 659403)
@@ -0,0 +1,51 @@
+diff --git a/include/Lcommon.h b/include/Lcommon.h
+index 1b3be43..081fcb8 100644
+--- a/include/Lcommon.h
++++ b/include/Lcommon.h
+@@ -48,7 +48,7 @@ const bool outputSeries=true; // Whether to output the coefficients or just th
+
+ // Loop i from m to n
+ // Useful in tidying up most for loops
+-#define loop(i,m,n) for(typeof(m) i=(m); i!=(n); i++)
++#define loop(i,m,n) for(decltype(m) i=(m); i!=(n); i++)
+
+ // A class for calculations involving polynomials of small degree
+ // Not efficient enough for huge polynomials
+@@ -68,8 +68,7 @@ template<class T=Complex> struct smallPoly {
+
+ void resize(int N) {
+ coeffs.resize(N);
+- loop(i,this->N,N)
+- coeffs[i]=zero;
++ loop(i,this->N,N) coeffs[i]=zero;
+ this->N=N;
+ }
+
+diff --git a/include/Lcommon_ld.h b/include/Lcommon_ld.h
+index 86ae4df..3b0cb0d 100644
+--- a/include/Lcommon_ld.h
++++ b/include/Lcommon_ld.h
+@@ -53,7 +53,7 @@ const bool outputSeries=true; // Whether to output the coefficients or just th
+
+ // Loop i from m to n
+ // Useful in tidying up most for loops
+-#define loop(i,m,n) for(typeof(m) i=(m); i!=(n); i++)
++#define loop(i,m,n) for(decltype(m) i=(m); i!=(n); i++)
+
+ // A class for calculations involving polynomials of small degree
+ // Not efficient enough for huge polynomials
+diff --git a/include/Lglobals.h b/include/Lglobals.h
+index 60002e4..ca2606c 100644
+--- a/include/Lglobals.h
++++ b/include/Lglobals.h
+@@ -24,9 +24,9 @@
+ #ifndef Lglobals_H
+ #define Lglobals_H
+
++#include <valarray>
+ using namespace std;
+
+-#include <valarray>
+ #ifdef USE_MPFR
+ #include "Lgmpfrxx.h"
+ typedef mpfr_class Double;
Copied: lcalc/repos/community-staging-x86_64/lcalc-system-cflags.patch (from rev 659401, lcalc/trunk/lcalc-system-cflags.patch)
===================================================================
--- community-staging-x86_64/lcalc-system-cflags.patch (rev 0)
+++ community-staging-x86_64/lcalc-system-cflags.patch 2020-07-07 16:46:28 UTC (rev 659403)
@@ -0,0 +1,32 @@
+--- lcalc-1.23/src/Makefile.orig 2019-08-05 09:09:40.888836276 +0000
++++ lcalc-1.23/src/Makefile 2019-08-05 09:10:16.912666730 +0000
+@@ -58,7 +58,7 @@
+ #MACHINE_SPECIFIC_FLAGS = -mpowerpc -mpowerpc64 -m64
+ endif
+
+-CCFLAGS = -Wa,-W -O3 $(OPENMP_FLAG) -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
++CCFLAGS = -Wa,-W -O3 $(OPENMP_FLAG) -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA) $(CXXFLAGS)
+ #CCFLAGS = -Wa,-W -O3 $(OPENMP_FLAG) $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
+ #CCFLAGS = -Wa,-W -O2 -fno-exceptions -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
+
+@@ -104,9 +104,9 @@
+ endif
+
+ ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
+- LDFLAGS = $(LDFLAGS2) -L$(LOCATION_PARI_LIBRARY) -lpari
++ LDFLAGS += $(LDFLAGS2) -L$(LOCATION_PARI_LIBRARY) -lpari
+ else
+- LDFLAGS = $(LDFLAGS2)
++ LDFLAGS += $(LDFLAGS2)
+ endif
+
+
+@@ -262,7 +262,7 @@
+
+
+ libLfunction.so: $(OBJ_L)
+- g++ -$(DYN_OPTION) -o libLfunction.so $(OBJ_L)
++ g++ -$(DYN_OPTION) -o libLfunction.so $(OBJ_L) $(LDFLAGS)
+
+ clean:
+ rm -f *.o lcalc libLfunction.so example_programs/example
Copied: lcalc/repos/community-staging-x86_64/pari-2.7.patch (from rev 659401, lcalc/trunk/pari-2.7.patch)
===================================================================
--- community-staging-x86_64/pari-2.7.patch (rev 0)
+++ community-staging-x86_64/pari-2.7.patch 2020-07-07 16:46:28 UTC (rev 659403)
@@ -0,0 +1,67 @@
+--- src/src/Lcommandline_elliptic.cc 2010-01-31 16:16:45.000000000 +0100
++++ src/src/Lcommandline_elliptic.cc 2011-05-10 17:08:10.000000000 +0200
+@@ -121,11 +121,11 @@
+
+
+ F = cgetg(6, t_VEC);
+- F[1] = lgeti(BIGDEFAULTPREC);
+- F[2] = lgeti(BIGDEFAULTPREC);
+- F[3] = lgeti(BIGDEFAULTPREC);
+- F[4] = lgeti(BIGDEFAULTPREC);
+- F[5] = lgeti(BIGDEFAULTPREC);
++ F[1] = (long)cgeti(BIGDEFAULTPREC);
++ F[2] = (long)cgeti(BIGDEFAULTPREC);
++ F[3] = (long)cgeti(BIGDEFAULTPREC);
++ F[4] = (long)cgeti(BIGDEFAULTPREC);
++ F[5] = (long)cgeti(BIGDEFAULTPREC);
+
+ //gaffsg(a1,(GEN) F[1]);
+ //gaffsg(a2,(GEN) F[2]);
+@@ -133,15 +133,15 @@
+ //gaffsg(a4,(GEN) F[4]);
+ //gaffsg(a6,(GEN) F[5]);
+
+- gaffect(strtoGEN(a1), (GEN) F[1]);
+- gaffect(strtoGEN(a2), (GEN) F[2]);
+- gaffect(strtoGEN(a3), (GEN) F[3]);
+- gaffect(strtoGEN(a4), (GEN) F[4]);
+- gaffect(strtoGEN(a6), (GEN) F[5]);
++ gaffect(gp_read_str(a1), (GEN) F[1]);
++ gaffect(gp_read_str(a2), (GEN) F[2]);
++ gaffect(gp_read_str(a3), (GEN) F[3]);
++ gaffect(gp_read_str(a4), (GEN) F[4]);
++ gaffect(gp_read_str(a6), (GEN) F[5]);
+
+- E = initell(F,BIGDEFAULTPREC);
++ E = ellinit(F, NULL, BIGDEFAULTPREC);
+
+- C=globalreduction(E);
++ C=ellglobalred(E);
+
+ x=gtodouble((GEN) C[1]);
+
+@@ -167,8 +167,8 @@
+
+ p=n;
+ gaffsg(p,y);
+- coeff[p] = Double(1.*llrint(gtodouble(apell(E,y))))/sqrt(Double(1.*p));
+- //coeff[p] = Double(1.*Long(gtodouble(apell(E,y))+.1))/sqrt(Double(1.*p));
++ coeff[p] = Double(1.*llrint(gtodouble(ellap(E,y))))/sqrt(Double(1.*p));
++ //coeff[p] = Double(1.*Long(gtodouble(ellap(E,y))+.1))/sqrt(Double(1.*p));
+
+ if(gtolong(gmod((GEN) E[12],(GEN) y))==0) // if p|discriminant, i.e. bad reduction
+ {
+diff -ru src/src/Lcommandline.cc b/src/Lcommandline.cc
+--- src/src/Lcommandline.cc 2012-08-08 23:21:56.000000000 +0200
++++ b/src/Lcommandline.cc 2014-01-06 14:02:19.463388366 +0100
+@@ -473,7 +473,9 @@
+
+ #ifdef INCLUDE_PARI
+ if(do_elliptic_curve){
+- allocatemoremem((int) N_terms*16+1000000); //XXXXXXXXX this should depend on whether we're double or long double or mpfr double
++ // Reallocate PARI stack
++ paristack_setsize((size_t)N_terms*16 + 1000000, 0); //XXXXXXXXX this should depend on whether we're double or long double or mpfr double
++
+ if (my_verbose>0) cout << "Will precompute " << N_terms << " elliptic L-function dirichlet coefficients..." << endl;
+ initialize_new_L(a1,a2,a3,a4,a6,N_terms);
+ }
More information about the arch-commits
mailing list