#12437: lcalc defines default values for functions outside of declarations
--------------------------------------+----------------------------------
       Reporter:  ohanar              |        Owner:  GeorgSWeber
           Type:  defect              |       Status:  needs_work
       Priority:  major               |    Milestone:  sage-6.2
      Component:  packages: standard  |   Resolution:
       Keywords:                      |    Merged in:
        Authors:                      |    Reviewers:
Report Upstream:  N/A                 |  Work issues:  Create a new spkg.
         Branch:                      |       Commit:
   Dependencies:  #12681              |     Stopgaps:
--------------------------------------+----------------------------------

Comment (by leif):

 Hmmm, haven't tested Andrew's patch [yet], but tried by myself.

 For GCC 4.9, apparently the following tiny patch is sufficient to build
 Lcalc and the Sage library extension module (which currently lacks a
 `depends` btw.^*^):

 {{{
 #!diff
 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);
 }}}
 (In addition to the patches to Lcalc we already have in Sage, of which
 only a trivial one is needed to build Lcalc outside of Sage.)


 ----

 ^*^

 {{{
 #!diff
 diff --git a/src/module_list.py b/src/module_list.py
 index fa460be..b5449be 100755
 --- a/src/module_list.py
 +++ b/src/module_list.py
 @@ -700,10 +700,12 @@ ext_modules = [

      Extension('sage.libs.lcalc.lcalc_Lfunction',
                sources = ['sage/libs/lcalc/lcalc_Lfunction.pyx'],
 -              libraries = ['m', 'ntl', 'mpfr', 'gmp', 'gmpxx',
 +              libraries = ['m', 'ntl', 'mpfr', 'gmp', 'gmpxx',         #
 XXX Are all of these really needed? (NTL??)
                             'Lfunction'],
                include_dirs = [SAGE_INC + "/libLfunction"],
 -              extra_compile_args=["-O3", "-ffast-math"],
 +              depends = [ os.path.join(SAGE_INC, "libLfunction", header)
 +                          for header in ["L.h"] ],                     #
 maybe more headers from there
 +              extra_compile_args=["-O3", "-ffast-math"],               #
 probably add '-Wno-deprecated', as of Lcalc 1.23
                language = 'c++'),


 }}}

 (And, despite having `language="c++"`, the extension module is
 ''compiled'' with the C compiler, not the C++ compiler, such that --
 besides other effects -- `CXXFLAGS` aren't used.  It gets ''linked'' with
 `g++` though.)

--
Ticket URL: <http://trac.sagemath.org/ticket/12437#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to