codon
codon copied to clipboard
Error trying to build from source
Hello,
Working on a FreeBSD 13.1 system, I tried unsuccessfully to build Codon from source.
Here are the steps I took:
$ pkg install git
$ pkg install cmake
$ pkg install ninja
$ git clone --depth 1 -b codon https://github.com/exaloop/llvm-project
$ cmake -S llvm-project/llvm -B llvm-project/build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_TARGETS_TO_BUILD=all
$ cmake --build llvm-project/build
$ cmake --install llvm-project/build
On this last step there was a warning but everything else seemed to went fine (the message says "Up-to-date" because I relaunched that command line):
-- Up-to-date: /usr/local/bin/llvm-ar
CMake Warning (dev) at /usr/local/share/cmake/Modules/GNUInstallDirs.cmake:243 (message):
Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
target architecture is known. Please enable at least one language before
including GNUInstallDirs.
Call Stack (most recent call first):
llvm-project/llvm/cmake/modules/LLVMInstallSymlink.cmake:5 (include)
llvm-project/build/tools/llvm-ar/cmake_install.cmake:51 (include)
llvm-project/build/tools/cmake_install.cmake:44 (include)
llvm-project/build/cmake_install.cmake:73 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
Apparently this custom-LLVM installation doesn't overwrite any standard FreeBSD LLVM file, but I was not confident about it at the start...
Carrying on, I took the following step:
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_DIR=$(llvm-config --cmakedir) \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++
Which immediately failed with the following error (I was working in the /root/dep directory):
CMake Error: The source directory "/root/dep" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Any idea on how to go forward?