0

I'm trying to compile LLVM using the Windows Subsystem for Linux (Windows 10 build 10.0.14342), but I keep getting cmake errors about how I'm missing C & C++ compilers. This is despite having gcc, g++, and build-essentials by using apt-get from within bash. My command is as follows:

cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" ../llvm-3.8 

I get a bunch of errors from CMake

 CMake Error: Parse error in cache file /home/andrew-wsl/llvm/build/CMakeCache.txt. Offending entry: Debug Info builds. CMake Error: Parse error in cache file /home/andrew-wsl/llvm/build/CMakeCache.txt. Offending entry: CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED -- 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:54 (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:54 (project) -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/cc -- 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 /home/andrew-wsl/llvm/build/CMakeFiles/CMakeTmp/testCCompiler.c try_compile() works only for enabled languages. Currently these are: ASM C CXX See project() command to enable other languages. Call Stack (most recent call first): CMakeLists.txt:54 (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:54 (project) -- Configuring incomplete, errors occurred! See also "/home/andrew-wsl/llvm/build/CMakeFiles/CMakeOutput.log". See also "/home/andrew-wsl/llvm/build/CMakeFiles/CMakeError.log". andrew-wsl@COMPUTER:~/llvm/build$ 

CMakeError.log can be found here: http://pastebin.com/7rWYFGu5

CMakeOutput.log can be found here: http://pastebin.com/2BaEFTvR

I'm not sure what's going on as I was able to compile a helloworld program with gcc and g++ successfully.

4
  • 2
    Did you switch the compiler/toolchain within the same binary output directory? Looks like completely removing your binary output directory and try again from scratch would help. Cache errors are typical for the described scenario. Commented Jun 17, 2016 at 7:52
  • @Florian Is the folder you're talking about the one where the resulting Makefile will be outputted? If so then yes. I did completely remove it, but I still had the same CMake errors afterwards. Commented Jun 17, 2016 at 8:07
  • Very strange are the (configure_file): configure_file Problem configuring file errors. Looks like file access problems (out of disk space, permissions, etc.). Please also take a look into CMakeFiles/CMakeError.log. Commented Jun 17, 2016 at 8:17
  • @Florian I have attached a link to the CMakeError.log at the bottom of my question. It looks like some CMake test files were unable to be compiled? Commented Jun 17, 2016 at 8:32

1 Answer 1

1

Turns out this is a known bug: https://github.com/Microsoft/BashOnWindows/issues/272

Long story short, it's fixed as of build 14352.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.