-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
79 lines (56 loc) · 2.66 KB
/
Dockerfile
File metadata and controls
79 lines (56 loc) · 2.66 KB
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
# ────────────────────────────────
# 1. Build stage
# ────────────────────────────────
FROM ubuntu:24.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
COPY deb /
# -------- toolchain & helpers
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential g++ cmake ninja-build \
git curl wget ca-certificates unzip \
python3 python3-pip libssl-dev \
apt-utils \
&& ((apt-get install -y --no-install-recommends ./chapel-2.4.0-1.ubuntu24.arm64.deb) || (apt-get install -y --no-install-recommends ./chapel-2.4.0-1.ubuntu24.amd64.deb)) \
&& rm -rf /var/lib/apt/lists/*
# && (apt-get install -y --no-install-recommends ./chapel-2.4.0-1.ubuntu24.arm64.deb) || (apt install -y ./chapel-2.4.0-1.ubuntu24.amd64.deb)
# -------- LibTorch (change CUDA tag for GPU builds)
# ARG TORCH_VERSION=2.2.0 # ← keep in sync with your sources
# ARG TORCH_VARIANT=cpu # cpu | cu118 | cu121 …
# RUN mkdir -p /opt \
# && cd /opt \
# && wget -q --show-progress \
# https://download.pytorch.org/libtorch/${TORCH_VARIANT}/libtorch-cxx11-abi-shared-with-deps-${TORCH_VERSION}%2B${TORCH_VARIANT}.zip \
# && unzip libtorch-cxx11-abi-shared-with-deps-${TORCH_VERSION}+${TORCH_VARIANT}.zip \
# && rm libtorch-cxx11-abi-shared-with-deps-${TORCH_VERSION}+${TORCH_VARIANT}.zip
RUN mkdir -p /app \
&& cd /app \
&& wget -q --show-progress \
https://download.pytorch.org/libtorch/nightly/cpu/libtorch-cxx11-abi-shared-with-deps-latest.zip \
&& unzip libtorch-cxx11-abi-shared-with-deps-latest.zip \
&& mkdir -p /app/.cache \
&& mv /app/libtorch-cxx11-abi-shared-with-deps-latest.zip /app/.cache/libtorch_cache.zip
ENV Torch_DIR=/app/libtorch
ENV CMAKE_PREFIX_PATH=/app/libtorch/libtorch/share/cmake
# lets CMake find TorchConfig.cmake
# -------- build your project
WORKDIR /app
COPY . /app
# (uncomment if you have submodules)
# RUN git submodule update --init --recursive
RUN ls
RUN cd /app \
&& mkdir -p build \
&& cd build \
&& cmake -DCMAKE_BUILD_TYPE=Debug .. \
&& make MyExample
# RUN mkdir build \
# && cd build \
# && cmake -DCMAKE_BUILD_TYPE=Debug .. \
# && make TinyLayerTest -j$(nproc)
#RUN cd build && ./TinyLayerTest
# && cmake -DCMAKE_PREFIX_PATH=/opt/libtorch -DCMAKE_BUILD_TYPE=Release .. \
# configure-and-build
# RUN cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release \
# && cmake --build build --target all -j$(nproc)
# RUN cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release
# RUN cmake --build build --target all -j$(nproc)