forked from EMsoft-org/EMsoftSuperbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
64 lines (58 loc) · 1.51 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
FROM ubuntu:jammy
ARG TARGETARCH
ARG DEBIAN_FRONTEND=noninteractive
RUN if [ "$TARGETARCH" = "arm64" ]; then \
apt-get update && apt-get -y upgrade \
&& apt-get install -y \
git \
vim \
wget \
cmake \
gcc \
gfortran \
ninja-build \
build-essential \
libopenblas-dev \
apt-utils \
opencl-headers \
ocl-icd-opencl-dev \
ocl-icd-libopencl1 \
clinfo ; \
elif [ "$TARGETARCH" = "amd64" ]; then \
apt-get update && apt-get -y upgrade \
&& apt-get install -y \
git \
vim \
wget \
cmake \
gcc \
gfortran \
ninja-build \
build-essential \
libopenblas-dev \
apt-utils \
opencl-headers \
ocl-icd-opencl-dev \
ocl-icd-libopencl1 \
libpocl-dev \
intel-opencl-icd \
clinfo \
; fi
# intel-opencl-icd makes iGPUs work from Intel (tested on i5-8400)
# libpocl-dev is for CPU on both Intel and AMD
# set some environmental variables for the Nvidia container
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
# set up OpenCL for Nvidia
RUN mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
# clone EMsoft and set up SDK Debug/Release
RUN mkdir /home/EMs \
&& cd /home/EMs \
&& git clone https://github.com/EMsoft-org/EMsoftSuperbuild.git \
&& cd EMsoftSuperbuild && mkdir Debug Release
# EMsoftSuperbuild
RUN cd /home/EMs/EMsoftSuperbuild/Debug/ \
&& cmake -DEMsoft_SDK=/opt/EMsoft_SDK -DCMAKE_BUILD_TYPE=Debug ../ -G Ninja && ninja \
&& cd ../Release \
&& cmake -DEMsoft_SDK=/opt/EMsoft_SDK -DCMAKE_BUILD_TYPE=Release ../ -G Ninja && ninja