-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CommandLine Error under LLVM 18 (Ubuntu 22.04) #678
Comments
Like it says in #357, this is a packaging issue. If you follow the instructions in the README to build LLVM from source you will not see this. |
I've followed instructions in a README.md and built LLVM 13 from source.
Then I've followed instructions in a README.md and built LLVM 18 (llvm-18.1.3) from source. Instruction in a README missed several steps important for successful LLVM build. Building terra with LLVM 18 is failed on a linkage due to error:
According to advice in 1 I've rebuilt terra with
Please help. terra: release-1.2.0-4-g7faa246 Footnotes |
I don't have Ubuntu 22.04 personally, so I am using Docker to build. But this should give you a basis for debugging—if it works here and not on your machine, maybe you have some difference in your system configuration that is causing problems. Note that the LLVM 18 source build is slightly different because LLVM changed the source distribution layout, but that other than the combined tarball and one additional flag One other thing I'll mention: link errors like what you show me are relatively unusual. I actually cannot think of the last time I've seen something like that. I wonder if it's possible that you're not actually using your source builds of LLVM. If you accidentally mixed builds or used the wrong one, that would be a classic way to get the errors you indicated. Configuration for Ubuntu 22.04 and LLVM 13
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -qq && \
apt-get install -qq build-essential cmake git wget libpython3-dev python3-pip && \
apt-get clean
RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/llvm-13.0.0.src.tar.xz && \
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang-13.0.0.src.tar.xz && \
tar xf llvm-13.0.0.src.tar.xz && \
tar xf clang-13.0.0.src.tar.xz && \
mv clang-13.0.0.src llvm-13.0.0.src/tools/clang && \
mkdir build install && \
cd build && \
cmake ../llvm-13.0.0.src -DCMAKE_INSTALL_PREFIX=$PWD/../install -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_LIBEDIT=OFF -DLLVM_ENABLE_ZLIB=OFF -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_ENABLE_ASSERTIONS=OFF && \
make install -j20 && \
rm -rf build llvm-13.0.0.src *.tar.xz
RUN git clone https://github.com/terralang/terra.git && \
cd terra/build && \
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../install -DCMAKE_PREFIX_PATH=$PWD/../../install && \
make install -j20 && \
ctest -j20 Build with: docker build -f Dockerfile.ubuntu22-llvm13 . Note that you may want to adjust the Configuration for Ubuntu 22.04 and LLVM 18
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -qq && \
apt-get install -qq build-essential cmake git wget libpython3-dev python3-pip && \
apt-get clean
RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/llvm-project-18.1.8.src.tar.xz && \
tar xf llvm-project-18.1.8.src.tar.xz && \
mkdir build install && \
cd build && \
cmake ../llvm-project-18.1.8.src/llvm -DCMAKE_INSTALL_PREFIX=$PWD/../install -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_LIBEDIT=OFF -DLLVM_ENABLE_ZLIB=OFF -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_ENABLE_ASSERTIONS=OFF -DLLVM_ENABLE_PROJECTS='clang' && \
make install -j20 && \
rm -rf build llvm-project-18.1.8.src *.tar.xz
RUN git clone https://github.com/terralang/terra.git && \
cd terra/build && \
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/../install -DCMAKE_PREFIX_PATH=$PWD/../../install && \
make install -j20 && \
ctest -j20 Build with: docker build -f Dockerfile.ubuntu22-llvm18 . |
Many thanks! Finally, I can build it with LLVM 18. |
Compiled using CMake:
Backtrace:
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
Similar issue: #357
The text was updated successfully, but these errors were encountered: