#11635: Ensure that libraries link to the shared version of NTL by default
----------------------------------------------------------+-----------------
       Reporter:  kcrisman                                |         Owner:  tbd 
        
           Type:  defect                                  |        Status:  
needs_review
       Priority:  minor                                   |     Milestone:  
sage-5.3    
      Component:  cygwin                                  |    Resolution:      
        
       Keywords:  cygwin ntl libtool spkg                 |   Work issues:      
        
Report Upstream:  N/A                                     |     Reviewers:      
        
        Authors:  Karl-Dieter Crisman, Jean-Pierre Flori  |     Merged in:      
        
   Dependencies:                                          |      Stopgaps:      
        
----------------------------------------------------------+-----------------
Changes (by {'newvalue': u'Karl-Dieter Crisman, Jean-Pierre Flori', 'oldvalue': 
u'Karl-Dieter Crisman'}):

  * keywords:  => cygwin ntl libtool spkg
  * author:  Karl-Dieter Crisman => Karl-Dieter Crisman, Jean-Pierre Flori


Old description:

> In #11547, we added copying of several needed dlls on Cygwin.  However,
> in the meantime NTL had a fairly major update (#5731).
>
> Based on this, this ticket splits off the NTL change from #11547 so that
> that ticket can get merged.
>
> Spkg at
> [http://sage.math.washington.edu/home/kcrisman/ntl-5.5.2.p0.spkg].
>
> Here is the previous diff - presumably we would do the same thing if we
> can confirm it is still necessary, which is almost certainly the case.
> {{{
> diff -r 6cf0ce59b84a SPKG.txt
> --- a/SPKG.txt  Tue May 25 15:56:29 2010 -0700
> +++ b/SPKG.txt  Tue Jun 28 22:44:18 2011 -0400
> @@ -2,7 +2,10 @@
>
>  == Description ==
>
> -NTL is a high-performance, portable C++ library providing data
> structures and algorithms for manipulating signed, arbitrary length
> integers, and for vectors, matrices, and polynomials over the integers
> and over finite fields.
> +NTL is a high-performance, portable C++ library providing data
> +structures and algorithms for manipulating signed, arbitrary
> +length integers, and for vectors, matrices, and polynomials over
> +the integers and over finite fields.
>
>  Website: http://www.shoup.net/ntl/
>
> @@ -27,6 +30,10 @@
>
>  == Changelog ==
>
> +=== ntl-5.4.2.p13 (Karl-Dieter Crisman, June 28th 2011) ===
> + * Keep libntl.dll but also require libntl.dll.a on Cygwin.
> +   This seems to be necessary for Sage to start - see #11547.
> +
>  === ntl-5.4.2.p12 (Mike Hansen, May 25th 2010) ===
>   * Rename libntl.dll to libntl.dll.a on Cygwin.  This is #9050.
>
> diff -r 6cf0ce59b84a spkg-install
> --- a/spkg-install      Tue May 25 15:56:29 2010 -0700
> +++ b/spkg-install      Tue Jun 28 22:44:18 2011 -0400
> @@ -120,7 +120,9 @@
>              exit 1
>          fi
>         cp libntl.dll "$SAGE_LOCAL/lib/libntl.dll.a"
> +       cp libntl.dll "$SAGE_LOCAL/lib/libntl.dll"
>         cp libntl.dll "$SAGE_LOCAL/bin/libntl.dll.a"
> +       cp libntl.dll "$SAGE_LOCAL/bin/libntl.dll"
>          if [ ! -f "$SAGE_LOCAL/bin/libntl.dll.a" ]; then
>              exit 1   # CRUCIAL that we have the dynamic link library
>          fi
> }}}

New description:

 In #11547, we added copying of several needed dlls on Cygwin.  However, in
 the meantime NTL had a fairly major update (#5731).

 From version 5.5, NTL provides a new build system using libtool (although
 libtool itself is not provided!) to generate shared libraries.
 On Cygwin, libtool properly install the shared library as cygntl-?.dll in
 the bin directory and the import file as libntl.dll.a in the lib
 directory, together with a libtool file libntl.la and a static version of
 the library as libntl.a.

 In particular, this ensures that the shared version is linked with by
 default because ld/gcc/g++ find the .dll.a file in the lib directory
 (which points to the dll file in the bin directory) before the .a file.

 Moreover, only moving the previously built libntl.dll to libntl.dll.a was
 not a solution.
 Indeed, the built file hardcoded its own build-time name into itself (as a
 DT_SONAME on linux), so that libraries linked to it (before or after
 renaming, does not matter) would in fact search for a file with the build
 time name... and fail.

 The spkg available at
 http://perso.telecom-paristech.fr/~flori/sage/ntl-5.5.2.p0.spkg
 vastly simplifies the old spkg-install, uses the (slightly patched)
 upstream build system and includes its own version of libtool (or rather
 the tools needed to generate it on the fly).

--

Comment:

 Ok, the latest spkg built correctly.

 Anyone wants to try on Mac OS? or Solaris?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11635#comment:47>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to