[docker] add centos Dockerfile and cmake files to build plugins

This commit is contained in:
Fabien Castan 2018-08-07 10:13:54 +00:00
parent 4d213f9283
commit 447bb5a5c2
3 changed files with 198 additions and 0 deletions

67
CMakeLists.txt Normal file
View file

@ -0,0 +1,67 @@
cmake_minimum_required(VERSION 3.3)
project(meshroom LANGUAGES C CXX)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type for Meshroom plugins" FORCE)
endif()
set(DEPS_CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type for all external libraries")
string(TOLOWER ${DEPS_CMAKE_BUILD_TYPE} DEPS_CMAKE_BUILD_TYPE_LOWERCASE)
option(ALICEVISION_ROOT "AliceVision root dir" $ENV{ALICEVISION_ROOT})
option(QT_DIR "Qt root directory" $ENV{QT_DIR})
option(MR_BUILD_QTOIIO "Enable building of QtOIIO plugin" ON)
option(MR_BUILD_QMLALEMBIC "Enable building of qmlAlembic plugin" ON)
if(CMAKE_BUILD_TYPE MATCHES Release)
message(STATUS "Force CMAKE_INSTALL_DO_STRIP in Release")
set(CMAKE_INSTALL_DO_STRIP TRUE)
endif()
set(CMAKE_CORE_BUILD_FLAGS -DCMAKE_BUILD_TYPE=${DEPS_CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_INSTALL_DO_STRIP=${CMAKE_INSTALL_DO_STRIP})
set(OIIO_CMAKE_FLAGS -DOPENIMAGEIO_LIBRARY_DIR_HINTS=${ALICEVISION_ROOT} -DOPENIMAGEIO_INCLUDE_DIR_HINTS=${ALICEVISION_ROOT})
set(ALEMBIC_CMAKE_FLAGS -DAlembic_DIR:PATH=${ALICEVISION_ROOT}/lib/cmake/Alembic)
set(QT_CMAKE_FLAGS -DQT_DIR=${QT_DIR} -DCMAKE_PREFIX_PATH=${QT_DIR})
include(ExternalProject)
# ==============================================================================
# GNUInstallDirs CMake module
# - Define GNU standard installation directories
# - Provides install directory variables as defined by the GNU Coding Standards.
# ==============================================================================
include(GNUInstallDirs)
if(MR_BUILD_QTOIIO)
set(QTOIIO_TARGET qtoiio)
ExternalProject_Add(${QTOIIO_TARGET}
GIT_REPOSITORY https://github.com/alicevision/QtOIIO
GIT_TAG develop
PREFIX ${BUILD_DIR}
BUILD_IN_SOURCE 0
BUILD_ALWAYS 0
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/qtoiio
BINARY_DIR ${BUILD_DIR}/qtoiio_build
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} ${OIIO_CMAKE_FLAGS} ${QT_CMAKE_FLAGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> <SOURCE_DIR>
)
endif()
if(MR_BUILD_QMLALEMBIC)
set(QMLALEMBIC_TARGET qmlalembic)
ExternalProject_Add(${QMLALEMBIC_TARGET}
GIT_REPOSITORY https://github.com/alicevision/qmlAlembic
GIT_TAG develop
PREFIX ${BUILD_DIR}
BUILD_IN_SOURCE 0
BUILD_ALWAYS 0
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/qmlalembic
BINARY_DIR ${BUILD_DIR}/qmlalembic_build
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} ${ALEMBIC_CMAKE_FLAGS} ${QT_CMAKE_FLAGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> <SOURCE_DIR>
)
endif()

48
Dockerfile Normal file
View file

@ -0,0 +1,48 @@
ARG CUDA_TAG=7.0
ARG OS_TAG=7
FROM alicevision:centos${OS_TAG}-cuda${CUDA_TAG}
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
# Install all compilation tools
# - file and openssl are needed for cmake
RUN yum install -y \
flex \
fontconfig \
freetype \
glib2 \
libICE \
libX11 \
libxcb \
libXext \
libXi \
libXrender \
libSM \
libXt-devel \
libGLU-devel \
mesa-libOSMesa-devel \
mesa-libGL-devel \
mesa-libGLU-devel \
xcb-util-keysyms \
xcb-util-image
ENV MESHROOM_DEV=/opt/Meshroom \
MESHROOM_BUILD=/tmp/Meshroom_build \
MESHROOM_BUNDLE=/opt/Meshroom_bundle \
QT_DIR=/path/to/qt/5.11.0/gcc_64 \
OPENIMAGEIO_DIR=/path/to/oiio/install \
PATH="${PATH}:${MESHROOM_BUNDLE}"
COPY . "${MESHROOM_DEV}"
WORKDIR /tmp/qt
RUN curl -LO http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run
RUN chmod u+x qt-unified-linux-x64-online.run
RUN ./qt-unified-linux-x64-online.run --verbose --platform minimal --script "${MESHROOM_DEV}/docker/qt-installer-noninteractive.qs"
WORKDIR ${MESHROOM_BUILD}
RUN cmake "${MESHROOM_DEV}" -DALICEVISION_ROOT=${AV_INSTALL} -DCMAKE_INSTALL_PREFIX=${MESHROOM_BUNDLE}
RUN make -j8 install

View file

@ -0,0 +1,83 @@
// Emacs mode hint: -*- mode: JavaScript -*-
function Controller() {
installer.autoRejectMessageBoxes();
installer.installationFinished.connect(function() {
gui.clickButton(buttons.NextButton);
})
// Copied from https://bugreports.qt.io/browse/QTIFW-1072?jql=project%20%3D%20QTIFW
// there are some changes between Qt Online installer 3.0.1 and 3.0.2. Welcome page does some network
// queries that is why the next button is called too early.
var page = gui.pageWidgetByObjectName("WelcomePage")
page.completeChanged.connect(welcomepageFinished)
}
Controller.prototype.WelcomePageCallback = function() {
gui.clickButton(buttons.NextButton);
}
welcomepageFinished = function()
{
//completeChange() -function is called also when other pages visible
//Make sure that next button is clicked only when in welcome page
if(gui.currentPageWidget().objectName == "WelcomePage") {
gui.clickButton( buttons.NextButton);
}
}
Controller.prototype.CredentialsPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.IntroductionPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.TargetDirectoryPageCallback = function()
{
gui.currentPageWidget().TargetDirectoryLineEdit.setText("/opt/qt");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ComponentSelectionPageCallback = function() {
var widget = gui.currentPageWidget();
widget.deselectAll();
// widget.selectComponent("qt");
// widget.selectComponent("qt.qt5.5110");
widget.selectComponent("qt.qt5.5110.gcc_64");
// widget.selectComponent("qt.qt5.5110.qtscript");
// widget.selectComponent("qt.qt5.5110.qtscript.gcc_64");
// widget.selectComponent("qt.qt5.5110.qtwebengine");
// widget.selectComponent("qt.qt5.5110.qtwebengine.gcc_64");
// widget.selectComponent("qt.qt5.5110.qtwebglplugin");
// widget.selectComponent("qt.qt5.5110.qtwebglplugin.gcc_64");
// widget.selectComponent("qt.tools");
gui.clickButton(buttons.NextButton);
}
Controller.prototype.LicenseAgreementPageCallback = function() {
gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
gui.clickButton(buttons.NextButton);
}
Controller.prototype.StartMenuDirectoryPageCallback = function() {
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ReadyForInstallationPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.FinishedPageCallback = function() {
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
checkBoxForm.launchQtCreatorCheckBox.checked = false;
}
gui.clickButton(buttons.FinishButton);
}