Cannot compile locally with Clang-14
I am facing issues trying to compile C8 locally using Clang-14. The conan profile I am using is the following:
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=clang
compiler.version=14
compiler.libcxx=libstdc++
build_type=Release
compiler.cppstd=17
[options]
[build_requires]
[env]
Before I do a conan install
I made sure to clean the .conan/data
directory in order to force conan to build everything fresh. I am getting this error:
In file included from /home/nikos/.conan/data/fmt/8.0.1/_/_/build/03e199533715cb80ae759a2913e41bae9bb6f13b/src/src/os.cc:13:
/home/nikos/.conan/data/fmt/8.0.1/_/_/build/03e199533715cb80ae759a2913e41bae9bb6f13b/src/include/fmt/os.h:11:10: fatal error: 'cerrno' file not found
#include <cerrno>
^~~~~~~~
In file included from /home/nikos/.conan/data/fmt/8.0.1/_/_/build/03e199533715cb80ae759a2913e41bae9bb6f13b/src/src/format.cc:8:
/home/nikos/.conan/data/fmt/8.0.1/_/_/build/03e199533715cb80ae759a2913e41bae9bb6f13b/src/include/fmt/format-inl.h:11:10: fatal error: 'algorithm' file not found
#include <algorithm>
^~~~~~~~~~~
1 error generated.
gmake[2]: *** [CMakeFiles/fmt.dir/build.make:90: CMakeFiles/fmt.dir/src/os.cc.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
1 error generated.
gmake[2]: *** [CMakeFiles/fmt.dir/build.make:76: CMakeFiles/fmt.dir/src/format.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/fmt.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2
fmt/8.0.1:
fmt/8.0.1: ERROR: Package '03e199533715cb80ae759a2913e41bae9bb6f13b' build failed
fmt/8.0.1: WARN: Build folder /home/nikos/.conan/data/fmt/8.0.1/_/_/build/03e199533715cb80ae759a2913e41bae9bb6f13b/build/Release
ERROR: fmt/8.0.1: Error in build() method, line 104
cmake.build()
ConanException: Error 2 while executing cmake --build "/home/nikos/.conan/data/fmt/8.0.1/_/_/build/03e199533715cb80ae759a2913e41bae9bb6f13b/build/Release" '--' '-j16'
Another thing I tried (although clearly wrong), was to copy paste the packages that have worked with gcc 11.3
and then build conan using the clang profile. Of course this didn't work out either producing this error:
bzip2/1.0.8: Calling build()
-- The C compiler identification is Clang 14.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang-14 - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
CMake Error at CMakeLists.txt:8 (add_library):
Cannot find source file:
//blocksort.c
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
CMake Error at CMakeLists.txt:38 (add_executable):
Cannot find source file:
//bzip2.c
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
CMake Error at CMakeLists.txt:8 (add_library):
No SOURCES given to target: bz2
CMake Error at CMakeLists.txt:38 (add_executable):
No SOURCES given to target: bzip2
CMake Generate step failed. Build files cannot be regenerated correctly.
bzip2/1.0.8:
bzip2/1.0.8: ERROR: Package 'fa6184392c7eba184edf56424b614463a3a25e60' build failed
bzip2/1.0.8: WARN: Build folder /home/nikos/.conan/data/bzip2/1.0.8/_/_/build/fa6184392c7eba184edf56424b614463a3a25e60
ERROR: bzip2/1.0.8: Error in build() method, line 67
cmake = self._configure_cmake()
while calling '_configure_cmake', line 61
self._cmake.configure()
ConanException: Error 1 while executing cd '/home/nikos/.conan/data/bzip2/1.0.8/_/_/build/fa6184392c7eba184edf56424b614463a3a25e60' && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="clang" -DCONAN_COMPILER_VERSION="14" -DCONAN_CXX_FLAGS="-m64" -DCONAN_SHARED_LINKER_FLAGS="-m64" -DCONAN_C_FLAGS="-m64" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="/home/nikos/.conan/data/bzip2/1.0.8/_/_/package/fa6184392c7eba184edf56424b614463a3a25e60" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCONAN_CMAKE_POSITION_INDEPENDENT_CODE="ON" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -DBZ2_VERSION_STRING="1.0.8" -DBZ2_VERSION_MAJOR="1" -DBZ2_BUILD_EXE="True" -Wno-dev '/home/nikos/.conan/data/bzip2/1.0.8/_/_/build/fa6184392c7eba184edf56424b614463a3a25e60'
Since we do know that clang-14 can be built successfully at least in our CI, can somebody help me built C8 locally? I am using Ubuntu 22.04 and clang-14.