forked from lahiri-phdworks/LLVM-Examples
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerFile
48 lines (42 loc) · 1.37 KB
/
DockerFile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM ubuntu:latest
ENV TZ=Asia/Kolkata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# LLVM dependencies:
RUN apt-get update ; apt-get install --no-install-recommends \
-y \
autoconf \
automake \
ca-certificates \
cmake \
libfreetype6-dev \
g++ \
gcc \
time \
libxml2-dev \
make \
musl-dev \
ninja-build \
libncurses5-dev libncursesw5-dev \
python3 \
python3-dev \
nano \
git \
wget
WORKDIR /home
RUN git clone --progress --verbose --depth 1 https://github.com/llvm/llvm-project.git
RUN cd llvm-project ; cmake -S llvm -B build -G "Ninja" \
-DLLVM_ENABLE_PROJECTS="llvm;clang;compiler-rt" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_INSTALL_UTILS=ON ; cd build ; ninja -j3 -v all ; ninja -j3 install
WORKDIR /home
RUN git clone --progress --verbose --depth 1 https://github.com/lahiri-phdworks/LLVM-Examples
ENV HOME=/home
ENV CXX=/home/llvm-project/build/bin/clang++
ENV CC=/home/llvm-project/build/bin/clang
ENV OPT=/home/llvm-project/build/bin/opt
ENV LLVM_BUILD_PATH=/home/llvm-project/build
ENV LLVM_BIN_DIR=/home/llvm-project/build/bin
# WORKDIR /home
# RUN cd LLVM-Examples/LLVMIRModify ; make -j 2 ;
# RUN cd LLVM-Examples/ClangAST ; rm -rf build ; mkdir -p build ; cd build ; cmake .. ; make -j 2 ; ./clang_ast ../tests/test1.cpp