-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from thierry-tct/adding_llvm11_support
Adding llvm11 support
- Loading branch information
Showing
138 changed files
with
5,629 additions
and
959 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,82 @@ | ||
# sudo docker build --no-cache -t thierrytct/mart:llvm-9.0.0 . --build-arg llvm_version=9.0.0 && sudo docker push thierrytct/mart:llvm-9.0.0 | ||
############################################################################## | ||
# | ||
# Some build examples: | ||
# - LLVM 3.4.2 | ||
# $ sudo docker build --no-cache -t thierrytct/mart:llvm-3.4.2 . --build-arg llvm_version=3.4.2 --build-arg base_image=thierrytct/llvm:3.4.2 --build-arg using_custom_llvm_base_image=on | ||
# $ sudo docker push thierrytct/mart:llvm-3.4.2 | ||
# - LLVM 11 | ||
# $ sudo docker build --no-cache -t thierrytct/mart:llvm-11 . --build-arg llvm_version=11 --build-arg mutant_selection_on=on | ||
# $ sudo docker push thierrytct/mart:llvm-11 | ||
# - LLVM latest | ||
# $ sudo docker build --no-cache -t thierrytct/mart:llvm-latest . --build-arg mutant_selection_on=on | ||
# $ sudo docker push thierrytct/mart:llvm-latest | ||
# | ||
# When using the latest version on LLVM (with version specified), do | ||
# $ sudo docker image tag thierrytct/mart:llvm-<latest-llvm-version> thierrytct/mart:latest | ||
# $ sudo docker push thierrytct/mart:latest | ||
# | ||
############################################################################## | ||
|
||
#ARG llvm_version=3.8.1 | ||
ARG llvm_version=3.4.2 | ||
#ARG llvm_version=9.0.0 | ||
ARG base_image=docker.io/ubuntu:focal | ||
|
||
FROM thierrytct/llvm:$llvm_version | ||
ARG llvm_version=3.4.2 | ||
#ARG llvm_version=9.0.0 | ||
FROM $base_image AS base | ||
|
||
# set this to enable mutant selection (with features axtraction) | ||
# Tells whether the specified base image is a custom llvm built image. | ||
# In that case, llvm will not be installed anymore | ||
ARG using_custom_llvm_base_image | ||
# The llvm_version to use, in case not using custom llvm base image. | ||
# if not specified in that case, the latest LLVM version is used | ||
ARG llvm_version | ||
# build type. one of: Debug, Release, RelWithDebInfo and MinSizeRel | ||
# default is RelWithDebInfo | ||
ARG built_type=Debug | ||
# set this to enable mutant selection (with features extraction) | ||
# This relies on dg, so careful with newer LLVM versions, need to | ||
# update compatibility with dg | ||
ARG mutant_selection_on | ||
|
||
ARG mart_location=/home/MART | ||
|
||
RUN mkdir -p $mart_location/build $mart_location/src | ||
RUN mkdir -p ${mart_location}/build $mart_location/src | ||
|
||
#git clone https://github.com/thierry-tct/mart.git /tmp/mart/src | ||
COPY . $mart_location/src | ||
COPY . ${mart_location}/src | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get -y update; exit 0 | ||
# Install LLVM if not using custom llvm base image | ||
RUN if [ "${using_custom_llvm_base_image}" = "" ]; then \ | ||
apt-get -y install cmake g++\ | ||
&& apt-get install -y python3-pip python3-dev \ | ||
&& cd /usr/local/bin \ | ||
&& ln -s /usr/bin/python3 python \ | ||
&& cd - \ | ||
&& { test -f $(dirname $(which pip3))/pip || ln -s $(which pip3) $(dirname $(which pip3))/pip; } \ | ||
&& pip install wllvm \ | ||
|| exit 1; \ | ||
llvm_version_suffix=""; \ | ||
[ "${llvm_version}" != "" ] && llvm_version_suffix="-${llvm_version}"; \ | ||
apt-get -y install llvm${llvm_version_suffix} clang${llvm_version_suffix} llvm${llvm_version_suffix}-dev \ | ||
|| exit 1; \ | ||
[ "${llvm_version}" != "" ] && ${mart_location}/src/update-alternatives-llvm-clang.sh ${llvm_version} 100; \ | ||
fi | ||
|
||
# fdupes needed for post compilation TCE. XXX 'make gitversion' is needed for dg | ||
# libtinfo-dev is needed because of linking error with llvm-9 (problem -ltinfo) | ||
# zlib1g-dev is needed because of linking error with llvm-9 ubuntu (problem -lz) | ||
# libtinfo-dev is needed because of linking error for some versions (problem -ltinfo) | ||
# zlib1g-dev is needed because of linking error for some version with ubuntu (problem -lz) | ||
RUN apt-get -y install fdupes libtinfo-dev zlib1g-dev \ | ||
&& mkdir -p $mart_location/build && cd $mart_location/build \ | ||
&& if [ "$mutant_selection_on" = "" ]; then extra=""; else extra="-DMART_MUTANT_SELECTION=on"; fi \ | ||
&& cmake $extra -DLLVM_DIR=/usr/local/share/llvm/cmake/ $mart_location/src \ | ||
&& make CollectMutOpHeaders && { make gitversion || echo "No gitversion need"; } && make | ||
ENV PATH="$mart_location/build/tools:${PATH}" | ||
&& mkdir -p ${mart_location}/build && cd ${mart_location}/build \ | ||
&& if [ "${mutant_selection_on}" = "" ]; then extra=""; else extra="-DMART_MUTANT_SELECTION=on"; fi \ | ||
&& if [ "${using_custom_llvm_base_image}" != "" ]; then extra+=" -DLLVM_DIR=/usr/local/share/llvm/cmake/"; fi \ | ||
&& cmake ${extra} -DCMAKE_BUILD_TYPE=${built_type} ${mart_location}/src \ | ||
&& { make gitversion || echo "No gitversion need"; } && make | ||
|
||
ENV PATH="${mart_location}/build/tools:${PATH}" | ||
ENV MART_BINARY_DIR="${mart_location}/build/tools" | ||
|
||
COPY ./example $mart_location/example | ||
COPY ./example ${mart_location}/example | ||
|
||
CMD ["$mart_location/bash", "$mart_location/example/run_example.sh"] | ||
CMD ["bash", "-c", "${MART_BINARY_DIR}/../../example/run_example.sh"] | ||
|
||
|
||
# && sed -i'' "s|/home/LLVM/llvm-$llvm_version/build_cmake/bin|$(dirname $(which clang))|g; s|/home/LLVM/llvm-$llvm_version/src/cmake/modules|/usr/local/share/llvm/cmake/|g" /usr/local/share/llvm/cmake/LLVMConfig.cmake \ |
Oops, something went wrong.