Skip to content

Commit d955338

Browse files
committed
Make FORCE_AVX2 optional (default -march=native) and drop unused libgomp
1 parent d563bb6 commit d955338

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

Dockerfile

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# ============================================================
22
# SISAP 2026 deglib submission — single container.
3-
# Stage 1 builds the deglib_sisap C++ binary (AVX2, no AVX-512 — the EPYC 7F72
4-
# eval node has no AVX-512). Stage 2 is a thin Python runtime that runs
5-
# submission/search.py, which drives the binary. Both stages share the same
6-
# Ubuntu base so the binary's glibc/libstdc++ match the runtime.
3+
# Stage 1 builds the deglib_sisap C++ binary (default -march=native; pass
4+
# --build-arg FORCE_AVX2=ON for an AVX2-only build). Stage 2 is a thin Python
5+
# runtime that runs submission/search.py, which drives the binary. Both stages
6+
# share the same Ubuntu base so the binary's glibc/libstdc++ match the runtime.
77
# Build from the repo root: docker build -t sisap-deglib .
88
# ============================================================
99
FROM ubuntu:24.04@sha256:786a8b558f7be160c6c8c4a54f9a57274f3b4fb1491cf65146521ae77ff1dc54 AS builder
@@ -15,8 +15,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1515

1616
COPY cpp /build/cpp
1717
WORKDIR /build/cpp
18-
# AVX2-only: drop -march=native so AVX-512 is not re-enabled on AVX-512 build hosts.
19-
RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DFORCE_AVX2=ON \
18+
# ISA selection:
19+
# FORCE_AVX2=OFF (default) -> -march=native: best ISA on the build host. On TIRA
20+
# the image is built on the eval node itself, so native targets that exact CPU.
21+
# FORCE_AVX2=ON -> AVX2-only build (drops -march=native so AVX-512 is not
22+
# re-enabled), for building on an AVX-512 host that must match a non-AVX-512
23+
# target (e.g. our build box vs the EPYC 7F72 eval node, which has no AVX-512).
24+
# Usage (AVX2-only): docker build --build-arg FORCE_AVX2=ON -t sisap-deglib .
25+
ARG FORCE_AVX2=OFF
26+
RUN if [ "$FORCE_AVX2" = "ON" ]; then \
27+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DFORCE_AVX2=ON ; \
28+
else \
29+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=native" ; \
30+
fi \
2031
&& cmake --build build --target deglib_sisap -j"$(nproc)"
2132

2233
# ============================================================
@@ -25,9 +36,8 @@ RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DFORCE_AVX2=ON \
2536
FROM ubuntu:24.04@sha256:786a8b558f7be160c6c8c4a54f9a57274f3b4fb1491cf65146521ae77ff1dc54 AS runtime
2637

2738
ENV DEBIAN_FRONTEND=noninteractive
28-
# libgomp1 = OpenMP runtime for the binary; python3 + numpy + h5py for search.py.
39+
# python3 + numpy + h5py for search.py.
2940
RUN apt-get update && apt-get install -y --no-install-recommends \
30-
libgomp1 \
3141
python3 \
3242
python3-numpy \
3343
python3-h5py \

0 commit comments

Comments
 (0)