I upgraded my AC100 to (a snapshot of the forthcoming) ubuntu precise,
thinking it woud perhaps raise new issues, and that would be interesting
to detect them beforehand.
And indeed, pari doesn't compile!
One of the files gives an assembler file which doesn't compile, but the
problem is optimization-dependent :
(sage subshell) hecke:Olinux-armv7l jpuydt$ make
gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -g
-funroll-loops -fPIC -I. -I../src/headers
-I/home/jpuydt/sage-4.8/local/include -o mp.o mp.c
/tmp/ccgVJ73D.s: Assembler messages:
/tmp/ccgVJ73D.s:376: Error: branch out of range
/tmp/ccgVJ73D.s:5127: Error: branch out of range
make: *** [mp.o] Erreur 1
SAGE_ROOT=/home/jpuydt/sage-4.8
(sage subshell) hecke:Olinux-armv7l jpuydt$ gcc -c -O2 -Wall
-fno-strict-aliasing -fomit-frame-pointer -g -funroll-loops -fPIC -I.
-I../src/headers -I/home/jpuydt/sage-4.8/local/include -o mp.o mp.c
/tmp/ccMfUGHc.s: Assembler messages:
/tmp/ccMfUGHc.s:376: Error: branch out of range
/tmp/ccMfUGHc.s:5120: Error: branch out of range
SAGE_ROOT=/home/jpuydt/sage-4.8
(sage subshell) hecke:Olinux-armv7l jpuydt$ gcc -c -O -Wall
-fno-strict-aliasing -fomit-frame-pointer -g -funroll-loops -fPIC -I.
-I../src/headers -I/home/jpuydt/sage-4.8/local/include -o mp.o mp.c
SAGE_ROOT=/home/jpuydt/sage-4.8
The gcc version is Ubuntu/Linaro 4.6.2-12ubuntu1.
I'll try to investigate where the problem is (pari? gcc? other?), but I
thought sharing early would raise good suggestions.
Snark on #sagemath
Try running something like:
gcc -c -S -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -g
-funroll-loops -fPIC -I. -I../src/headers
-I/home/jpuydt/sage-4.8/local/include -o mp.s mp.c
and then look at the assembler generated in mp.s
you can also s/-S/-E/; s/mp.s/mp.e/ or variant to reduce to, and
create a self contained small test case and report upstream.
If you want it "working now", you can try removing -funroll-loops
> /tmp/ccgVJ73D.s: Assembler messages:
> /tmp/ccgVJ73D.s:376: Error: branch out of range
> /tmp/ccgVJ73D.s:5127: Error: branch out of range
> make: *** [mp.o] Erreur 1
> SAGE_ROOT=/home/jpuydt/sage-4.8
> (sage subshell) hecke:Olinux-armv7l jpuydt$ gcc -c -O2 -Wall
> -fno-strict-aliasing -fomit-frame-pointer -g -funroll-loops -fPIC -I.
> -I../src/headers -I/home/jpuydt/sage-4.8/local/include -o mp.o mp.c
> /tmp/ccMfUGHc.s: Assembler messages:
> /tmp/ccMfUGHc.s:376: Error: branch out of range
> /tmp/ccMfUGHc.s:5120: Error: branch out of range
> SAGE_ROOT=/home/jpuydt/sage-4.8
> (sage subshell) hecke:Olinux-armv7l jpuydt$ gcc -c -O -Wall
> -fno-strict-aliasing -fomit-frame-pointer -g -funroll-loops -fPIC -I.
> -I../src/headers -I/home/jpuydt/sage-4.8/local/include -o mp.o mp.c
> SAGE_ROOT=/home/jpuydt/sage-4.8
>
> The gcc version is Ubuntu/Linaro 4.6.2-12ubuntu1.
>
> I'll try to investigate where the problem is (pari? gcc? other?), but I
> thought sharing early would raise good suggestions.
Hard to tell without looking at what is being generated, but I
suspect something related to -mimplict-it=??? assembler option
with the assembler generating extra code, and branch encoding
for short jumps (8 or 11 bits). You can add -marm to CFLAGS
and then it can only generate 24 bit displacement jumps...
> Snark on #sagemath
Paulo
After I compile mp.c with only the -O switch, pari and the rest of sage
compiled correctly.
Snark on #sagemath
>> (sage subshell) hecke:Olinux-armv7l jpuydt$ make
>> gcc -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -g
>> -funroll-loops -fPIC -I. -I../src/headers
>> -I/home/jpuydt/sage-4.8/local/include -o mp.o mp.c
>
> Try running something like:
>
> gcc -c -S -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer -g
> -funroll-loops -fPIC -I. -I../src/headers
> -I/home/jpuydt/sage-4.8/local/include -o mp.s mp.c
>
> and then look at the assembler generated in mp.s
>
> you can also s/-S/-E/; s/mp.s/mp.e/ or variant to reduce to, and
> create a self contained small test case and report upstream.
Hmmm... I'll send the mp.e as a mp.c ; it doesn't compile with both
-funroll-loops and -O3, so I guess it's a valid test case. Not really
small (19147 lines), but I guess that will do.
> If you want it "working now", you can try removing -funroll-loops
I used the -O option instead of -O3 ;-)
>> /tmp/ccgVJ73D.s: Assembler messages:
>> /tmp/ccgVJ73D.s:376: Error: branch out of range
>> /tmp/ccgVJ73D.s:5127: Error: branch out of range
>> make: *** [mp.o] Erreur 1
>> SAGE_ROOT=/home/jpuydt/sage-4.8
>> (sage subshell) hecke:Olinux-armv7l jpuydt$ gcc -c -O2 -Wall
>> -fno-strict-aliasing -fomit-frame-pointer -g -funroll-loops -fPIC -I.
>> -I../src/headers -I/home/jpuydt/sage-4.8/local/include -o mp.o mp.c
>> /tmp/ccMfUGHc.s: Assembler messages:
>> /tmp/ccMfUGHc.s:376: Error: branch out of range
>> /tmp/ccMfUGHc.s:5120: Error: branch out of range
>> SAGE_ROOT=/home/jpuydt/sage-4.8
>> (sage subshell) hecke:Olinux-armv7l jpuydt$ gcc -c -O -Wall
>> -fno-strict-aliasing -fomit-frame-pointer -g -funroll-loops -fPIC -I.
>> -I../src/headers -I/home/jpuydt/sage-4.8/local/include -o mp.o mp.c
>> SAGE_ROOT=/home/jpuydt/sage-4.8
>>
>> The gcc version is Ubuntu/Linaro 4.6.2-12ubuntu1.
>>
>> I'll try to investigate where the problem is (pari? gcc? other?), but I
>> thought sharing early would raise good suggestions.
>
> Hard to tell without looking at what is being generated, but I
> suspect something related to -mimplict-it=??? assembler option
> with the assembler generating extra code, and branch encoding
> for short jumps (8 or 11 bits). You can add -marm to CFLAGS
> and then it can only generate 24 bit displacement jumps...
Adding -marm makes the file compile too.
Snark on #sagemath
PS: https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/926855
Amusing remark :
sage: float(maxima('1e+17'))
1e+17
One problem down... It's a shame others came up...
Snark on #sagemath
Any attempt to port sage to another platform seems to bring up endless issues.
It took me several years of my spare time to get Sage building on Solaris. Prior
to my efforts, someone else worked on it full time for two years, though he
never got very far with it.
I've looked at building Sage on both AIX and HP-UX, but the issues are
formidable. (In the case of HP-UX, there is probably little point anyway, but
IBM make some very fast machines which run AIX).
I think your ARM port will be less hassle than an AIX port!!!!
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
Thank you Julian/Snark for your really valuable contributions! It's
going to be fun to run Sage on my gtab.
William
>
> --
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?
>
>
> --
> To post to this group, send an email to sage-...@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org
ARM is a plaftorm which is at the tip of the bleeding edge in some
sense, so gcc gets much work, and especially optimisation work.
Which also means they sometimes let bugs slip in the compiler, and
the buggy compiler slip out. I have the ubuntu gcc team and the linaro
gcc team on it, so I hope that one will go away soon. I shook quite a
few trees...
I consider portability of a piece of code a good indicator of its
quality : bad code doesn't port.
Snark on #sagemath
Well, the problem was in the gcc version used for precise on ARM, which
has been updated since : I just compiled 5.0beta5 on my AC100 (still
building docs though) ; I only needed the new flint spkg
(http://trac.sagemath.org/sage_trac/ticket/10328).
Snark on #sagemath