c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Cannot compile on Ubuntu 24.04.1 with GCC

Open Adversing opened this issue 11 months ago • 4 comments

I am encountering the same issue I mentioned in the discussion down below, even though it has been resolved by @farid-cs by installing ncurses headers. My setup is as follows:

  • OS: Ubuntu 24.04.1
  • Compiler: GCC (not musl)
  • cmake-tools version: 1.20.36
  • cmake version: 0.0.17 (VSc extension)

Steps Taken

I have attempted the following to resolve the issue:

  1. Re-installed the required libraries (tried multiple versions).
  2. Cloned the repository again.

Despite these attempts, the issue persists when building the project via the Visual Studio Code extension CMake Tools. However, when I build C3 Compiler using the terminal, it works without any issues.

Discussed in https://github.com/c3lang/c3c/discussions/1817

Originally posted by farid-cs January 11, 2025 I tryed to compile on Void Linux musl version following all the instructions, but if failed with the following error:

CMake Error at /usr/lib/cmake/llvm/LLVMExports.cmake:73 (set_target_properties):
  The link interface of target "LLVMSupport" contains:

    Terminfo::terminfo

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /usr/lib64/cmake/llvm/LLVMConfig.cmake:353 (include)
  CMakeLists.txt:149 (find_package)

Adversing avatar Jan 15 '25 00:01 Adversing

I had something similar as a problem when using CMake from within CLion. Basically the environment variables were different in some way, so I always had to explicitly add these:

-DLLVM_DIR=/opt/homebrew/Cellar/llvm@18/18.1.8/lib/cmake/llvm
-DLLD_DIR=/opt/homebrew/Cellar/llvm@18/18.1.8/lib/cmake/lld

Could something similar help you?

lerno avatar Jan 21 '25 11:01 lerno

I had something similar as a problem when using CMake from within CLion. Basically the environment variables were different in some way, so I always had to explicitly add these:

-DLLVM_DIR=/opt/homebrew/Cellar/llvm@18/18.1.8/lib/cmake/llvm
-DLLD_DIR=/opt/homebrew/Cellar/llvm@18/18.1.8/lib/cmake/lld

Could something similar help you?

Thanks for the info, I'll let you know when I'll try to change the env variables as you said.

Adversing avatar Jan 21 '25 19:01 Adversing

Unfortunately, even after applying the fix you proposed, the error is still present.

Adversing avatar Jan 22 '25 19:01 Adversing

The issue is still present and still I have no idea how to fix it.

Adversing avatar Mar 21 '25 09:03 Adversing

The build works fine with clang with this Dockerfile/Containerfile I made. @Adversing

ARG UBUNTU_VERSION=24.04
FROM ubuntu:${UBUNTU_VERSION}

RUN apt-get -y update && apt-get -y upgrade && apt-get -y install cmake git clang zlib1g zlib1g-dev libllvm18 llvm llvm-dev llvm-runtime liblld-dev liblld-18 libpolly-18-dev

RUN cd ~ && git clone https://github.com/c3lang/c3c.git && cd c3c && cmake -B build -S . && cmake --build build && ./build/c3c --version

ENTRYPOINT ~/c3c/build/c3c

Just install podman from apt, then podman build --tag c3c .

waveproc avatar Aug 28 '25 04:08 waveproc

This Dockerfile has gcc instead of clang and it also worked.

ARG UBUNTU_VERSION=24.04
FROM ubuntu:${UBUNTU_VERSION}

RUN apt-get -y update && apt-get -y upgrade && apt-get -y install cmake git build-essential gcc zlib1g zlib1g-dev libllvm18 llvm llvm-dev llvm-runtime liblld-dev liblld-18 libpolly-18-dev

RUN cd ~ && git clone https://github.com/c3lang/c3c.git && cd c3c && cmake -B build -S . && cmake --build build && ./build/c3c --version

ENTRYPOINT ~/c3c/build/c3c

waveproc avatar Aug 28 '25 04:08 waveproc