Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

cmake error on Arch Linux #51

Closed
NanXiao opened this issue Apr 2, 2019 · 2 comments
Closed

cmake error on Arch Linux #51

NanXiao opened this issue Apr 2, 2019 · 2 comments

Comments

@NanXiao
Copy link

NanXiao commented Apr 2, 2019

Hi,

Greeting from me!

My OS is Arch Linux, and cmake version is 3.14.1. Running "cmake -G Ninja ../llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release" will generate following error:

# cmake -G Ninja ../llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release
CMake Deprecation Warning at CMakeLists.txt:14 (cmake_policy):
  The OLD behavior for policy CMP0051 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/root/project/build/CMakeFiles/CMakeOutput.log".

Could you help to check it? Thanks very much in advance!

Best Regards
Nan Xiao

@rafaelauler
Copy link
Contributor

I've seen this error happening with me before when trying to build LLVM in a misconfigured environment, but I don't quite remember what I did. I'm going to guess that the fact that you are missing "ninja" is confusing CMake, so I would first try to install "ninja" before specifying you want to use ninja with "-G Ninja".

So you should either install ninja or drop the "-G Ninja" option and build with make, like this:

cmake ../llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release
make

I don't know the package in Arch that installs ninja, but in Ubuntu it is "ninja-build". So I would try to install ninja or ninja-build, whatever works.

@NanXiao
Copy link
Author

NanXiao commented Apr 3, 2019

@rafaelauler

Yes, this is the problem. Thanks very much for your help!

@NanXiao NanXiao closed this as completed Apr 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants