XCode 4

66 views
Skip to first unread message

Jason Grout

unread,
Mar 21, 2011, 9:40:06 PM3/21/11
to sage-...@googlegroups.com

Has anyone compiled Sage with the new XCode 4 on OSX? If so, do long
tests pass?

Just checking before trying to upgrade...

Thanks,

Jason

kcrisman

unread,
Mar 21, 2011, 10:58:33 PM3/21/11
to sage-devel
I only have the option to upgrade to 3.2.6 right now from Software
Update, so it must be app-store only.

I can see this update potentially causing problems for the OS X App,
if I understand the announcement correctly as being a major change in
how things are built. I would strongly suggest testing that.

Also, I think you can have more than one XCode at a time, right?

Jason Grout

unread,
Mar 21, 2011, 11:20:47 PM3/21/11
to sage-...@googlegroups.com
On 3/21/11 9:58 PM, kcrisman wrote:
> I only have the option to upgrade to 3.2.6 right now from Software
> Update, so it must be app-store only.


Yes, app store, and $4.99 or something like that to boot. Though it's
free if you already pay for their developer or iOS memberships.


>
> I can see this update potentially causing problems for the OS X App,
> if I understand the announcement correctly as being a major change in
> how things are built. I would strongly suggest testing that.
>
> Also, I think you can have more than one XCode at a time, right?
>

I don't know.

Jason

Dima Pasechnik

unread,
Mar 22, 2011, 7:43:52 AM3/22/11
to sage-devel
I tried to get Xcode 4 from the local Apps Store, and got
"The item you've requested is not currently available in the Singapore
Store."
Given that I read on the net about people actually buying it from this
store,
this is fishy...

(Xcode 3 gets moved to /Applications/Developer-old/ when one installs
Xcode 4, they say)

Dima Pasechnik

unread,
Mar 22, 2011, 9:12:59 PM3/22/11
to sage-devel


On Mar 22, 7:43 pm, Dima Pasechnik <dimp...@gmail.com> wrote:
> I tried to get Xcode 4 from the local Apps Store, and got
> "The item you've requested is not currently available in the Singapore
> Store."
> Given that I read on the net about people actually buying it from this
> store,
> this is fishy...

I filed a case with Apple Store support, and got a reply that
"blah blah blah, Apple constantly works with its content providers to
expand the iTunes Store's catalog."

I couldn't resist replying:
"Xcode is an Apple's own application!
Should Apple work more with Apple, is this what you are saying?"

Corporate screw-ups might sometimes can be amusing...

William Stein

unread,
Apr 27, 2011, 4:28:17 PM4/27/11
to sage-...@googlegroups.com, Alyson Deines
Hi,

Aly Deines showed me what happened when she installed Xcode 4 then
built Sage. She build Sage-4.7.rc0 itself, and it compiled fine.
However, when she ran it, it crashed on startup. The traceback
implicates Pynac:

(gdb)
#0 0x0000000107a20c64 in PyInt_FromLong (ival=-5) at Objects/intobject.c:91
#1 0x00000001079971fa in GiNaC::Number_T::Number_T ()
#2 0x0000000107997280 in GiNaC::numeric::numeric ()
#3 0x00000001079e7bea in GiNaC::library_init::library_init ()
#4 0x00000001078708f8 in __static_initialization_and_destruction_0 ()
#5 0x00007fff5fc0d500 in
__dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE
()
#6 0x00007fff5fc0bcec in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj
()
#7 0x00007fff5fc0bc9d in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj
()
#8 0x00007fff5fc0bda6 in
__dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE ()
#9 0x00007fff5fc08fbb in __dyld_dlopen ()
#10 0x00007fff86ad2360 in dlopen ()
#11 0x00000001000e88af in _PyImport_GetDynLoadFunc ()
#12 0x00000001000d2e04 in _PyImport_LoadDynamicModule ()
#13 0x00000001000d10df in import_submodule ()


Note that Ipython alone and python alone both start fine.

I should buy and install XCode4 on bsd.math.washington.edu, so it is
easier for people to debug this problem.

-- William

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

David Kirkby

unread,
Apr 27, 2011, 5:32:58 PM4/27/11
to sage-...@googlegroups.com
On 27 April 2011 21:28, William Stein <wst...@gmail.com> wrote:
> Hi,
>
> Aly Deines showed me what happened when she installed Xcode 4 then
> built Sage.  She build Sage-4.7.rc0 itself, and it compiled fine.
> However, when she ran it, it crashed on startup.   The traceback
> implicates Pynac:

Could this be related to

http://trac.sagemath.org/sage_trac/ticket/11116

?

Solving that bug would be very nice, as it basically stops any further
progress on a 64-bit Solaris port whilst Pynac is crashing.

Dave

Francois Bissey

unread,
Apr 27, 2011, 5:40:11 PM4/27/11
to sage-...@googlegroups.com

I thought about it too but the backtrace appears to be quite different.
Off course we cannot dismiss that solving #11116 won't have other
side effects. We alraedy know #11116 can happen on linux too.

Francois

This email may be confidential and subject to legal privilege, it may
not reflect the views of the University of Canterbury, and it is not
guaranteed to be virus free. If you are not an intended recipient,
please notify the sender immediately and erase all copies of the message
and any attachments.

Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more
information.

Dima Pasechnik

unread,
Apr 27, 2011, 11:28:41 PM4/27/11
to sage-devel
Hi,

I tried XCode 4 and came to conclusion that it is buggy as hell
- I can't build working Sage (due to startup-time segfaults, as
described here),
I can't even build a working copy of MPIR, etc etc...

Even worse is behaviour with its clang compilers (they can't even
compile several parts of Sage)

So I reverted back to Xcode 3.
(I should have added this to Wiki, but I lost my password, it
seems :-))

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

William Stein

unread,
Apr 30, 2011, 12:54:22 AM4/30/11
to sage-...@googlegroups.com, Alyson Deines
On Wed, Apr 27, 2011 at 8:28 PM, Dima Pasechnik <dim...@gmail.com> wrote:
> Hi,
>
> I tried XCode 4 and came to conclusion that it is buggy as hell
> - I can't build working Sage (due to startup-time segfaults, as
> described here),
> I can't even build a working copy of MPIR, etc etc...
>
> Even worse is behaviour with its clang compilers (they can't even
> compile several parts of Sage)

Wow, that's incredible!

We should:

(1) add a remark right in the prereq spkg that checks that xcode 4
isn't being used (unless SAGE_PORT or something is set)

(2) if xcode 4 is being used (as detected by 1), the error message
should suggest xcode 3, and explain how to revert to it. (Is it easy
still?)

-- William

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

Dima Pasechnik

unread,
Apr 30, 2011, 11:27:02 AM4/30/11
to sage-devel
On Apr 30, 12:54 pm, William Stein <wst...@gmail.com> wrote:
> On Wed, Apr 27, 2011 at 8:28 PM, Dima Pasechnik <dimp...@gmail.com> wrote:
> > Hi,
>
> > I tried XCode 4 and came to conclusion that it is buggy as hell
> > - I can't build working Sage (due to startup-time segfaults, as
> > described here),
> > I can't even build a working copy of MPIR, etc etc...
>
> > Even worse is behaviour with its clang compilers (they can't even
> > compile several parts of Sage)
>
> Wow, that's incredible!
>
> We should:
>
>    (1) add a remark right in the prereq spkg that checks that xcode 4 (4.0.1, to be precise)
> isn't being used (unless SAGE_PORT or something is set)

In fact, I don't know how to check this easily: it ships the same
build of gcc as XCode 3 (3.2.6, to be precise)
(gcc version 4.2.1 (Apple Inc. build 5666) (dot 3))
and there is no ready way to check the version of the whole setup.
The difference sits in libraries.
One notable difference is that cc is not gcc, but a gcc-llvm build.
(namely, gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM
build 2335.6)))

So one can test that "cc -v" != "gcc -v", but this does nor seem to be
robust enough.

Probably one can use Applescript, but I have no clue about it.

>
>    (2) if xcode 4 is being used (as detected by 1), the error message
> should suggest xcode 3, and explain how to revert to it.   (Is it easy
> still?)

To revert back, I tried xcode-select, and it didn't quite work, as
Xcode 4 overwrites /usr/* with new stuff, and probably something
didn't work as expected.
I ended up re-installing XCode 3 in the usual way.
(and then I removed XCode 4 to save space, so I can't easily check
things any more :-( )

Dima

Dima Pasechnik

unread,
Apr 30, 2011, 11:59:51 AM4/30/11
to sage-devel
I edited
http://wiki.sagemath.org/SupportedPlatforms
to reflect the status of XCode 4.

Dr. David Kirkby

unread,
Apr 30, 2011, 12:13:56 PM4/30/11
to sage-...@googlegroups.com
On 04/30/11 04:27 PM, Dima Pasechnik wrote:
> On Apr 30, 12:54 pm, William Stein<wst...@gmail.com> wrote:

>>> Even worse is behaviour with its clang compilers (they can't even
>>> compile several parts of Sage)
>>
>> Wow, that's incredible!
>>
>> We should:
>>
>> (1) add a remark right in the prereq spkg that checks that xcode 4 (4.0.1, to be precise)
>> isn't being used (unless SAGE_PORT or something is set)
>
> In fact, I don't know how to check this easily: it ships the same
> build of gcc as XCode 3 (3.2.6, to be precise)
> (gcc version 4.2.1 (Apple Inc. build 5666) (dot 3))
> and there is no ready way to check the version of the whole setup.
> The difference sits in libraries.
> One notable difference is that cc is not gcc, but a gcc-llvm build.
> (namely, gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM
> build 2335.6)))
>
> So one can test that "cc -v" != "gcc -v", but this does nor seem to be
> robust enough.
>
> Probably one can use Applescript, but I have no clue about it.


Can you post the output of these two commands.

$ gcc -dM -E -xc /dev/null
$ cc -dM -E -xc /dev/null

It might help if you sorted them

to find the differences. i.e.

$ gcc -dM -E -xc /dev/null | sort > a
$ cc -dM -E -xc /dev/null | sort > b
$ diff a b

You might find there's something in there which can differentiate them. If there
is, we can add a specific test to the scripts $SAGE_LOCAL/bin/testcc.sh and
$SAGE_LOCAL/bin/testcxx.sh. Currently those scripts report one of

* GCC
* Sun_Studio
* HP_on_Tru64
* HP_on_HP-UX
* IBM_on_AIX
* HP_on_Alpha_Linux
* Unknown


Currently the scripts check if __GNUC__ is defined and if so its considered gcc
or a gcc-like compiler (e.g. Intel's icc). But if there's a need to
differentiate Clang, I'd be very surprised if there was not something we can use.

Dave

amaseam

unread,
May 1, 2011, 9:03:08 PM5/1/11
to sage-...@googlegroups.com
2011/4/30 Dima Pasechnik <dim...@gmail.com>:

> On Apr 30, 12:54 pm, William Stein <wst...@gmail.com> wrote:
>> On Wed, Apr 27, 2011 at 8:28 PM, Dima Pasechnik <dimp...@gmail.com> wrote:
>> > Hi,
>>
>> > I tried XCode 4 and came to conclusion that it is buggy as hell
>> > - I can't build working Sage (due to startup-time segfaults, as
>> > described here),
>> > I can't even build a working copy of MPIR, etc etc...
>>
>> > Even worse is behaviour with its clang compilers (they can't even
>> > compile several parts of Sage)
>>
>> Wow, that's incredible!
>>
>> We should:
>>
>>    (1) add a remark right in the prereq spkg that checks that xcode 4 (4.0.1, to be precise)
>> isn't being used (unless SAGE_PORT or something is set)
>
> In fact, I don't know how to check this easily: it ships the same
> build of gcc as XCode 3 (3.2.6, to be precise)
> (gcc version 4.2.1 (Apple Inc. build 5666) (dot 3))
> and there is no ready way to check the version of the whole setup.
> The difference sits in libraries.

$ xcodebuild -version
Xcode 3.1.4
Component versions: DevToolsCore-1204.0; DevToolsSupport-1186.0
BuildVersion: 9M2809

Dima Pasechnik

unread,
May 1, 2011, 11:23:07 PM5/1/11
to sage-devel


On May 2, 9:03 am, amaseam <amas...@gmail.com> wrote:
> 2011/4/30 Dima Pasechnik <dimp...@gmail.com>:
excellent! That's certainly can be used.

Dima Pasechnik

unread,
May 2, 2011, 2:28:43 AM5/2/11
to sage-devel
This is now trac #11280
Reply all
Reply to author
Forward
0 new messages