-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
47 lines (36 loc) · 1.61 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
37
38
39
40
41
42
43
44
45
46
47
ARG BASE_CONTAINER=python:3.9-slim-buster
FROM ${BASE_CONTAINER} as suitesparse
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -yq build-essential cmake git
ARG SUITESPARSE
ARG COMPACT
WORKDIR /build
RUN git clone https://github.com/eliben/pycparser.git --depth 1
WORKDIR /build/GraphBLAS/build
RUN git clone https://github.com/DrTimothyAldenDavis/GraphBLAS.git --depth 1 --branch ${SUITESPARSE} \
&& cd GraphBLAS/build \
&& cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DGBCOMPACT=${COMPACT} \
&& make -j$(nproc) \
&& make install
FROM ${BASE_CONTAINER} as psg
ARG SUITESPARSE
ARG VERSION
ENV PYTHONUNBUFFERED 1
COPY --from=suitesparse /usr/include/GraphBLAS.h /usr/local/include/
COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas* /usr/lib/x86_64-linux-gnu/
COPY --from=suitesparse /build/pycparser/utils/fake_libc_include/* /usr/local/lib/python3.9/site-packages/pycparser/utils/fake_libc_include/
RUN apt-get update && apt-get install -yq build-essential git
RUN pip3 install numpy cffi pytest cython
RUN mkdir -p /psg
ADD . /psg
WORKDIR /psg
RUN git tag ${VERSION} && \
python3 suitesparse_graphblas/create_headers.py && \
python3 setup.py install && \
ldconfig
#RUN pytest --pyargs suitesparse_graphblas.tests
RUN apt-get -y --purge remove git python3-pip && apt-get clean
FROM ${BASE_CONTAINER}
COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas* /usr/lib/x86_64-linux-gnu/
COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgomp* /usr/lib/x86_64-linux-gnu/
COPY --from=psg /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages