Opened 7 years ago

Closed 7 years ago

#13806 closed defect (fixed)

Building complex_double.pyx fails on Cygwin

Reported by: jpflori Owned by: tbd
Priority: major Milestone: sage-5.6
Component: porting: Cygwin Keywords: cygwin cephes spkg
Cc: kcrisman, dimpase Merged in: sage-5.6.beta3
Authors: Jean-Pierre Flori Reviewers: Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by kcrisman)

At some point a dependency on the mc library was added, but this is not available by default on Cygwin (this surely lives in a very common and useful package, but I've reinstalled Cygwin recently and it has not appeared yet) and is not needed anyway. So the dependency should be removed thus avoiding overlinking and build failure where this lib is not available.

Apply trac_13806.2.patch.

Attachments (1)

trac_13806.2.patch (1.5 KB) - added by jpflori 7 years ago.
New version completly discarding Cephes use on Cygwin.

Download all attachments as: .zip

Change History (34)

comment:1 Changed 7 years ago by kcrisman

??? I didn't have any troubles with this.

sage: CDF(1)
1.0

comment:2 Changed 7 years ago by jpflori

I already had this problem the first time I tried building on Cygwin (see CygwinPort page) but it magically disappeared the second time so I did not really care.

As I wrote in the description I think the lib got installed by some Cygwin package between my two attempts.

But anyway, everything buids fine without linking to that lib, so its definitely useless and dangerous to leave 'mc' in these file dependencies (there is the same problem with the complex_... file generated by gen_interpreters.py).

comment:3 Changed 7 years ago by jpflori

  • Status changed from new to needs_review

comment:4 Changed 7 years ago by kcrisman

JP, am I correct in seeing that this patch only affects Cygwin-only code in any case? I find the different syntax for the two files irksome, but they both make sense. I can't test this right now but will try to do so tomorrow. How do I check whether I even have mc? I guess I must since this didn't cause trouble on my machine...

comment:5 follow-ups: Changed 7 years ago by kcrisman

  • Cc dimpase added

Okay, I checked this an it's so. Positive review on the patch part - it should not affect any other systems.

As to whether it works... I have no way of checking this on Windows 7. I don't even have this problem on XP, though I will try to check that it's not evil. How do I see whether my Cygwin has "mc" somehow?

comment:6 Changed 7 years ago by kcrisman

  • Authors set to Jean-Pierre Flori
  • Reviewers set to Karl-Dieter Crisman

comment:7 in reply to: ↑ 5 ; follow-up: Changed 7 years ago by dimpase

Replying to kcrisman:

Okay, I checked this an it's so. Positive review on the patch part - it should not affect any other systems.

As to whether it works... I have no way of checking this on Windows 7. I don't even have this problem on XP, though I will try to check that it's not evil. How do I see whether my Cygwin has "mc" somehow?

huh, mc ? Midnight Commander? Something else? Medical Condition? ;-)

Last edited 7 years ago by dimpase (previous) (diff)

comment:8 in reply to: ↑ 7 Changed 7 years ago by kcrisman

huh, mc ? Midnight Commander? Something else? Medical Condition? ;-)

Well, I have no idea! Though I suspect not these... maybe Multiplication, Complex. Did you read the patch? It's some library I've never heard of (which describes most libraries, but still...)

comment:9 follow-up: Changed 7 years ago by jpflori

I don't think the problem is 7 specific. As I mentioned before i think the problem that libmc is installed by a quite common package that I did not install myself, as I use a fresh and minimal Cygwin setup.

And I'm not sure what this is... Maybe that's some Cygwin specific version of libm for complex? and md would be for double?

comment:10 Changed 7 years ago by jpflori

Maybe see #9543 as well.

comment:11 in reply to: ↑ 9 Changed 7 years ago by kcrisman

Replying to jpflori:

I don't think the problem is 7 specific. As I mentioned before i think the problem that libmc is installed by a quite common package that I did not install myself, as I use a fresh and minimal Cygwin setup.

And I'm not sure what this is... Maybe that's some Cygwin specific version of libm for complex? and md would be for double?

Maybe. Do the files in question actually test ok on your Cygwin without this libmc?

comment:12 in reply to: ↑ 5 Changed 7 years ago by kcrisman

As to whether it works... I have no way of checking this on Windows 7. I don't even have this problem on XP, though I will try to check that it's not evil. How do I see whether my Cygwin has "mc" somehow?

When I do this, I don't find it, or md, for that matter:

$ls /cygdrive/c/cygwin/lib/libm<tab>
libm.a
<irrelevant stuff>

and other directories with lib also have either nothing or at any rate nothing related, including not libm.

Anyway, this file passes some tests for me, though it gives a different answer for one of the algdep things and gives annoying errors about being unable to start pari because gp --emacs --quiet --stacksize 1000000 failed. Is it possible that this is not possible to do in this (our Cygwin Sage) setup? But it looks like the standard way for our pexpect interface, and doing this command by hand ./sage -gp ... works fine.

comment:13 follow-up: Changed 7 years ago by jpflori

I think the libm* problems are from the time the Cygwin's libm was not C99 compliant or something like that and we needed cephes at http://www.netlib.org/cephes/ See #9543 and #8780.

I think we should try to remove all the Cygwin specific mc and md things.

comment:14 in reply to: ↑ 13 ; follow-up: Changed 7 years ago by kcrisman

I think the libm* problems are from the time the Cygwin's libm was not C99 compliant or something like that and we needed cephes at http://www.netlib.org/cephes/

It's certainly possible.

I think we should try to remove all the Cygwin specific mc and md things.

Let's please try to do this after we get Sage to build on Cygwin reliably, though :)

comment:15 in reply to: ↑ 14 ; follow-up: Changed 7 years ago by jpflori

Replying to kcrisman:

I think the libm* problems are from the time the Cygwin's libm was not C99 compliant or something like that and we needed cephes at http://www.netlib.org/cephes/

It's certainly possible.

I think we should try to remove all the Cygwin specific mc and md things.

Let's please try to do this after we get Sage to build on Cygwin reliably, though :)

So let's merge the ticket as is! it needs review :)

comment:16 in reply to: ↑ 15 Changed 7 years ago by kcrisman

So let's merge the ticket as is! it needs review :)

Fair enough, but it's hard for me to check whether I even have these libraries.

comment:17 Changed 7 years ago by kcrisman

  • Status changed from needs_review to positive_review

Just got past complex_double.o in compiling with this patch (it had been blocked at the algebras/letterplace stuff, so cleanly), so presumably the lack of the library isn't a problem. I'll assume this is indeed necessary on Win 7, though if Dima could independently verify this it would be nice...

comment:18 Changed 7 years ago by jpflori

  • Keywords cephes spkg added
  • Status changed from positive_review to needs_work
  • Work issues set to cephes spkg

Wooo, I think we have to get back on this one and think a little more. Indeed I spotted that the cephes spkg failed to install (although that was not detected properly...). So we have to check two things:

  • why the cephes spkg fails (if it succeeds, it will provide libmc and libmd),
  • if the cephes spkg is really needed, indeed as I mentioned before, I think that the libm provided by Cygwin is now C99 compliant (enough) and cephes is not needed anymore (and I don't think keeping it in case one wants to build Sage on a very old Cygwin with a poor libm is any kind of justification).

So I think we should first:

  • fix the cephes spkg.

Check it is not needed on Cygwin anymore, and if so:

  • disable its installation on Cygwin,
  • removed all Cygwin specific code involving libmc and libmd.

comment:19 follow-up: Changed 7 years ago by jpflori

In fact cephes is currently only used on Cygwin, so if it is not needed, it should be removed completely (and we could as well not waste time fixing it).

comment:20 in reply to: ↑ 19 Changed 7 years ago by kcrisman

In fact cephes is currently only used on Cygwin, so if it is not needed, it should be removed completely (and we could as well not waste time fixing it).

That's not quite correct - see #9543. So I would be happy to disable it on Cygwin, but not in general.

I agree that we should only support the newest Cygwin, given that this would primarily be used in binary form.

comment:21 Changed 7 years ago by jpflori

I remember of #9543, but I worte my previous post after reading the first lines of spkg-install which states that is only installed on Cygwin :) I've not looked further or at #9543 again to gather more information.

comment:22 Changed 7 years ago by jpflori

Indeed there is no error checking at all in the spkg-install script and it is only installed on Cygwin.

#9543 is two years old, potentially the FreeBSD libm has gotten better since then just as the Cygwin one?

comment:24 Changed 7 years ago by kcrisman

No, see this FreeBSD port patch which is basically #9543's patch and which afaik is definitely still needed on FreeBSD. I'll put that link on #9543, though, in case it turns out to be useful.

Changed 7 years ago by jpflori

New version completly discarding Cephes use on Cygwin.

comment:25 Changed 7 years ago by jpflori

Here comes a new patches discarding any Cephes reference on Cygwin.

comment:26 Changed 7 years ago by kcrisman

This seems to work fine with ./sage -ba on Cygwin. Interesting that we never actually installed Cephes - do I understand you correctly?

comment:27 follow-up: Changed 7 years ago by jpflori

I think you did install it, or the installation would have failed as for me. It is maybe 7 specific. Can you check for "$SAGE_LOCAL/lib/libm[c|d].a" ?

But what you just pointed out and confirmed is that linking to these files (and so installing Cephes) is not needed anymore on Cygwin.

comment:28 in reply to: ↑ 27 Changed 7 years ago by kcrisman

  • Description modified (diff)

I think you did install it, or the installation would have failed as for me. It is maybe 7 specific. Can you check for "$SAGE_LOCAL/lib/libm[c|d].a" ?

Oh, that's where they lived! Yes, they are there.

But what you just pointed out and confirmed is that linking to these files (and so installing Cephes) is not needed anymore on Cygwin.

Agreed.

Patchbot, apply trac_13806.2.patch

comment:29 Changed 7 years ago by jpflori

  • Status changed from needs_work to needs_review

comment:30 follow-up: Changed 7 years ago by kcrisman

Dumb question: Even though this patch worked fine, there seems to be an extraneous comma.

'sage/ext/interpreters/interp_cdf.c'],), 

in the new code. I assume that as usual Python tuples can end with commas, so it doesn't affect anything, but it looks a little silly, like

sage: integrate(x^2,x,)
1/3*x^3

comment:31 in reply to: ↑ 30 Changed 7 years ago by kcrisman

  • Status changed from needs_review to positive_review

Dumb question: Even though this patch worked fine, there seems to be an extraneous comma.

Well, who cares? It is valid syntax. I don't want to hold this up.

comment:32 Changed 7 years ago by jdemeyer

  • Work issues cephes spkg deleted

comment:33 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.6.beta3
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.