View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015155CMakeCMakepublic2014-09-14 00:372015-03-02 08:57
ReporterDavid Zemon 
Assigned ToBrad King 
PriorityhighSeverityblockReproducibilityalways
StatusclosedResolutionfixed 
PlatformDesktopOSWindowsOS Version8 x64
Product Version 
Target VersionCMake 3.1Fixed in VersionCMake 3.1 
Summary0015155: enable_language reports failure to find a module, but not which one
DescriptionUpon generating the Makefiles for my project, CMake prings the following two lines for each new language that I enable:

CMake Error: cmListFileCache: error can not open file C:/Users/David/Documents/GitHub/PropWare
CMake Error: Could not find cmake module file:

No other errors are reported. No extra text comes afterward (not even a single space after the semicolon). The path in the first line is the root of my project - not a file. Two lines are printed at the very bottom saying that I can look at the CMakeOutput.log and CMakeError.log files, but they do not seem to provide any useful information.
Steps To ReproduceThe PropWare project should exist on in a user-writable path. A version of GCC ported for the Parallax Propeller is required to build my project. The environment variable "PROPWARE_PATH" must be set to the project root directory. All files from <root>/CMakeModules should be copied into the CMake installation directory.

All of the above requirements can be most easily satisfied by downloading the release-2.0-nightly branch of PropWare from github (https://github.com/DavidZemon/PropWare/tree/release-2.0-nightly [^]) and running INSTALL.py from within the `util` directory. This will download PropGCC and CMake 3.0.2 (if a version of CMake >= 3.0 is not in the PATH) and copy over the necessary files into your CMake installation directory as well as setting a couple environment variables.

If you choose to run INSTALL.py, it will attempt to build the PropWare libraries and will fail with the above errors.
If you choose to configure everything manually, the error will appear as soon as you try to configure the makefiles for the project. I use 'cmake -G "Unix Makefiles" ..' from within a child directory of the root (GNU Make is distributed with the Windows release of PropGCC). I found the same error occurs when I use the default Makefile generator of Visual Studio. Attempting to use MinGW Makefiles throws lots of different errors (can't find the compiler).
Additional InformationPropWare is ready to be released to the public as an easy-to-use build-system for the Parallax Propeller, but without windows compatibility, the whole project is nearly useless. Probably 95% of my potential users are on Windows, so until I either find the problem or get a work around, my project isn't worth squat.

Sorry if the "severity" and "priority" are set too strong or wrong. I'm not sure what to compare it with - but it is a blocking problem for me and I have not been able to find a way around it.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0036791)
David Zemon (reporter)
2014-09-14 00:41

I forgot to mention, this problem does not exist on Ubuntu 14.04 (with CMake 3.0.2) or Debian 7.6 (with CMake 3.0.1).

On Linux systems I do not have to copy over the CMakeModules directory into the CMake installation directory. I don't know why the Linux method doesn't work in Windows, but I was easily able to get around it by copying the files over with INSTALL.py so it doesn't worry me too much.
(0036792)
David Zemon (reporter)
2014-09-14 00:48

I also want to add that I am more than happy to provide as much information as is requested. Reproducing the problem can be a bit of a nuisance since it requires installing PropWare, so just let me know what files would be useful and I can provide them.

I've run a trace from both Linux and Windows and didn't see anything meaningful to me, but I can upload both files if it would be helpful.
(0036795)
Brad King (manager)
2014-09-15 10:03

This is a little much for me to try to reproduce locally, but I can help you debug it. The only occurrences of "Could not find cmake module file: " in the CMake source are in cmGlobalGenerator.cxx:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalGenerator.cxx;hb=v3.0.2 [^]

The EnableLanguage method runs each time you enable a language. You could build CMake from source and add some debug statements to see which file it is unable to load, and why it doesn't print at least the name of the file it wants in the error message.

Also, CMAKE_MODULE_PATH should work fine on Windows so you shouldn't need to modify the CMake installation.
(0036797)
David Zemon (reporter)
2014-09-15 10:11

I did download the source and found that reference. I poked through it's usages and was able to understand how it is used. I was going to do exactly what you suggested and try put some debugging statements in there, but I wasn't able to get my Windows environment setup correctly for compiling desktop programs. CMake wasn't recognizing my compiler (I have MinGW installed).

I was getting pretty frustrated by that point (I only have Windows in a VM too - so having to sit and wait constantly isn't helping). I'll give it another try tonight to see if I can make any headway in compiling from source.

Is it hard to cross-compile from Linux (Ubuntu 14.04) for Windows? I installed mingw on my host machine already.
(0036799)
Brad King (manager)
2014-09-15 10:18

Re 0015155:0036797: CMake supports Linux -> Windows cross compiling of projects AFAIK but I do not know if anyone has done this with CMake itself. It may work.

With MSYS installed you should be able to use the bootstrap script to build from source.

Or with just MinGW you can use an existing CMake binary installation (preferably one not modified by your INSTALL.py). Just make sure the compiler and mingw32-make programs are in your PATH, and then run CMake with the "MinGW Makefiles" generator option.
(0036800)
David Zemon (reporter)
2014-09-15 10:25

MSYS is not currently installed but I'll go ahead and add it. I'll update this evening with results. Thanks for the help.
(0036815)
David Zemon (reporter)
2014-09-16 20:49
edited on: 2014-09-16 20:50

A virtual machine running on top of an i5-2520 is a slooowwww beast.

I've finally got some output. Hopefully now that I've made it through the first compilation of CMake and know the process, I can move a bit faster from here on out.

Interestingly enough, running with this new version of CMake, I don't get the first error line anymore - only the second. That being said, I added "cout << filename << endl;" and here's my complete results now:

David@Win8Virtual:~/Documents/GitHub/PropWare/bin$ export PATH=$HOME/propgcc/bin:$HOME/cmake/bin:$PATH
David@Win8Virtual:~/Documents/GitHub/PropWare/bin$ which make
/c/Users/David/propgcc/bin/make.exe
David@Win8Virtual:~/Documents/GitHub/PropWare/bin$ which cmake
/c/Users/David/cmake/bin/cmake.exe
David@Win8Virtual:~/Documents/GitHub/PropWare/bin$ rm -rf * && cmake -G "Unix Makefiles" ..
-- C:/Users/David/Documents/GitHub/PropWare/CMakeModules
-- C:/Users/David/Documents/GitHub/PropWare/CMakeModulesC:/Users/David/Documents/GitHub/PropWare/CMakeModules
-- The C compiler identification is GNU 4.6.1
-- The CXX compiler identification is GNU 4.6.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/David/propgcc/bin/propeller-elf-gcc.exe
-- The COGC compiler identification is unknown
-- The COGCXX compiler identification is unknown
-- The ECOGC compiler identification is unknown
-- The ECOGCXX compiler identification is unknown
-- LOADED: Generic-gcc-Propeller.cmake
-- Check for working C compiler: C:/Users/David/propgcc/bin/propeller-elf-gcc.exe
-- Check for working C compiler: C:/Users/David/propgcc/bin/propeller-elf-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Users/David/propgcc/bin/propeller-elf-gcc.exe
-- Check for working CXX compiler: C:/Users/David/propgcc/bin/propeller-elf-gcc.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error: Could not find cmake module file:
File name: CMakeCOGCInformation.cmake
CMake Error: Could not find cmake module file:
File name: CMakeCOGCXXInformation.cmake
CMake Error: Could not find cmake module file:
File name: CMakeECOGCInformation.cmake
CMake Error: Could not find cmake module file:
File name: CMakeECOGCXXInformation.cmake
CMake Error: Could not find cmake module file:
File name: CMakeDATInformation.cmake
-- Configuring incomplete, errors occurred!
See also "C:/Users/David/Documents/GitHub/PropWare/bin/CMakeFiles/CMakeOutput.log".
See also "C:/Users/David/Documents/GitHub/PropWare/bin/CMakeFiles/CMakeError.log".
David@Win8Virtual:~/Documents/GitHub/PropWare/bin$

(0036816)
David Zemon (reporter)
2014-09-16 21:04

Oh that's just too precious... it's throwing the error on line 666: http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalGenerator.cxx;hb=v3.0.2#l666 [^]

For reference, here's what the output looks like when I run cmake on Linux:

david@balrogJr:~/External/Kits/Embedded/Parallax/Library/PropWare/bin$ rm -rf * && cmake ..
-- /home/david/External/Kits/Embedded/Parallax/Library/PropWare/CMakeModules
-- /home/david/External/Kits/Embedded/Parallax/Library/PropWare/CMakeModules/home/david/External/Kits/Embedded/Parallax/Library/PropWare/CMakeModules
-- The C compiler identification is GNU 4.6.1
-- The CXX compiler identification is GNU 4.6.1
-- The ASM compiler identification is GNU
-- Found assembler: /opt/parallax/bin/propeller-elf-gcc
-- The COGC compiler identification is GNU 4.6.1
-- The COGCXX compiler identification is GNU 4.6.1
-- The ECOGC compiler identification is GNU 4.6.1
-- The ECOGCXX compiler identification is GNU 4.6.1
-- LOADED: Generic-gcc-Propeller.cmake
-- Check for working C compiler: /opt/parallax/bin/propeller-elf-gcc
-- Check for working C compiler: /opt/parallax/bin/propeller-elf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /opt/parallax/bin/propeller-elf-gcc
-- Check for working CXX compiler: /opt/parallax/bin/propeller-elf-gcc -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Configuring done
-- Generating done
-- Build files have been written to: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/bin
david@balrogJr:~/External/Kits/Embedded/Parallax/Library/PropWare/bin$
(0036817)
David Zemon (reporter)
2014-09-16 21:37

I'm not going to try and run CMake in a debugger to dig deeper than this, but I made a simple modification to cmSystemTools.cxx between lines 224 and 225 that reads:

std::cout << "M2: " << m2 << std::endl;

And it there is nothing following "M2: " in the output. For whatever reason, that filename is lost.
(0036822)
Brad King (manager)
2014-09-18 09:29

I've fixed the error messages to actually report the file names:

 enable_language: Fix error messages on missing modules
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b549a5c [^]

That should avoid needing to locally modify CMake to debug such failures in the future.
(0036823)
Brad King (manager)
2014-09-18 09:32

Re 0015155:0036815: From the output lines:

 CMake Error: Could not find cmake module file:
 File name: CMakeCOGCInformation.cmake

it looks like this project tries to add its own language infrastructure as described here:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CMakeAddNewLanguage.txt;hb=v3.0.2 [^]

The failure is likely due to the same problem with trying to get your CMakeModules to work when added to CMAKE_MODULE_PATH.
(0036826)
David Zemon (reporter)
2014-09-18 21:45

I'm working my way through the code on Linux now. When I checked out origin/next from the repo, I started running into issues locally. When I revert back to the v3.0.2 tag, it compiles perfectly. So - this is good. It's no longer a "windows only" issue and makes my job of debugging much easier.

While reading very carefully through cmGlobalGenerator.cxx, I came across something that struck me as odd. Line number (from v3.0.2 tag) 501 doesn't look like it should be there after reading lines 536-540. I don't think this has anything to do with my issue, but worth raising nonetheless.
(0036827)
David Zemon (reporter)
2014-09-18 22:28

I added a line to cmMakefile.cxx to help with the debugging. In the v3.0.2 tag, I added

  std::cout << "We're reading the external file: " << external << std::endl;

below line 634. I added the same line to the next branch.

The following two comments will contain first few lines of output when generating with v3.0.2 and next - they are radically different, with next reading in many more files than v3.0.2.
(0036828)
David Zemon (reporter)
2014-09-18 22:28

From tag v3.0.2:

david@balrogJr:~/External/Kits/Embedded/Parallax/Library/PropWare/bin$ rm -rf * && cmake ..
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/CMakePropellerHeader.cmake
We're reading the external file: /home/david/reusable/cmake_copy/Modules/CMakeUnixFindMake.cmake
We're reading the external file: /home/david/reusable/cmake_copy/Modules/CMakeDetermineSystem.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/bin/home/david/External/Kits/Embedded/Parallax/Library/PropWare/PropellerToolchain.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/PropellerToolchain.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/bin/CMakeFiles/3.0.2/CMakeSystem.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/PropellerToolchain.cmake
Language is enabled: C
We're reading the external file: /home/david/reusable/cmake_copy/Modules/CMakeDetermineCCompiler.cmake
We're reading the external file: /home/david/reusable/cmake_copy/Modules/CMakeDetermineCompiler.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/Platform/Generic-C
We're reading the external file: /home/david/reusable/cmake_copy/Modules/CMakeDetermineCompilerId.cmake
-- The C compiler identification is GNU 4.6.1
We're reading the external file: /home/david/reusable/cmake_copy/Modules/CMakeFindBinUtils.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/bin/CMakeFiles/3.0.2/CMakeCCompiler.cmake
Language is enabled: CXX
(0036829)
David Zemon (reporter)
2014-09-18 22:29

From next:

david@balrogJr:~/External/Kits/Embedded/Parallax/Library/PropWare/bin$ rm -rf * && cmake ..
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/CMakePropellerHeader.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/CMakeUnixFindMake.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/CMakeDetermineSystem.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/bin/home/david/External/Kits/Embedded/Parallax/Library/PropWare/PropellerToolchain.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/PropellerToolchain.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/bin/CMakeFiles/3.0.20140918-g624c3b/CMakeSystem.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/PropellerToolchain.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/CMakeSystemSpecificInitialize.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/Platform/Generic-Initialize
Language is enabled: C
We're reading the external file: /home/david/reusable/cmake/Modules/CMakeDetermineCCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/CMakeDetermineCompiler.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/Platform/Generic-C
We're reading the external file: /home/david/reusable/cmake/Modules/CMakeDetermineCompilerId.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/CMakeCompilerIdDetection.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/CMakeParseArguments.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/XL-C-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/SunPro-C-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/Intel-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/zOS-C-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/HP-C-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/ADSP-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/Cray-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/PGI-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/Clang-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/Clang-DetermineCompilerInternal.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/MSVC-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/Embarcadero-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/GNU-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/AppleClang-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/Clang-DetermineCompilerInternal.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/SDCC-C-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/Compaq-C-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/MIPSpro-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/PathScale-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/Borland-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/IAR-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/TI-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/Fujitsu-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/SCO-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake
We're reading the external file: /home/david/reusable/cmake/Modules/Compiler/Watcom-DetermineCompiler.cmake
-- The C compiler identification is GNU 4.6.1
We're reading the external file: /home/david/reusable/cmake/Modules/CMakeFindBinUtils.cmake
We're reading the external file: /home/david/External/Kits/Embedded/Parallax/Library/PropWare/bin/CMakeFiles/3.0.20140918-g624c3b/CMakeCCompiler.cmake
Language is enabled: CXX
(0036831)
Brad King (manager)
2014-09-19 08:36

Re 0015155:0036826: I think you're right about the "needTestLanguage[lang] = true;" line, but it actually makes no difference currently because both copies of that will be unconditionally reached.

Re 0015155:0036827: Post-3.0 development has refactored the way the compiler id detection source file gets generated. Fragments are now loaded from all those Compiler/*-DetermineCompiler.cmake modules.

As explained in the file linked from 0015155:0036823, the language enablement APIs are internal so if you maintain your own in CMAKE_MODULE_PATH it is up to you to port to each new CMake version.
(0036833)
David Zemon (reporter)
2014-09-19 09:43
edited on: 2014-09-19 09:44

Well - I've finally fixed my problem. Looks like the only bug in CMake was that it wasn't catching my error in Linux and was poorly describing it in Windows. I needed to add CMakeTest<Lang>Compiler.cmake files. Once I added that file for each language, it compiles perfectly with every version of CMake that I've tried.

Thankfully, the origin/next branch of cmake both reports the error in Linux and describes it properly on both OSes, so there is nothing more to do with this ticket.

Thank you so much for all your help. It's a huge relief to finally have PropWare working on Windows!!!

(0036834)
Brad King (manager)
2014-09-19 09:45

Re 0015155:0036833: Great, thanks for reporting back. The error message fix will be in the CMake 3.1 release.
(0038128)
Robert Maynard (manager)
2015-03-02 08:57

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2014-09-14 00:37 David Zemon New Issue
2014-09-14 00:41 David Zemon Note Added: 0036791
2014-09-14 00:48 David Zemon Note Added: 0036792
2014-09-15 10:03 Brad King Note Added: 0036795
2014-09-15 10:11 David Zemon Note Added: 0036797
2014-09-15 10:18 Brad King Note Added: 0036799
2014-09-15 10:25 David Zemon Note Added: 0036800
2014-09-16 20:49 David Zemon Note Added: 0036815
2014-09-16 20:50 David Zemon Note Edited: 0036815
2014-09-16 21:04 David Zemon Note Added: 0036816
2014-09-16 21:37 David Zemon Note Added: 0036817
2014-09-18 09:29 Brad King Note Added: 0036822
2014-09-18 09:32 Brad King Note Added: 0036823
2014-09-18 21:45 David Zemon Note Added: 0036826
2014-09-18 22:28 David Zemon Note Added: 0036827
2014-09-18 22:28 David Zemon Note Added: 0036828
2014-09-18 22:29 David Zemon Note Added: 0036829
2014-09-19 08:36 Brad King Note Added: 0036831
2014-09-19 09:43 David Zemon Note Added: 0036833
2014-09-19 09:44 David Zemon Note Edited: 0036833
2014-09-19 09:45 Brad King Note Added: 0036834
2014-09-19 09:47 Brad King Assigned To => Brad King
2014-09-19 09:47 Brad King Status new => resolved
2014-09-19 09:47 Brad King Resolution open => fixed
2014-09-19 09:47 Brad King Fixed in Version => CMake 3.1
2014-09-19 09:47 Brad King Target Version => CMake 3.1
2014-09-19 09:47 Brad King Summary cmlistfilecache: error can not open file => enable_language reports failure to find a module, but not which one
2015-03-02 08:57 Robert Maynard Note Added: 0038128
2015-03-02 08:57 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team