Mac os x, gcc-6 compile error

Hi guys,

I’m trying to build root 6.08.02 from source on Mac os x 10.11.6. Doing it with clang 800 something works fine, but I need to compile it with gcc-6. gcc-6 I installed via:

I used:

to set everything up and than started compiling with:

but the builds fails with the error message:

[ 53%] Building CXX object core/meta/CMakeFiles/Meta.dir/src/TToggleGroup.cxx.o [ 53%] Building CXX object core/meta/CMakeFiles/Meta.dir/src/TViewPubDataMembers.cxx.o [ 54%] Building CXX object core/meta/CMakeFiles/Meta.dir/src/TViewPubFunctions.cxx.o [ 54%] Building CXX object core/meta/CMakeFiles/Meta.dir/src/TVirtualStreamerInfo.cxx.o [ 54%] Built target Meta Scanning dependencies of target Unix [ 55%] Building CXX object core/unix/CMakeFiles/Unix.dir/src/TUnixSystem.cxx.o [ 55%] Built target Unix Scanning dependencies of target Macosx [ 55%] Building CXX object core/macosx/CMakeFiles/Macosx.dir/src/ cc1objplus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast' make[2]: *** [core/macosx/CMakeFiles/Macosx.dir/src/] Error 1 make[1]: *** [core/macosx/CMakeFiles/Macosx.dir/all] Error 2 make: *** [all] Error 2

Any ideas? Thx!,

I do not think gcc (even 6) can build Cocoa back-end on macOS/work with Apple’s framewors. So maybe there is a problem with cmake (what is is negative -O ??), but I think you anyway have to disable Cocoa in the first place (before it was --disable-cocoa, not sure how you do this nowadays).

To switch from cocoa (default) to X11 add the following options to the cmake configuration: -Dcocoa=OFF -Dx11=ON

Worked, thx!

I just get the same error as you while compiling ROOT. I updated my macOS system to Mojave (10.14), before i have a working version of ROOT that builded with cocoa. When we select x11 option, the build was successful, but the screen like TBrowser is really bad about resolution. Is there any way to pass this error;

[ 34%] Building CXX object core/macosx/CMakeFiles/Macosx.dir/src/ [ 34%] Copying /Users/umutkeskin/programFiles/root/root-6.14.04/icons/bld_AlignBtm.xpm [ 34%] Copying /Users/umutkeskin/programFiles/root/root-6.14.04/icons/bld_AlignBtm_d.xpm cc1objplus: error: argument to '-O' should be a non-negative integer, 'g', 's' or 'fast' [ 34%] Copying /Users/umutkeskin/programFiles/root/root-6.14.04/icons/bld_AlignCenter.png make[2]: *** [core/macosx/CMakeFiles/Macosx.dir/src/] Error 1 make[1]: *** [core/macosx/CMakeFiles/Macosx.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....
by changing something or rebuilding something in our macOS system. I get this error in many applications which building like ROOT from the source code etc. I appreciate any help about this.