-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65b02ec
commit 687d771
Showing
4 changed files
with
65 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,29 +6,34 @@ RUN apt-get update && apt-get install -y \ | |
WORKDIR /opt/source | ||
ADD . . | ||
|
||
WORKDIR /opt/source/build_sse | ||
WORKDIR /opt/source/build_sse2 | ||
RUN cmake -DHAVE_MPI=0 -DHAVE_TESTS=0 -DHAVE_SSE2=1 -DCMAKE_BUILD_TYPE=Release .. | ||
RUN make -j $(nproc --all) | ||
|
||
WORKDIR /opt/source/build_sse41 | ||
RUN cmake -DHAVE_MPI=0 -DHAVE_TESTS=0 -DHAVE_SSE4_1=1 -DCMAKE_BUILD_TYPE=Release .. | ||
RUN make -j $(nproc --all) | ||
|
||
WORKDIR /opt/source/build_avx | ||
WORKDIR /opt/source/build_avx2 | ||
RUN cmake -DHAVE_MPI=0 -DHAVE_TESTS=0 -DHAVE_AVX2=1 -DCMAKE_BUILD_TYPE=Release .. | ||
RUN make -j $(nproc --all) | ||
|
||
FROM debian:stable-slim | ||
MAINTAINER Milot Mirdita <[email protected]> | ||
RUN apt-get update && apt-get install -y \ | ||
gawk bash grep libstdc++6 libgomp1 zlib1g libbz2-1.0 \ | ||
gawk bash grep libstdc++6 libgomp1 libatomic1 zlib1g libbz2-1.0 wget tar \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=builder /opt/source/build_sse/src/plass /usr/local/bin/plass_sse42 | ||
COPY --from=builder /opt/source/build_avx/src/plass /usr/local/bin/plass_avx2 | ||
RUN echo '#!/bin/bash\n\ | ||
if $(grep -q -E "^flags.+avx2" /proc/cpuinfo); then\n\ | ||
exec /usr/local/bin/plass_avx2 "$@"\n\ | ||
else\n\ | ||
exec /usr/local/bin/plass_sse42 "$@"\n\ | ||
fi'\ | ||
>> /usr/local/bin/plass | ||
COPY --from=builder /opt/source/build_sse2/src/plass /usr/local/bin/plass_sse2 | ||
COPY --from=builder /opt/source/build_sse41/src/plass /usr/local/bin/plass_sse41 | ||
COPY --from=builder /opt/source/build_avx2/src/plass /usr/local/bin/plass_avx2 | ||
RUN echo '#!/bin/sh\n\ | ||
FLAGS="$(grep -m 1 "^flags" /proc/cpuinfo)"\n\ | ||
case "${FLAGS}" in\n\ | ||
*avx2*) exec /usr/local/bin/plass_avx2 "$@" ;;\n\ | ||
*sse4_1*) exec /usr/local/bin/plass_sse41 "$@" ;;\n\ | ||
*) exec /usr/local/bin/plass_sse2 "$@" ;;\n\ | ||
fi' >> /usr/local/bin/plass | ||
RUN chmod +x /usr/local/bin/plass | ||
|
||
VOLUME ["/app"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters