-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.compare-to-K2SN-MSS
30 lines (25 loc) · 1.83 KB
/
Dockerfile.compare-to-K2SN-MSS
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
#
# Copyright (C) 2021 Yaron Gvili and Gvili Tech Ltd.
#
# See the accompanying LICENSE.txt file for licensing information.
#
FROM ubuntu:latest
# set up tool chain
RUN apt-get update && apt-get install -yq cmake gcc g++
RUN cmake --version && gcc --version && g++ --version
# set up tools for getting source code
RUN apt-get update && apt-get install -yq wget unzip
# get and build Catch2 source code
ARG CATCH2_VERSION=v2.13.2
RUN wget https://github.com/catchorg/Catch2/archive/${CATCH2_VERSION}.zip -O Catch2.zip && unzip Catch2.zip -d .
RUN (CATCH2_VER=$(echo ${CATCH2_VERSION} | sed 's~^v~~'); ln -s Catch2-${CATCH2_VER} Catch2 && cd Catch2 && cmake -Bbuild -H. -DBUILD_TESTING=OFF && MAKEFLAGS=$(( $(nproc) + 1 )) cmake --build build/ --target install)
# get and build LibSWIFFT source code
ARG LIBSWIFFT_VERSION=v1.2.0
ARG LIBSWIFFT_MCFLAGS=-march=native
RUN wget https://github.com/gvilitechltd/LibSWIFFT/archive/${LIBSWIFFT_VERSION}.zip -O LibSWIFFT.zip && unzip LibSWIFFT.zip -d .
RUN (LIBSWIFFT_VER=$(echo ${LIBSWIFFT_VERSION} | sed 's~^v~~'); ln -s LibSWIFFT-${LIBSWIFFT_VER} LibSWIFFT)
RUN (cd LibSWIFFT && cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release -DSWIFFT_MACHINE_COMPILE_FLAGS=${LIBSWIFFT_MCFLAGS} && MAKEFLAGS=-j$(( $(nproc) - 1 )) cmake --build build/ --target all)
# get and build K2SN-MSS source code
RUN wget https://github.com/gvilitechltd/K2SN-MSS/archive/refs/heads/swifftperf.zip -O K2SN-MSS.zip && unzip K2SN-MSS.zip -d .
RUN (cd K2SN-MSS-swifftperf && cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release && MAKEFLAGS=-j$(( $(nproc) - 1 )) cmake --build build/ --target all)
ENTRYPOINT ["/bin/bash", "-c", "echo 'LibSWIFFT performance (256 bytes per call):' && LibSWIFFT/build/test/swifft_catch 'swifft takes at most 2000 cycles per call' && echo 'Compared to K2SN-MSS performance (128 bytes per call):' && K2SN-MSS-swifftperf/build/tester"]