I've run into a problem using the FortranCInterface_VERIFY macro with the Nag Fortran compiler. If the Fortran compiler flags contain the '-g90' option, it fails because Nag tries to write a debug file (*.g90) to the same directory as the source Fortran file. In most cases, a user does not have write permission in the CMake installation location and the compile fails. I can not control where Nag writes these debug files.

Suggestions on how to work around this other than skipping this test if using Nag with the '-g90' option?

Example CMakeLists.txt file:

cmake_minimum_required(VERSION 2.8)


project(Foo C Fortran)

include(FortranCInterface)
FortranCInterface_VERIFY()


Error Output:
Building Fortran object CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
<redacted>/nag/5.2.724/bin/nagfor -g90 -I<redacted>/foo/CMakeFiles/FortranCInterface/VerifyC -c /opt/packages/cmake/2.8.8/share/cmake-2.8/Modules/FortranCInterface/Verify/VerifyFortran.f -o CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
    NAG Fortran Compiler Release 5.2(724)
Obsolescent: /opt/packages/cmake/2.8.8/share/cmake-2.8/Modules/FortranCInterface/Verify/VerifyFortran.f, line 1: Fixed source form Fatal Error: /opt/packages/cmake/2.8.8/share/cmake-2.8/Modules/FortranCInterface/Verify/VerifyFortran.f: Cannot create file /opt/packages/cmake/2.8.8/share/cmake-2.8/Modules/FortranCInterface/Verify/VerifyFortran.g90
    gmake[2]: *** [CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o] Error 2
gmake[2]: Leaving directory `<redacted>/foo/CMakeFiles/FortranCInterface/VerifyC'
    gmake[1]: *** [CMakeFiles/VerifyFortran.dir/all] Error 2
gmake[1]: Leaving directory `<redacted>/foo/CMakeFiles/FortranCInterface/VerifyC'
    gmake: *** [all] Error 2


--
Lori A. Pritchett-Sheats, PhD.
CCS-2, Computational Physics and Methods
Office: 505-665-6675
Fax: 505-665-4972

Los Alamos National Laboratory
P.O. Box 1663
MS D413
Los Alamos, NM 87544

--

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://www.cmake.org/mailman/listinfo/cmake

Reply via email to