Building C3 on ubuntu fails
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
Could this somehow have caused it: file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/lib)
If the CMAKE_BINARY_DIR is set to the source dir, then that could happen.
Try it now.
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
That means LLD is missing. You need that library as well.
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
I'm going to close the issue for now, got it fixed