2022-06-09 21:16:57 +02:00
|
|
|
FROM ortools/cmake:system_deps_swig AS env
|
2024-07-22 13:53:01 +02:00
|
|
|
|
2022-06-09 21:16:57 +02:00
|
|
|
ENV PATH=/root/.local/bin:$PATH
|
2025-07-21 17:24:22 +02:00
|
|
|
#RUN pacman -Syu --noconfirm pybind11
|
2022-07-28 10:48:14 +02:00
|
|
|
RUN pacman -Syu --noconfirm python \
|
2022-09-30 00:18:52 +02:00
|
|
|
python-setuptools python-wheel python-virtualenv \
|
2023-10-25 10:09:19 +02:00
|
|
|
python-pip python-protobuf python-numpy python-pandas
|
|
|
|
|
RUN python -m pip install --break-system-package \
|
|
|
|
|
absl-py mypy mypy-protobuf
|
2022-06-09 21:16:57 +02:00
|
|
|
|
|
|
|
|
FROM env AS devel
|
|
|
|
|
WORKDIR /home/project
|
|
|
|
|
COPY . .
|
|
|
|
|
|
2025-11-17 16:49:24 +01:00
|
|
|
ARG CMAKE_BUILD_PARALLEL_LEVEL
|
|
|
|
|
ENV CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-4}
|
|
|
|
|
|
2022-06-09 21:16:57 +02:00
|
|
|
FROM devel AS build
|
2023-10-25 10:09:19 +02:00
|
|
|
# Archlinux do not provide pybind11 protobuf package
|
2022-06-09 21:16:57 +02:00
|
|
|
RUN cmake -S. -Bbuild -DBUILD_DEPS=OFF \
|
2025-07-21 17:24:22 +02:00
|
|
|
-DBUILD_pybind11=ON \
|
2024-07-18 18:47:55 +02:00
|
|
|
-DBUILD_pybind11_abseil=ON \
|
2023-10-25 10:09:19 +02:00
|
|
|
-DBUILD_pybind11_protobuf=ON \
|
2024-07-16 16:02:43 +02:00
|
|
|
-DUSE_COINOR=ON \
|
|
|
|
|
-DUSE_GLPK=ON \
|
|
|
|
|
-DUSE_HIGHS=OFF \
|
|
|
|
|
-DUSE_SCIP=ON \
|
2023-10-23 14:25:37 +02:00
|
|
|
-DBUILD_PYTHON=ON \
|
2025-11-04 22:43:52 +01:00
|
|
|
-DBUILD_CXX_SAMPLES=OFF -DBUILD_CXX_EXAMPLES=OFF \
|
|
|
|
|
-DBUILD_googletest=ON
|
2022-06-09 21:16:57 +02:00
|
|
|
RUN cmake --build build --target all -v
|
|
|
|
|
RUN cmake --build build --target install
|
|
|
|
|
|
|
|
|
|
FROM build AS test
|
|
|
|
|
RUN CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test
|
|
|
|
|
|
|
|
|
|
FROM env AS install_env
|
|
|
|
|
WORKDIR /home/sample
|
|
|
|
|
COPY --from=build /home/project/build/python/dist/*.whl .
|
2024-11-21 09:34:20 +01:00
|
|
|
RUN python -m pip install --break-system-packages *.whl
|
2022-06-09 21:16:57 +02:00
|
|
|
|
|
|
|
|
FROM install_env AS install_devel
|
|
|
|
|
COPY cmake/samples/python .
|
|
|
|
|
|
|
|
|
|
FROM install_devel AS install_build
|
|
|
|
|
RUN python -m compileall .
|
|
|
|
|
|
|
|
|
|
FROM install_build AS install_test
|
|
|
|
|
RUN python sample.py
|