Installing root 6.x from source on Mac OS 10.11 fails with a fortran error

When installing root 6.08 or 6.10 on my Mac using cmake, I get the following error:

The Fortran compiler "/usr/local/bin/gfortran" is not able to compile a
  simple test program.

  It fails with the following output:

   Change Dir: /Users/kwells/Development/physics/chroma_env/src/root-build/CMakeFiles/CMakeTmp

  Run Build Command:"/usr/bin/make" "cmTC_84fce/fast"

  /Applications/ -f
  CMakeFiles/cmTC_84fce.dir/build.make CMakeFiles/cmTC_84fce.dir/build

  Building Fortran object CMakeFiles/cmTC_84fce.dir/testFortranCompiler.f.o

  /usr/local/bin/gfortran -c
  -o CMakeFiles/cmTC_84fce.dir/testFortranCompiler.f.o

  FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!

  make[1]: *** [CMakeFiles/cmTC_84fce.dir/testFortranCompiler.f.o] Error 1

  make: *** [cmTC_84fce/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  cmake/modules/CheckCompiler.cmake:11 (enable_language)
  CMakeLists.txt:35 (include)

I have tried various methods for installing gcc/gfortran with no success.

Thanks in advance,


it looks like you have some brew(?) installation of gnu binutils (for example as).
You can have a look at but a first step could consist in removing all of the aforementioned packages (as, gcc/gfortran installed, as you say, “with various methods”) and install the xcode command line utilities to then retry the CMake configuration.

xcode-select --install


Thank you for the response. That has fixed the issue. I was thrown off because I not longer have a gfortran executable. But I guess the make process is smart enough to deal with that!


great you solved that! Yes,in general it is…


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.