-
Notifications
You must be signed in to change notification settings - Fork 796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cmake cannot find the gcc/g++ compilers #272
Comments
Could you try cloning your git repro into your UNIX user's home directory (cd ~) and try building again? If this is a public GitHub repro? If so send me the link and I can try this myself. Thanks! |
I tried a minimal helloworld c++ test program with the corresponding cmakefile that fails for me even in the home directory. |
Same problem here. I wanted to compile x265 (https://bitbucket.org/multicoreware/x265) and it showed:
CMakeError.log:
Currently using Insider Preview 14332. There were no problem on 14295. Didn't test on 14318. |
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.
|
@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. |
@benhillis Yeah, seems like it shouldn't validate the pointer member if the length is zero. I'd expect EFAULT with a null pointer and a non-zero length. Thanks, WSL is great stuff. |
@mcgoo after fixing the issue with the writev system call that you identified I'm able to build run cmake on the project that @nlappas linked. @mxalbert1996 I'm trying out https://bitbucket.org/multicoreware/x265 now.
|
@mxalbert1996 Looks like cmake is finding the C and C++ compilers, but I'm not sure what to do at this screen. If I press 'c' I get an "Errors occurred during the last pass" error. |
I'm afraid I don't know what to say on that latest issue but I did get the same cmake compiler errors on both wangle (https://github.com/facebook/wangle) and casablanca (https://github.com/Microsoft/cpprestsdk) if you're looking for other projects to try it out on. |
@benhillis maybe try cd ~/x265; mkdir tmp; cd tmp; cmake ../source and you should be able to see what cmake is complaining about. |
Hello @benhillis !
My cmake version is 2.8.12.2 I've installed Bash on my Windows 10 (build 14332) like 40 minutes ago, so i guess it's the newest version of it. If this error is already fixed, please tell me how can I get this fix. |
@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. |
Thanks @benhillis ! |
Bug also filed over here on the CMake tracker - https://cmake.org/Bug/view.php?id=16079. Will point them this way as the source of the fix. |
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!! |
Adding a link to #238 since this has the same root cause. |
I just updated - looks like this fix did not make it in time for 14342. |
@mcgoo thanks for confirming, I will make sure that our release notes for 14342 get published today. |
If you want another public repo that is affected by this, try https://github.com/julialang/julia. That might actually generally be a good test case, it compiles a LOT of external dependencies etc., so it might be a good test case. |
What build number (and later) is this fixed in? |
@mcgoo Your test case passes successfully on 14342, specifically to STDOUT file. I modified @mcgoo's test case as follows:
I had tested combinations and summarized the test results.
Different cases are for a file + zero size combinations. (Nos. 5 & 7) |
@kimjs29 Thanks for providing such a clear repro. I'll give this a shot as soon as I get to my desk. I've confirmed that in our dev build we match the Ubuntu 15.10 column above. The fix will be in an upcoming Windows Insider fast ring build. |
when I can get the fixed release? Thank you. |
It seems fixed in the build 14352 that was released today to the fast ring :D |
Closing this out as users have verified this is fixed in build 14352, please reopen if you continue to see this issue. Thanks! |
I confirm too! |
is there a way to fix this issue without upgrading the build? the build upgrade screws up other components of my computer so I'm hoping to find a workaround with build 14342 |
@vagarwal87 - No. At the moment and unfortunately, WSL upgrade is tied to Windows build upgrade. |
Is this coming to regular users anytime soon? If it's been fixed since May, well its now October and I just ran into this bug in the Windows Anniversary edition. |
It indeed is fixed, might be that those fixes haven't made it into the newest official builds? Just subscribe to the Release Preview channel for Windows Insider, which will give you one of the most stable versions. I can confirm that in the current build of the Release Preview ring, this bug is fixed. |
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)
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
try_compile() works only for enabled languages. Currently these are:
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.
The text was updated successfully, but these errors were encountered: