jank icon indicating copy to clipboard operation
jank copied to clipboard

can't compile on Fresh Ubuntu 24.10

Open veqqq opened this issue 6 months ago • 6 comments

Debian dependencies:

sudo apt-get install -y curl git git-lfs zip build-essential entr libssl-dev libdouble-conversion-dev pkg-config ninja-build cmake zlib1g-dev libffi-dev clang libclang-dev llvm llvm-dev libzip-dev libbz2-dev doctest-dev gcc g++ libgc-dev

newest clang/llvm: bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"

Try to build:

cd compiler+runtime
./bin/configure -GNinja -DCMAKE_BUILD_TYPE=Release
./bin/compile

Error:

The imported target "clangBasic" references the file

"/usr/lib/llvm-19/lib/libclangBasic.a"

but this file does not exist. Possible reasons include:

* The file was deleted, renamed, or moved to another location.

* An install or uninstall procedure did not complete successfully.

* The installation package was faulty and contained

"/usr/lib/llvm-19/lib/cmake/clang/ClangTargets.cmake"

but not all the files it references.

Similar to: https://github.com/llvm/llvm-project/issues/108995
Try solution from https://github.com/llvm/llvm-project/issues/99819

This from same llvm page but lower:

apt-get install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python3-clang

Same error.

Try this from page:

apt-get install libllvm-19-ocaml-dev libllvm19 llvm-19 llvm-19-dev llvm-19-doc llvm-19-examples llvm-19-runtime

same issue.

apt-get install libclang-rt-19-dev
# polly
apt-get install libpolly-19-dev
# libfuzzer
apt-get install libfuzzer-19-dev
# lldb
apt-get install lldb-19
# lld (linker)
apt-get install lld-19
# libc++
apt-get install libc++-19-dev libc++abi-19-dev
# OpenMP
apt-get install libomp-19-dev
# libclc
apt-get install libclc-19-dev
# libunwind
apt-get install libunwind-19-dev
# mlir
apt-get install libmlir-19-dev mlir-19-tools
# bolt
apt-get install libbolt-19-dev bolt-19
# flang
apt-get install flang-19

Try to build again. Error:

CMake Error at CMakeLists.txt:131 (message):
Found Clang 19.1.7 to embed in jank, but trying to use Clang 18.1.3 to
compile it. Please ensure you're using the same Clang to compile jank as
you are embedding in jank. Follow the build.md documentation.

-- Configuring incomplete, errors occurred!
ninja: error: loading 'build.ninja': No such file or directory

...Ninja is already installed! However:

The following package was automatically installed and is no longer required:
liblldb-18

sudo apt autoremove

Force cmake to use newer clang:

export CC=/usr/bin/clang-19

I deleted "clang" and renamed "clang-19" to "clang" but the same error!

Use this to get the compiler going!

export CC=clang-19 export CCX=clang++-19


Build, New error:

-- The CXX compiler identification is Clang 18.1.3 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: /usr/bin/clang++-19 -- Check for working C compiler: /usr/bin/clang++-19 - broken CMake Error at /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler

"/usr/bin/clang++-19"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: '/home/alex/jank/compiler+runtime/build/CMakeFiles/CMakeScratch/TryCompile-bsmOYc'

Run Build Command(s): /usr/bin/ninja -v cmTC_ca040 [1/2] /usr/bin/clang++-19 -o CMakeFiles/cmTC_ca040.dir/testCCompiler.c.o -c /home/alex/jank/compiler+runtime/build/CMakeFiles/CMakeScratch/TryCompile-bsmOYc/testCCompiler.c FAILED: CMakeFiles/cmTC_ca040.dir/testCCompiler.c.o /usr/bin/clang++-19 -o CMakeFiles/cmTC_ca040.dir/testCCompiler.c.o -c /home/alex/jank/compiler+runtime/build/CMakeFiles/CMakeScratch/TryCompile-bsmOYc/testCCompiler.c clang++-19: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] /home/alex/jank/compiler+runtime/build/CMakeFiles/CMakeScratch/TryCompile-bsmOYc/testCCompiler.c:2:3: error: "The CMAKE_C_COMPILER is set to a C++ compiler" 2 | # error "The CMAKE_C_COMPILER is set to a C++ compiler" | ^ 1 error generated. ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:21 (project)


That was a bit painful.

veqqq avatar Apr 01 '25 02:04 veqqq