Static and shared libraries for Cygwin

100 views
Skip to first unread message

Jean-Pierre Flori

unread,
Jul 4, 2012, 9:32:07 AM7/4/12
to sage-...@googlegroups.com
Dear all,

In the process of updating FLINT spkg to use upstream version 2.3, we're updating the spkg-install script and came accross an old hack to be sure that the shared library links to the shared library version of NTL.

But that's not really the problem here.
Indeed, building of the shared version of FLINT has been disabled upstream by Bill Hart,because it just does not work out of the box.
After a little searching this might just be because building shared libraries of MPIR and MPFR fails (the second one potentially a consequence of the first one).
And this might be because MPIR fails to build both shared and static libs at the same time (thats my first idea after a quick search on google and sage trac), see trac ticket #12115.
But be aware that I did not test anything myself yet, I'm just installing cygwin right now.

Anyway, here is my question, what version of the libraries do we actually need to run Sage?
Both? Or just shared versions? Or in a worst scenario, could static versions be sufficient?
Maybe this is documented somewhere, but I did not find anything yet.

Best,
JP

Volker Braun

unread,
Jul 4, 2012, 9:40:28 AM7/4/12
to sage-...@googlegroups.com
I've been thinking about this yesterday for some other reasons, and I think we should work towards getting rid of static libraries altogether. From a software distribution/maintenance/updating/testing point of view its really terrible to have static libraries floating about without knowing for sure which package statically links what (Note that this is different from build-time dependencies in spkg/standard/deps).

Jean-Pierre Flori

unread,
Jul 4, 2012, 9:59:07 AM7/4/12
to sage-...@googlegroups.com


On Wednesday, July 4, 2012 3:40:28 PM UTC+2, Volker Braun wrote:
I've been thinking about this yesterday for some other reasons, and I think we should work towards getting rid of static libraries altogether. From a software distribution/maintenance/updating/testing point of view its really terrible to have static libraries floating about without knowing for sure which package statically links
I agree with that point of view.
As far as FLINT is concerned, the first thing I'll try on Cygwin it to properly build a shared version of MPIR/MPFR/NTL/FLINT and then check whether the NTL static linking bug is gone or not.

Bill Hart

unread,
Jul 6, 2012, 1:55:49 PM7/6/12
to sage-...@googlegroups.com
We need to change flint in two ways:

1) Instead of disabling shared library on flint, set it up so that either static or shared can be selected, but not both. It should make its selection based on whether a shared/static library of mpir is available if the user hasn't selected.

2) Don't pass -fPIC anywhere when building a shared library on Cygwin or MinGW (obviously it is still needed elsewhere).

Bill.
Reply all
Reply to author
Forward
0 new messages