forked from AndreWeiner/of_pytorch_docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (29 loc) · 1.18 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
FROM ubuntu:22.04
# avoid time zone configuration by tzdata
ARG DEBIAN_FRONTEND=noninteractive
# install basic utilities
RUN apt-get update && apt-get install --no-install-recommends -y \
apt-utils \
ca-certificates \
cmake \
g++ \
make \
sudo \
unzip \
vim-tiny \
wget
# add openfoam-plus repository
RUN wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | bash
# install OpenFOAM via Debian package
ARG FOAM_PATH=/usr/lib/openfoam/openfoam2206
RUN apt-get update && apt-get install --no-install-recommends -y \
openfoam2206-default && \
echo ". ${FOAM_PATH}/etc/bashrc" >> /etc/bash.bashrc && \
sed -i "s/-std=c++11/-std=c++14/g" ${FOAM_PATH}/wmake/rules/General/Gcc/c++ && \
sed -i "s/-Wold-style-cast/-Wno-old-style-cast/g" ${FOAM_PATH}/wmake/rules/General/Gcc/c++
## download and extract the PyTorch C++ libraries (libtorch)
RUN wget -q -O libtorch.zip https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.12.1%2Bcpu.zip && \
unzip libtorch.zip -d opt/ && \
rm *.zip
## set libtorch enironment variable
ENV TORCH_LIBRARIES /opt/libtorch