Install on OSX with gcc

How to install ROOT from source on OSX with gcc?
Basically I fail to choose gcc as linker

“configure” script proposes to chose compiler, but not linker.
As result:

Checking for source directory … /Installed/root-v5-34
Configuring for macosx64
Checking for Fink/MacPorts directory … /sw
Checking for GNU Make version >= 3.80 … ok
Checking for C compiler … gcc
Checking for C++ compiler … g++
Checking for linker (LD) … clang++

and obviously:

clang: error: linker command failed with exit code 1

Hopefully you’ve resolved this issue by now, but if you’re running the configure script, you’re able to choose certain options, like

./configure --with-cc=/path/to/C/compiler --with-cxx=/path/to/C++/compiler --with-f77=/path/to/Fortran/compiler --with-ld=/path/to/linker

to set compilers and a linker. For gcc, I’m not sure what linker to use.

I’m currently trying to compile Root 6.06.02 on OS X 10.12.3 using this configuration method, and I’m using GCC/G++/GFortran 4.9 (installed using Homebrew). I’ve used


in compiling but it throws me the following error:

ld: unknown option: -O2

and a bunch of other garbage at some point in the output.

Is this the right linker to use with gcc? If I don’t select it specifically, it defaults to clang++, as ikualakov has above.

– Andrew

You should be able to specify g++ as linker.