Hello,
I need to compile ROOT with gcc/g++. I am having difficulty with the objective C libraries.
If I link a true g++ (installed with brew) to the command gg++ and the same for gcc -> ggcc - I can start to compile with
cmake ../ -DCMAKE_CXX_COMPILER=gg++ -DCMAKE_C_COMPILER=ggcc <the rest of my options>
The compilation gets about 70% done before it gives me an error that “Option ‘-O’ takes an integer argument”. I tracked this down. In ‘root/core/macosx/CMakeLists.txt’, there is a line
set_source_files_properties(${sources} COMPILE_FLAGS "-ObjC++ -std=c++11")
So g++ is not recognizing the Objective C flag. I’ve changed this line to
set_source_files_properties(${sources} COMPILE_FLAGS "-x objective-c++-header -lobjc -std=c++11")
Which is the g++ equivalent. I’ve also tried ‘-x objective-c++’. This attempt fails at around 70% with hundreds of errors. It basically looks like the compiler does not understand the Objective C++.
Has anyone had success in compiling ROOT from source with g++ on OSX (not clang)?
PS - As a side note, I believe ‘g++’ in /usr/bin on OSX is actually a link to clang - verified on my machine by typing ‘g++ --version’. This is why I installed g++ from brew and linked it to gg++.
ROOT Version: Github Master branch, commit # 2762a32
Platform: OSX
Compiler: GCC 8.1.0