NASA-SW-VnV / ikos

Static analyzer for C/C++ based on the theory of Abstract Interpretation.
Other
2.02k stars 150 forks source link

Debian 12 Bookworm Dockerfile w/ conan #270

Open athatheo opened 4 months ago

athatheo commented 4 months ago

Hi community!

Has anyone managed to use ikos on a project that handled external packages with conan package manager? When I try it, I get the "unsupported llvm type" error.

ivanperez-keera commented 4 months ago

What version of LLVM are you using?

athatheo commented 4 months ago

What version of LLVM are you using?

llvm-14

This is my dockerfile & I can also provide the Dockerfile to reproduce the error.

RUN apt-get update && apt-get install software-properties-common --yes
RUN apt-get update && apt-get install --yes --no-install-recommends binutils cmake make python3 python3-pygments ca-certificates
RUN apt-get update && apt install --yes --no-install-recommends git build-essential checkinstall \
        python3-pytest python3-setuptools libxml2-utils libz3-dev ninja-build python3-pip
RUN pip install conan==3.3 --break-system-packages

RUN apt-add-repository "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-14 main"

RUN apt-get update && apt-get install --yes --no-install-recommends libgmp-dev libboost-dev libboost-filesystem-dev \
    libboost-thread-dev libboost-test-dev libsqlite3-dev libtbb-dev \
    libz-dev libedit-dev python3-distutils python3-pip llvm-14 llvm-14-dev llvm-14-tools clang-14 libmpfr-dev python3.11-venv
RUN pip install llvmlite --break-system-packages
RUN git clone --depth 1 --branch v${IKOS_VERSION_TAG} https://github.com/NASA-SW-VnV/ikos
WORKDIR ikos
# Python >3.9 changed the function name, updating
RUN sed -i.orig 's/isAlive/is_alive/g' ./analyzer/python/ikos/analyzer.py
RUN cmake -B build -DLLVM_CONFIG_EXECUTABLE="/usr/lib/llvm-14/bin/llvm-config" -DCMAKE_INSTALL_PREFIX=/usr/ -GNinja
WORKDIR build
RUN ninja -j$(nproc)

RUN checkinstall --type=debian --pkgname=ikos --pkgversion=${IKOS_VERSION_TAG} --pkgrelease="CUSTOM" \
    --provides=ikos \
    --requires="python3 \(\>= 3.11 \),libstdc++6 \(\>= 10.2.1\),libsqlite3-0 \(\>= 3.34.1\),libboost-dev \(\>= 1.74.0\),libboost-filesystem-dev \(\>= 1.74.0\),libboost-thread-dev \(\>= 1.74.0\),python3-pygments \(\>= 2.7.1\),libgmpxx4ldbl \(\>= 6.2.1\),libtbb-dev \(\>= 2021.8.0\),zlib1g \(\>= 1.2.11\),llvm-14 \(\>= 14.0.1\),llvm-14-tools \(\>= 14.0.1\),clang-14 \(\>= 14.0.1\),libmpfr6 \(\>= 4.1.0\),file \(\>= 5.39\)" \
    --strip=yes --fstrans=no \
    --default --exclude /usr/bin/python3 ninja install
athatheo commented 3 months ago

Hey @ivanperez-keera Any chance you have some feedback/comment?