[CMake] Ninja Fortran on XL

Ephi Sinowitz (BLOOMBERG/ 919 3RD A) esinowitz at bloomberg.net
Thu Apr 12 15:06:35 EDT 2018


Unfortunately there is no way I can see to control the output directory. It is always the current working directory.

From: brad.king at kitware.com At: 04/12/18 09:42:58To:  Ephi Sinowitz (BLOOMBERG/ 919 3RD A ) ,  cmake at cmake.org
Subject: Re: [CMake] Ninja Fortran on XL

On 04/12/2018 08:22 AM, Ephi Sinowitz (BLOOMBERG/ 919 3RD A) wrote:
> 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?

One can put two commands, e.g. something like:

```
set(CMAKE_Fortran_PREPROCESS_SOURCE
   "<CMAKE_Fortran_COMPILER> ... -d -qnoobject <SOURCE>"
   "mv <WHEREVER_XL_PUTS_IT> <PREPROCESSED_SOURCE>"
    )
```

Filling in `<WHEREVER_XL_PUTS_IT>` may be difficult.  I've observed:

* `/path/to/foo.F`    ==>  `./Ffoo.f`
* `/path/to/foo.F90`  ==>  `./Ffoo.f90`

CMake would need to be taught to produce a `<PLACEHOLDER>`
for this value, and it would need to know the mapping that
xlf uses for extensions.

Does xlf have a way to control in what directory the file is placed?

-Brad


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


More information about the CMake mailing list