CMake and Fortran compiler

Mojca Miklavec mojca.miklavec.lists at gmail.com
Fri Dec 9 15:33:27 PST 2011


Hello,

I'm trying to compile Root with CMake (the Root package is MacPorts is
broken, but even if it wasn't, there might be reasons why I would want
to use a standalone version).

When running ccmake <path-to-root-sources> I get the following error:

CMake Error at /opt/local/share/cmake-2.8/Modules/CMakeDetermineFortranCompiler.cmake:31
(MESSAGE):
  Could not find compiler set in environment variable FC:

  CMAKE_Fortran_COMPILER-NOTFOUND.
Call Stack (most recent call first):
  cmake/modules/CheckCompiler.cmake:11 (enable_language)
  CMakeLists.txt:24 (include)

CMake Error: Error required internal CMake variable not set, cmake may
be not be built correctly.
Missing variable is:
CMAKE_Fortran_COMPILER_ENV_VAR

CMake Error: Could not find cmake module
file:/path/to/root/build/CMakeFiles/CMakeFortranCompiler.cmake


I strongly suspect that this error has nothing to do with Root itself,
but rather with some "misconfiguration" in cmake package in MacPorts
which is not aware of Fortran being present. But I might just as well
be wrong.  (I'm neither a Fortran programmer not somebody familiar
with CMake.)

After setting
    export FC=/opt/local/bin/gfortran-mp-4.4
(almost) all goes fine again.

What do you suggest?

Thank you,
    Mojca


More information about the macports-users mailing list