llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.59k stars 11.82k forks source link

[Compilation-related problem] "ExtendPath" issue for the llvm-15.0.0 release #57579

Open rubyFeedback opened 2 years ago

rubyFeedback commented 2 years ago

Hello llvm devs, just reporting a potential issue - I think it is already aware, but I wanted to mention it for llvm-15.0.0 since it was released recently.

So I am trying to compile llvm from source on my linux box here.

However had, I am running into this issue:

-- Targeting AMDGPU
-- Targeting BPF
-- Targeting X86
-- Registering Bye as a pass plugin (static build: OFF)
CMake Error at cmake/modules/CMakeLists.txt:1 (include):
  include could not find requested file:

    ExtendPath

CMake Error at cmake/modules/CMakeLists.txt:3 (include):
  include could not find requested file:

    FindPrefixFromConfig

CMake Error at cmake/modules/CMakeLists.txt:116 (find_prefix_from_config):
  Unknown CMake command "find_prefix_from_config".

For reference purposes, here is my environment:

Operating system:                GNU/Linux
Operating system bit type:       x86_64 (64 bit)
CPU Model:                       AMD A8-7600 Radeon R7, 10 Compute Cores 4C+6G, 4 cores
RAM:                             14934 MB RAM
CFLAGS in use:                   -O2 -fPIC -fno-strict-overflow -Wno-error
gcc:                             12.2.0
glibc:                           2.33
linux:                           5.15.19
binutils:                        2.39
cmake:                          3.24.1

I did not have these issues with older cmake versions so perhaps it has to do more with cmake than llvm. Either way, something isn't quite right. After the Unknown CMake command "find_prefix_from_config". it does not continue. So I currently can not compile llvm from source. I used to be able to do so before on the same machine, so I have to investigate the issue eventually.

I believe the same issue arose on llvm-14.0.x releases - at the least when I googled for this error I also encountered this in an older github issue a few months ago. It was listed as fixed back then, but with the new release now, and the same issue coming up, perhaps it either was not fixed or it was a separate issue. Either way I am just reporting this.

Hopefully someone can have a look - llvm is kind of needed for many other projects such as meson. On my main machine here the older llvm I have still works fine but on a new computer without internet connection this is a bit of an issue (I can of course connect it to the internet but my flat is oddly spaced and my wifi connector has another issue, so I'd have to carry the computer to the basement and for the time being I am avoiding this; will investigate more when I have time later this day or week.)

Anyway that's it here - please feel free to close this issue at any moment in time, especially if it is already known.

asl commented 2 years ago

How have you checked out LLVM? Did you do git clone of the repo? Or did something else?

Visone-Selektah commented 2 years ago

Hi! I have the exact same error, building it from sources (tar.xz file) OS --> Venom-linux Kernel --> 5.19.7 GCC --> 12.2.0 Glibc --> 2.36 Binutils --> 2.39 Cmake --> 3.24

atsampson commented 2 years ago

I'm seeing the same problem, building from the separate tarballs in the same way as for previous releases - none of {clang,clang-tools-extra,compiler-rt,llvm,openmp,polly}-15.0.0.src.tar.gz contain llvm-project/cmake, so the definitions there aren't found. Building from llvm-project-15.0.0.src.tar.gz, which contains everything, works OK.

nikic commented 2 years ago

The cmake directory is shipped separately in the cmake-* tarball. You will need it in addition to llvm-* if you are doing standalone builds.

amigalemming commented 1 year ago

The separate cmake tarball remains unmentioned in GettingStarted.html. I have downloaded and unpacked the cmake tarball but still do not know how to incorporate its files. The llvm tarball already contains directory cmake/modules, whereas the cmake tarball contains the directory Modules.

amigalemming commented 1 year ago

I have added the option -DCMAKE_MODULE_PATH=/tmp/cmake-15.0.7.src/Modules to the cmake call. This seems to fix the FindPrefixFromConfig issue but leaves me with other errors.