forked from JonasToth/docker-flang-worker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (53 loc) · 1.8 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
FROM buildbot/buildbot-worker:master
USER root
RUN apt-get update
RUN apt-get install -y build-essential cmake wget
# ----------------------- Compilation of dependencies -------------------------
### LLVM
WORKDIR /build-llvm
RUN wget --show-progress http://releases.llvm.org/5.0.1/llvm-5.0.1.src.tar.xz
RUN tar xf llvm-5.0.1.src.tar.xz
WORKDIR /build-llvm/llvm-5.0.1.src
WORKDIR /build-llvm/llvm-5.0.1.src/build/
RUN cmake .. -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/usr/local/
RUN make -j$(nproc)
# USER root
RUN make install
WORKDIR /
RUN rm -rf /build-llvm
### flang driver
WORKDIR /build-flang
RUN git clone --progress https://github.com/flang-compiler/clang.git
WORKDIR /build-flang/clang
RUN git checkout flang_release_50
WORKDIR /build-flang/clang/build
RUN cmake .. -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/usr/local/
RUN make -j$(nproc)
# USER root
RUN make install
WORKDIR /
RUN rm -rf /build-flang
### OpenMP libraries
WORKDIR /build-openmp
RUN wget http://releases.llvm.org/5.0.1/openmp-5.0.1.src.tar.xz
RUN tar xf openmp-5.0.1.src.tar.xz
WORKDIR /build-openmp/openmp-5.0.1.src/runtime
WORKDIR /build-openmp/openmp-5.0.1.src/runtime/build
RUN cmake .. -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=/usr/local/
RUN make -j$(nproc)
RUN make install
WORKDIR /
RUN rm -rf /build-openmp
### flang components
WORKDIR /build-flang
RUN git clone --progress https://github.com/flang-compiler/flang.git
WORKDIR /build-flang/flang
WORKDIR /build-flang/flang/build
RUN cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_Fortran_COMPILER=flang ..
RUN make -j$(nproc)
RUN make install
WORKDIR /
RUN rm -rf /build-flang
# ------------------------- Clean up ------------------------------
### Remove initial build packages
RUN apt-get autoremove build-essential cmake wget