[CMake] CXX incorrectly includes CMakeFortranInformation.cmake for MinGW/MSYS/Wine

Alan W. Irwin irwin at beluga.phys.uvic.ca
Mon Apr 5 03:40:44 EDT 2010


On 2010-04-04 21:28-0400 John Drescher wrote:

> On Sun, Apr 4, 2010 at 7:16 PM, Alan W. Irwin <irwin at beluga.phys.uvic.ca> wrote:
>> Clint (with an old version of MinGW) and I (with MinGW-4.5) have been
>> running into a peculiar CXX error for MinGW/MSYS on Wine.
>>
>> Enabling C++ _sometimes_ fails because it includes
>> CMakeFortranInformation.cmake (why?) which then leads to a
>> "get_filename_component called with incorrect number of arguments"
>>
>
> I had this same problem under wine and using vc2005.

That is a pretty interesting platform as well!

> I believe the
> issue is caused by wine pulling in at least some of environment
> variables from the linux system.

That idea of something leaking through from Linux to Wine to disrupt CMake
might be possible although I had a quick look at my short list of
environment variable using printenv and I didn't spot anything relevant. Of
course, the wine registry is huge so there may be some issue in there.
Fortunately, that is a human-readable file under Wine so it is easy to grep
it for any relevant string. I hope the CMake developers can come up with
some ideas about this hypothesis once they pinpoint exactly where things
start to go wrong from my --trace results for an extremely simple project.
Of course, I would be happy to do further tests of this hypothesis.

> The weird thing is this error only
> occurred with some of my projects.

Well some of my simple experiments (the ones that enabled Fortran before
CXX) looked like they were working until I discovered later that
CMAKE_CXX_COMPILER_WORKS was not being set correctly for the ones I thought
were initially working. Our PLplot project checks that variable, and if it
is not set disables the language but maybe that is not necessary. I will try
setting it to ON to see if I can get further with the PLplot C++ testing.

> To get around this temporarily disabled the fortran module.

I found something similar when I moved CMakeFortranInformation.cmake, but I
have to double-check now about whether CMAKE_CXX_COMPILER_WORKS was set
correctly when Fortran was disabled that way.  If this turns out to work,
then it won't be particular convenient in the PLplot case (we have to do two
test runs rather than one with either C++ or Fortran disabled), but at least
it allows us to test the C++ parts of the PLplot build for this platform.  I
will give that (and the previous idea of setting CMAKE_CXX_COMPILER_WORKS) a
shot tomorrow, but I am also looking forward to a real fix for obvious
reasons.

BTW, for those trying to follow what I did for this platform, I discovered
that MinGW-4.4 didn't work at all under Wine until I changed all Linux
permissions of the Windows files in bin, libexec, and mingw32 to go+rx. (I
presume Wine or CMake must check those permissions.) MinGW-4.5 already had
those permissions which is why it worked (except for the noted limitations)
right out of the box with CMake.  Werner Smekal has advised me that
MinGW-4.4 is the recommended version (MinGW-4.5 is a development version) so
I will probably stick to 4.4 from now on.  Unfortunately, the change from
MinGW-4.5 to MinGW-4.4 did not remove any issues.  OTOH, it didn't create
any either.

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); PLplot scientific plotting software
package (plplot.org); 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