Compiling on Debian leads to missing compiler messages

Trying to compile openvas-smb from source:

  1. git clone https://github.com/greenbone/openvas-smb.git
  2. cd openvas-smb
  3. mkdir BUILD
  4. cd BUILD
  5. cmake ..
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:27 (project):
  The CMAKE_C_COMPILER:

    /usr/share/clang/scan-build/ccc-analyzer

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/home/xxx/src/gvm/openvas-smb/BUILD/CMakeFiles/CMakeOutput.log".
See also "/home/xxx/src/gvm/openvas-smb/BUILD/CMakeFiles/CMakeError.log".

Same for other parts. Debian just does not know about ccc-analyzer.

clang version:

$ clang --version
clang version 9.0.1-9 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Debian package versions:

libllvm7:amd64  1:7.0.1-10 Modular compiler and toolchain technologies, runtime library
libllvm9:amd64  1:9.0.1-9  Modular compiler and toolchain technologies, runtime library
llvm-9          1:9.0.1-9  Modular compiler and toolchain technologies
llvm-9-dev      1:9.0.1-9  Modular compiler and toolchain technologies, libraries and headers
llvm-9-runtime  1:9.0.1-9  Modular compiler and toolchain technologies, IR interpreter
llvm-9-tools    1:9.0.1-9  Modular compiler and toolchain technologies, tools

missing ccc-analyzer

$ ccc-analyzer
-bash: ccc-analyzer: command not found

while tool scan-build is available:

$ which scan-build
/usr/bin/scan-build

Same for checked out branch and source snapshot downloads.

GVM Versions

gsad:

cacf022c2 2020-03-16 | Merge pull request #2044 from swaterkamp/AdjustCertTableHeader9 (HEAD -> gsa-9.0, origin/gsa-9.0)


openvasmd:

97ee2ef2 2020-03-13 | Merge pull request #1011 from bjoernricks/add-osp-request-sleep (HEAD -> gvmd-9.0, origin/gvmd-9.0)


openvas:

69505c2f 2020-03-09 | Merge pull request #462 from jjnicola/isotime-warn-7 (HEAD -> openvas-7.0, origin/openvas-7.0)


gvm-libs:

2aa6f49b 2020-02-26 | Add changelog entry (HEAD -> gvm-libs-11.0, origin/gvm-libs-11.0)

gvm-tools:

f070194 2020-01-10 | Merge pull request #240 from y0urself/unify-config-params (HEAD -> master, origin/master, origin/HEAD)

node:

v11.15.0

redis-server:

Redis server v=5.0.7 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=636cde3b5c7a3923

Environment

Operating system:

Linux gvm-stable 5.4.0-4-amd64 #1 SMP Debian 5.4.19-1 (2020-02-13) x86_64 GNU/Linux
Debian testing (bullseye/sid)

PostgreSQL:

psql (PostgreSQL) 12.2 (Debian 12.2-2.pgdg100+1)

Installation method / source:

source installation, git checkout of latest stable branches

Just install the package with your Debian system :wink:

https://debian.pkgs.org/sid/debian-main-amd64/clang-tools-9_9.0.1-9_amd64.deb.html

No. Does not help out:

# apt install clang-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
clang-tools is already the newest version (1:9.0-49).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Same as before:

$ cmake ..
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:27 (project):
  The CMAKE_C_COMPILER:

    /usr/share/clang/scan-build/ccc-analyzer

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/home/xxx/src/gvm/openvas-smb/BUILD/CMakeFiles/CMakeOutput.log".
See also "/home/xxx/src/gvm/openvas-smb/BUILD/CMakeFiles/CMakeError.log".

Sure this ccc-analyzer was not renamed or directories renamed? With clang-9?

$ dpkg -l | grep clang | awk '{ print $2 " " $3 }'
clang                 1:9.0-49
clang-9               1:9.0.1-9
clang-format          1:9.0-49
clang-format-9        1:9.0.1-9
clang-tidy            1:9.0-49
clang-tidy-9          1:9.0.1-9
clang-tools           1:9.0-49
clang-tools-9         1:9.0.1-9
clangd                1:9.0-49
clangd-9              1:9.0.1-9
libclang-common-9-dev 1:9.0.1-9
libclang-cpp9         1:9.0.1-9
libclang1-9           1:9.0.1-9

Says it all. cmake can’t find your c compiler. Set CMAKE_C_COMPILE or the CC environment variable. This seems to be not an issue with our software but your setup and cmake.

2 Likes
CMAKE_C_COMPILER: /usr/share/clang/scan-build/ccc-analyzer

is set by cmake. Wherever this comes from