sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.44k stars 480 forks source link

Add a gcc package #12369

Closed jdemeyer closed 12 years ago

jdemeyer commented 12 years ago

The aim is to add a GCC package (GNU compiler collection) to Sage with compilers for C, C++ and Fortran. We don't always build it, we would install it by default only on systems where this is needed. This would replace the fortran package.

spkg: http://boxen.math.washington.edu/home/jdemeyer/spkg/gcc-4.6.3.spkg

Apply:

  1. attachment: 12369_gcc_root.patch and attachment: 12369_gcc_root_part2.patch to the SAGE_ROOT repository.
  2. attachment: 12369_scripts_hgignore.patch to the SCRIPTS repository.
  3. attachment: 12369_doc.patch to the Sage library.

See also:

  1. 12782: When building GCC, build MPIR without the C++ interface (superseded by #11616).

Depends on #12479 Depends on #12602 Depends on #12608 Depends on #12609 Depends on #12647 Depends on #10492 Depends on #12367 Depends on #12368 Depends on #12405 Depends on #12570 Depends on #12574 Depends on #12423 Depends on #12425 Depends on #12456 Depends on #12363 Depends on #12223 Depends on #12515 Depends on #12519 Depends on #12548 Depends on #12562 Depends on #12629 Depends on #12638 Depends on #12714 Depends on #12647 Depends on #12739 Depends on #12112 Depends on #12631

CC: @vbraun

Component: packages: standard

Author: Jeroen Demeyer

Reviewer: Simon King

Merged: sage-5.0.beta13

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

jdemeyer commented 12 years ago

Description changed:

--- 
+++ 
@@ -4,4 +4,6 @@

 **Apply** [attachment: 12369_gcc_root.patch](https://github.com/sagemath/sage-prod/files/10654635/12369_gcc_root.patch.gz) to the `SAGE_ROOT` repository.

-**Testing release**: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta1-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta1-gcc/)
+**Testing releases**:
+1. GCC-4.4.6: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta1-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta1-gcc/)
+2. GCC-4.6.2: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta2-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta2-gcc/)
jhpalmieri commented 12 years ago
comment:52

More data: with SAGE_CHECK=yes and testing release 1 (gcc-4.4.6), I bypassed the failing packages by installing them without running self-tests. At the end there were a number of doctest failures:

    sage -t  --long -force_lib devel/sage/sage/symbolic/expression.pyx # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/matrix/matrix2.pyx # 4 doctests failed
    sage -t  --long -force_lib devel/sage/sage/rings/polynomial/polynomial_element.pyx # 1 doctests failed
    sage -t  --long -force_lib devel/sage/sage/matrix/matrix_symbolic_dense.pyx # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/calculus/wester.py # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/calculus/functional.py # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/symbolic/integration/integral.py # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/calculus/tests.py # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/functions/trig.py # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/functions/hyperbolic.py # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/symbolic/function.pyx # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/matrix/matrix_double_dense.pyx # 4 doctests failed
    sage -t  --long -force_lib devel/sage/sage/functions/min_max.py # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/interfaces/maxima_lib.py # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/libs/ppl.pyx # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/tensor/differential_form_element.py # Killed/crashed
    sage -t  --long -force_lib devel/sage/sage/tensor/differential_forms.py # Killed/crashed

The ones not marked "Killed/crashed" are the familiar ones from #11881.

Next, I tried to compile with SAGE_CHECK unset, and gd failed to build:

gcc -fPIC -g -I/Applications/sage_builds/GCC-no-check/sage-5.0.beta1-gcc/local/include -I/Applications/sage_builds/GCC-no-check/sage-5.0.beta1-gcc/local/include/freetype2/ -o .libs/gdparttopng gdparttopng.o  -L/Applications/sage_builds/GCC-no-check/sage-5.0.beta1-gcc/local/lib ./.libs/libgd.dylib -liconv /Applications/sage_builds/GCC-no-check/sage-5.0.beta1-gcc/local/lib/libfreetype.dylib /Applications/sage_builds/GCC-no-check/sage-5.0.beta1-gcc/local/lib/libpng12.dylib -lz
Undefined symbols for architecture x86_64:
  "_gdImageCreateFromGd2Part", referenced from:
      _main in gdparttopng.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[4]: *** [gdparttopng] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
Error building gd.

I just did ./sage -i spkg/standard/gd-..., and it seems to have built fine. I don't know what went wrong the first time, and I haven't had time to continue the build or to start it over.

Next, I worked with testing release 2 (gcc-4.6.2). As jdemeyer has noted, pari-2.5.0 won't build, so after verifying that (actually, it claims to have built, but it failed all (!) self-tests), I dropped in the new Pari spkg from #12363. That worked. Python failed its self-tests, so I installed it with SAGE_CHECK unset. cvxopt failed self-tests, as before. Everything else passed (including ppl). Sage failed to start up, and it looks like the issue at #11967, so right now I'm rebuilding with a newer Python spkg. I'll report back when that's done.

jdemeyer commented 12 years ago
comment:53

gcc-4.6.2 is certainly the way to go. Sage builds, and there is only one doctest failing (with a Segmentation Fault):

$ ./sage -t --long  devel/sage/sage/rings/padics/padic_ZZ_pX_CR_element.pyx
sage -t --long "devel/sage/sage/rings/padics/padic_ZZ_pX_CR_element.pyx"
The doctested process was killed by signal 11
         [5.1 s]

----------------------------------------------------------------------
The following tests failed:

        sage -t --long "devel/sage/sage/rings/padics/padic_ZZ_pX_CR_element.pyx" # Killed/crashed
Total time for all tests: 5.1 seconds
jdemeyer commented 12 years ago

Description changed:

--- 
+++ 
@@ -5,5 +5,4 @@
 **Apply** [attachment: 12369_gcc_root.patch](https://github.com/sagemath/sage-prod/files/10654635/12369_gcc_root.patch.gz) to the `SAGE_ROOT` repository.

 **Testing releases**:
-1. GCC-4.4.6: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta1-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta1-gcc/)
-2. GCC-4.6.2: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta2-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta2-gcc/)
+1. GCC-4.6.2: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta2-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta2-gcc/)
jdemeyer commented 12 years ago

Changed dependencies from #11073, #10492, #12366, #12367, #12368, #12405, #12416, #12422, #12423, #12425, #12456, #12457, #12363 to #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363

jdemeyer commented 12 years ago
comment:55

I created ticket #12480 for the padic_ZZ_pX_CR_element.pyx segfault.

jdemeyer commented 12 years ago

Changed dependencies from #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363 to #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12480

jdemeyer commented 12 years ago

Changed dependencies from #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12480 to #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363

jdemeyer commented 12 years ago
comment:56

Removing #12480 as a dependency, since it really has nothing to do with OS X 10.7.

jdemeyer commented 12 years ago

Attachment: 12369_scripts_hgignore.patch.gz

jdemeyer commented 12 years ago

Description changed:

--- 
+++ 
@@ -2,7 +2,9 @@

 **spkg**: [http://boxen.math.washington.edu/home/jdemeyer/spkg/gcc-4.6.2.spkg](http://boxen.math.washington.edu/home/jdemeyer/spkg/gcc-4.6.2.spkg)

-**Apply** [attachment: 12369_gcc_root.patch](https://github.com/sagemath/sage-prod/files/10654635/12369_gcc_root.patch.gz) to the `SAGE_ROOT` repository.
+**Apply**:
+1. [attachment: 12369_gcc_root.patch](https://github.com/sagemath/sage-prod/files/10654635/12369_gcc_root.patch.gz) to the `SAGE_ROOT` repository.
+2. [attachment: 12369_scripts_hgignore.patch](https://github.com/sagemath/sage-prod/files/10654633/12369_scripts_hgignore.patch.gz) to the `SCRIPTS` repository.

 **Testing releases**:
-1. GCC-4.6.2: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta2-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta2-gcc/)
+1. GCC-4.6.2: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gcc/)
jdemeyer commented 12 years ago

Description changed:

--- 
+++ 
@@ -8,3 +8,4 @@

 **Testing releases**:
 1. GCC-4.6.2: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gcc/)
+2. Dependencies only: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gccdeps/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gccdeps/): this contains all *dependencies* of this ticket but not this ticket itself, it still includes the old Fortran spkg.
jhpalmieri commented 12 years ago
comment:59

I've tried the testing release on several machines. On all but one, everything seems fine, but on one, gcc fails to compile. Any ideas why? Here's the log file; note the lines

cc1: internal compiler error: Segmentation fault: 11
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
jhpalmieri commented 12 years ago
comment:60

To clarify, I should have said that I've tried testing the release on several OS X Lion machines, and it's failing on one of them.

jdemeyer commented 12 years ago
comment:61

1) Do you have MAKE="make -jN" set or such?

2) Does it fail consistently in the same spot if you try again?

3) Try building gcc with SAGE_CHECK=yes

4) Try building gcc with CFLAGS="-O0" or CFLAGS_FOR_BUILD="-O0"

jhpalmieri commented 12 years ago
comment:62

Replying to @jdemeyer:

1) Do you have MAKE="make -jN" set or such?

I had MAKE="make -j2", but I unset it and that didn't help.

2) Does it fail consistently in the same spot if you try again?

Same spot, every time.a

3) Try building gcc with SAGE_CHECK=yes

I did that, but it didn't help: with SAGE_CHECK=yes and MAKE unset, it still fails in the same spot.

4) Try building gcc with CFLAGS="-O0" or CFLAGS_FOR_BUILD="-O0"

Do you mean just setting these variables, or do I need to modify the spkg? Just setting them (along with SAGE_CHECK and MAKE as above) doesn't help.

I also tried temporarily clearing out /usr/local in case some old files there were causing conflicts, but no help.

jhpalmieri commented 12 years ago
comment:63

(Actually, regarding item 2, it stops at one place if MAKE="make -j2", and another if MAKE is unset, as you might expect. But in each case, it's consistent.)

jdemeyer commented 12 years ago
comment:64

Could you also post a list of all your environment variables (see for example the top of SAGE_ROOT/install.log)

jhpalmieri commented 12 years ago
comment:65

Here's the top of install.log:

Installing GCC because a Fortran compiler is missing.
Installing GCC because your 'gcc' is not so recent.
*** ALL ENVIRONMENT VARIABLES BEFORE BUILD: ***
Apple_PubSub_Socket_Render=/tmp/launch-OIACLZ/Render
Apple_Ubiquity_Message=/tmp/launch-7Be69V/Apple_Ubiquity_Message
BIBINPUTS=/Users/palmieri/Documents/uw/tex/inputs/bibtex:.:
COMMAND_MODE=unix2003
DISPLAY=/tmp/launch-zCNApn/org.x:0
EDITOR=/usr/bin/emacs
FIGNORE=.log:.aux:.blg:.dvi:.aux:.bbl:.toc:.lof:.flc:.elc
HISTCONTROL=ignoreboth
HOME=/Users/palmieri
LANG=en_US.UTF-8
LOGNAME=palmieri
MAKE=make -j2
MAKEFLAGS=
MAKELEVEL=1
MFLAGS=
PATH=/Applications/sage_builds/clean/sage-5.0.beta3-gcc/spkg/bin:/Applications/sage_builds/clean/sage-5.0.beta3-gcc/local/bin:/Users/palmieri/bin:/opt/local/bin:/opt/local/sbin:/Applications/sage/:/usr/texbin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
PWD=/Applications/sage_builds/clean/sage-5.0.beta3-gcc/spkg
PYTHONPATH=/Applications/sage_builds/clean/sage-5.0.beta3-gcc/local
SAGEMATH=palmieri@sage.math.washington.edu:.
SAGE_DOC_JSMATH=yes
SAGE_LOCAL=/Applications/sage_builds/clean/sage-5.0.beta3-gcc/local
SAGE_LOGS=/Applications/sage_builds/clean/sage-5.0.beta3-gcc/spkg/logs
SAGE_PARALLEL_SPKG_BUILD=yes
SAGE_PORT=yes
SAGE_ROOT=/Applications/sage_builds/clean/sage-5.0.beta3-gcc
SHELL=/bin/bash
SHLVL=4
SSH_AUTH_SOCK=/tmp/launch-Y3Ezc9/Listeners
TERM=xterm-color
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=303
TERM_SESSION_ID=7E69A75B-352B-4367-A920-892CA994DAB8
TEXINPUTS=/Applications/sage/local/share/texmf//:/Users/palmieri/Documents/uw/tex/inputs//:.:
TMPDIR=/var/folders/qk/gyt9gwv171df7_3lt94z5pqc0000gn/T/
TRANSFERS=jpalmier@homer.u.washington.edu:transfers
USER=palmieri
_=/usr/bin/env
__CF_USER_TEXT_ENCODING=0x1F5:0:0
***********************************************

(There is no directory /opt, so any references to it are not important. I should probably delete that part of my PATH.)

jdemeyer commented 12 years ago
comment:66

The $TMPDIR looks suspicious, but it seems to be added by Apple on all OS X 10.7 systems, so it can't be that. Otherwise, I don't see anything special in your environment.

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 12 years ago
comment:67

Replying to @jdemeyer:

Replying to @ohanar:

Agreed, which is why I would like only fortran to be built if it is the only language needed.

Is build time your only concern here? Because if you need to build Fortran, you most likely need to build a stage 1 C compiler anyway.

I'm 95% sure you will need to build the complete gcc - not just the stage 1, even if you only want fortran, so I doubt trying to build just fortran would save much, if any, time. Building g++ probably takes a non-significant amount of extra time, but I'd think it much more sensible to have all the compilers at the same version, and not a mixture.

We currently enforce the versions of gcc/g++/gfortran in Sage to be the same. Strictly speaking they don't need to be, but it increases the chances of the build going ok if the same versions are used. We can also attempt to replicate bugs reported much easier if all versions are the same.

Dave

jdemeyer commented 12 years ago
comment:68

I removed mpc from the gcc spkg and propose to add a separate mpc spkg, which might also benefit Sage in other ways: #12515.

jdemeyer commented 12 years ago

Changed dependencies from #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363 to #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12515

jdemeyer commented 12 years ago

Changed dependencies from #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12515 to #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12223, #12515

jdemeyer commented 12 years ago

Changed dependencies from #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12223, #12515 to #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12223, #12515, #12519

jdemeyer commented 12 years ago

Description changed:

--- 
+++ 
@@ -7,5 +7,5 @@
 2. [attachment: 12369_scripts_hgignore.patch](https://github.com/sagemath/sage-prod/files/10654633/12369_scripts_hgignore.patch.gz) to the `SCRIPTS` repository.

 **Testing releases**:
-1. GCC-4.6.2: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gcc/)
-2. Dependencies only: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gccdeps/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gccdeps/): this contains all *dependencies* of this ticket but not this ticket itself, it still includes the old Fortran spkg.
+1. GCC-4.6.2: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta4-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta4-gcc/)
+2. Dependencies only: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta4-gccdeps/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta4-gccdeps/): this contains all *dependencies* of this ticket but not this ticket itself, it still includes the old Fortran spkg.
jhpalmieri commented 12 years ago
comment:72

Several times I've had the build fail in the middle when building with MAKE="make -j2". I think what happens is this: mpfr gets built for a second time, and during that build (or installation), its library gets deleted, and then the other spkg being built at the same time fails. For example, I just got this while building ntl:

g++ -I../include -I.  -O2 -g  -fno-common  -c  lzz_pXFactoring.c
g++ -I../include -I.  -O2 -g  -fno-common  -c  mat_GF2.c
g++ -I../include -I.  -O2 -g  -fno-common  -c  mat_GF2E.c
g++ -I../include -I.  -O2 -g  -fno-common  -c  mat_RR.c
dyld: Library not loaded: /Applications/sage_builds/GCC-clang-no-check/sage-5.0.beta4-gcc/local/lib/libmpfr.1.dylib
  Referenced from: /Applications/sage_builds/GCC-clang-no-check/sage-5.0.beta4-gcc/local/libexec/gcc/x86_64-apple-darwin11.3.0/4.6.2/cc1plus
  Reason: image not found
g++: internal compiler error: Trace/BPT trap: 5 (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[3]: *** [mat_RR.o] Error 4
make[2]: *** [libntl.dylib] Error 2
Failed to build NTL dylib.

So maybe mpir and mpfr should be built right after gcc, to avoid this?

jdemeyer commented 12 years ago
comment:73

Thanks John, I already noticed this myself. I see two solutions:

  1. rebuild mpir, mpfr, mpc after GCC without building anything else.

  2. don't delete the old libraries in the mpir, mpfr, mpc (at least if gcc is installed).

I'm more inclined to go for option 2. I never quite understood why we have to delete old libraries anyway.

jhpalmieri commented 12 years ago
comment:74

I don't know if it's the new version of Xcode (4.3) or if it's due to modifications in the latest gcc spkg, but the latest testing release builds fine with the default compiler on a laptop where it failed before and on a desktop where it succeeded before. ("Builds fine" means built and passed all of Sage's doctests. I have to rebuild with SAGE_CHECK=yes to see how that goes. I'll also try with clang.)

jdemeyer commented 12 years ago
comment:75

Replying to @jhpalmieri:

I don't know if it's the new version of Xcode (4.3)

If you upgraded XCode on that laptop, that would be the likely reason why it suddenly works.

jhpalmieri commented 12 years ago
comment:76

Replying to @jdemeyer:

  1. don't delete the old libraries in the mpir, mpfr, mpc (at least if gcc is installed).

I'm more inclined to go for option 2. I never quite understood why we have to delete old libraries anyway.

Right, this makes sense to me, and $MAKE install overwrites the old libraries anyway.

By the way, I've built with and without CC=clang (etc.) and with and without SAGE_CHECK=yes, on several different Lion machines, and I've had no problems except for python and cvxopt failing self-tests. I don't know what's going on with cvxopt. Could it be an atlas problem on Lion? In any case, the new Xcode seems to be a good choice for those people willing to upgrade from earlier versions of Lion to OS X 10.7.3.

jdemeyer commented 12 years ago

Changed dependencies from #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12223, #12515, #12519 to #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12223, #12515, #12519, #12548

jdemeyer commented 12 years ago

Changed dependencies from #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12223, #12515, #12519, #12548 to #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12223, #12515, #12519, #12548, #12562

jdemeyer commented 12 years ago

Description changed:

--- 
+++ 
@@ -7,5 +7,5 @@
 2. [attachment: 12369_scripts_hgignore.patch](https://github.com/sagemath/sage-prod/files/10654633/12369_scripts_hgignore.patch.gz) to the `SCRIPTS` repository.

 **Testing releases**:
-1. GCC-4.6.2: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta4-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta4-gcc/)
-2. Dependencies only: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta4-gccdeps/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta4-gccdeps/): this contains all *dependencies* of this ticket but not this ticket itself, it still includes the old Fortran spkg.
+1. GCC-4.6.2: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gcc/)
+2. Dependencies only: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gccdeps/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gccdeps/): this contains all *dependencies* of this ticket but not this ticket itself, it still includes the old Fortran spkg.
bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 12 years ago
comment:80

There needs to be a couple of changes for Solaris - in particular, the ability to specify the assembler and linker to be used, since the Sun assembler is not suitable for gcc on x86, So when configuring gcc, one might specify

--with-gnu-as --with-as=/usr/local/binutils-2.20/bin/as --without-gnu-ld --with-ld=/usr/ccs/bin/ld

The above specifies the GNU assembler is used, where it is, the Sun linker is used, and where it is. I'd suggest we have environment variables to specify the locations of the linker and assembler. (Perhaps SAGE_PATH_TO_ASSEMBLER and SAGE_PATH_TO_LINKER or something similar). I suspect this could be useful sometimes on Linux too, as people might have more than one copy of the assembler and/or linker present.

Although I personally always specify --with-gnu-as or {{{--without-gnu-as}}], and similar for the linker, I don't think this is strictly necessary, as the gcc configure script will determine if linker and assembler specified are the GNU ones or not.

Do you want a patch on another ticket, or this one?

Dave

jdemeyer commented 12 years ago
comment:81

Replying to @sagetrac-drkirkby:

I'd suggest we have environment variables to specify the locations of the linker and assembler.

GCC respects the standard $LD and $AS environment variables, so I don't see any need for this.

jdemeyer commented 12 years ago

Changed dependencies from #11073, #10492, #12366, #12367, #12368, #12405, #12416, #11967, #12423, #12425, #12456, #12363, #12223, #12515, #12519, #12548, #12562 to #11073, #10492, #12367, #12368, #12405, #12570, #11967, #12423, #12425, #12456, #12363, #12223, #12515, #12519, #12548, #12562

jdemeyer commented 12 years ago
comment:83

Apparently, $AS and $LD are only used to build GCC itself, so we would still need to add --with-as=$AS --with-ld=$LD.

jdemeyer commented 12 years ago

Changed dependencies from #11073, #10492, #12367, #12368, #12405, #12570, #11967, #12423, #12425, #12456, #12363, #12223, #12515, #12519, #12548, #12562 to #11073, #10492, #12367, #12368, #12405, #12570, #12574, #12423, #12425, #12456, #12363, #12223, #12515, #12519, #12548, #12562

jdemeyer commented 12 years ago
comment:85

Replying to @sagetrac-drkirkby:

the Sun assembler is not suitable for gcc on x86

I don't think this is true. I found only one issue with -pipe (#12562). Apart from that, Sage builds fine with the Sun assembler.

Anyway, I fixed the GCC spkg to use the AS and LD environment variables as arguments for --with-as and --with-ld.

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 12 years ago
comment:86

Replying to @jdemeyer:

Replying to @sagetrac-drkirkby:

the Sun assembler is not suitable for gcc on x86

I don't think this is true. I found only one issue with -pipe (#12562). Apart from that, Sage builds fine with the Sun assembler.

Anyway, I fixed the GCC spkg to use the AS and LD environment variables as arguments for --with-as and --with-ld.

IMHO, which is shared by the GCC documentation, the Sun assembler should be used, so unless AS is set, it would be wise to use /usr/ccs/bin/as. (On Solaris 11 and OpenSolaris, there's a link to /usr/bin/as, but that's not true on Solaris 10).

http://gcc.gnu.org/install/specific.html#ix86-x-solaris210

says on the Solaris x86 notes.


It is recommended that you configure GCC to use the GNU assembler, in /usr/sfw/bin/gas. The versions included in Solaris 10, from GNU binutils 2.15, and Solaris 11, from GNU binutils 2.19, work fine, although the current version, from GNU binutils 2.21, is known to work, too. Recent versions of the Sun assembler in /usr/ccs/bin/as work almost as well, though.

For linking, the Sun linker, is preferred.

It also says It may be necessary to configure with --without-gnu-ld --with-ld=/usr/ccs/bin/ld to guarantee use of Sun ld.


I thought the configure script would work out the --without-gnu-ld, but it might be worth adding the option unless LD is set.

I don't know what the status of t2.math is. William said he was going to switch it on a couple of weeks ago, but last time I looked it was down. Also, not sure about SkyNet.

If we need a Solaris 11 x86 machine I have one. A bit limited in performance (pair of dual core 2.8 GHz Opterons and 8 GB RAM, but it is useable. It's running the latest release of Solaris 11. I really need to work out how to use the remote management on it, as it is very noisy, must be placed in the garage, but I don't know how to manage it properly on it's management port.

Dave

jhpalmieri commented 12 years ago
comment:87

With sage-5.0.beta4-gcc, CC=clang and CXX=clang++, things built fine on OS X Lion, Xcode 4.3. With sage-5.0.beta5-gcc, though, polybori fails to build when I try this: at the very start of the build, I get this:

****************************************************
Starting build...
Removing old PolyBoRi install...
Done removing old PolyBoRi install.
Running build_polybori...
scons: Reading SConscript files ...
Platform:  darwin
Detecting type sizes... no
Could not detect type sizes (maybe compile/link flags trouble)! Exiting.
Error building PolyBoRi.

I wonder what differences between beta4-gcc and beta5-gcc caused this.

I haven't seen this problem when using the default gcc instead of clang.

jdemeyer commented 12 years ago

Description changed:

--- 
+++ 
@@ -1,6 +1,6 @@
 The aim is to add a gcc package to Sage.  We probably don't want to always build it, we would install it by default only on systems where this is needed.  This would replace the fortran package.

-**spkg**: [http://boxen.math.washington.edu/home/jdemeyer/spkg/gcc-4.6.2.spkg](http://boxen.math.washington.edu/home/jdemeyer/spkg/gcc-4.6.2.spkg)
+**spkg**: [http://boxen.math.washington.edu/home/jdemeyer/spkg/gcc-4.6.3.spkg](http://boxen.math.washington.edu/home/jdemeyer/spkg/gcc-4.6.3.spkg)

 **Apply**:
 1. [attachment: 12369_gcc_root.patch](https://github.com/sagemath/sage-prod/files/10654635/12369_gcc_root.patch.gz) to the `SAGE_ROOT` repository.
jdemeyer commented 12 years ago

Description changed:

--- 
+++ 
@@ -7,5 +7,5 @@
 2. [attachment: 12369_scripts_hgignore.patch](https://github.com/sagemath/sage-prod/files/10654633/12369_scripts_hgignore.patch.gz) to the `SCRIPTS` repository.

 **Testing releases**:
-1. GCC-4.6.2: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gcc/)
+1. GCC-4.6.3: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gcc/)
 2. Dependencies only: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gccdeps/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gccdeps/): this contains all *dependencies* of this ticket but not this ticket itself, it still includes the old Fortran spkg.
jdemeyer commented 12 years ago

Changed dependencies from #11073, #10492, #12367, #12368, #12405, #12570, #12574, #12423, #12425, #12456, #12363, #12223, #12515, #12519, #12548, #12562 to #10492, #12367, #12368, #12405, #12570, #12574, #12423, #12425, #12456, #12363, #12223, #12515, #12519, #12548, #12562, #12629

jdemeyer commented 12 years ago

Description changed:

--- 
+++ 
@@ -7,5 +7,5 @@
 2. [attachment: 12369_scripts_hgignore.patch](https://github.com/sagemath/sage-prod/files/10654633/12369_scripts_hgignore.patch.gz) to the `SCRIPTS` repository.

 **Testing releases**:
-1. GCC-4.6.3: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gcc/)
-2. Dependencies only: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gccdeps/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta5-gccdeps/): this contains all *dependencies* of this ticket but not this ticket itself, it still includes the old Fortran spkg.
+1. GCC-4.6.3: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta7-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta7-gcc/)
+2. Dependencies only: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta7-gccdeps/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta7-gccdeps/): this contains all *dependencies* of this ticket but not this ticket itself, it still includes the old Fortran spkg.
jdemeyer commented 12 years ago

Changed dependencies from #10492, #12367, #12368, #12405, #12570, #12574, #12423, #12425, #12456, #12363, #12223, #12515, #12519, #12548, #12562, #12629 to #10492, #12367, #12368, #12405, #12570, #12574, #12423, #12425, #12456, #12363, #12223, #12515, #12519, #12548, #12562, #12629, #12011

jdemeyer commented 12 years ago
comment:93

Attachment: 12369_doc.patch.gz

jdemeyer commented 12 years ago

Description changed:

--- 
+++ 
@@ -5,6 +5,7 @@
 **Apply**:
 1. [attachment: 12369_gcc_root.patch](https://github.com/sagemath/sage-prod/files/10654635/12369_gcc_root.patch.gz) to the `SAGE_ROOT` repository.
 2. [attachment: 12369_scripts_hgignore.patch](https://github.com/sagemath/sage-prod/files/10654633/12369_scripts_hgignore.patch.gz) to the `SCRIPTS` repository.
+3. [attachment: 12369_doc.patch](https://github.com/sagemath/sage-prod/files/10654634/12369_doc.patch.gz) to the Sage library.

 **Testing releases**:
 1. GCC-4.6.3: [http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta7-gcc/](http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta7-gcc/)
jdemeyer commented 12 years ago
comment:94

Unfortunately, it seems that GCC 4.6.3 miscompiles PARI on OS X PPC 32-bit, reported upstream at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52517