Sage works on OS X 10.7!

113 views
Skip to first unread message

Jeroen Demeyer

unread,
Feb 10, 2012, 5:09:13 PM2/10/12
to sage-devel
I would like to announce a working Sage on OS X 10.7. It requires XCode
4 and setting SAGE_PORT=yes, but apart from that it builds from source
"out of the box". The main new thing is that we include a GCC spkg (to
build a C, C++ and Fortran compiler), replacing the old Fortran spkg.
It builds and all doctests pass, but I have *not* actually used it. In
particular, I have not tried the notebook.

Source tarball:
http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gcc/sage-5.0.beta3-gcc.tar

I also have a binary based on a slightly older version:
http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta2-gcc/sage-5.0.beta2-gcc-x86_64-Darwin.dmg

The ticket which achieves this isn't quite ready yet (#12369). It still
needs to be tested on other systems to make sure that it doesn't break
anything. There is some discussion about LD_LIBRARY_PATH (#12405) and I
expect some work for my new spkg/install (#10492).

David Roe

unread,
Feb 10, 2012, 5:20:32 PM2/10/12
to sage-...@googlegroups.com
Awesome!

Given this, do you have an estimate for the release timetable for Sage 5.0?
David


--
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

unread,
Feb 10, 2012, 5:43:54 PM2/10/12
to sage-...@googlegroups.com
On Fri, Feb 10, 2012 at 2:09 PM, Jeroen Demeyer <jdem...@cage.ugent.be> wrote:
> I would like to announce a working Sage on OS X 10.7.  It requires XCode
> 4 and setting SAGE_PORT=yes, but apart from that it builds from source
> "out of the box".  The main new thing is that we include a GCC spkg (to
> build a C, C++ and Fortran compiler), replacing the old Fortran spkg.
> It builds and all doctests pass, but I have *not* actually used it.  In
> particular, I have not tried the notebook.

That is so, so, so awesome!!!

>
> Source tarball:
> http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3-gcc/sage-5.0.beta3-gcc.tar
>
> I also have a binary based on a slightly older version:
> http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta2-gcc/sage-5.0.beta2-gcc-x86_64-Darwin.dmg
>
> The ticket which achieves this isn't quite ready yet (#12369).  It still
> needs to be tested on other systems to make sure that it doesn't break
> anything.  There is some discussion about LD_LIBRARY_PATH (#12405) and I
> expect some work for my new spkg/install (#10492).
>

> --
> 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

entropy

unread,
Feb 13, 2012, 11:51:13 AM2/13/12
to sage-devel
Hi all,

This is wonderful news. So great, that I tried to compile
sage-5.0beta3 on my OS X 10.7.2 laptop. Sadly, it threw an error while
attempting to compile gcc4.6.2. Hopefully someone may have more
expertise than me.  Below is the bottom of the build log with the
error. I'm running XCode 4.1.

Thanks for any help!
Jesse


<lots of successful compiling up here!>
....
checking for x86_64-apple-darwin11.2.0-gcc... /Users/jberwald/src/
sage-5.0.beta3-gcc/spkg/build/gcc-4.6.2/gcc-build/./gcc/xgcc -B/Users/
jberwald/src/sage-5.0.beta3-gcc/spkg/build/gcc-4.6.2/gcc-build/./gcc/ -
B/Users/jberwald/src/sage-5.0.beta3-gcc/local/x86_64-apple-
darwin11.2.0/bin/ -B/Users/jberwald/src/sage-5.0.beta3-gcc/local/
x86_64-apple-darwin11.2.0/lib/ -isystem /Users/jberwald/src/
sage-5.0.beta3-gcc/local/x86_64-apple-darwin11.2.0/include -isystem /
Users/jberwald/src/sage-5.0.beta3-gcc/local/x86_64-apple-darwin11.2.0/
sys-include
checking for suffix of object files... configure: error: in `/Users/
jberwald/src/sage-5.0.beta3-gcc/spkg/build/gcc-4.6.2/gcc-build/x86_64-
apple-darwin11.2.0/libgcc':
configure: error: cannot compute suffix of object files: cannot
compile
See `config.log' for more details.
make[3]: *** [configure-target-libgcc] Error 1
make[2]: *** [all] Error 2

real 2m34.632s
user 10m22.815s
sys 1m24.590s
************************************************************************
Error installing package gcc-4.6.2
************************************************************************

On Feb 10, 5:43 pm, William Stein <wst...@gmail.com> wrote:
> On Fri, Feb 10, 2012 at 2:09 PM, Jeroen Demeyer <jdeme...@cage.ugent.be> wrote:
> > I would like to announce a working Sage on OS X 10.7.  It requires XCode
> > 4 and setting SAGE_PORT=yes, but apart from that it builds from source
> > "out of the box".  The main new thing is that we include a GCC spkg (to
> > build a C, C++ and Fortran compiler), replacing the old Fortran spkg.
> > It builds and all doctests pass, but I have *not* actually used it.  In
> > particular, I have not tried the notebook.
>
> That is so, so, so awesome!!!
>
>
>
>
>
>
>
>
>
>
>
> > Source tarball:
> >http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta3...
>
> > I also have a binary based on a slightly older version:
> >http://boxen.math.washington.edu/home/jdemeyer/release/sage-5.0.beta2...
>
> > The ticket which achieves this isn't quite ready yet (#12369).  It still
> > needs to be tested on other systems to make sure that it doesn't break
> > anything.  There is some discussion about LD_LIBRARY_PATH (#12405) and I
> > expect some work for my new spkg/install (#10492).
>
> > --
> > 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 athttp://groups.google.com/group/sage-devel

Dr. David Kirkby

unread,
Feb 13, 2012, 12:06:57 PM2/13/12
to sage-...@googlegroups.com
On 02/13/12 04:51 PM, entropy wrote:
> Hi all,
>
> This is wonderful news. So great, that I tried to compile
> sage-5.0beta3 on my OS X 10.7.2 laptop. Sadly, it threw an error while
> attempting to compile gcc4.6.2. Hopefully someone may have more
> expertise than me. Below is the bottom of the build log with the
> error. I'm running XCode 4.1.
>
> Thanks for any help!
> Jesse

> configure: error: cannot compute suffix of object files: cannot

If you google "cannot compute suffix of object files" you will get 110,000 hits.
I think the problem is often related to the fact the run-time linker can't find
the mpir of mpfr libraries. Although the configure script can find them, since
you have specified them, the linker often can't, so whilst the first stage of
gcc builds, the second stage does not.

I've tried to argue with the gcc developers that this is a bug, but they don't
seem to see it that way, and say it would be hard to fix.

You would be best to post your problem to the gcc mailing list, including the
config.log file from the directory where the failure occured. NOT the top-level
config.log, which wont have the reason for the failure

Dave

William Stein

unread,
Feb 13, 2012, 12:55:43 PM2/13/12
to sage-...@googlegroups.com

It fails in *exactly* the same way for me on my laptop.

deep:sage-5.0.beta3-gcc wstein$ uname -a
Darwin deep.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug 9
20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64

deep:sage-5.0.beta3-gcc wstein$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc.
build 5658) (LLVM build 2335.15.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


-- William

> For more options, visit this group at http://groups.google.com/group/sage-devel

John H Palmieri

unread,
Feb 13, 2012, 1:05:56 PM2/13/12
to sage-...@googlegroups.com


On Monday, February 13, 2012 9:55:43 AM UTC-8, William wrote:

I posted the same failure two days ago to the relevant trac ticket,

  <http://trac.sagemath.org/sage_trac/ticket/12369>.

It's curious that my failure and the other two reported here were all on laptops. On several non-laptops, things have worked fine for me. Coincidence? Or is there something about the laptop architecture which is causing the problem? Has anyone seen this failure on a desktop machine?

--
John

Volker Braun

unread,
Feb 13, 2012, 2:49:29 PM2/13/12
to sage-...@googlegroups.com
On Monday, February 13, 2012 10:05:56 AM UTC-8, John H Palmieri wrote:
Or is there something about the laptop architecture which is causing the problem?

It would be useful if people would post the output of "uname -a" with the success/failure reports in this thread. 

John H Palmieri

unread,
Feb 13, 2012, 5:13:57 PM2/13/12
to sage-...@googlegroups.com

A success, an iMac with 4 GB RAM:

$ uname -a
Darwin jpalmieri538.math.washington.edu 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64

(This looks like the same output as from the failure below.  I just updated this machine to OS X 11.3.0 this morning, and the gcc spkg builds successfully.  It also built successfully with 11.2.0.)

A success, another iMac with 4GB RAM:

$ uname -a
Darwin sage1.cs.washington.edu 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug  9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64

A failure, a Mac Book Pro with 2 GB RAM:

$ uname -a
Darwin jhp-mbp-2.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64


There is also more detailed system information available from the "system_profiler" command, so let me know if you need some other data.

--
John

entropy

unread,
Feb 13, 2012, 5:57:45 PM2/13/12
to sage-devel


On Feb 13, 5:13 pm, John H Palmieri <jhpalmier...@gmail.com> wrote:
> On Monday, February 13, 2012 11:49:29 AM UTC-8, Volker Braun wrote:
>
> > On Monday, February 13, 2012 10:05:56 AM UTC-8, John H Palmieri wrote:
>
> >> Or is there something about the laptop architecture which is causing the
> >> problem?
>
> > It would be useful if people would post the output of "uname -a" with the
> > success/failure reports in this thread.
>

Interesting! As you can see, I'm on 11.2 and sage fails to build.

$ uname -a
Darwin hyperion 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug 9
20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64


> A success, an iMac with 4 GB RAM:
>
> $ uname -a
> Darwin jpalmieri538.math.washington.edu 11.3.0 Darwin Kernel Version
> 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
> x86_64
>
> (This looks like the same output as from the failure below.  I just updated
> this machine to OS X 11.3.0 this morning, and the gcc spkg builds
> successfully.  It also built successfully with 11.2.0.)
>
> A success, another iMac with 4GB RAM:
>
> $ uname -a
> Darwin sage1.cs.washington.edu 11.2.0 Darwin Kernel Version 11.2.0: Tue
> Aug  9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64
>
> A failure, a Mac Book Pro with 2 GB RAM:
>
> $ uname -a
> Darwin jhp-mbp-2.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12
> 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
>
> There is also more detailed system information available from the
> "system_profiler" command, so let me know if you need some other data.
>
> --
> John

Jesse

Dima Pasechnik

unread,
Feb 13, 2012, 9:16:18 PM2/13/12
to sage-...@googlegroups.com
In gmane.comp.mathematics.sage.devel, you wrote:
> ------=_Part_1067_3756437.1329162569160
> Content-Type: text/plain; charset=ISO-8859-1

Likely this is hardware-specific failures. Please post also
what you see in "About this Mac", i.e. the processor type and
amount of RAM.

Dima

John H Palmieri

unread,
Feb 13, 2012, 9:45:19 PM2/13/12
to sage-...@googlegroups.com
I think we'll need more information, unless RAM is the only relevant issue.  A successful machine (desktop):

Processor: 2.4 GHz Intel Core 2 Duo
Memory: 4 GB 667 MHz DDR2 SDRAM

A failing machine (laptop):

Processor: 2.4 GHz Intel Core 2 Duo
Memory: 2 GB 667 MHz DDR2 SDRAM

As I said earlier, the shell command "system_profiler" gives a lot more information, but I don't know if any of it is actually relevant...

--
John

Jeroen Demeyer

unread,
Feb 14, 2012, 2:51:50 AM2/14/12
to sage-...@googlegroups.com
On 2012-02-13 19:05, John H Palmieri wrote:
> I posted the same failure two days ago to the relevant trac ticket,
>
> <http://trac.sagemath.org/sage_trac/ticket/12369>.
Not the same failure, your failure on #12369 was an "internal compiler
error: segmentation fault"

Jeroen Demeyer

unread,
Feb 14, 2012, 2:54:01 AM2/14/12
to sage-...@googlegroups.com
On 2012-02-13 18:55, William Stein wrote:
> It fails in *exactly* the same way for me on my laptop.

William (or somebody else), could you pack the whole
$SAGE_ROOT/spkg/build/gcc-4.6.2 directory in a tarball for me such that
I can have a look at log files?

Also send me $SAGE_ROOT/spkg/logs/gcc-4.6.2.log

Please do this from a *serially* built Sage (MAKE="make -j1").

entropy

unread,
Feb 14, 2012, 9:32:32 AM2/14/12
to sage-devel
Here is a link to the gcc build file:

http://dl.dropbox.com/u/546764/gcc-4.6.2_sagebuild.zip

and the log file

http://dl.dropbox.com/u/546764/gcc-4.6.2.log.

These are from a serial build. Note that I had initially attempted a
parallel build, which failed with the same error. I've attempted a
build on Darwin kernel version 11.2 and 11.3. Some more system info,
if it matters:

Model Name: MacBook Pro
Model Identifier: MacBookPro8,3
Processor Name: Intel Core i7
Processor Speed: 2.2 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 6 MB
Memory: 8 GB

thanks,
Jesse

Jeroen Demeyer

unread,
Feb 14, 2012, 11:07:25 AM2/14/12
to sage-...@googlegroups.com
On sage1.cs.washington.ede (where compiling works), gcc --version gives:

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build

5658) (LLVM build 2336.1.00)


With entropy's log of a failed build:

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build
5658) (LLVM build 2335.15.00)

Note the different LLVM version number.

John H Palmieri

unread,
Feb 14, 2012, 11:22:31 AM2/14/12
to sage-...@googlegroups.com

It said that, and then about a hundred lines later, it failed with the same message as given by "entropy".  Indeed, now that he has posted his log, it looks like his error is the same: he also the "internal compiler error: segmentation fault" message in his log.

--
John

Jeroen Demeyer

unread,
Feb 14, 2012, 1:50:52 PM2/14/12
to sage-...@googlegroups.com
John, entropy, Could you try the following:

$ rm spkg/logs/gcc-4.6.2.log
$ MAKE="make -j1" SAGE_CHECK=yes CFLAGS="-O0" ./sage -f
spkg/standard/gcc-4.6.2.spkg

If it fails, send me spkg/logs/gcc-4.6.2.log


R. Andrew Ohana

unread,
Feb 14, 2012, 3:42:29 PM2/14/12
to sage-...@googlegroups.com
You could also try

$ CC=clang CXX=clang++ MAKE="make -j1" ./sage -f spkg/standard/gcc-4.6.2.spkg

One of the main points of the gcc spkg is because llvm-gcc is buggy,
clang should be just as able to build gcc, and doesn't suffer from the
same bugs as llvm-gcc does with pari and symmetrica.

> --
> 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

--
Andrew

entropy

unread,
Feb 14, 2012, 4:44:46 PM2/14/12
to sage-devel
sigh... :) here's the log file: http://dl.dropbox.com/u/546764/gcc-4.6.2.log.

It now fails with a slightly different error, though I suspect this is
because I ran the ./sage -f command below:

configure: error: cannot compute suffix of object files: cannot
compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

as opposed to the original

make[3]: *** [configure-target-libgcc] Error 1
make[2]: *** [all] Error 2

thanks for all your help,
Jesse

William Stein

unread,
Feb 14, 2012, 4:55:18 PM2/14/12
to sage-...@googlegroups.com
On Tue, Feb 14, 2012 at 12:42 PM, R. Andrew Ohana
<andrew...@gmail.com> wrote:
> You could also try
>
> $ CC=clang CXX=clang++ MAKE="make -j1" ./sage -f spkg/standard/gcc-4.6.2.spkg
>
> One of the main points of the gcc spkg is because llvm-gcc is buggy,
> clang should be just as able to build gcc, and doesn't suffer from the
> same bugs as llvm-gcc does with pari and symmetrica.

gcc built for me with those options. Now I'll resume the build of Sage.

d-69-91-145-32:sage-5.0.beta3-gcc wstein$ uname -a
Darwin d-69-91-145-32.dhcp4.washington.edu 11.2.0 Darwin Kernel


Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011;
root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64

-----
...
/usr/bin/install -c -m 644 omp.h
'/Users/wstein/sage/install/sage-5.0.beta3-gcc/local/lib/gcc/x86_64-apple-darwin11.2.0/4.6.2/include'

real 16m28.713s
user 11m57.666s
sys 3m5.779s
Successfully installed gcc-4.6.2
Now cleaning up tmp files.
Finished installing gcc-4.6.2.spkg


>
> On Tue, Feb 14, 2012 at 10:50, Jeroen Demeyer <jdem...@cage.ugent.be> wrote:
>> John, entropy, Could you try the following:
>>
>> $ rm spkg/logs/gcc-4.6.2.log
>> $ MAKE="make -j1" SAGE_CHECK=yes CFLAGS="-O0" ./sage -f
>> spkg/standard/gcc-4.6.2.spkg
>>
>> If it fails, send me spkg/logs/gcc-4.6.2.log
>>
>>
>> --
>> 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
>
>
>
> --
> Andrew
>
> --
> 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

unread,
Feb 14, 2012, 4:56:12 PM2/14/12
to sage-...@googlegroups.com
On Tue, Feb 14, 2012 at 1:55 PM, William Stein <wst...@gmail.com> wrote:
> On Tue, Feb 14, 2012 at 12:42 PM, R. Andrew Ohana
> <andrew...@gmail.com> wrote:
>> You could also try
>>
>> $ CC=clang CXX=clang++ MAKE="make -j1" ./sage -f spkg/standard/gcc-4.6.2.spkg
>>
>> One of the main points of the gcc spkg is because llvm-gcc is buggy,
>> clang should be just as able to build gcc, and doesn't suffer from the
>> same bugs as llvm-gcc does with pari and symmetrica.
>
> gcc built for me with those options.  Now I'll resume the build of Sage.

Here's my log file:

http://wstein.org/tmp/install.log

entropy

unread,
Feb 14, 2012, 5:24:41 PM2/14/12
to sage-devel
woohoo! Success as well using

$ CC=clang CXX=clang++ MAKE="make -j1" ./sage -f spkg/standard/
gcc-4.6.2.spkg

Successfully installed gcc-4.6.2
Now cleaning up tmp files.
Finished installing gcc-4.6.2.spkg (!!)

Learning many things during this painful transition from linux to mac.
I'll continue the build process.....

Jesse
> >> On Tue, Feb 14, 2012 at 10:50, Jeroen Demeyer <jdeme...@cage.ugent.be> wrote:
> >>> John, entropy, Could you try the following:
>
> >>> $ rm spkg/logs/gcc-4.6.2.log
> >>> $ MAKE="make -j1" SAGE_CHECK=yes CFLAGS="-O0" ./sage -f
> >>> spkg/standard/gcc-4.6.2.spkg
>
> >>> If it fails, send me spkg/logs/gcc-4.6.2.log
>
> >>> --
> >>> 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 athttp://groups.google.com/group/sage-devel
> >>> URL:http://www.sagemath.org
>
> >> --
> >> Andrew
>
> >> --
> >> 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 athttp://groups.google.com/group/sage-devel

entropy

unread,
Feb 14, 2012, 5:57:08 PM2/14/12
to sage-devel
Darn, flopped again. The mpir package "could not find a working
compiler". Kind of ironic, since this whole thread has been about
building gcc-4.6.2. :) From the log, it seems to have found the
system's gcc (4.2.1, the same one that couldn't build 4.6 I suppose).
But has issues with the following issue: "no, double -> ulong
conversion". To be clear, after gcc-4.6.2 built and installed, in
order to restart the build process, I simply typed "make" again in the
sage root directory. Is it necessary to modify this command if one
restarts a build process? Or is my problem that the built process
should be using gcc-4.6.2 throughout once gcc-4.6.2 is built?

The log file for the failed mpir build can be found here if anyone is
interested: http://dl.dropbox.com/u/546764/mpir-2.1.3.p9.log

Jesse

R. Andrew Ohana

unread,
Feb 14, 2012, 8:14:13 PM2/14/12
to sage-...@googlegroups.com
On Tue, Feb 14, 2012 at 14:57, entropy <jber...@gmail.com> wrote:
> Darn, flopped again. The mpir package "could not find a working
> compiler". Kind of ironic, since this whole thread has been about
> building gcc-4.6.2. :)  From the log, it seems to have found the
> system's gcc (4.2.1, the same one that couldn't build 4.6 I suppose).
> But has issues with the following issue: "no, double -> ulong
> conversion". To be clear, after gcc-4.6.2 built and installed, in
> order to restart the build process, I simply typed "make" again in the
> sage root directory. Is it necessary to modify this command if one
> restarts a build process? Or is my problem that the built process
> should be using gcc-4.6.2 throughout once gcc-4.6.2 is built?

Once gcc-4.6.2 is built, it should start using it. FYI, I didn't
actually test using clang for building only gcc-4.6.2, I tested it for
building all the gcc deps in addition to gcc-4.6.2.

Specifically:

$ CC=clang CXX=clang++ make

compiled a fully working version of sage on sage1.cs, since it used
clang until gcc was built, and then it switched over to the newly
compiled gcc.

(granted, on this system llvm-gcc works just fine)

> For more options, visit this group at http://groups.google.com/group/sage-devel

John H Palmieri

unread,
Feb 14, 2012, 9:10:17 PM2/14/12
to sage-...@googlegroups.com


On Tuesday, February 14, 2012 5:14:13 PM UTC-8, R. Andrew Ohana wrote:
On Tue, Feb 14, 2012 at 14:57, entropy wrote:
> Darn, flopped again. The mpir package "could not find a working
> compiler". Kind of ironic, since this whole thread has been about
> building gcc-4.6.2. :)  From the log, it seems to have found the
> system's gcc (4.2.1, the same one that couldn't build 4.6 I suppose).
> But has issues with the following issue: "no, double -> ulong
> conversion". To be clear, after gcc-4.6.2 built and installed, in
> order to restart the build process, I simply typed "make" again in the
> sage root directory. Is it necessary to modify this command if one
> restarts a build process? Or is my problem that the built process
> should be using gcc-4.6.2 throughout once gcc-4.6.2 is built?

Once gcc-4.6.2 is built, it should start using it. FYI, I didn't
actually test using clang for building only gcc-4.6.2, I tested it for
building all the gcc deps in addition to gcc-4.6.2.

Specifically:

$ CC=clang CXX=clang++ make

compiled a fully working version of sage on sage1.cs, since it used
clang until gcc was built, and then it switched over to the newly
compiled gcc.

Why would it switch over to gcc?  Wouldn't this use clang for any spkg which respects the CC environment variable, regardless of the presence of SAGE_ROOT/local/bin/gcc?

--
John

Jeroen Demeyer

unread,
Feb 15, 2012, 3:16:21 AM2/15/12
to sage-...@googlegroups.com
On 2012-02-14 23:24, entropy wrote:
> woohoo! Success as well using
>
> $ CC=clang CXX=clang++ MAKE="make -j1" ./sage -f spkg/standard/
> gcc-4.6.2.spkg
>
> Successfully installed gcc-4.6.2
> Now cleaning up tmp files.
> Finished installing gcc-4.6.2.spkg (!!)

Could you do the same with SAGE_CHECK=yes please, maybe clang builds a
*broken* gcc.

Jeroen Demeyer

unread,
Feb 15, 2012, 3:24:40 AM2/15/12
to sage-...@googlegroups.com
On 2012-02-15 03:10, John H Palmieri wrote:
> Why would it switch over to gcc? Wouldn't this use clang for any spkg
> which respects the CC environment variable, regardless of the presence
> of SAGE_ROOT/local/bin/gcc?
Currently, I set up #12369 such that it always uses gcc if the GCC spkg
has been installed (it overrides CC and CXX). I did this mainly
because, once you built GCC, you would want to use it. But I also
wanted people to be able to specify a different compiler for GCC and its
prerequisites.

So:

CC=clang CXX=clang++ make

should use clang for GCC and its prerequisites and then switch to GCC
for the rest of the build.

Jeroen Demeyer

unread,
Feb 15, 2012, 3:40:34 AM2/15/12
to sage-...@googlegroups.com
On 2012-02-14 23:57, entropy wrote:
> To be clear, after gcc-4.6.2 built and installed, in
> order to restart the build process, I simply typed "make" again in the
> sage root directory. Is it necessary to modify this command if one
> restarts a build process? Or is my problem that the built process
> should be using gcc-4.6.2 throughout once gcc-4.6.2 is built?
Normally, once the GCC spkg is built, Sage should always use this newly
built gcc, no matter what. Simply "make" should work. In your case, it
doesn't, so that's a bug.

Please try, from $SAGE_ROOT:

$ source spkg/bin/sage-env
$ ls -l local/bin/gcc
$ which gcc
$ gcc --version

entropy

unread,
Feb 15, 2012, 10:02:02 AM2/15/12
to sage-devel
With SAGE_CHECK=yes it does indeed seem to build a broken gcc:

...
checking for long long... yes
checking size of long long... configure: error: in `/Users/jberwald/
src/sage-5.0.beta3-gcc/spkg/build/gcc-4.6.2/gcc-build/gcc':
configure: error: cannot compute sizeof (long long)
See `config.log' for more details.
make[2]: *** [configure-stage1-gcc] Error 77
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

real 0m18.379s
user 0m12.491s
sys 0m5.427s
************************************************************************
Error installing package gcc-4.6.2
************************************************************************

William Stein

unread,
Feb 15, 2012, 10:06:52 AM2/15/12
to sage-...@googlegroups.com
On Tue, Feb 14, 2012 at 1:55 PM, William Stein <wst...@gmail.com> wrote:
> On Tue, Feb 14, 2012 at 12:42 PM, R. Andrew Ohana
> <andrew...@gmail.com> wrote:
>> You could also try
>>
>> $ CC=clang CXX=clang++ MAKE="make -j1" ./sage -f spkg/standard/gcc-4.6.2.spkg
>>
>> One of the main points of the gcc spkg is because llvm-gcc is buggy,
>> clang should be just as able to build gcc, and doesn't suffer from the
>> same bugs as llvm-gcc does with pari and symmetrica.
>
> gcc built for me with those options.  Now I'll resume the build of Sage.

After using Andrew's instructions, building the reset of Sage...
worked fine (on my OS X 10.7 laptop)! Thanks, Andrew. This is great,
since now I assume PARI is built with full optimization instead of
-O0.

....
Build finished. The built documents can be found in
/Users/wstein/sage/install/sage-5.0.beta3-gcc/devel/sage/doc/output/html/tr/a_tour_of_sage
You have new mail in /var/mail/wstein
d-69-91-145-32:sage-5.0.beta3-gcc wstein$
You have new mail in /var/mail/wstein
d-69-91-145-32:sage-5.0.beta3-gcc wstein$
d-69-91-145-32:sage-5.0.beta3-gcc wstein$ ./sage
----------------------------------------------------------------------
| Sage Version 5.0.beta3-gcc, Release Date: 2012-02-11 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
**********************************************************************
* *
* Warning: this is a prerelease version, and it may be unstable. *
* *
**********************************************************************
sage:


William

John H Palmieri

unread,
Feb 15, 2012, 10:59:16 AM2/15/12
to sage-...@googlegroups.com
It failed.  Log: <http://sage.math.washington.edu/home/palmieri/misc/gcc-4.6.2-j1-sage-check-O0.log>.

Building with clang (but without SAGE_CHECK) worked.  I'm rebuilding now using clang and SAGE_CHECK=yes.

--
John

 

John H Palmieri

unread,
Feb 16, 2012, 1:21:40 AM2/16/12
to sage-...@googlegroups.com

This mostly worked. I skipped python's self-tests.  cvxopt failed self tests (and in fact self-tests hung for that spkg; I had to ctrl-c to quit).  Everything else installed fine.  There was one doctest failure:

   rings/polynomial/pbori.pyx

with two RuntimeErrors.

--
John

John H Palmieri

unread,
Feb 17, 2012, 12:28:49 AM2/17/12
to sage-...@googlegroups.com


On several desktop machines, which didn't have problems building Sage without using clang, using clang also worked: all self-tests (except python and cvxopt) passed, and all of Sage's tests passed.

On a laptop which failed to build without clang, using clang mostly worked, except (building either with or without SAGE_CHECK), I got this doctest failure:

**********************************************************************
File "/Applications/sage_builds/GCC-clang-no-check/sage-5.0.beta3-gcc/devel/sage-main/sage/rings/polynomial/pbori.pyx", line 120:
    sage: for f in I2.groebner_basis():
        f
Exception raised:
    Traceback (most recent call last):
      File "/Applications/sage_builds/GCC-clang-no-check/sage-5.0.beta3-gcc/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/Applications/sage_builds/GCC-clang-no-check/sage-5.0.beta3-gcc/local/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/Applications/sage_builds/GCC-clang-no-check/sage-5.0.beta3-gcc/local/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_0[12]>", line 1, in <module>
        for f in I2.groebner_basis():###line 120:
    sage: for f in I2.groebner_basis():
      File "pbori.pyx", line 4830, in sage.rings.polynomial.pbori.BooleanPolynomialIdeal.groebner_basis (sage/rings/polynomial/pbori.cpp:28081)
        sig_on()
    RuntimeError: Aborted
**********************************************************************
File "/Applications/sage_builds/GCC-clang-no-check/sage-5.0.beta3-gcc/devel/sage-main/sage/rings/polynomial/pbori.pyx", line 4817:
    sage: I.groebner_basis()
Exception raised:
    Traceback (most recent call last):
      File "/Applications/sage_builds/GCC-clang-no-check/sage-5.0.beta3-gcc/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/Applications/sage_builds/GCC-clang-no-check/sage-5.0.beta3-gcc/local/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/Applications/sage_builds/GCC-clang-no-check/sage-5.0.beta3-gcc/local/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_151[11]>", line 1, in <module>
        I.groebner_basis()###line 4817:
    sage: I.groebner_basis()
      File "pbori.pyx", line 4830, in sage.rings.polynomial.pbori.BooleanPolynomialIdeal.groebner_basis (sage/rings/polynomial/pbori.cpp:28081)
        sig_on()
    RuntimeError: Aborted

------------------------------------------------------------------------
Unhandled SIGABRT: An abort() occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug
in it and is not properly wrapped with sig_on(), sig_off(). You might
want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate.
------------------------------------------------------------------------

--
John


Jeroen Demeyer

unread,
Feb 17, 2012, 2:33:04 AM2/17/12
to sage-...@googlegroups.com
On 2012-02-17 06:28, John H Palmieri wrote:
> On several desktop machines, which didn't have problems building Sage
> without using clang, using clang also worked: all self-tests (except
> python and cvxopt) passed, and all of Sage's tests passed.
>
> On a laptop which failed to build without clang, using clang mostly
> worked, except (building either with or without SAGE_CHECK), I got this
> doctest failure:
Thanks for your report. I guess this means we should build GCC with
clang, if clang is available.

Jeroen Demeyer

unread,
Feb 17, 2012, 2:39:10 AM2/17/12
to sage-...@googlegroups.com
On 2012-02-17 06:28, John H Palmieri wrote:
> ------------------------------------------------------------------------
> Unhandled SIGABRT: An abort() occurred in Sage.
> This probably occurred because a *compiled* component of Sage has a bug
> in it and is not properly wrapped with sig_on(), sig_off(). You might
> want to run Sage under gdb with 'sage -gdb' to debug this.
> Sage will now terminate.
> ------------------------------------------------------------------------
I'm suspecting the linker for this. Try running gdb over the failing
code (maybe after recompiling the Sage library with CFLAGS="-O0 -g"
CXXFLAGS="-O0 -g").

Jeroen Demeyer

unread,
Feb 17, 2012, 2:40:26 AM2/17/12
to sage-...@googlegroups.com
On 2012-02-17 06:28, John H Palmieri wrote:
> On a laptop which failed to build without clang, using clang mostly
> worked, except (building either with or without SAGE_CHECK), I got this
> doctest failure:
On this laptop on which GCC failed to build with Apple's gcc, could you
please try to build the new updated GCC spkg:
http://boxen.math.washington.edu/home/jdemeyer/spkg/gcc-4.6.2.spkg

I changed some ./configure options. I doubt this will solve the
problem, but I would like you to try it anyway.

R. Andrew Ohana

unread,
Feb 17, 2012, 5:17:05 AM2/17/12
to sage-...@googlegroups.com
I think we should only compile using clang when xcode is version 4+.
Clang is relatively new, and I don't think that it would be wise to
rely on the older versions, especially when gcc-4.2 worked so well for
sage (at least pre gcc spkg).

Dima Pasechnik

unread,
Feb 17, 2012, 5:22:57 AM2/17/12
to sage-...@googlegroups.com

one should also try to disable laptop's power management features as
much as possible before such a build.
They can potentially interfere, and they potentailly can make
laptops run differently.

Just a thought.

Dima

Jeroen Demeyer

unread,
Feb 17, 2012, 7:42:44 AM2/17/12
to sage-...@googlegroups.com
John: concerning your laptop failure and the "clang" fix: the problem
might also be one of the *dependencies* of GCC: mpir, mpfr or mpc. So
could you try to build Sage with clang, remove GCC and then build GCC
with gcc:

(after downloading and extracting the source)
$ CC=clang make
[... hours pass ...]
$ rm local/bin/gcc local/bin/g++ spkg/standard/gcc-4.6.2.spkg
$ ./sage -f
http://boxen.math.washington.edu/home/jdemeyer/spkg/gcc-4.6.2.spkg

John H Palmieri

unread,
Feb 18, 2012, 6:12:19 PM2/18/12
to sage-...@googlegroups.com
We have another small problem with Lion. I just wiped my hard drive and reinstalled Lion (because of some non-Sage related issues). Then I reinstalled Xcode: the newly released version 4.3.  Two issues: command-line tools are no longer installed by default, so you have to install gcc, clang, etc., by running Xcode, choosing "Preferences", clicking the "Downloads" tab, and installing "Command Line Tools".  Next, there is now no longer a /Developer directory, which means that the command xcodebuild (which is run by the prereq script) may fail to report the correct version of Xcode. So from the shell, you need to run

  $ xcode-select -switch /Applications/Xcode.app/Contents/Developer

(and you may need to run this via sudo).  So these instructions need to be added to the installation guide or the README.txt file.

For the second issue, it might instead be better to figure out the version of Xcode some other way in the prereq script (and anywhere else this is done, like maybe the current python spkg).

This version of Xcode has new versions of gcc and clang, so I'm trying to compile with those to see if it makes any difference.

--
John

John H Palmieri

unread,
Feb 19, 2012, 12:53:56 AM2/19/12
to sage-...@googlegroups.com

On the plus side, on the laptop where I had problems before, Sage built and passed all doctests using the default compiler:

$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I'm going to build with SAGE_CHECK=yes to see what packages fail self-tests, but Apple seems to have fixed some of their compiler bugs in this latest release.

--
John

Jeroen Demeyer

unread,
Feb 20, 2012, 2:49:23 AM2/20/12
to sage-...@googlegroups.com
On 2012-02-19 06:53, John H Palmieri wrote:
> On the plus side, on the laptop where I had problems before, Sage built
> and passed all doctests using the default compiler:
You mean 5.0.beta4 worked or do you mean my 5.0.beta4-gcc?

John H Palmieri

unread,
Feb 20, 2012, 10:53:05 AM2/20/12
to sage-...@googlegroups.com

Your 5.0.beta4-gcc.  I should try a plain 5.0.beta4, too, I guess.

--
John
 

John H Palmieri

unread,
Feb 20, 2012, 2:47:27 PM2/20/12
to sage-...@googlegroups.com

With plain 5.0.beta4, I have the same problems as with earlier versions of Sage: pari fails self-tests, symmetrica gives a doctest failure in the Sage library, etc.  So I'm sticking to 5.0.beta4-gcc.

--
John

Jeroen Demeyer

unread,
Feb 20, 2012, 3:41:30 PM2/20/12
to sage-...@googlegroups.com
On 2012-02-20 20:47, John H Palmieri wrote:
> With plain 5.0.beta4, I have the same problems as with earlier versions
> of Sage: pari fails self-tests, symmetrica gives a doctest failure in
> the Sage library, etc.
That's not unexpected, thanks for testing!

entropy

unread,
Feb 21, 2012, 5:00:01 PM2/21/12
to sage-devel
John,

Just to confirm, did this build work for you on Lion 10.7.2, with
Xcode 4.3, and gcc version 4.2.1 (LLVM build 2336.9.00)? From you
follow-up messages I am assuming that beta4-gcc still builds a copy of
gcc-4.6 on top of everything else, correct?

I never was able to get clang to build sage on my Apple (10.7.2 with
Xcode 4.2). I was wondering if a few of you who were able to
successfully build sage on your Mac could chime in with your "uname -
a" as well as Xcode and gcc versions. I'm on

$ uname -a
Darwin hyperion 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12
18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64

with
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc.
build 5658) (LLVM build 2335.15.00)

and Xcode version 4.1.

Thanks,
Jesse

R. Andrew Ohana

unread,
Feb 21, 2012, 5:45:55 PM2/21/12
to sage-...@googlegroups.com
On Tue, Feb 21, 2012 at 14:00, entropy <jber...@gmail.com> wrote:
> John,
>
> Just to confirm, did this build work for you on Lion 10.7.2, with
> Xcode 4.3, and gcc version 4.2.1 (LLVM build 2336.9.00)? From you
> follow-up messages I am assuming that beta4-gcc still builds a copy of
> gcc-4.6 on top of everything else, correct?

Yup, this is correct.

>
> I never was able to get clang to build sage on my Apple (10.7.2 with
> Xcode 4.2).

Just to make sure, you were using the gcc version of sage, yes? There
are some components of sage that rely on gnu extensions, so currently
gcc is needed, however you should be able to build the bundled version
of gcc+deps with clang.

> I was wondering if a few of you who were able to
> successfully build sage on your Mac could chime in with your "uname -
> a" as well as Xcode and gcc versions. I'm on
>
> $ uname -a
> Darwin hyperion 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12
> 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64
>
> with
> $ gcc --version
> i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc.
> build 5658) (LLVM build 2335.15.00)
>
> and Xcode version 4.1.

Would you mind giving clang --version as well (I only tested on Xcode
4.2 and am currently testing with the freely released command line
tools that were released alongside 4.3).

John H Palmieri

unread,
Feb 21, 2012, 7:37:43 PM2/21/12
to sage-...@googlegroups.com


On Tuesday, February 21, 2012 2:00:01 PM UTC-8, entropy wrote:
John,

Just to confirm, did this build work for you on Lion 10.7.2, with
Xcode 4.3, and gcc version 4.2.1 (LLVM build 2336.9.00)?

I'm using Lion 10.7.3, not 10.7.2. I agree with the gcc version:


$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ clang --version
Apple clang version 3.1 (tags/Apple/clang-318.0.45) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix

$ uname -a
Darwin Macintosh-001b639d44a1.local 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64

(I get the same output, except for the machine name, on a desktop machine and on a laptop. For building sage-5.0.beta4-gcc.tar, with the previous version of Xcode, the desktop worked with either the default compiler or with clang, while with the laptop, I was only able to build using CC=clang and CXX=clang++.)
 
From you
follow-up messages I am assuming that beta4-gcc still builds a copy of
gcc-4.6 on top of everything else, correct?

Yes, absolutely.


I never was able to get clang to build sage on my Apple (10.7.2 with
Xcode 4.2). I was wondering if a few of you who were able to
successfully build sage on your Mac could chime in with your "uname -
a" as well as Xcode and gcc versions. I'm on

With the same sage-5.0.beta4-gcc tarball, using CC=clang and CXX=clang++, gcc built just fine, and then it was used to build everything else.  I haven't had luck building a plain sage-5.0.beta4 tarball.

--
John

Jeroen Demeyer

unread,
Feb 22, 2012, 10:55:32 AM2/22/12
to sage-...@googlegroups.com
On 2012-02-19 00:12, John H Palmieri wrote:
> Next, there is now no longer a /Developer directory, which means that
> the command xcodebuild (which is run by the prereq script) may fail to
> report the correct version of Xcode. So from the shell, you need to run
>
> $ xcode-select -switch /Applications/Xcode.app/Contents/Developer
>
> (and you may need to run this via sudo). So these instructions need to
> be added to the installation guide or the README.txt file.
>
> For the second issue, it might instead be better to figure out the
> version of Xcode some other way in the prereq script (and anywhere else
> this is done, like maybe the current python spkg).

xcodebuild is used in:
* prereq (where it fails harmlessly)
* python's spkg-install
* Mercurial's setup.py (upstream)
* the sage-bdist script

(Sage tip: use the rsyncable tarballs to grep all of Sage, including
spkgs. Remember to create the top-level sage-VERSION directory yourself
and extract inside that.)

R. Andrew Ohana

unread,
Feb 22, 2012, 12:42:23 PM2/22/12
to sage-...@googlegroups.com
On Wed, Feb 22, 2012 at 07:55, Jeroen Demeyer <jdem...@cage.ugent.be> wrote:
> On 2012-02-19 00:12, John H Palmieri wrote:
>> Next, there is now no longer a /Developer directory, which means that
>> the command xcodebuild (which is run by the prereq script) may fail to
>> report the correct version of Xcode. So from the shell, you need to run
>>
>>   $ xcode-select -switch /Applications/Xcode.app/Contents/Developer
>>
>> (and you may need to run this via sudo).  So these instructions need to
>> be added to the installation guide or the README.txt file.
>>
>> For the second issue, it might instead be better to figure out the
>> version of Xcode some other way in the prereq script (and anywhere else
>> this is done, like maybe the current python spkg).
>
> xcodebuild is used in:
> * prereq (where it fails harmlessly)
> * python's spkg-install
> * Mercurial's setup.py (upstream)
> * the sage-bdist script

It would be good to remove xcodebuild's usage since all lion machines
(and maybe earlier too) have the command, even without xcode
installed. This has become important now that the apple command line
tools are separate from xcode.

Try building on sqrt5 -- xcode is not installed there, instead I've
installed the command line tools from apple's developer website.


>
> (Sage tip: use the rsyncable tarballs to grep all of Sage, including
> spkgs.  Remember to create the top-level sage-VERSION directory yourself
> and extract inside that.)
>

Reply all
Reply to author
Forward
0 new messages