[CMake] Ninja Fortran on XL

Ephi Sinowitz (BLOOMBERG/ 919 3RD A) esinowitz at bloomberg.net
Thu Apr 12 08:22:07 EDT 2018


Trying to get this to work by setting a proper CMAKE_Fortran_PREPROCESS_SOURCE variable.

Here is GNU_Fortran for reference. 
set(CMAKE_Fortran_PREPROCESS_SOURCE
   "<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")

The analogous switch for -E in XL is -d -qnoobject. However, CMake expects the PREPROCESSED_SOURCE output to be in the form <SOURCE>-pp.f and XL does not allow you to control that. The output is always of the form F<SOURCE>.f 

Is there anything I can do here like putting redirection or two commands inside the CMAKE_Fortran_PREPROCESS_SOURCE variable?

Here is a relevant snippet from the XL compiler documentation on this switch.

“To call cpp for a particular file, use a file suffix of .F, .F77, .F90, .F95, .F03, or .F08. If you specify the -d option, each .F* file filename.F* is preprocessed into an intermediate file Ffilename.f, which is then compiled. ... If you only want to preprocess and do not want to produce object or executable files, specify the -qnoobject option also.”

-ephi 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180412/5464386f/attachment.html>


More information about the CMake mailing list