-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
92 lines (73 loc) · 2.63 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Dockerfile for HAFT and LLVM 3.8.0 (June 2016)
FROM ubuntu
MAINTAINER Dmitrii Kuvaiskii ([email protected])
# == Basic packages ==
RUN apt-get update && \
apt-get install -y git \
texinfo \
vim \
libxml2-dev \
cmake \
python \
gcc \
build-essential \
flex \
bison \
linux-tools-generic
# use bash not sh
RUN rm /bin/sh && \
ln -s /bin/bash /bin/sh
# get correct perf
RUN list=( /usr/lib/linux-tools/*-generic/perf ) && \
ln -sf ${list[-1]} /usr/bin/perf
# == LLVM & CLang ==
# prepare environment
ENV LLVM_SOURCE=/root/bin/llvm/llvm/ \
LLVM_BUILD=/root/bin/llvm/build/ \
CLANG_SOURCE=/root/bin/llvm/llvm/tools/clang/ \
GOLD_PLUGIN=/root/bin/binutils/
RUN mkdir -p $LLVM_SOURCE $LLVM_BUILD $GOLD_PLUGIN ${GOLD_PLUGIN}build
# get correct versions of sources
RUN git clone https://github.com/llvm-mirror/llvm $LLVM_SOURCE && \
git clone --depth 1 git://sourceware.org/git/binutils-gdb.git ${GOLD_PLUGIN}binutils && \
git clone http://llvm.org/git/compiler-rt.git ${LLVM_SOURCE}projects\compiler-rt && \
git clone http://llvm.org/git/openmp.git ${LLVM_SOURCE}projects\openmp && \
git clone https://github.com/llvm-mirror/clang $CLANG_SOURCE
WORKDIR $LLVM_SOURCE
COPY install/patches/llvm380.patch ./
RUN git checkout release_38 && \
git apply llvm380.patch
WORKDIR $CLANG_SOURCE
RUN git checkout release_38
# build
WORKDIR $LLVM_BUILD
RUN cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_INSTALL_PREFIX=${LLVM_BUILD} -DLLVM_BINUTILS_INCDIR=${GOLD_PLUGIN}binutils/include ../llvm && \
make -j8 && \
make install
# == Gold Linker ==
WORKDIR ${GOLD_PLUGIN}build
RUN ../binutils/configure --enable-gold --enable-plugins --disable-werror
RUN make all-gold && \
make
RUN cp gold/ld-new /usr/bin/ld && \
cp binutils/ar /usr/bin/ar && \
cp binutils/nm-new /usr/bin/nm-new && \
\
mkdir -p /usr/lib/bfd-plugins && \
cp ${LLVM_BUILD}/lib/LLVMgold.so /usr/lib/bfd-plugins
# == HAFT ==
ENV HAFT=/root/code/haft/
COPY ./ ${HAFT}
RUN make -C ${HAFT}src/tx/pass && \
make -C ${HAFT}src/tx/runtime && \
make -C ${HAFT}src/ilr/pass && \
\
make -C ${HAFT}src/benches/util/libc ACTION=helper && \
make -C ${HAFT}src/benches/util/renamer
VOLUME /data
WORKDIR /root/code/haft/
# == Environment variables ==
# number of runs in each performance experiment
ENV NUM_RUNS=1
# == Interface ==
ENTRYPOINT ["/bin/bash"]