Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(ALICEVISION_ROOT "$ENV{ALICEVISION_ROOT}" CACHE STRING "AliceVision root dir
set(QT_DIR "$ENV{QT_DIR}" CACHE STRING "Qt root directory")

option(MR_BUILD_QTALICEVISION "Enable building of QtAliceVision plugin" ON)
set(QTALICEVISION_VERSION "develop" CACHE STRING "Version of the QtAliceVision plugin (default to develop)")

if(CMAKE_BUILD_TYPE MATCHES Release)
message(STATUS "Force CMAKE_INSTALL_DO_STRIP in Release")
Expand Down Expand Up @@ -39,7 +40,7 @@ if(MR_BUILD_QTALICEVISION)
set(QTALICEVISION_TARGET QtAliceVision)
ExternalProject_Add(${QTALICEVISION_TARGET}
GIT_REPOSITORY https://github.com/alicevision/QtAliceVision
GIT_TAG develop
GIT_TAG ${QTALICEVISION_VERSION}
PREFIX ${BUILD_DIR}
BUILD_IN_SOURCE 0
BUILD_ALWAYS 0
Expand Down
28 changes: 10 additions & 18 deletions docker/Dockerfile_rocky
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ARG AV_VERSION
ARG CUDA_VERSION
ARG ROCKY_VERSION
FROM alicevision/meshroom-deps:${MESHROOM_VERSION}-av${AV_VERSION}-rocky${ROCKY_VERSION}-cuda${CUDA_VERSION}
ARG QTAV_VERSION

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Providing a default value for QTAV_VERSION (e.g., develop) ensures that direct builds of the Dockerfile (without using the helper script) do not fail or result in an empty version string during the CMake configuration.

ARG QTAV_VERSION=develop

LABEL maintainer="AliceVision Team alicevision-team@googlegroups.com"

# Execute with nvidia docker (https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0))
Expand All @@ -11,12 +12,11 @@ LABEL maintainer="AliceVision Team alicevision-team@googlegroups.com"

RUN dnf install -y patchelf

ENV MESHROOM_DEV=/opt/Meshroom \
MESHROOM_BUILD=/tmp/Meshroom_build \
MESHROOM_BUNDLE=/opt/Meshroom_bundle \
AV_INSTALL=/opt/AliceVision_install \
QT_DIR=/opt/Qt/6.8.3/gcc_64 \
PATH="${PATH}:${MESHROOM_BUNDLE}"
ENV MESHROOM_DEV=/opt/Meshroom
ENV MESHROOM_BUILD=/tmp/Meshroom_build
ENV MESHROOM_BUNDLE=/opt/Meshroom_bundle
ENV AV_INSTALL=/opt/AliceVision_install
ENV PATH="${PATH}:${MESHROOM_BUNDLE}"
Comment on lines +15 to +19

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Splitting the environment variables into multiple ENV instructions increases the number of layers in the Docker image. It is recommended to combine them into a single ENV instruction using backslashes to keep the image metadata clean and minimize layers.

ENV MESHROOM_DEV=/opt/Meshroom \
    MESHROOM_BUILD=/tmp/Meshroom_build \
    MESHROOM_BUNDLE=/opt/Meshroom_bundle \
    AV_INSTALL=/opt/AliceVision_install \
    QT_DIR=/opt/Qt/6.8.3/gcc_64 \
    PATH="${PATH}:${MESHROOM_BUNDLE}"


COPY *.txt *.md *.py ${MESHROOM_DEV}/
COPY ./docs ${MESHROOM_DEV}/docs
Expand Down Expand Up @@ -45,8 +45,11 @@ WORKDIR ${MESHROOM_BUILD}
RUN mkdir ${MESHROOM_BUNDLE}/aliceVision && \
mv /opt/AliceVision_bundle/* ${MESHROOM_BUNDLE}/aliceVision

# PySide6: copy missing libQt63DQuickScene3D.so along with its dependencies to avoid runtime issues
RUN cp ${QT_ROOT}/lib/libQt63DQuickScene3D.so.6.8.3 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/lib/libQt63DQuickScene3D.so.6

# Build Meshroom plugins
RUN cmake "${MESHROOM_DEV}" -DALICEVISION_ROOT="${AV_INSTALL}" -DCMAKE_INSTALL_PREFIX="${MESHROOM_BUNDLE}/qtPlugins"
RUN cmake "${MESHROOM_DEV}" -DQT_DIR=${QT_ROOT} -DALICEVISION_ROOT="${AV_INSTALL}" -DQTALICEVISION_VERSION=${QTAV_VERSION} -DCMAKE_INSTALL_PREFIX="${MESHROOM_BUNDLE}/qtPlugins"
RUN make "-j$(nproc)" QtAliceVision
RUN make "-j$(nproc)" && \
rm -rf "${MESHROOM_BUILD}" "${MESHROOM_DEV}" \
Expand All @@ -58,16 +61,6 @@ RUN make "-j$(nproc)" && \
${MESHROOM_BUNDLE}/aliceVision/share/man/ \
aliceVision/share/pkgconfig

# PySide6: copy missing libQt63DQuickScene3D.so along with its dependencies to avoid runtime issues
RUN cp ${QT_DIR}/lib/libQt63DQuickScene3D.so.6.8.3 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
mv ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs/libQt63DQuickScene3D.so.6.8.3 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs/libQt63DQuickScene3D.so.6 && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/lib/libQt6Concurrent.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Animation/libQt63DAnimation.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Core/libQt63DCore.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Input/libQt63DInput.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Logic/libQt63DLogic.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs && \
cp ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/Qt3D/Render/libQt63DRender.so.6 ${MESHROOM_BUNDLE}/lib/PySide6/Qt/qml/QtQuick/Dialogs

# Copy libOpenGL in the bundle: needed by QtAliceVision as a side effect of a Qt6 bug
RUN cp /usr/lib64/libOpenGL.so.0.0.0 ${MESHROOM_BUNDLE}/lib
RUN mv ${MESHROOM_BUNDLE}/lib/libOpenGL.so.0.0.0 ${MESHROOM_BUNDLE}/lib/libOpenGL.so.0
Expand All @@ -86,4 +79,3 @@ WORKDIR /root

EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

63 changes: 36 additions & 27 deletions docker/Dockerfile_rocky_deps
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,47 @@ LABEL maintainer="AliceVision Team alicevision-team@googlegroups.com"
# Execute with nvidia docker (https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0))
# docker run -it --runtime=nvidia meshroom

ENV MESHROOM_DEV=/opt/Meshroom \
MESHROOM_BUILD=/tmp/Meshroom_build \
QT_DIR=/opt/Qt/6.8.3/gcc_64 \
QT_CI_LOGIN=alicevisionjunk@gmail.com \
QT_CI_P=azerty1.

# Install libs needed by Qt
RUN dnf update -y
RUN dnf install -y flex fontconfig freetype glib2-devel libICE
RUN dnf install -y libX11 libXext libXi libXrender libSM
RUN dnf install -y libXt-devel mesa-libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libEGL-devel
RUN dnf install -y zlib-devel systemd openssh-server
RUN dnf install -y libxcb-devel \
libxkbcommon-devel \
libxkbcommon-x11-devel \
xcb-util-wm xcb-util-image \
xcb-util-keysyms \
xcb-util-renderutil
RUN dnf install -y libglvnd-opengl
RUN dnf update -y --nobest

RUN dnf install -y \
# Python / pip (needed by aqtinstall)
python3 \
python3-pip \
# Qt runtime/build dependencies
flex fontconfig freetype glib2-devel libICE \
libX11 libXext libXi libXrender libSM \
libXt-devel mesa-libGLU-devel mesa-libGL-devel mesa-libEGL-devel \
zlib-devel systemd openssh-server \
libxcb-devel \
libxkbcommon-devel \
libxkbcommon-x11-devel \
xcb-util-wm xcb-util-image \
xcb-util-keysyms \
xcb-util-renderutil \
libglvnd-opengl

RUN pip3 install --upgrade pip && \
pip3 install aqtinstall


ENV QT_VERSION=6.8.3
ENV QT_ARCH=linux_gcc_64
ENV QT_ARCH_SHORT=gcc_64
ENV QT_MODULES="qtcharts qt3d qtshadertools"
ENV QT_DIR=/opt/Qt
ENV QT_ROOT=/opt/Qt/${QT_VERSION}/${QT_ARCH_SHORT}

# Install Qt (to build plugins)
WORKDIR /tmp/qt
COPY dl/qt.run /tmp/qt
RUN chmod +x qt.run
RUN ./qt.run --root /opt/Qt --verbose --email ${QT_CI_LOGIN} --password ${QT_CI_P} --accept-obligations \
--accept-licenses --default-answer --platform minimal --auto-answer installationErrorWithCancel=Ignore \
--no-force-installations --no-default-installations --confirm-command \
install qt.qt6.683.linux_gcc_64 qt.qt6.683.addons.qtcharts qt.qt6.683.addons.qt3d
RUN rm qt.run
RUN aqt install-qt \
--outputdir "${QT_DIR}" \
linux desktop "${QT_VERSION}" "${QT_ARCH}" \
-m ${QT_MODULES}

# Strip sections containing ".note.ABI.tag" from .so: https://github.com/Microsoft/WSL/issues/3023
RUN find ${QT_DIR}/lib/ -name '*.so' | xargs strip --remove-section=.note.ABI-tag
# RUN find ${QT_DIR}/lib/ -name '*.so' | xargs strip --remove-section=.note.ABI-tag

ENV MESHROOM_DEV=/opt/Meshroom

COPY ./*requirements.txt ${MESHROOM_DEV}/

Expand Down
11 changes: 4 additions & 7 deletions docker/build-rocky.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
set -e
set -ex

test -z "$MESHROOM_VERSION" && MESHROOM_VERSION="$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse --short HEAD)"
test -z "$MESHROOM_VERSION" && MESHROOM_VERSION="$(git rev-parse --abbrev-ref HEAD | tr '/' '.')-$(git rev-parse --short HEAD)"
test -z "$QTAV_VERSION" && echo "qtAliceVision version not specified, set QTAV_VERSION in the environment" && exit 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Error messages should be redirected to standard error (stderr) instead of standard output (stdout) to follow standard CLI practices.

Suggested change
test -z "$QTAV_VERSION" && echo "qtAliceVision version not specified, set QTAV_VERSION in the environment" && exit 1
test -z "$QTAV_VERSION" && echo "qtAliceVision version not specified, set QTAV_VERSION in the environment" >&2 && exit 1

test -z "$AV_VERSION" && echo "AliceVision version not specified, set AV_VERSION in the environment" && exit 1
test -z "$CUDA_VERSION" && CUDA_VERSION=12.1.1
test -z "$ROCKY_VERSION" && ROCKY_VERSION=9
Expand All @@ -11,11 +12,6 @@ test -d docker || (
exit 1
)

test -d dl || \
mkdir dl
test -f dl/qt.run || \
wget --no-check-certificate "https://download.qt.io/official_releases/online_installers/qt-online-installer-linux-x64-online.run" -O "dl/qt.run"

# DEPENDENCIES
docker build \
--rm \
Expand All @@ -33,6 +29,7 @@ docker build \
--build-arg "MESHROOM_VERSION=${MESHROOM_VERSION}" \
--build-arg "CUDA_VERSION=${CUDA_VERSION}" \
--build-arg "ROCKY_VERSION=${ROCKY_VERSION}" \
--build-arg "QTAV_VERSION=${QTAV_VERSION}" \
--build-arg "AV_VERSION=${AV_VERSION}" \
--tag "alicevision/meshroom:${MESHROOM_VERSION}-av${AV_VERSION}-rocky${ROCKY_VERSION}-cuda${CUDA_VERSION}" \
-f docker/Dockerfile_rocky .
Expand Down
2 changes: 1 addition & 1 deletion docker/extract-rocky.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -ex

test -z "$MESHROOM_VERSION" && MESHROOM_VERSION="$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse --short HEAD)"
test -z "$MESHROOM_VERSION" && MESHROOM_VERSION="$(git rev-parse --abbrev-ref HEAD | tr '/' '.')-$(git rev-parse --short HEAD)"
test -z "$AV_VERSION" && echo "AliceVision version not specified, set AV_VERSION in the environment" && exit 1
test -z "$CUDA_VERSION" && CUDA_VERSION="12.1.1"
test -z "$ROCKY_VERSION" && ROCKY_VERSION="9"
Expand Down
2 changes: 1 addition & 1 deletion setupInitScriptUnix.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
if DIR_NAME not in paths:
newPaths = []
for lib in ("lib64", "lib"):
newPaths.append(os.path.join(DIR_NAME, lib, "PySide6", "Qt", "qml", "QtQuick", "Dialogs"))
newPaths.append(os.path.join(DIR_NAME, lib, "PySide6", "Qt", lib))
newPaths.append(os.path.join(DIR_NAME, "aliceVision", lib))
newPaths.append(os.path.join(DIR_NAME, lib))
newPaths.append(DIR_NAME)
Expand Down
Loading