Compile root with GCC on osx 10.9

hi all,

I’m trying to get root to compile on OSX mavericks (10.9), I am reliant on GCC because code we use does not compile on clang. That code ties into ROOT so I encountered the ABI incompatibilities between ROOT which was compiled with clang-libc++ and our code which is compiled with gcc-libstdc++.

I can only think of 1 option and that is to get ROOT compile somehow with libstdc++, that implies (if I’m correct), that I need ROOT to be compiled with GCC. However the root’s configure script always somehow adds “-stdlib=libc++” to the compiler options.

so

  1. is there a clean way of compiling ROOT with GCC (macports) on OSX 10.9
  2. any of you got other options - which does not involve 1), but does guarantee compatibility between our internal code and ROOT’s libraries?

PS
changing our internal code to adhere to clang/libc++ seems undoable for now.

MacPorts automatically uses clang under 10.9, and there’s no way to change it other than changing the default compiler for all your ports, which is not recommended.

I think the best way to solve your problem might be to install gcc itself from MacPorts, then do a regular source installation of ROOT (not from MacPorts) using gcc. Then you should have full control of the compiler flags. Even if ./configure puts libc++ in there, you should be able to manually edit the Makefile for whatever changes before doing “make”.

Jean-François

i was probably very vague, but I was compiling ROOT from source, only GCC is from macports, not ROOT.

The problem is with the trunk version, somehow it really depends on clang on osx, of course you can overwrite the compilers with g++ etc, but the stdlib option is magically added somewhere, not simply in a makefile.

checking out version 5.34 works, albeit without cocoa support, because that too is dependent on clang.