Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New MPIR won't build on Cygwin #12115

Closed
kcrisman opened this issue Dec 3, 2011 · 49 comments
Closed

New MPIR won't build on Cygwin #12115

kcrisman opened this issue Dec 3, 2011 · 49 comments

Comments

@kcrisman
Copy link
Member

kcrisman commented Dec 3, 2011

The recent MPIR versions can only be built shared OR static on Cygwin, not both.
Moreover, MPIR configure scripts gets confused if Cygwin, which is only 32 bits, is ran on a 64 bits Windows.

Hence the following spkg sets ABI=32 (to tackle the second problem) and only builds a shared version of the library (to tackle the first one).

http://boxen.math.washington.edu/home/jpflori/mpir-2.4.0.p7.spkg

Updated spkg based on this one at #13137.
Please use the one there.

Upstream: None of the above - read trac for reasoning.

CC: @nexttime @dimpase @wbhart @jdemeyer

Component: porting: Cygwin

Keywords: mpir cygwin spkg

Reviewer: Volker Braun, Karl-Dieter Crisman, Jean-Pierre Flori

Issue created by migration from https://trac.sagemath.org/ticket/12115

@kcrisman kcrisman added this to the sage-5.6 milestone Dec 3, 2011
@kcrisman
Copy link
Member Author

kcrisman commented Dec 3, 2011

comment:1

I fixed this with a jury-rigged spkg here. Patch attached, just for reference.

Next error:

Making all in yasm
make[4]: Entering directory `/home/Administrator/sage-4.8.alpha3/spkg/build/mpir-2.1.3.p8/src/yasm'
gcc -std=gnu99 -I.  -c -o genperf.o `test -f tools/genperf/genperf.c || echo './'`tools/genperf/genperf.c
gcc -std=gnu99 -I.  -c -o gp-perfect.o `test -f tools/genperf/perfect.c || echo './'`tools/genperf/perfect.c
gcc -std=gnu99 -I.  -c -o gp-phash.o `test -f libyasm/phash.c || echo './'`libyasm/phash.c
gcc -std=gnu99 -I.  -c -o gp-xmalloc.o `test -f libyasm/xmalloc.c || echo './'`libyasm/xmalloc.c
gcc -std=gnu99 -I.  -c -o gp-xstrdup.o `test -f libyasm/xstrdup.c || echo './'`libyasm/xstrdup.c
gcc -std=gnu99 -o genperf.exe  genperf.o gp-perfect.o  gp-phash.o gp-xmalloc.o gp-xstrdup.o
./genperf.exe x86insn_nasm.gperf x86insn_nasm.c
found distinct (A,B) on attempt 19
built perfect hash table of size 512
./genperf.exe x86insn_gas.gperf x86insn_gas.c
found distinct (A,B) on attempt 1640
built perfect hash table of size 512
gcc -std=gnu99 -I.  -c -o re2c-main.o `test -f tools/re2c/main.c || echo './'`tools/re2c/main.c
gcc -std=gnu99 -I.  -c -o re2c-code.o `test -f tools/re2c/code.c || echo './'`tools/re2c/code.c
gcc -std=gnu99 -I.  -c -o re2c-dfa.o `test -f tools/re2c/dfa.c || echo './'`tools/re2c/dfa.c
gcc -std=gnu99 -I.  -c -o re2c-parser.o `test -f tools/re2c/parser.c || echo './'`tools/re2c/parser.c
Makefile:3665: recipe for target `re2c-parser.o' failed
make[4]: *** [re2c-parser.o] Error 1
make[4]: Leaving directory `/home/Administrator/sage-4.8.alpha3/spkg/build/mpir-2.1.3.p8/src/yasm'
Makefile:772: recipe for target `all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/Administrator/sage-4.8.alpha3/spkg/build/mpir-2.1.3.p8/src'
Makefile:603: recipe for target `all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/Administrator/sage-4.8.alpha3/spkg/build/mpir-2.1.3.p8/src'
Error building MPIR.

real    17m31.973s
user    0m42.992s
sys     1m0.848s
************************************************************************
Error installing package mpir-2.1.3.p8
************************************************************************

Interpreting this error is definitely beyond my pay grade.

@kcrisman kcrisman changed the title MPIR won't build on Cygwin due to building static library New MPIR won't build on Cygwin Dec 3, 2011
@kcrisman
Copy link
Member Author

kcrisman commented Dec 3, 2011

For reference only - don't build static library

@kcrisman
Copy link
Member Author

kcrisman commented Dec 4, 2011

comment:2

Attachment: draft-of-diff-mpir-2.1.3.p7-p8.diff.gz

The original reported issue is explained best at this post. So apparently we can't build both, so what is the best solution?


Apparently the ysam problem is a race condition; see this post. This would be fixed by mpir upgrading ysam, according to this.

@kcrisman
Copy link
Member Author

kcrisman commented Dec 4, 2011

Upstream: None of the above - read trac for reasoning.

@kcrisman
Copy link
Member Author

kcrisman commented Dec 7, 2011

comment:3

MPIR has upgraded this in a release candidate. See this mpir-devel post and this mpir release.


So what should we do about the static library issue? Will this break something if we revert that?

@kcrisman
Copy link
Member Author

kcrisman commented Dec 7, 2011

Changed upstream from None of the above - read trac for reasoning. to Fixed upstream, in a later stable release.

@kcrisman
Copy link
Member Author

comment:4

I get a different problem on Windows XP on the new MPIR.

../yasm/yasm -I .. -f elf64 -D GSYM_PREFIX lshift.as -DDLL_EXPORT -D PIC -o .libs/lshift.o
/bin/sh ../libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4" gcc -std=gnu99 -c -DHAVE_CONFIG_H    -m32 -O2 -fomit-frame-pointer -mtune=k8 -march=k8   -D__GMP_WITHIN_GMP -I..  -DOPERATION_`echo rshift | sed 's/_$//'` -I. -I..  `test -f 'rshift.asm' || echo './'`rshift.asm
 ../mpn/m4-ccas --m4=m4 gcc -std=gnu99 -c -DHAVE_CONFIG_H -m32 -O2 -fomit-frame-pointer -mtune=k8 -march=k8 -D__GMP_WITHIN_GMP -I.. -DOPERATION_rshift -I. -I.. rshift.asm  -DDLL_EXPORT -DPIC -o .libs/rshift.o
m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_rshift -DDLL_EXPORT -DPIC rshift.asm >tmp-rshift.s
 gcc -std=gnu99 -c -DHAVE_CONFIG_H -m32 -O2 -fomit-frame-pointer -mtune=k8 -march=k8 -D__GMP_WITHIN_GMP -I.. -DOPERATION_rshift -I. -I.. tmp-rshift.s -DDLL_EXPORT -DPIC -o .libs/rshift.o
tmp-rshift.s: Assembler messages:
tmp-rshift.s:53: Error: bad register name `%rcx'
tmp-rshift.s:55: Error: bad register name `%rax'
tmp-rshift.s:56: Error: bad register name `%rcx'
tmp-rshift.s:59: Error: bad register name `%rax'
tmp-rshift.s:61: Error: bad register name `%rcx'
tmp-rshift.s:62: Error: bad register name `%rsi,%rdx,8)'
tmp-rshift.s:63: Error: bad register name `%rdi,%rdx,8)'
tmp-rshift.s:64: Error: bad register name `%rdx'
tmp-rshift.s:65: Error: bad register name `%rsi,%rcx,8)'
tmp-rshift.s:70: Error: bad register name `%rax'
tmp-rshift.s:76: Error: bad register name `%rsi,%rcx,8)'
tmp-rshift.s:80: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:82: Error: bad register name `%rsi,%rcx,8)'
tmp-rshift.s:86: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:88: Error: bad register name `%rsi,%rcx,8)'
tmp-rshift.s:92: Error: bad register name `%rsi,%rcx,8)'
tmp-rshift.s:93: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:98: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:100: Error: bad register name `%rcx'
tmp-rshift.s:103: Error: bad register name `%rcx'
tmp-rshift.s:108: Error: bad register name `%rsi,%rcx,8)'
tmp-rshift.s:112: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:114: Error: bad register name `%rsi,%rcx,8)'
tmp-rshift.s:118: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:120: Error: bad register name `%rsi,%rcx,8)'
tmp-rshift.s:124: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:126: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:131: Error: bad register name `%rsi,%rcx,8)'
tmp-rshift.s:135: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:137: Error: bad register name `%rsi,%rcx,8)'
tmp-rshift.s:141: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:143: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:148: Error: bad register name `%rsi,%rcx,8)'
tmp-rshift.s:152: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:154: Error: bad register name `%rdi,%rcx,8)'
tmp-rshift.s:159: Error: bad register name `%rdi,%rcx,8)'
Makefile:605: recipe for target `rshift.lo' failed
make[4]: *** [rshift.lo] Error 1
make[4]: Leaving directory `/home/SageUser/sage-4.8.alpha3/spkg/build/mpir-2.1.3.p8/src/mpn'
Makefile:772: recipe for target `all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/SageUser/sage-4.8.alpha3/spkg/build/mpir-2.1.3.p8/src'
Makefile:603: recipe for target `all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/SageUser/sage-4.8.alpha3/spkg/build/mpir-2.1.3.p8/src'
Error building MPIR.

real    15m36.246s
user    12m36.996s
sys     11m12.666s
************************************************************************
Error installing package mpir-2.1.3.p8
************************************************************************

However, given that this has something to do with yasm, perhaps the new yasm would fix it? Or is this something that would be fixed by rebasing? (I don't see anything about forking, but I don't know how to interpret assembler (!) messages.)

@dimpase
Copy link
Member

dimpase commented Dec 11, 2011

comment:5

Replying to @kcrisman:

I get a different problem on Windows XP on the new MPIR.

this is a typical assembler error (something to do with the misconfiguration/mismatch of commands for particular hardware).
Nothing to do with Cygwin per se. Hopefully can be fixed by yasm upgrade.

@kcrisman
Copy link
Member Author

comment:6

Any fix here will have to be based on #12139, the new p8.

@kcrisman
Copy link
Member Author

comment:7

Any fix here will have to be based on #12139, the new p8.

There is now a p9 at #12131.

@jdemeyer
Copy link

comment:8

In the mean time, MPIR has been upgraded again to version 2.4.0, latest spkg is at #12751.

@jpflori
Copy link

jpflori commented Jul 10, 2012

comment:9

I get a similar "bad register name" failure with Cygwin 1.17... on Windows 7 64 bits with Sage 5.1.rc1.

@jpflori
Copy link

jpflori commented Jul 11, 2012

comment:10

I've get similar errors with the tentative spkg of MPIR 2.5.1 of #13137 (by the way they occur in tmp_mul-1.s as with the standard 5.1.rc1 spkg).
What's strange is that I have no problem compiling upstream MPIR 2.5.1...

@jpflori
Copy link

jpflori commented Jul 11, 2012

comment:11

Looking at #8664 gave some hints, and checking the log, I see some core2 in mtune and march.
Although -m32 is set, maybe some 64 bits stuff...
I'm trying again with ABI=32 set.

@jpflori
Copy link

jpflori commented Jul 11, 2012

comment:12

Setting ABI=32 solves the problem.
I guess the right solution is to define ABI=32 by default on Cygwin as it is only 32 bits for the moment.
The day it gets 64 bits, this can be changed.

@jpflori
Copy link

jpflori commented Jul 11, 2012

comment:13

Oh and that was with the MPIR 2.5.1 spkg, but I guess trying with the 2.4.0 would give the same result.

@kcrisman
Copy link
Member Author

comment:14

Thanks for trying things on Cygwin again! I gave up a while ago, but if you can keep build instructions up-to-date at CygwinPort and #6743, that would be wonderful.

@jdemeyer
Copy link

comment:15

Replying to @jpflori:

I get a similar "bad register name" failure with Cygwin 1.17... on Windows 7 64 bits with Sage 5.1.rc1.

Could you please post the mpir-2.4.0.p5.log file?

@jpflori
Copy link

jpflori commented Jul 11, 2012

Attachment: mpir-2.4.0.p5.log

@jpflori
Copy link

jpflori commented Jul 11, 2012

Attachment: mpir-2.5.1.p1.log

@jpflori
Copy link

jpflori commented Jul 11, 2012

comment:16

Attachment: mpir-2.4.0.p6.log

Have a look at the 2.4.0.p6 log (the p5 fails because of the static AND shared problem).
The 2.5.1.p1 includes several logs (sorry its large) and the first ones should reveal a similar failure.
The last log in 2.5.1.p1 was generated with ABI=32 and succeeded.

@jdemeyer
Copy link

comment:17

I understand the problem and it's trivial to fix.
Where did you get this mpir-2.4.0.p6 from?
There is an mpir-2.4.0.p6 merged in sage-5.2.beta1 (from #12751) but I doubt you're referring to that one.

@jpflori
Copy link

jpflori commented Jul 11, 2012

comment:18

I bumped the version number for my experiments.

@jpflori
Copy link

jpflori commented Aug 1, 2012

Author: Karl-Dieter Crisman, Jean-Pierre Flori

@jpflori
Copy link

jpflori commented Aug 1, 2012

Changed keywords from none to mpir cygwin

@jpflori
Copy link

jpflori commented Aug 2, 2012

Changed keywords from mpir cygwin to mpir cygwin spkg

@jpflori

This comment has been minimized.

@kcrisman
Copy link
Member Author

kcrisman commented Oct 5, 2012

comment:25

This works on Cygwin on XP!

@vbraun
Copy link
Member

vbraun commented Nov 23, 2012

comment:26

I would be in favor of never building the static libraries on any system, though we don't have to do that in this ticket. Positive review.

@vbraun
Copy link
Member

vbraun commented Nov 23, 2012

Reviewer: Volker Braun

@jpflori

This comment has been minimized.

@jpflori

This comment has been minimized.

@jpflori
Copy link

jpflori commented Nov 29, 2012

comment:29

The spkg at #13137 is based on that one so this ticket should not be merger directly and closed when #13137 is merged.

@jpflori

This comment has been minimized.

@jdemeyer
Copy link

Changed reviewer from Volker Braun to Volker Braun, Karl-Dieter Crisman, Jean-Pierre Flori

@jdemeyer
Copy link

Changed author from Karl-Dieter Crisman, Jean-Pierre Flori to none

@jdemeyer jdemeyer removed this from the sage-5.6 milestone Dec 17, 2012
@jdemeyer
Copy link

comment:32

In general, I think it is a bad idea not to merge a ticket just because another ticket is based on it. Imagine that some major problems arise with #13137, then this ticket here might get lost and forgetten. However, I don't know the specific situation here, so I'll let your decision stand.

@jdemeyer
Copy link

Dependencies: #13137

@jpflori
Copy link

jpflori commented Jan 11, 2013

Author: Karl-Dieter Crisman, Jean-Pierre Flori

@jpflori
Copy link

jpflori commented Jan 11, 2013

Changed dependencies from #13137 to none

@jpflori
Copy link

jpflori commented Jan 11, 2013

comment:34

Now it seems that including #13137 will be painful I have to agree with you Jeroen and ask you if it's possible to include this easy fix in 5.6?
Sorry for taking the wrong decision in the beginning...

@jpflori jpflori added this to the sage-5.6 milestone Jan 11, 2013
@jdemeyer jdemeyer modified the milestones: sage-5.6, sage-5.7 Jan 12, 2013
@jdemeyer
Copy link

Changed author from Karl-Dieter Crisman, Jean-Pierre Flori to none

@jdemeyer
Copy link

comment:37

It seems that #13137 is ready after all...

@jdemeyer jdemeyer removed this from the sage-5.7 milestone Jan 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants