CMake error in CLion: /builder.py: ValueError: Could not determine compiler family. Use --compiler-family to disambiguate

Hi,

In terminal, ‘./yb_build.sh release’, ‘./yb_build.sh’ and ‘YB_USE_NINJA=0 ./yb_build.sh’ succeed. But in CLion, the CMake output error message as below. I am using CLion 2022.3.3 on AlmaLinux 8.7, with yugabyte-db source code version ‘Commit 661f4736 by tnayak, 03/24/2023 01:49 PM committed 03/28/2023 08:02 AM parent 3831c854’.

Below is the screen shot of the CMake configuration in CLion. Any other configuration needed for CMake in CLion?

/home/liubaogang/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/223.8836.42/bin/cmake/linux/x64/bin/cmake -DCMAKE_BUILD_TYPE=Debug -S /home/liubaogang/code/yugabyte-db -B /home/liubaogang/code/yugabyte-db/build/debug-clang-dynamic
– The C compiler identification is GNU 8.5.0
– The CXX compiler identification is GNU 8.5.0
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /usr/lib64/ccache/cc - skipped
– Detecting C compile features
– Detecting C compile features - done
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /usr/lib64/ccache/c++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– CMAKE_SYSTEM_INFO_FILE: Platform/Linux
– CMAKE_SYSTEM_NAME: Linux
– CMAKE_SYSTEM_PROCESSOR: x86_64
– CMAKE_SYSTEM: Linux-4.18.0-425.13.1.el8_7.x86_64
– CMAKE_VERSION: 3.24.2
– PRECOMPILED HEADERS: OFF
Will build tests by default
YB_BUILD_TESTS=ON
Will not build fuzz targets by default
YB_BUILD_FUZZ_TARGETS=OFF
YB_BUILD_TYPE: debug
YB_LINKING_TYPE: dynamic
CMAKE_MAKE_PROGRAM: /usr/bin/gmake
YB_SRC_ROOT: /home/liubaogang/code/yugabyte-db
YB_THIRDPARTY_DIR: /home/liubaogang/code/yugabyte-db/thirdparty
YB_BUILD_ROOT: /home/liubaogang/code/yugabyte-db/build/debug-clang-dynamic
YB_TARGET_ARCH: x86_64
Detected the number of logical CPUs: 4
Using shared library suffix ‘.so’.
CMAKE_C_COMPILER=/usr/lib64/ccache/cc
CMAKE_CXX_COMPILER=/usr/lib64/ccache/c++
LATEST SYMLINK PATH: /home/liubaogang/code/yugabyte-db/build/latest
YB_COMPILER_TYPE env var: clang
CMAKE_CXX_COMPILER=/usr/lib64/ccache/c++
Compiler version information:
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: …/configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugs.almalinux.org/ --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.5.0 20210514 (Red Hat 8.5.0-16) (GCC)

Selected compiler family ‘gcc’, version ‘8.5.0’
THIRDPARTY_INSTRUMENTATION_TYPE=uninstrumented
Invoking build_thirdparty.sh with these arguments: --build-type;uninstrumented

  • cd /home/liubaogang/code/yugabyte-db/thirdparty
  • pip3 install --quiet -r requirements.txt
    WARNING: You are using pip version 20.2.4; however, version 23.0.1 is available.
    You should consider upgrading via the ‘/home/liubaogang/code/yugabyte-db/thirdparty/venv/bin/python3 -m pip install --upgrade pip’ command.

Logging to /home/liubaogang/logs/build_thirdparty_2023-03-30T14_49_17.log (linked to build_thirdparty_latest.log)

  • python3 /home/liubaogang/code/yugabyte-db/thirdparty/python/yugabyte_db_thirdparty/yb_build_thirdparty_main.py --build-type uninstrumented
    Unsetting CC for third-party build (was set to “/usr/lib64/ccache/cc”).
    Unsetting CXX for third-party build (was set to “/usr/lib64/ccache/c++”).
    Traceback (most recent call last):
    File “/home/liubaogang/code/yugabyte-db/thirdparty/python/yugabyte_db_thirdparty/yb_build_thirdparty_main.py”, line 105, in
    main()
    File “/home/liubaogang/code/yugabyte-db/thirdparty/python/yugabyte_db_thirdparty/yb_build_thirdparty_main.py”, line 53, in main
    builder.parse_args()
    File “/home/liubaogang/code/yugabyte-db/thirdparty/python/yugabyte_db_thirdparty/builder.py”, line 259, in parse_args
    compiler_family, compiler_prefix = self.determine_compiler_family_and_prefix()
    File “/home/liubaogang/code/yugabyte-db/thirdparty/python/yugabyte_db_thirdparty/builder.py”, line 239, in determine_compiler_family_and_prefix
    raise ValueError(
    ValueError: Could not determine compiler family. Use --compiler-family to disambiguate.

Log saved to /home/liubaogang/logs/build_thirdparty_2023-03-30T14_49_17.log

CMake Error at CMakeLists.txt:248 (message):
Thirdparty was built unsuccessfully, terminating.

– Configuring incomplete, errors occurred!
See also “/home/liubaogang/code/yugabyte-db/build/debug-clang-dynamic/CMakeFiles/CMakeOutput.log”.

[Finished]

cc @svarnau @mbautin