c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Building C3 on ubuntu fails

Open tonis2 opened this issue 1 year ago • 6 comments

Hei,

I'm trying to build C3 dev on ubuntu.

Cloned the repo, entered the folder, created build folder, then ran cmake ..

Below is what error I'm getting, the build process some-why deletes the ´/lib` folder inside c3 folder

C3C version: 0.6.0
-- Found LLVM 18.1.8
-- Using LLVMConfig.cmake in: /usr/lib/llvm-18/cmake
-- Libraries located in: /usr/lib/llvm-18/lib
-- LLVM was built with RTTI
-- using find_library
CMake Error at CMakeLists.txt:209 (file):
  file COPY cannot find "/var/home/default/Documents/c/c3c/lib": No such file
  or directory.


-- linking to llvm libs LLD_COFF-NOTFOUND;LLD_COMMON-NOTFOUND;LLD_WASM-NOTFOUND;LLD_MINGW-NOTFOUND;LLD_ELF-NOTFOUND;LLD_MACHO-NOTFOUND
-- Found lld libs LLD_COFF-NOTFOUND;LLD_COMMON-NOTFOUND;LLD_WASM-NOTFOUND;LLD_MINGW-NOTFOUND;LLD_ELF-NOTFOUND;LLD_MACHO-NOTFOUND
-- using gcc/clang warning switches
-- The following OPTIONAL packages have been found:

 * FFI
 * LibEdit
 * Terminfo
 * ZLIB
 * zstd
 * LibXml2
 * CURL

-- The following REQUIRED packages have been found:

 * LLVM

tonis2 avatar Jul 08 '24 07:07 tonis2

Could this somehow have caused it: file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/lib)

lerno avatar Jul 08 '24 11:07 lerno

If the CMAKE_BINARY_DIR is set to the source dir, then that could happen.

lerno avatar Jul 08 '24 11:07 lerno

Try it now.

lerno avatar Jul 08 '24 12:07 lerno

It's better now, but I'm still getting some errors

-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LLD_COFF
    linked by target "c3c" in directory /var/home/default/Documents/c/c3c
    linked by target "c3c_wrappers" in directory /var/home/default/Documents/c/c3c
LLD_COMMON
    linked by target "c3c" in directory /var/home/default/Documents/c/c3c
    linked by target "c3c_wrappers" in directory /var/home/default/Documents/c/c3c
LLD_ELF
    linked by target "c3c" in directory /var/home/default/Documents/c/c3c
    linked by target "c3c_wrappers" in directory /var/home/default/Documents/c/c3c
LLD_MACHO
    linked by target "c3c" in directory /var/home/default/Documents/c/c3c
    linked by target "c3c_wrappers" in directory /var/home/default/Documents/c/c3c
LLD_MINGW
    linked by target "c3c" in directory /var/home/default/Documents/c/c3c
    linked by target "c3c_wrappers" in directory /var/home/default/Documents/c/c3c
LLD_WASM
    linked by target "c3c" in directory /var/home/default/Documents/c/c3c
    linked by target "c3c_wrappers" in directory /var/home/default/Documents/c/c3c

tonis2 avatar Jul 09 '24 19:07 tonis2

That means LLD is missing. You need that library as well.

lerno avatar Jul 09 '24 19:07 lerno

passing -DC3_LINK_DYNAMIC=true to cmake will make it build if your system LLVM/LLD doesn't include static libraries. this is needed on some distros like arch

MegaHakkero avatar Jul 30 '24 12:07 MegaHakkero

I'm going to close the issue for now, got it fixed

tonis2 avatar Jul 30 '24 14:07 tonis2