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

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Arjen Markus-2

Hello,

 

In the PLplot project we are looking for a way to combine the MinGW-w64/MSYS2 platform (or Cygwin) with the NAG Fortran compiler. The reason for this is that both MinGW-w64/MSYS2 and Cygwin come with a nice repository of libraries, some of which we can use in the context of PLplot. The NAG Fortran compiler is a very nice, strict, compiler that is available for both Windows and Linux (and possibly other platforms as well). I know in principle how to combine NAG Fortran with the GCC tools, so this part of the combination is not the problem.

 

The problem is rather this:

If I start a console with MinGW-w64/MSYS2 or Cygwin I get an environment where all the libraries that I want can be found, but that environment is identified by CMake as “MinGW” or “Cygwin”, so that the NAG Fortran specific settings are ignored.

 

(I store them in a file MinGW-NAG-Fortran.cmake, in analogy with all the other such files – a file Windows-NAG-Fortran.cmake does do the job for the “bare” Windows platform.)

 

The NAG Fortran compiler is selected, just like I want, instead of the gfortran compiler, as I define FC to be “nagfor” and I have expanded the PATH to include all the stuff for NAG Fortran.

 

But the crucial part is that CMake uses the settings for the GNU compilers.

 

So: Is it possible to instruct CMake to use the NAG-Fortran specific settings and if so, how do I do that?

 

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

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Alan W. Irwin
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.

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
__________________________
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Arjen Markus-2

Hi Alan,

> -----Original Message-----
> From: Alan W. Irwin [[hidden email]]
> Sent: Thursday, February 08, 2018 10:59 PM
> To: Arjen Markus
> Cc: [hidden email]
> 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.
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Alan W. Irwin
On 2018-02-09 07:36-0000 Arjen Markus wrote:

> Hi Alan,
>
>> -----Original Message-----
>> From: Alan W. Irwin [mailto:[hidden email]]
>> Sent: Thursday, February 08, 2018 10:59 PM
>> To: Arjen Markus
>> Cc: [hidden email]
>> 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
__________________________
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Arjen Markus-2

Hi Alan,

 

> -----Original Message-----
> From: Alan W. Irwin [[hidden email]]
> Sent: Friday, February 09, 2018 11:27 AM
> To: Arjen Markus
>
> 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.
>
Hm, you may be right – I will try that today (left-over from a previous attempt
J).

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

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Arjen Markus-2

Hi Alan,

 

The result is the same or very much the same.

 

Regards,

 

Arjen

 

From: CMake [mailto:[hidden email]] On Behalf Of Arjen Markus
Sent: Friday, February 09, 2018 11:30 AM
To: Alan W. Irwin
Cc: [hidden email]
Subject: Re: [CMake] MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

 

>
Hm, you may be right – I will try that today (left-over from a previous attempt
J).

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

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Alan W. Irwin
On 2018-02-09 10:44-0000 Arjen Markus wrote:

> Hi Alan,
>
>
>
> The result is the same or very much the same.

OK.  Time for more knowledgable people to weigh in here about what
Platform filenames to use for the combination of nagfor and
MinGW-w64/MSYS2 for the "Unix Makefiles" and "MSYS Makefiles"
generators.

Meanwhile, can you test whether the Platform filename I suggested for
the nagfor Cygwin case with "Unix Makefiles" generator is correct?

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
__________________________
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Mojca Miklavec-2
On 9 February 2018 at 18:24, Alan W. Irwin wrote:

> On 2018-02-09 10:44-0000 Arjen Markus wrote:
>
>> Hi Alan,
>>
>> The result is the same or very much the same.
>
> OK.  Time for more knowledgable people to weigh in here about what
> Platform filenames to use for the combination of nagfor and
> MinGW-w64/MSYS2 for the "Unix Makefiles" and "MSYS Makefiles"
> generators.
>
> Meanwhile, can you test whether the Platform filename I suggested for
> the nagfor Cygwin case with "Unix Makefiles" generator is correct?
>
> Alan

I wonder if this is in any way related to
    https://cmake.org/Bug/view.php?id=14252

We had numerous problems with Fortran flags simply inheriting settings
from CFLAGS under assumption that the Fortran compiler must be "the
same" as C complier and probably understand the same flags.

Our most burning issue was resolved once GCC's Fortran stopped
complaining about "-arch", but the underlying problem in CMake was
probably never resolved. We were also not able to prevent the use of
Fortran in case it was detected on the system. This must be a
consequence of very few people still using Fortran and thus the
interest was not as high as fixing bugs for C/C++ compilers.

Mojca
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Alan W. Irwin
On 2018-02-10 08:04+0100 Mojca Miklavec wrote:

> On 9 February 2018 at 18:24, Alan W. Irwin wrote:
>> On 2018-02-09 10:44-0000 Arjen Markus wrote:
>>
>>> Hi Alan,
>>>
>>> The result is the same or very much the same.
>>
>> OK.  Time for more knowledgable people to weigh in here about what
>> Platform filenames to use for the combination of nagfor and
>> MinGW-w64/MSYS2 for the "Unix Makefiles" and "MSYS Makefiles"
>> generators.
>>
>> Meanwhile, can you test whether the Platform filename I suggested for
>> the nagfor Cygwin case with "Unix Makefiles" generator is correct?
>>
>> Alan
>
> I wonder if this is in any way related to
>    https://cmake.org/Bug/view.php?id=14252

Hi Mojca:

Just to clarify there has been a change in the CMake bugtracker.  You
reference the old bug tracker entry where all issues there were
automatically closed and moved to the new bug tracker
<https://gitlab.kitware.com/cmake/cmake/issues/14252>. However, that
is an almost completely vacuous entry (except for title) in the new
bug tracker although it does declare the issue is still open. As far
as I can tell from that old discussion, Brad King found the hard-coded
source of your problem in the CMake code with -arch, but there is no
reference to a fix either in the old tracker or new one so I assume
that fix has not been implemented yet.

Furthermore, although there is a superficial resemblance I am pretty
sure from the description this hard-coded issue is quite specific to
certain compiler options, and does not refer to ignoring all nagfor
compiler options as Arjen has apparently observed. So I think the
source of Arjen's problem likely is that he is using the incorrect
Platform filenames for the various nagfor Windows cases that have been
discussed, and we need advice from a CMake language support expert to
help us figure out what those Platform filenames should be.

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
__________________________
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Brad King
In reply to this post by Arjen Markus-2
On 2/9/2018 2:36 AM, Arjen Markus wrote:
> From: Alan W. Irwin
>> 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 think those names are correct.  However, the status of CMake
for MSYS2-native builds is unclear.  See below.

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

Good.

> but if I try the same with MinGWw-w64/MSYS2, this file is clearly ignored

What is the value of CMAKE_SYSTEM_NAME that is detected?

Typically this should be "Windows" for a Windows-native CMake
and "CYGWIN" for a cygwin-built CMake that is linked against the
cygwin runtime library.

For MSYS2 what CMake are you running?  A Windows CMake or one
that came packaged by MSYS2?  Does the latter link against the
msys2 runtime library?

-Brad
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Alan W. Irwin
On 2018-02-13 12:32-0500 Brad King wrote:

> On 2/9/2018 2:36 AM, Arjen Markus wrote:
>> From: Alan W. Irwin
>>> 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 think those names are correct.  However, the status of CMake
> for MSYS2-native builds is unclear.  See below.
>
>> 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)
>
> Good.
>
>> but if I try the same with MinGWw-w64/MSYS2, this file is clearly ignored
>
> What is the value of CMAKE_SYSTEM_NAME that is detected?
>
> Typically this should be "Windows" for a Windows-native CMake
> and "CYGWIN" for a cygwin-built CMake that is linked against the
> cygwin runtime library.
>
> For MSYS2 what CMake are you running?  A Windows CMake or one
> that came packaged by MSYS2?  Does the latter link against the
> msys2 runtime library?

While waiting for Arjen to respond from his European time zone to that
question, which cmake package for MinGW-w64/MSYS2 do you usually
recommend?  The cmake package from the mingw64 repository or the cmake
package from the msys2 repository?

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
__________________________
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Brad King
On 2/13/2018 2:50 PM, Alan W. Irwin wrote:
> While waiting for Arjen to respond from his European time zone to that
> question, which cmake package for MinGW-w64/MSYS2 do you usually
> recommend?  The cmake package from the mingw64 repository or the cmake
> package from the msys2 repository?

I'm not familiar with either of those.  What does each report as
CMAKE_HOST_SYSTEM_NAME?

-Brad
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Alan W. Irwin
On 2018-02-13 14:56-0500 Brad King wrote:

> On 2/13/2018 2:50 PM, Alan W. Irwin wrote:
>> While waiting for Arjen to respond from his European time zone to that
>> question, which cmake package for MinGW-w64/MSYS2 do you usually
>> recommend?  The cmake package from the mingw64 repository or the cmake
>> package from the msys2 repository?
>
> I'm not familiar with either of those.  What does each report as
> CMAKE_HOST_SYSTEM_NAME?

In general, you get native packages from the mingw64 repository and
POSIX-aware packages from the msys2 repository for this dual-natured
platform, and cmake is one of those rare beasts that has a package
in each repo.

@Arjen: to answer Brad's questions you should modify our top-level
CMakeLists.txt to also report CMAKE_HOST_SYSTEM_NAME (just in case
that is not the same as CMAKE_SYSTEM_NAME which we already report
there).  I assume from the CMakeCache.txt file you included in your
August comprehensive test report for this platform that you are still
running $PREFIX/mingw64/bin/cmake.exe, i.e., the version of cmake from
the mingw64 repository.  So just configuring PLplot on that platform
should give you the mingw64 answer to Brad's questions.  And to get
the msys2 answer you will need to temporarily move
$PREFIX/mingw64/bin/cmake.exe out of the way, install the POSIX
version of cmake from the msys2 repo, and configure PLplot from
scratch again using the msys2 version of cmake.

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
__________________________
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Arjen Markus-2

Hi Brad, Alan,

 

See below.

> -----Original Message-----
> From: Alan W. Irwin [[hidden email]]
> Sent: Tuesday, February 13, 2018 11:55 PM
>
> In general, you get native packages from the mingw64 repository and POSIX-aware
> packages from the msys2 repository for this dual-natured platform, and cmake is
> one of those rare beasts that has a package in each repo.
>
Yes, I have both – one in $PREFIX/mingw64/bin and one in $PREFIX/usr/bin. The latter is the MSYS2 version.

> @Arjen: to answer Brad's questions you should modify our top-level CMakeLists.txt
> to also report CMAKE_HOST_SYSTEM_NAME (just in case that is not the same
> as CMAKE_SYSTEM_NAME which we already report there).  >

The MinGW version of Cmake reports Windows for both variables and the MSYS2 version reports MSYS.

I set CC and FC to x64cc and nagfor respectively before invoking CMake (either version), so that the proper tools are used. However, the problem is that sometimes the configuration fails, sometimes the build fails. There is very little information about what is going wrong. Or there is a lot I simply fail to find the wanted needle in that haystack.

I have also had a situation where the Freetype library was recognised but the build failed on a bunch of unresolved externals.

Further complication: my trial licence for NAG Fortran ends today L.

So, the exercise up to now has brought us a nice way to use NAG Fortran in its native environment, but without the benefit of installed packages under MinGW-w64/MSYS2.

The number of combinations to try is also rather big, I am afraid. That would require a lot more trial and error, if no pruning is possible.

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

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: MinGW-w64/MSYS2 (or Cygwin) and NAG Fortran - how to combine?

Brad King
On 2/14/2018 3:16 AM, Arjen Markus wrote:
> The MinGW version of Cmake reports Windows for both variables

Great, that's expected.  Then Windows-NAG-Fortran would be the proper
module for flags for a compiler targeting a Windows environment.

> and the MSYS2 version reports MSYS.

If CMAKE_SYSTEM_NAME is "MSYS" then likely all the `CYGWIN-*`
modules should become `MSYS-*` modules.

-Brad
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake