Skip to content

Instantly share code, notes, and snippets.

@Cheaterman
Last active April 11, 2022 20:06
Show Gist options
  • Save Cheaterman/75899df0e37c04d2dd782c3c23b10ed9 to your computer and use it in GitHub Desktop.
Save Cheaterman/75899df0e37c04d2dd782c3c23b10ed9 to your computer and use it in GitHub Desktop.
Dockerfile

open.mp Linux build image

How to use:

  1. docker build -t open.mp/build:ubuntu-18.04 .
  2. docker run --rm -ti -v /path/to/omp/sources:/omp -w /omp open.mp/build:ubuntu-18.04
  3. ???
  4. Profit! Built open.mp is available in /path/to/omp/sources/build
  5. Note: You can use -e CONFIG=Debug or -e CONFIG=RelWithDebInfo in the docker run call to change the build type
#!/bin/sh
[ ! -e build ] && mkdir build
[ -z $CONFIG ] && config=Release || config="$CONFIG"
(
export \
CC=/usr/bin/clang-10 \
CXX=/usr/bin/clang++-10 \
&&
cd build &&
cmake .. \
-G Ninja \
-DCMAKE_C_FLAGS=-m32 \
-DCMAKE_CXX_FLAGS=-m32 \
-DCMAKE_BUILD_TYPE=$config \
&&
cmake --build . --config $config
)
FROM ubuntu:18.04
RUN \
apt-get update && \
apt-get install -y \
gpg \
wget \
&& \
wget -O- https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | \
gpg --dearmor - | \
tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null && \
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | \
tee /etc/apt/sources.list.d/kitware.list >/dev/null && \
apt-get update && \
apt-get install -y \
cmake \
ninja-build \
clang-10 \
python3-pip \
gcc-8-multilib \
g++-8-multilib \
&& \
pip3 install conan
ADD build.sh /
CMD /build.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment