Open rjzak opened 1 year ago
We test LLVM 11 and LLVM 14 at the CI, so LLVM 12 should also work.
It seems the problem is somewhere in here on your system:
The LLVM_INCLUDE_DIRS
is incorrect; this variable is set by this line I think: https://github.com/lfortran/lfortran/blob/107de5718008ae05deb1da173e54efdde9316d79/CMakeLists.txt#L124, so possibly your LLVM installation has broken CMake files.
How did you install LLVM?
LLVM was installed via the package manager, and LLVM does have a bunch of cmake files, and it does seem that LLVM is found. Just a bad variable is set.
Ok. Did you manage to resolve it? If so, then you can close the issue. If not, then let's figure it out.
Haven't figured it out, and I made sure I have all the LLVM 12 & CMake packages available installed.
$ sudo xbps-query -s "Low Level Virtual"
[*] clang-12.0.1_3 Low Level Virtual Machine - C language family frontend
[*] clang-analyzer-12.0.1_3 Low Level Virtual Machine - A source code analysis framework
[*] clang-tools-extra-12.0.1_3 Low Level Virtual Machine - Extra Clang tools
[*] libclang-12.0.1_3 Low Level Virtual Machine - C frontend runtime library
[*] libclang-cpp-12.0.1_3 Low Level Virtual Machine - C frontend runtime library (C++ interface)
[*] libcxx-12.0.1_3 Low Level Virtual Machine - C++ standard library
[*] libcxx-devel-12.0.1_3 Low Level Virtual Machine - C++ standard library - development files
[*] libcxxabi-12.0.1_3 Low Level Virtual Machine - low level support for libc++
[*] libcxxabi-devel-12.0.1_3 Low Level Virtual Machine - low level support for libc++ - development files
[*] libllvm12-12.0.1_3 Low Level Virtual Machine - runtime library
[*] libomp-12.0.1_3 Low Level Virtual Machine - Clang OpenMP support library
[*] libomp-devel-12.0.1_3 Low Level Virtual Machine - Clang OpenMP support library - development files
[*] lld-12.0.1_3 Low Level Virtual Machine - linker
[*] lld-devel-12.0.1_3 Low Level Virtual Machine - linker - development files
[*] lldb-12.0.1_3 Low Level Virtual Machine - LLDB debugger
[*] llvm-libunwind-12.0.1_3 Low Level Virtual Machine - libunwind
[*] llvm-libunwind-devel-12.0.1_3 Low Level Virtual Machine - libunwind - development files
[*] llvm12-12.0.1_3 Low Level Virtual Machine
$ sudo xbps-query -s cmake
[*] cmake-3.24.2_1 Cross-platform, open-source build system
[*] extra-cmake-modules-5.98.0_1 Extra modules and scripts for CMake
Keep the issue open until we figure it out. Are you using Void Linux? I would need to install it and debug it to see what the problem could be.
I am using Void Linux, but for PowerPC64LE, which complicates things since it's an unofficial port, and Void for x86_64 may behave differently. I can investigate as well, but I'm not sure where the p
variable in p::llvm
comes from.
The p
variable is defined here: https://github.com/lfortran/lfortran/blob/107de5718008ae05deb1da173e54efdde9316d79/CMakeLists.txt#L167, it's just p::llvm
as the cmake name of the target.
CMake seems to grab GNU compilers despite being able to locate LLVM. Is LLVM 12.0 not new enough?