sage 6.6: error building r

209 views
Skip to first unread message

Buck Evan

unread,
Apr 15, 2015, 10:46:31 AM4/15/15
to sage-s...@googlegroups.com
I'm trying to build sage from source.
I've installed lots of things, including gcc, but I've gotten stuck while building R.
It's erroring out in /usr/bin/cc (which it chose as the objective-c compiler):


  1. In file included from /usr/include/Availability.h:153:0,
  2. from /usr/include/stdlib.h:61,
  3. from ../../../../include/R.h:28,
  4. from qdBitmap.h:23,
  5. from qdBitmap.c:27:
  6. /System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:486:41: error: expected ',' or '}' before '__attribute__'
  7. kFSEventStreamEventFlagItemIsHardlink __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_9_0) = 0x00100000,
  8. ^


Full details are here:

Jeroen Demeyer

unread,
Apr 15, 2015, 10:58:42 AM4/15/15
to sage-s...@googlegroups.com
On 2015-04-15 16:46, Buck Evan wrote:
> Full details are here:
> http://paste.pound-python.org/show/9mou1V2L8kJPOg3ztHcb/
I can't help with this problem, but as a general rule, it's much easier
to debug a build with "make -j1".

Buck Evan

unread,
Apr 15, 2015, 11:15:03 AM4/15/15
to sage-s...@googlegroups.com
Here's the same error under -j1, in case it helps:

Buck Evan

unread,
Apr 15, 2015, 11:18:19 AM4/15/15
to sage-s...@googlegroups.com
I may have gotten confused by the interleaved compiler messages, as Jeroen suspected.

Below is the real error. It's not related to /usr/bin/cc; it's using gcc.
Is this another case of objective-c syntax leaking into the C headers?


  1. gcc -std=gnu99 -I../../../../include -DNDEBUG -I../../../include -I../../../../src/include -DHAVE_CONFIG_H -I../../../../src/extra/zlib -fPIC -g -O2 -c devQuartz.c -o devQuartz.o
  1. In file included from /usr/include/Availability.h:153:0,
  1. from /usr/include/stdio.h:65,
  2. from ../../../../include/Rinternals.h:37,
  3. from ../../../include/Defn.h:80,
  4. from devQuartz.c:30:
  1. /System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:486:41: error: expected ',' or '}' before '__attribute__'
  2. kFSEventStreamEventFlagItemIsHardlink __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_9_0) = 0x00100000,

Volker Braun

unread,
Apr 15, 2015, 11:18:47 AM4/15/15
to sage-s...@googlegroups.com
It picks up homebrew stuff and breaks. Remove homebrew from your PATH  (and/or other environment variables) and try again

Justin C. Walker

unread,
Apr 15, 2015, 4:20:27 PM4/15/15
to sage-s...@googlegroups.com

On Apr 15, 2015, at 08:18 , Volker Braun wrote:

> It picks up homebrew stuff and breaks. Remove homebrew from your PATH
> (and/or other environment variables) and try again

FWIW, I see the same issue on OS X, 10.10.3, with Xcode 6.1 and possibly updated command-line tools. On that system I don't have homebrew or other installs to muddy the water.

Justin

>
> On Wednesday, April 15, 2015 at 5:15:03 PM UTC+2, Buck Evan wrote:
>>
>> Here's the same error under -j1, in case it helps:
>> http://paste.pound-python.org/show/CSFQbBf722doPeyrXxJi/
>>
>>
>> On Wednesday, April 15, 2015 at 10:58:42 AM UTC-4, Jeroen Demeyer wrote:
>>>
>>> On 2015-04-15 16:46, Buck Evan wrote:
>>>> Full details are here:
>>>> http://paste.pound-python.org/show/9mou1V2L8kJPOg3ztHcb/
>>> I can't help with this problem, but as a general rule, it's much easier
>>> to debug a build with "make -j1".
>>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To post to this group, send email to sage-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

--
Justin C. Walker
Curmudgeon-at-large
Director
Institute for the Absorption of Federal Funds
----
186,000 Miles per Second
Not just a good idea:
it's the law!
----

Volker Braun

unread,
Apr 15, 2015, 4:29:11 PM4/15/15
to sage-s...@googlegroups.com
Whats the output of gcc --version (the Xcode one?)

Justin C. Walker

unread,
Apr 15, 2015, 5:25:54 PM4/15/15
to sage-s...@googlegroups.com

On Apr 15, 2015, at 13:29 , Volker Braun wrote:

> Whats the output of gcc --version (the Xcode one?)

% gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix

--
Justin C. Walker, Curmudgeon at Large
Institute for the Absorption of Federal Funds
-----------
Like the ski resort full of girls hunting for husbands
and husbands hunting for girls, the situation is not
as symmetrical as it might seem.
- Alan MacKay
--

Buck Evan

unread,
Apr 15, 2015, 5:57:42 PM4/15/15
to sage-s...@googlegroups.com
I removed homebrew from all environment variables, with no change in behavior.

Han Xiao

unread,
Apr 16, 2015, 9:35:21 PM4/16/15
to sage-s...@googlegroups.com
I had the same problem while I was trying upgrading my Sage from 6.4.1 to 6.6. I'm using OS X 10.10.3 and I do have homebrew installed. I really hope this problem could be solved. 

David Einstein

unread,
Apr 22, 2015, 5:35:54 PM4/22/15
to sage-s...@googlegroups.com
I too am having this problem.  I recently upgraded Xcode to 6.3.1 and am running OSX 10.10.3.   I have homebrew, but have removed it and all the /usr/local stuff from my environment. Also I am using the sage built gcc (I set SAGE_INSTALL_GCC=yes), which should (in theory) moot the homebrew issue.

If I cd into the directory

sage/local/var/tmp/sage/build/r-3.1.2.p0/src/src/library/grDevices

and go into the sage shell, and do

gcc -std=gnu99 -I../../../../include -DNDEBUG -I../../../include -I../../../../src/include -DHAVE_CONFIG_H -I../../../../src/extra/zlib     -fPIC  -g -O2   -c devQuartz.c -o devQuartz.o

I get the same result (not surprisingly, but somewhat reassuring)

However, if I do

/usr/bin/gcc -std=gnu99 -I../../../../include -DNDEBUG -I../../../include -I../../../../src/include -DHAVE_CONFIG_H -I../../../../src/extra/zlib     -fPIC  -g -O2   -c devQuartz.c -o devQuartz.o

(using the system compiler instead of the sage built compiler) it compiles.  Unfortunately, this does not help the big picture, as I am loath to compile R with a different compiler than everything else.

Justin C. Walker

unread,
Apr 22, 2015, 7:15:08 PM4/22/15
to sage-s...@googlegroups.com

On Apr 22, 2015, at 14:35 , David Einstein wrote:

> I too am having this problem. I recently upgraded Xcode to 6.3.1 and am
> running OSX 10.10.3. I have homebrew, but have removed it and all the
> /usr/local stuff from my environment. Also I am using the sage built gcc (I
> set SAGE_INSTALL_GCC=yes), which should (in theory) moot the homebrew issue.
>
> If I cd into the directory
>
> sage/local/var/tmp/sage/build/r-3.1.2.p0/src/src/library/grDevices

...grDevices/src??

> and go into the sage shell, and do
[snip]
> However, if I do
>
> /usr/bin/gcc -std=gnu99 -I../../../../include -DNDEBUG -I../../../include
> -I../../../../src/include -DHAVE_CONFIG_H -I../../../../src/extra/zlib
> -fPIC -g -O2 -c devQuartz.c -o devQuartz.o
>
> (using the system compiler instead of the sage built compiler) it compiles.
> Unfortunately, this does not help the big picture, as I am loath to
> compile R with a different compiler than everything else.

I see the same thing (but with the 6.3 command-line tools).

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds
--------
Men are from Earth.
Women are from Earth.
Deal with it.
--------



David Einstein

unread,
Apr 22, 2015, 7:15:57 PM4/22/15
to sage-s...@googlegroups.com
This is data, not advice, it likely leads to dogs and cats living together, ... mass hysteria.

I changed the R spkg-install to add 

CC=/usr/bin/gcc

and sage built and seems to work. 

Something strange seems to be happening with the builtin gcc and the OSX system frameworks.

Volker Braun

unread,
Apr 22, 2015, 7:39:09 PM4/22/15
to sage-s...@googlegroups.com
Can everybody who has issues with this open a bug on Apple's bug tracker: https://bugreport.apple.com

They won't tell you anything useful but the more people complain the more likely is this to be fixed in a future Xcode version...

Buck Evan

unread,
Apr 26, 2015, 1:04:11 PM4/26/15
to sage-s...@googlegroups.com
This is the text of my bug report, in case anyone would rather copy paste.
This was filed at https://bugreport.apple.com/ under "OSX SDK".

---

Summary:
Under GNU gcc, there's a syntax error in ApplicationServices.h if $MACOSX_DEPLOYMENT_TARGET has any value less than 10.10.

Steps to Reproduce:
```
$ echo '#include <ApplicationServices/ApplicationServices.h>' | MACOSX_DEPLOYMENT_TARGET=10.10 gcc -c -xc -
(it works, no output)

$ echo '#include <ApplicationServices/ApplicationServices.h>' | MACOSX_DEPLOYMENT_TARGET=10.9 gcc -c -xc -
In file included from /usr/include/Availability.h:153:0,
from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:19,
from <stdin>:1:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:486:41: error: expected ',' or '}' before '__attribute__'
kFSEventStreamEventFlagItemIsHardlink __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_9_0) = 0x00100000,
^
```

This is related to the fact that clang supports "enumeration attributes" but GNU gcc does not.
http://clang.llvm.org/docs/LanguageExtensions.html#attributes-on-enumerators
https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax

The dev forums suggest that "It looks like the macros in Availability.h need an "ENUM" variant (like we have for the CF and NS availability macros) to cover this case."
https://devforums.apple.com/message/1128923#1128923

Expected Results:
successful compilation

Actual Results:
compilation fails with a syntax error

Version:
osx 10.10.3 (14D131)
xcode Version 6.2 (6C131e)
gcc --version: gcc (GCC) 4.9.2

Notes:
Downstream ticket: http://trac.sagemath.org/ticket/18254
Reply all
Reply to author
Forward
0 new messages