[cmake-developers] Ninja and optional support for Fortran

David Cole david.cole at kitware.com
Mon Oct 15 11:37:41 EDT 2012


The reason Eigen has the "workaround code" attempting to enable the
Fortran language optionally is described fairly completely in this set
of related bugs in the CMake bug tracker:

  http://public.kitware.com/Bug/view.php?id=8345
  http://public.kitware.com/Bug/view.php?id=9220
  http://public.kitware.com/Bug/view.php?id=10227

If the OPTIONAL keyword could be supported properly in
enable_language, their workaround code could be replaced by a simple
test after the enable_language call.

I realize this is tangential to whether or not Fortran can be used
with the ninja generator, but thought it made sense to point out these
bugs in this context. If that issue were addressed first, then you
wouldn't have the problem unless you actually NEEDED to build Fortran
code using the ninja generator.


David


On Sun, Oct 14, 2012 at 5:57 PM, Marcus D. Hanwell
<marcus.hanwell at kitware.com> wrote:
> Hi,
>
> We use Eigen in a few projects, and it has optional support for
> Fortran. It seems that the way it probes for a working Fortran
> compiler causes the Ninja generator to error out.
>
> CMake Error: The "Ninja" generator does not support the language "Fortran" yet.
> -- The Fortran compiler identification is unknown
> CMake Error at /usr/share/cmake-2.8/Modules/CMakeFortranInformation.cmake:27
> (GET_FILENAME_COMPONENT):
>   get_filename_component called with incorrect number of arguments
> Call Stack (most recent call first):
>   blas/CMakeLists.txt:9 (enable_language)
>
>
> CMake Error: The "Ninja" generator does not support the language "Fortran" yet.
> CMake Error at /usr/share/cmake-2.8/Modules/CMakeFortranInformation.cmake:27
> (GET_FILENAME_COMPONENT):
>   get_filename_component called with incorrect number of arguments
> Call Stack (most recent call first):
>   lapack/CMakeLists.txt:9 (enable_language)
>
> I could suggest a new option for the project, but I was wondering if
> anyone involved in the Ninja generator has thoughts on when (if)
> Fortran will be supported, and more generally if there is a good way
> to test for a language, such as Fortran, when building a project. I
> haven't looked too deeply at their approach, but this is the only
> thing that seems to be a problem for us in using Eigen (which is a C++
> meta-template library with some optional Fortran code compiled and
> wrapped when a working compiler is available).
>
> Thanks,
>
> Marcus
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers



More information about the cmake-developers mailing list