WSL: Cmake cannot find the gcc/g++ compilers
Hi, I installed build essentials, gcc, g++, cmake, make and I tried to run a simple project. However I get error messages from CMAKE that the compiler is broken.
:/mnt/c/Users/NAME/Documents/githubLocal/mybuild$ cmake Unix Makefiles -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/usr/bin/g++ - DCMAKE_CC_COMPILER=/usr/bin/gcc … – The C compiler identification is unknown CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:186 (configure_file): configure_file Problem configuring file Call Stack (most recent call first): CMakeLists.txt:59 (project)
-- The CXX compiler identification is unknown
CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:185 (configure_file):
configure_file Problem configuring file Call Stack (most recent call first): CMakeLists.txt:59 (project)
– Check for working C compiler: /usr/bin/cc CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:47 (try_compile): Unknown extension “.c” for file
/mnt/c/Users/NAME/Documents/githubLocal/mybuild/CMakeFiles/CMakeTmp/testCCompiler.c
try_compile() works only for enabled languages. Currently these are:
C CXX
See project() command to enable other languages. Call Stack (most recent call first): CMakeLists.txt:59 (project)
– Check for working C compiler: /usr/bin/cc – broken CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message): The C compiler “/usr/bin/cc” is not able to compile a simple test program.
It fails with the following output:
CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:59 (project)
– Configuring incomplete, errors occurred! See also “/mnt/c/Users/NAME/Documents/githubLocal/mybuild/CMakeFiles/CMakeOutput.log”. See also “/mnt/c/Users/NAME/Documents/githubLocal/mybuild/CMakeFiles/CMakeError.log”. nlappas@NIKOS-SURFACE:/mnt/c/Users/Nikos/Documents/githubLoca/mybuild$`
By the way the compilers work properly, when I use them from the command line, they compile source files and link them succesfully. Which gcc and which g++ give me also the correct paths.
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Reactions: 3
- Comments: 30 (11 by maintainers)
I just updated - looks like this fix did not make it in time for 14342.
It seems fixed in the build 14352 that was released today to the fast ring 😄
This appears to be caused by the writev system call failing with -EFAULT on WSL and succeeding on linux when passed a struct iovec containing a null pointer.
This program prints nothing on Linux and “bad address” on WSL.
Closing this out as users have verified this is fixed in build 14352, please reopen if you continue to see this issue. Thanks!
@WhiteBearSpirit Unfortunately you’ll have to wait for another external release to the fast ring for this to be fixed. The change that fixes this was made a few days ago on our development branch and will take some time to reach the fast ring. Unfortunately there is currently no workaround.
Keep an eye out for our release notes as we release new builds.
@Mcgoo Thanks for the awesome debugging! Minor note: Its actually the buffer size of zero that makes the above example work. If you change the size to non zero you will get EFAULT.
I’m actually working on a fix for this right now. I’ll be sure to try cmake to make sure it works with my change.
Hi @WhiteBearSpirit , if you can install Torch7 on this great Windows Bash (after they fixed the bug), please let me know… I also want to install Torch7 on Windows. Thanks!!