Opened 6 years ago
Closed 6 years ago
#18254 closed defect (fixed)
osx R spkg error: expected ',' or '}' before '__attribute__'
Reported by: | buck | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.7 |
Component: | packages: standard | Keywords: | |
Cc: | vbraun | Merged in: | |
Authors: | Buck Evan | Reviewers: | John Palmieri, Volker Braun |
Report Upstream: | N/A | Work issues: | |
Branch: | 3c5cd0f (Commits, GitHub, GitLab) | Commit: | 3c5cd0f74446992a2b98f84c34043cfa181b68b4 |
Dependencies: | Stopgaps: |
Description
The sage-support discussion is here: https://groups.google.com/forum/#!topic/sage-support/9m5N0KUqkWo
I'm on OS X 10.10.3. I've removed homebrew from any part of the build. I've updated sage to the develop branch.
The error still persists: (full output)
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 In file included from /usr/include/Availability.h:153:0, from /usr/include/stdio.h:65, from ../../../../include/Rinternals.h:37, from ../../../include/Defn.h:80, from devQuartz.c:30: /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,
I suspect this needs another patch to fix up inappropriate objective-c in the C code, similar to what was done for dispatch/object.h, but I might be off base.
Attachments (3)
Change History (69)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
Those are warnings, not errors. The buildbot log shows the same warnings ( http://build.sagedev.org/release/builders/%20%20fast%20Volker%20MiniMac%20%28OSX%2010.10%20x86_64%29%20full/builds/42/steps/compile_1/logs/r-project). Do you have -Werror
or something like that in CFLAGS/CXXFLAGS/...? This looks like a problem with your environment variables.
comment:3 Changed 6 years ago by
@vbraun: I showed all my environment above:
$ env PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin PWD=/Users/buck/trees/mine/sage HOME=/Users/buck SHLVL=1 _=/usr/bin/env
There's definitely an error:
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 In file included from /usr/include/Availability.h:153:0, from /usr/include/stdio.h:65, from ../../../../include/Rinternals.h:37, from ../../../include/Defn.h:80, from devQuartz.c:30: /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, ^ ... Error installing package r-3.1.2.p0
comment:4 Changed 6 years ago by
The error I've pointed out does not show in your buildbot log.
comment:5 Changed 6 years ago by
On osx 10.10, __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_9_0)
expands to __attribute__((availability(macosx,introduced=10.10)))
, which helps explain the error message..
I expect the difference is that your buildbot is not 10.10.
comment:6 Changed 6 years ago by
I'm guessing that this has to do with Xcode, and in particular the fact that its most recent version is broken.
comment:7 Changed 6 years ago by
Sage sets MACOSX_DEPLOYMENT_TARGET=10.9
on 10.10 to work around Apple's broken toolchain so the conditional should be false. Though the error is about what is before the __OSX_AVAILABLE_STARTING
. What are the relevant lines in your Availability.h?
I thought we had established that he is using Xcode < 6.3 on the mailinglist? With Xcode 6.3 he should't have gotten this far, the compilation pretty much dies immediately.
comment:8 Changed 6 years ago by
PS: The buildbot most certainly is on OSX 10.10.3
comment:9 Changed 6 years ago by
On a machine on which I upgraded Xcode, I run into the same problem, and that machine built Sage fine before the upgrade.
comment:10 Changed 6 years ago by
Here's the gcc version you asked for:
$ which gcc /usr/bin/gcc $ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix
The XCode GUI reports "Version 6.3 (6D570)".
comment:11 Changed 6 years ago by
I've attached the entire files just in case I've gotten it wrong, but I believe these are the relevant lines.
Availability.h:
162 #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 163 #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_osx
5513 #define __AVAILABILITY_INTERNAL__MAC_10_10 __attribute__((availability(macosx,introduced=10.10)))
comment:12 Changed 6 years ago by
- Milestone changed from sage-6.7 to sage-duplicate/invalid/wontfix
Xcode 6.3 isn't going to work (#18156). Propose to close as duplicate.
comment:13 Changed 6 years ago by
- Status changed from new to needs_review
comment:14 Changed 6 years ago by
While both these issues may be caused by xcode-6.3, they look like separate bugs, separate pieces of work to me.
I upgraded my Xcode at the recommendation of one of the guys at sage days :( Shall I downgrade to 6.2?
comment:15 Changed 6 years ago by
yes, downgrade to 6.2
comment:16 Changed 6 years ago by
I've downgraded to 6.2, with no change in behavior D:
$ gcc --version 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.57) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix
The GUI reports "Version 6.2 (6C131e)".
The error looks exactly the same to me, but here it is, for completeness:
$ ./src/bin/sage-spkg Found local metadata for r-3.1.2.p0 Found local sources at /Users/buck/trees/mine/sage/upstream/r-3.1.2.tar.gz Checksum: 93809368e5735a630611633ac1fa99010020c5d6 vs 93809368e5735a630611633ac1fa99010020c5d6 r-3.1.2.p0 ==================================================== Setting up build directory for r-3.1.2.p0 Finished set up **************************************************** Host system: Darwin MacBookPro-7831C1F266DE.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64 **************************************************** C compiler: gcc C compiler version: Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/Users/buck/trees/mine/sage/local/libexec/gcc/x86_64-apple-darwin14.3.0/4.9.2/lto-wrapper Target: x86_64-apple-darwin14.3.0 Configured with: ../src/configure --prefix=/Users/buck/trees/mine/sage/local --with-local-prefix=/Users/buck/trees/mine/sage/local --with-gmp=/Users /buck/trees/mine/sage/local --with-mpfr=/Users/buck/trees/mine/sage/local --with-mpc=/Users/buck/trees/mine/sage/local --with-system-zlib --disable- multilib --disable-nls --enable-languages=c,c++,fortran --disable-libitm --without-isl --without-cloog Thread model: posix gcc version 4.9.2 (GCC) **************************************************** Copying fake java and javac compiler on OS X Configuring R without ATLAS for OS X patching file src/scripts/R.sh.in patching file configure <snip> 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 In file included from /usr/include/Availability.h:153:0, from /usr/include/stdio.h:65, from ../../../../include/Rinternals.h:37, from ../../../include/Defn.h:80, from devQuartz.c:30: /System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:486:41: error: expected ',' or '}' before '__attr ibute__' kFSEventStreamEventFlagItemIsHardlink __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_9_0) = 0x00100000, ^ <snip>
comment:17 Changed 6 years ago by
Did you compile from scratch (make distclean && make)?
comment:18 Changed 6 years ago by
I know you weren't asking me, but a further data point: I did not compile from scratch. On one machine, I had updated to OS X 10.10.3 and the most recent Xcode, and I got this error. On a second machine, I just updated to OS X 10.10.3 but did not update Xcode, and I was able to install R (with sage -f r
) successfully. Now on that same machine I'm also trying a build from scratch, but from the experiments so far, it really looks like a manifestation of a problem with the most recent Xcode.
Note that I have not yet tried upgrading Xcode and then downgrading it.
comment:19 Changed 6 years ago by
I've made distclean, and still get the same dang behavior D:
Found local metadata for r-3.1.2.p0 Found local sources at /Users/buck/trees/mine/sage/upstream/r-3.1.2.tar.gz Checksum: 93809368e5735a630611633ac1fa99010020c5d6 vs 93809368e5735a630611633ac1fa99010020c5d6 r-3.1.2.p0 ==================================================== Setting up build directory for r-3.1.2.p0 Finished set up **************************************************** Host system: Darwin 140-sfoeng50-54.clients.corp.yelpcorp.com 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~ 5/RELEASE_X86_64 x86_64 **************************************************** C compiler: gcc C compiler version: Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/Users/buck/trees/mine/sage/local/libexec/gcc/x86_64-apple-darwin14.3.0/4.9.2/lto-wrapper Target: x86_64-apple-darwin14.3.0 Configured with: ../src/configure --prefix=/Users/buck/trees/mine/sage/local --with-local-prefix=/Users/buck/trees/mine/sage/local --wit h-gmp=/Users/buck/trees/mine/sage/local --with-mpfr=/Users/buck/trees/mine/sage/local --with-mpc=/Users/buck/trees/mine/sage/local --wit h-system-zlib --disable-multilib --disable-nls --enable-languages=c,c++,fortran --disable-libitm --without-isl --without-cloog Thread model: posix gcc version 4.9.2 (GCC) **************************************************** Copying fake java and javac compiler on OS X Configuring R without ATLAS for OS X <snip> 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 In file included from /usr/include/Availability.h:153:0, from /usr/include/stdio.h:65, from ../../../../include/Rinternals.h:37, from ../../../include/Defn.h:80, from devQuartz.c:30: /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,
comment:20 Changed 6 years ago by
Whereas I downloaded a fresh 6.7.beta1 tarball and built it successfully on the machine running OS X 10.10.3 and Xcode 6.2. On another machine on which I've installed Xcode 6.3, I may try downgrading that to see if I can build there.
comment:21 follow-up: ↓ 23 Changed 6 years ago by
I asked gcc for an expansion of the file in question and got this:
# 309 "/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h" 3 enum { kFSEventStreamEventFlagNone = 0x00000000, # 330 "/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h" 3 kFSEventStreamEventFlagMustScanSubDirs = 0x00000001, # 345 "/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h" 3 kFSEventStreamEventFlagUserDropped = 0x00000002, <snip> kFSEventStreamEventFlagItemIsSymlink = 0x00040000, kFSEventStreamEventFlagOwnEvent = 0x00080000, kFSEventStreamEventFlagItemIsHardlink __attribute__((weak_import)) = 0x00100000, kFSEventStreamEventFlagItemIsLastHardlink __attribute__((weak_import)) = 0x00200000, };
@jhpalmieri Show me what you get for this command?
gcc -E /System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h | grep kFSEventStreamEventFlagNone -B20 -A150 | grep -v '^$' | sed -n '/enum {/,/}/p'
comment:22 Changed 6 years ago by
Unsetting MACOSX_DEPLOYMENT_TARGET
makes the .o file build fine...
Reproduction procedure:
cd 'local/var/tmp/sage/build/r-3.1.2.p0' && '../../../../../../sage' --sh cd src/src/library/grDevices/src 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 #syntax error explosion env | grep MACOSX #MACOSX_DEPLOYMENT_TARGET=10.9 unset MACOSX_DEPLOYMENT_TARGET env | grep MACOSX #no output 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 #several warnings, but no error
comment:23 in reply to: ↑ 21 ; follow-up: ↓ 24 Changed 6 years ago by
Replying to buck:
@jhpalmieri Show me what you get for this command?
gcc -E /System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h | grep kFSEventStreamEventFlagNone -B20 -A150 | grep -v '^$' | sed -n '/enum {/,/}/p'
enum { kFSEventStreamEventFlagNone = 0x00000000, # 330 "/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h" kFSEventStreamEventFlagMustScanSubDirs = 0x00000001, # 345 "/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h" kFSEventStreamEventFlagUserDropped = 0x00000002, kFSEventStreamEventFlagKernelDropped = 0x00000004, kFSEventStreamEventFlagEventIdsWrapped = 0x00000008, # 367 "/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h" kFSEventStreamEventFlagHistoryDone = 0x00000010, # 380 "/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h" kFSEventStreamEventFlagRootChanged = 0x00000020, # 395 "/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h" kFSEventStreamEventFlagMount = 0x00000040, # 408 "/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h" kFSEventStreamEventFlagUnmount = 0x00000080, kFSEventStreamEventFlagItemCreated __attribute__((availability(macosx,introduced=10.7))) = 0x00000100, kFSEventStreamEventFlagItemRemoved __attribute__((availability(macosx,introduced=10.7))) = 0x00000200, kFSEventStreamEventFlagItemInodeMetaMod __attribute__((availability(macosx,introduced=10.7))) = 0x00000400, kFSEventStreamEventFlagItemRenamed __attribute__((availability(macosx,introduced=10.7))) = 0x00000800, kFSEventStreamEventFlagItemModified __attribute__((availability(macosx,introduced=10.7))) = 0x00001000, kFSEventStreamEventFlagItemFinderInfoMod __attribute__((availability(macosx,introduced=10.7))) = 0x00002000, kFSEventStreamEventFlagItemChangeOwner __attribute__((availability(macosx,introduced=10.7))) = 0x00004000, kFSEventStreamEventFlagItemXattrMod __attribute__((availability(macosx,introduced=10.7))) = 0x00008000, kFSEventStreamEventFlagItemIsFile __attribute__((availability(macosx,introduced=10.7))) = 0x00010000, kFSEventStreamEventFlagItemIsDir __attribute__((availability(macosx,introduced=10.7))) = 0x00020000, kFSEventStreamEventFlagItemIsSymlink __attribute__((availability(macosx,introduced=10.7))) = 0x00040000, kFSEventStreamEventFlagOwnEvent __attribute__((availability(macosx,introduced=10.9))) = 0x00080000 }; enum { kFSEventStreamEventIdSinceNow = 0xFFFFFFFFFFFFFFFFULL };
comment:24 in reply to: ↑ 23 Changed 6 years ago by
Replying to jhpalmieri:
Replying to buck:
@jhpalmieri Show me what you get for this command?
gcc -E /System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h | grep kFSEventStreamEventFlagNone -B20 -A150 | grep -v '^$' | sed -n '/enum {/,/}/p'
enum { kFSEventStreamEventFlagOwnEvent __attribute__((availability(macosx,introduced=10.9))) = 0x00080000 };
This looks entirely different from mine. Describe this environment for me? It looks like 10.9.
comment:25 Changed 6 years ago by
It is running 10.10, according to "About my Mac" and uname
:
$ uname -v Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64
I have Xcode 6.2. No homebrew or anything similar. What else would you like to know?
comment:26 Changed 6 years ago by
Do you have Xcode installed, or just the command line tools? Here's what happened on one machine:
- I had Xcode 6.3 installed. Sage would not build and I saw the above error.
- I downloaded the older version of the command-line tools, installed it, and tried again. Still no luck.
- Then I deleted the Xcode app and things now work.
So try deleting the Xcode app and see if that helps.
comment:27 follow-up: ↓ 28 Changed 6 years ago by
Also note that xcode and clt (command line tools) are separate packages and you can easily have different versions installed...
comment:28 in reply to: ↑ 27 Changed 6 years ago by
Replying to vbraun:
Also note that xcode and clt (command line tools) are separate packages and you can easily have different versions installed...
Although in my case, it seems that there is some shadowing (if that is the right word) if you have Xcode 6.3 and an earlier version of the command line tools.
comment:29 Changed 6 years ago by
@vbraun: Where's the ticket that induced you (plural) to twiddle the MACOSX_DEPLOYMENT_TARGET
?
comment:30 Changed 6 years ago by
It's this one: http://trac.sagemath.org/ticket/17204
That ticket doesn't describe how to reproduce the relevant issue, or how to check my libtool version. The version I find doesn't seem to be in the same scheme as the one mentioned (2.4.3).
$ libtool -V Apple Inc. version cctools-862
I'm interested because this patch *seems to* work, and I'm trying to see if I've thereby regressed #17204:
-
src/bin/sage-env
diff --git a/src/bin/sage-env b/src/bin/sage-env index 43f265b..8b26eda 100644
a b fi 268 268 269 269 # Mac OS X-specific setup 270 270 if [ `uname` = "Darwin" ]; then 271 # set MACOSX_DEPLOYMENT_TARGET -- if set incorrectly, this can271 # unset MACOSX_DEPLOYMENT_TARGET -- if set incorrectly, this can 272 272 # cause lots of random "Abort trap" issues on OSX. see trac 273 273 # #7095 for an example. 274 MACOSX_VERSION=`uname -r | awk -F. '{print $1}'` 275 MACOSX_DEPLOYMENT_TARGET=10.$[$MACOSX_VERSION-4] 276 if [ $MACOSX_DEPLOYMENT_TARGET = '10.10' ]; then 277 # Workaround for the libtool version detection bug 278 # See http://trac.sagemath.org/ticket/17204 279 MACOSX_DEPLOYMENT_TARGET=10.9 280 fi 281 export MACOSX_DEPLOYMENT_TARGET 274 unset MACOSX_DEPLOYMENT_TARGET 282 275 fi 283 276 284 277 # Compile-time path for libraries. This is the equivalent of
comment:31 Changed 6 years ago by
It seems like this bug has the reproduction information I was looking for: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63610
Because I was able to make distclean && make
with no issues whatsoever, I think the libtool problem is gone, and the workaround should be removed, since it is the source of this bug at hand.
comment:32 Changed 6 years ago by
Sorry for the spam, but I keep learning things. =X
Even if the libtool issue still exists, the above patch would avoid it. It's an implementation of the alternative workaround suggested by gcc dev Jack Howarth at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63610#c9
comment:33 Changed 6 years ago by
- Branch set to u/buck/unset_macosx_deployment_target_18254
- Commit set to 569f12d06763baf11bf341129a9b7312a2bceb24
New commits:
569f12d | unset MACOSX_DEPLOYMENT_TARGET, rather than sometimes setting a bogus value
|
comment:34 Changed 6 years ago by
There is nothing bogus about setting an earlier MACOSX_DEPLOYMENT_TARGET, its commonly used to make binaries that in addition run on older versions.
Autotool-based projects are supposed to ship their own copy of libtool, not use the system libtool.
comment:35 Changed 6 years ago by
Well... that patch is bogus then.
It's still mysterious that unsetting it "solves" this problem.
comment:36 Changed 6 years ago by
- Branch u/buck/unset_macosx_deployment_target_18254 deleted
- Commit 569f12d06763baf11bf341129a9b7312a2bceb24 deleted
comment:37 Changed 6 years ago by
Have you tried an earlier MACOSX_DEPLOYMENT_TARGET, maybe 10.8? We just have to find a combination that circumvents all bugs in Xcode...
comment:38 Changed 6 years ago by
I tried with MACOSX_DEPLOYMENT_TARGET=10.10
and got a segfault, so I guess that bug is still around.
Why is unset MACOSX_DEPLOYMENT_TARGET
a non-starter?
I'll try 10.8...
comment:39 Changed 6 years ago by
I've verified that anything other than MACOSX_DEPLOYMENT_TARGET=10.10
throws the OP error.
Can I change the if-10.10 to do an unset?
comment:40 Changed 6 years ago by
I've pared it down to this minimal reproduction:
$ 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, ^
comment:41 Changed 6 years ago by
This only reproduces with GNU gcc, not with /usr/bin/gcc.
gcc bug?
comment:42 Changed 6 years ago by
Even-more-minimal reproduction:
$ echo 'enum {a = 1, b __attribute__((availability(macosx,introduced=10.10))) = 1};' | /usr/bin/gcc -c -xc - (no output, it works) $ echo 'enum {a = 1, b __attribute__((availability(macosx,introduced=10.10))) = 1};' | gcc -c -xc - <stdin>:1:16: error: expected ',' or '}' before '__attribute__'
comment:43 Changed 6 years ago by
On a machine running 10.10.3 and Xcode 6.2, if I use unset MACOSX_DEPLOYMENT_TARGET
, Sage builds but I get a lot of doctest errors:
---------------------------------------------------------------------- sage -t --long src/sage/plot/graphics.py # Killed due to abort sage -t --long src/sage/matrix/matrix2.pyx # Killed due to abort sage -t --long src/sage/schemes/elliptic_curves/height.py # Killed due to abort sage -t --long src/sage/crypto/mq/sr.py # 5 doctests failed sage -t --long src/sage/libs/ppl.pyx # Killed due to abort sage -t --long src/sage/symbolic/integration/integral.py # Killed due to abort sage -t --long src/sage/schemes/projective/projective_morphism.py # Killed due to abort sage -t --long src/sage/modular/modsym/ambient.py # Killed due to abort sage -t --long src/sage/schemes/elliptic_curves/ell_finite_field.py # Killed due to abort sage -t --long src/sage/functions/prime_pi.pyx # Killed due to abort sage -t --long src/sage/modular/modform/eisenstein_submodule.py # Killed due to abort sage -t --long src/sage/tests/french_book/calculus_doctest.py # Killed due to abort sage -t --long src/sage/interfaces/maxima_lib.py # Killed due to abort sage -t --long src/sage/coding/code_constructions.py # Killed due to abort sage -t --long src/sage/groups/generic.py # Killed due to abort sage -t --long src/sage/matrix/matrix_modn_dense_template.pxi # Killed due to abort sage -t --long src/sage/rings/polynomial/multi_polynomial_sequence.py # 1 doctest failed sage -t --long src/sage/matrix/matrix_cyclo_dense.pyx # Killed due to abort sage -t --long src/sage/calculus/functional.py # Killed due to abort sage -t --long src/doc/en/thematic_tutorials/coding_theory.rst # Killed due to abort sage -t --long src/sage/functions/min_max.py # Killed due to abort sage -t --long src/sage/rings/polynomial/pbori.pyx # Killed due to abort sage -t --long src/sage/rings/algebraic_closure_finite_field.py # Killed due to abort sage -t --long src/sage/functions/trig.py # Killed due to abort sage -t --long src/doc/de/tutorial/tour_advanced.rst # Killed due to abort sage -t --long src/doc/en/tutorial/tour_advanced.rst # Killed due to abort sage -t --long src/doc/ru/tutorial/tour_advanced.rst # Killed due to abort sage -t --long src/sage/modular/modsym/modsym.py # Killed due to abort sage -t --long src/doc/pt/tutorial/tour_advanced.rst # Killed due to abort sage -t --long src/doc/fr/tutorial/tour_advanced.rst # Killed due to abort sage -t --long src/sage/modular/abvar/homology.py # Killed due to abort sage -t --long src/sage/symbolic/function.pyx # Killed due to abort sage -t --long src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py # Killed due to\ abort sage -t --long src/sage/tests/french_book/linalg_doctest.py # Killed due to abort sage -t --long src/sage/rings/finite_rings/element_base.pyx # Killed due to abort ----------------------------------------------------------------------
A typical such error says
------------------------------------------------------------------------ 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(). Sage will now terminate. ------------------------------------------------------------------------
comment:44 Changed 6 years ago by
@jhpalmieri That looks like the abort errors mentioned in sage-env. It says to look at #7095
One workaround is to configure R with --with-aqua=no
, but I don't know if that's acceptable. I don't know what aqua is or what R might use it for.
comment:45 Changed 6 years ago by
I'm pretty sure that some old libtool versions still linger in third-party tarballs, so we'll need MACOSX_DEPLOYMENT_TARGET <= 10.9 for a while.
comment:46 Changed 6 years ago by
Disabling aqua (=OSX gui), at least until Apple publishes a working Xcode, is fine with me.
comment:47 Changed 6 years ago by
I'm confused about the goal here. As far as I can tell, if you have Xcode 6.3, Sage won't build, and the problem won't be with R
, but with gcc
. If you delete Xcode 6.3 and install version 6.2 of the command-line tools, Sage will build. Is this reproducible by anyone else? If so, what problem are we trying to solve with this ticket?
comment:48 Changed 6 years ago by
You're mistaken. I've been running 6.2 this whole time.
comment:49 Changed 6 years ago by
I wish any of you were on IRC. This would all go so much more quickly.
comment:50 Changed 6 years ago by
The next question is whether anyone else can replicate your problems. By the way, does it help to delete the Xcode app and just install the command-line tools (via the link described in the top-voted answer to http://stackoverflow.com/questions/29529455/missing-c-header-debug-after-updating-osx-command-line-tools-6-3)?
Edit: you originally had installed Xcode 6.3. I wonder if there are any traces of that left somewhere?
comment:51 Changed 6 years ago by
With the change
-
build/pkgs/r/spkg-install
diff --git a/build/pkgs/r/spkg-install b/build/pkgs/r/spkg-install index 2bb904d..4bad9c8 100755
a b if [ "$UNAME" = "Darwin" ]; then 84 84 R_CONFIGURE="--enable-R-framework=no $R_CONFIGURE" 85 85 fi 86 86 87 # OS X 10.10 and/or Xcode 6.3 broke the R installation. See 88 # http://trac.sagemath.org/ticket/18254. 89 if { uname -sr | grep 'Darwin 14\.' ;} &>/dev/null; then 90 echo "OS X 10.10: Configuring R without aqua support." 91 R_CONFIGURE="--with-aqua=no $R_CONFIGURE" 92 fi 93 87 94 if [ "$UNAME" = "CYGWIN" ]; then 88 95 # Cygwin libm does not provide "long double" functions 89 96 # and we do not install Cephes on Cygwin at the moment
along with the workaround for gcc at #18156, R
builds and passes its test suite, and Sage passes all tests, too. (This is with command line tools 6.3.1.)
comment:52 follow-up: ↓ 53 Changed 6 years ago by
There is a new R release at #18229, does it change anything?
comment:53 in reply to: ↑ 52 Changed 6 years ago by
Replying to vbraun:
There is a new R release at #18229, does it change anything?
Yes. Without the change here, I get the same failure. With the change here, I get a new failure:
gcc -std=gnu99 -I/Users/palmieri/Desktop/Sage_stuff/git/sage/local/var/tmp/sage/build/r-3.2.0.p0/src/include -DNDEBUG -fPIC -g -O2 -c init.c -o init.o gcc -std=gnu99 -I/Users/palmieri/Desktop/Sage_stuff/git/sage/local/var/tmp/sage/build/r-3.2.0.p0/src/include -DNDEBUG -fPIC -g -O2 -c threeDplot.c -o threeDplot.o gcc -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Users/palmieri/Desktop/Sage_stuff/git/sage/local/var/tmp/sage/build/r-3.2.0.p0/src/lib -L/Users/palmieri/Desktop/Sage_stuff/git/sage/local/lib/ -o lattice.so init.o threeDplot.o -L/Users/palmieri/Desktop/Sage_stuff/git/sage/local/var/tmp/sage/build/r-3.2.0.p0/src/lib -lR -Wl,-framework -Wl,CoreFoundation installing to /Users/palmieri/Desktop/Sage_stuff/git/sage/local/var/tmp/sage/build/r-3.2.0.p0/src/library/lattice/libs ** R ** data *** moving datasets to lazyload DB dyld: lazy symbol binding failed: Symbol not found: _BZ2_bzReadOpen Referenced from: /Users/palmieri/Desktop/Sage_stuff/git/sage/local/var/tmp/sage/build/r-3.2.0.p0/src/lib/libR.dylib Expected in: flat namespace dyld: Symbol not found: _BZ2_bzReadOpen Referenced from: /Users/palmieri/Desktop/Sage_stuff/git/sage/local/var/tmp/sage/build/r-3.2.0.p0/src/lib/libR.dylib Expected in: flat namespace /Users/palmieri/Desktop/Sage_stuff/git/sage/local/var/tmp/sage/build/r-3.2.0.p0/src/bin/INSTALL: line 34: 9807 Done echo 'tools:::.install_packages()' 9808 Trace/BPT trap: 5 | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" $myArgs --slave --args ${args} make[5]: *** [lattice.ts] Error 1 make[4]: *** [recommended-packages] Error 2 make[3]: *** [stamp-recommended] Error 2 Error building vignettes.
comment:54 Changed 6 years ago by
Got there too. Like in #18254 libR.dylib is underlinked but somehow R.bin linked OK.
otool -L /Users/fbissey/build/sage-6.6.beta5/local/var/tmp/sage/build/r-3.2.0.p0/src/lib/libR.dylib /Users/fbissey/build/sage-6.6.beta5/local/var/tmp/sage/build/r-3.2.0.p0/src/lib/libR.dylib: libR.dylib (compatibility version 3.2.0, current version 3.2.0) libRblas.dylib (compatibility version 0.0.0, current version 0.0.0) /Users/fbissey/build/sage-6.6.beta5/local/lib/libgfortran.3.dylib (compatibility version 4.0.0, current version 4.0.0) /Users/fbissey/build/sage-6.6.beta5/local/lib/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1153.18.0) /Users/fbissey/build/sage-6.6.beta5/local/lib/libreadline.6.dylib (compatibility version 6.0.0, current version 6.3.0) /Users/fbissey/build/sage-6.6.beta5/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8) /usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 53.1.0) /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /Users/fbissey/build/sage-6.6.beta5/local/lib/libgomp.1.dylib (compatibility version 2.0.0, current version 2.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0) /Users/fbissey/build/sage-6.6.beta5/local/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
libbz2 is missing. A gross hack that should get us past this would be to configure with --without-system-bzlib
to force the use of the internal copy but it is quite curious we miss that linking on some platforms.
comment:55 Changed 6 years ago by
--without-system-bzlib
did the trick. I also noticed that with r-3.1.2 bzip2 was not properly detected during configuration on my mac and therefore the internal copy was used in that case too.
comment:56 Changed 6 years ago by
That works for me, too. All tests pass.
comment:57 Changed 6 years ago by
Let's make the new R version and its attendant patch a separate issue and ship the patch shown in comment:51.
comment:58 Changed 6 years ago by
- Branch set to u/buck/18254_osx_R_noaqua
- Commit set to ad87162c8b4b7ccef0553ad66d9a6b2e112c8f48
New commits:
ad87162 | skip R-aqua on osx 10.10. see #18254
|
comment:59 Changed 6 years ago by
- Commit changed from ad87162c8b4b7ccef0553ad66d9a6b2e112c8f48 to 3c5cd0f74446992a2b98f84c34043cfa181b68b4
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
3c5cd0f | skip R-aqua on osx 10.10. see #18254
|
comment:60 Changed 6 years ago by
As for upstream, I've gotten some good response on the osx-dev forums:
https://devforums.apple.com/message/1128923#1128923
tl;dr: Fixing this upstream involves enhancements to one of both gcc and clang:
- clang: the macros in Availability.h need an "ENUM" variant (like we have for the CF and NS availability macros) to cover this case
- gcc: implement clang's extension http://clang.llvm.org/docs/LanguageExtensions.html#attributes-on-enumerators
comment:61 Changed 6 years ago by
Apple says they don't care about GNU-gcc bugs. Is there a good reason to use gnu-gcc for all of this?
Apple Developer Relations24-Apr-2015 02:40 PM Engineering has determined that this is an issue for a third party to resolve. We do not support GNU gcc. If you have questions regarding the resolution of this issue, please update your bug report with them. We are closing this report. Please be sure to regularly check new Apple releases for any updates that might affect this issue. Buck Golemon21-Apr-2015 10:54 PM 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 I've opened a public question on the matter at: http://stackoverflow.com/questions/29788547/gcc-attribute-for-enum-members Buck Golemon21-Apr-2015 10:03 PM 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, ^ ``` 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 Configuration: Attachments:
comment:62 Changed 6 years ago by
Summary of why we use gcc instead of clang.
- We need a fortran compiler so we build gcc anyway
- A lot of packages shipped with sage won't compile with clang
- it is too hard to use clang for some and gcc for some other
- some of the package broken with clang my be in the too hard basket
I expect one way or another most packages in sage will eventually compile with clang. I for one will work on this once gentoo-prefix on OS X finally gets its toolchain issues sorted and default to clang.
comment:63 Changed 6 years ago by
- Reviewers set to John Palmieri, Volker Braun
- Status changed from needs_review to positive_review
Let's merge this. The change was first suggested in comment 44, so I've made buck the author.
comment:64 Changed 6 years ago by
Merge or close as invalid? Can you set the milestone if you actually want to merge the branch?
comment:65 Changed 6 years ago by
- Milestone changed from sage-duplicate/invalid/wontfix to sage-6.7
Sorry. I think you set the milestone a while ago, and no one reset it to match the new branch.
comment:66 Changed 6 years ago by
- Branch changed from u/buck/18254_osx_R_noaqua to 3c5cd0f74446992a2b98f84c34043cfa181b68b4
- Resolution set to fixed
- Status changed from positive_review to closed
Just to make double-sure, I tried one more time with an essentially empty environment from the develop branch. I get the same error: