[CMake] MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Arjen Markus Arjen.Markus at deltares.nl
Fri Feb 9 02:36:02 EST 2018


Hi Alan,

> -----Original Message-----
> From: Alan W. Irwin [mailto:irwin at beluga.phys.uvic.ca]
> Sent: Thursday, February 08, 2018 10:59 PM
> To: Arjen Markus
> Cc: cmake at cmake.org
> Subject: Re: [CMake] MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to
> combine?
>
> On 2018-02-08 19:33-0000 Arjen Markus wrote:
>
> > So: Is it possible to instruct CMake to use the NAG-Fortran specific
> settings [for the Cygwin and MinGW-w64/MSYS2 platforms] and if so, how do I do
> that?
>
> Hi Arjen:
>
> I think you should be guided by what goes on for gfortran. For that compiler, the
> relevant Platform files are called CYGWIN-GNU-Fortran.cmake and Windows-
> GNU-Fortran.cmake Platform files for the Cygwin, and MinGW-w64/MSYS2
> platforms.  Furthermore, in all the existing nagfor cases (Linux and Darwin), you
> derive the nagfor-related name from the gfortran related name by replacing GNU-
> Fortran by NAG-Fortran. Therefore, I suggest you try the names CYGWIN-NAG-
> Fortran.cmake and Windows-NAG-Fortran.cmake for the two separate Platform
> files you are trying to create for the Cygwin and
> MinGW-w64/MSYS2 platforms.
>
I have a Platform file "Windows-NAG-Fortran.cmake" and that is used correctly if I start the NAG Fortran environment (using the MinGW Makefiles generator), but if I try the same with MinGWw-w64/MSYS2, this file is clearly ignored - I see the compiler fail on a typical GCC flag for creating shared libraries (the Platform file I added takes care of that in the NAG Fortran environment and therefore the build succeeds).

My guess is that the environment is determined in an early stage and then GNU/GCC has already been selected. But not all is lost - I realised that I may be able to get around this by expanding the PATH with the MinGW-w64/MSYS2 specific directories. I have not tried that yet.

Though I am still interested in other solutions ;).

Regards,

Arjen





DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain confidential and privileged information. If you are not the intended recipient please notify the sender immediately and destroy this message. Unauthorized use, disclosure or copying of this message is strictly prohibited. The foundation 'Stichting Deltares', which has its seat at Delft, The Netherlands, Commercial Registration Number 41146461, is not liable in any way whatsoever for consequences and/or damages resulting from the improper, incomplete and untimely dispatch, receipt and/or content of this e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180209/7e19c772/attachment-0001.html>


More information about the CMake mailing list