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

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Feb 9 05:26:30 EST 2018


On 2018-02-09 07:36-0000 Arjen Markus wrote:

> 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).

Hi Arjen:

Is the issue that you used the "Unix Makefiles" generator rather than
the "MSYS Makefiles" generator for the MinGW-w64/MSYS2 test?  I
believe you have found both generators work pretty well for this
platform, but in order to use your "Windows-NAG-Fortran.cmake" platform
file, you may find that the "MSYS Makefiles" generator is the one you
*must* use.

If you report back that experiment doesn't work, then we need a
knowledgable CMake developer to chime in here to let you know exactly
what Platform filename is correct for the nagfor compiler on the
MinGW-w64/MSYS2 platform for either/both the "Unix Makefiles" and
"MSYS Makefiles" generators.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list