Master Fails to Build on OSX: NSEventModifierFlags

I am trying to build ROOT 5.34 from the git master in order to test a patch for https://sft.its.cern.ch/jira/browse/ROOT-8288. I get errors related to NSEventModifierFlags and CocoaConstants.h

Here is the error output from building. The std output and configure log are attached as files.

[code]CMake Warning:
Manually-specified variables were not used by the project:

ROOT_CLASSIC

In file included from /Users/jfcaron/Software/root/root/graf2d/cocoa/src/CocoaConstants.mm:1:
include/CocoaConstants.h:22:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kAlphaShiftKeyMask;
^
include/CocoaConstants.h:23:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kShiftKeyMask;
^
include/CocoaConstants.h:24:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kControlKeyMask;
^
include/CocoaConstants.h:25:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kAlternateKeyMask;
^
include/CocoaConstants.h:26:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kCommandKeyMask;
^
include/CocoaConstants.h:27:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kDeviceIndependentModifierFlagsMask;
^
/Users/jfcaron/Software/root/root/graf2d/cocoa/src/CocoaConstants.mm:30:7: error: unknown type name ‘NSEventModifierFlags’
const NSEventModifierFlags kAlphaShiftKeyMask = NSAlphaShiftKeyMask;
^
/Users/jfcaron/Software/root/root/graf2d/cocoa/src/CocoaConstants.mm:31:7: error: unknown type name ‘NSEventModifierFlags’
const NSEventModifierFlags kShiftKeyMask = NSShiftKeyMask;
^
/Users/jfcaron/Software/root/root/graf2d/cocoa/src/CocoaConstants.mm:32:7: error: unknown type name ‘NSEventModifierFlags’
const NSEventModifierFlags kControlKeyMask = NSControlKeyMask;
^
/Users/jfcaron/Software/root/root/graf2d/cocoa/src/CocoaConstants.mm:33:7: error: unknown type name ‘NSEventModifierFlags’
const NSEventModifierFlags kAlternateKeyMask = NSAlternateKeyMask;
^
/Users/jfcaron/Software/root/root/graf2d/cocoa/src/CocoaConstants.mm:34:7: error: unknown type name ‘NSEventModifierFlags’
const NSEventModifierFlags kCommandKeyMask = NSCommandKeyMask;
^
/Users/jfcaron/Software/root/root/graf2d/cocoa/src/CocoaConstants.mm:35:7: error: unknown type name ‘NSEventModifierFlags’
const NSEventModifierFlags kDeviceIndependentModifierFlagsMask = NSDeviceIndependentModifierFlagsMask;
^
12 errors generated.
make: *** [graf2d/cocoa/src/CocoaConstants.o] Error 1
make: *** Waiting for unfinished jobs…
In file included from /Users/jfcaron/Software/root/root/graf2d/cocoa/src/MenuLoader.mm:5:
include/CocoaConstants.h:22:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kAlphaShiftKeyMask;
^
include/CocoaConstants.h:23:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kShiftKeyMask;
^
include/CocoaConstants.h:24:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kControlKeyMask;
^
include/CocoaConstants.h:25:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kAlternateKeyMask;
^
include/CocoaConstants.h:26:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kCommandKeyMask;
^
include/CocoaConstants.h:27:14: error: unknown type name ‘NSEventModifierFlags’
extern const NSEventModifierFlags kDeviceIndependentModifierFlagsMask;
^
6 errors generated.
make: *** [graf2d/cocoa/src/MenuLoader.o] Error 1[/code]
makelog.txt (497 KB)
configurelog.txt (7.92 KB)

[quote=“jfcaron”]I am trying to build ROOT 5.34 from the git master in order to test a patch for https://sft.its.cern.ch/jira/browse/ROOT-8288. I get errors related to NSEventModifierFlags and CocoaConstants.h

Here is the error output from building. The std output and configure log are attached as files.

[code]CMake Warning:
Manually-specified variables were not used by the project:

ROOT_CLASSIC

make: *** [graf2d/cocoa/src/MenuLoader.o] Error 1[/code][/quote]

That’s something really weird. This CocoaConstants.h exists only in master, not in 5.34. And … anyway - the type NSEventModifierFlags is not something new. What’s your version of OS X/OS X SDK/XCode and how do you git clone/configure/build exactly?

[quote=“tpochep”]

That’s something really weird. This CocoaConstants.h exists only in master, not in 5.34. And … anyway - the type NSEventModifierFlags is not something new. What’s you version of OS X/OS X SDK/XCode and how do you git clone/configure/build exactly?[/quote]

Oh, do you have OS X < 10.10? This enum/typedef is apparently quite new: developer.apple.com/reference/a … guage=objc (10.10).
I’ll submit a fix tomorrow.

Edit: yes, I can see from configure log - SDK 10.9

Indeed I am still on OSX 10.9.5. Thanks for fixing.

The problem should be fixed now by this: a9ec29036a687cdc4b532fad746ba3594489c151 ( root.cern.ch/gitweb/?p=root.git … 594489c151 ). Well, if something else is not broken now :wink:

Ok I got past that error but now clang itself has crashed! I will try to report this to the clang people, but I’ll post the logs here too just in case.
make_err.txt (36.4 KB)
makelog.txt (885 KB)
configurelog.txt (7.92 KB)

Well, given you have an outdated OS X and really old XCode/clang - reporting this bug is probably useless, I think they at best will recommend you to update. Anyway, this crash is not related to my Cocoa code, so I think the issue is resolved now.

I would argue that 10.9.5 is still officially supported, but it wouldn’t be a useful argument.

Clang 3.6.2 from macports still crashes (previously it was 3.5 provided by XCode).

I tried using gcc 5.0 instead but I can’t get the configure settings right, it keeps trying to use clang for some parts and then crashes. I’ll need to learn how to use the CMake method I think.

[quote=“jfcaron”]I would argue that 10.9.5 is still officially supported, but it wouldn’t be a useful argument.

Clang 3.6.2 from macports still crashes (previously it was 3.5 provided by XCode).

[/quote]

hmm, maybe ROOT’s cling guys have something to say? and gcc 5 I guess is irrelevant here (I do not think it can build the Cocoa backend, which was the reason you created this topic). BTW I remember reading some bulletin from CERN’s IT about OS X versions they support/recommend - not sure 10.9 is still among them (though I personally like 10.9 more than versions above :wink: ).

[quote]I would argue that 10.9.5 is still officially supported, but it wouldn’t be a useful argument.[/quote]True but only for a few more months. For example as of December 1st, no machine running 10.9 will be allowed (by the security team) from connecting to the network …