From 19728e2df8edb84c4373bbe115cf1f61fbda852d Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Mon, 1 Jul 2019 20:17:59 +0200 Subject: [PATCH 01/10] [docker] move to cuda-8.0 by default --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9d24677855..38400415b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG CUDA_TAG=7.0 +ARG CUDA_TAG=8.0 ARG OS_TAG=7 ARG NPROC=1 FROM nvidia/cuda:${CUDA_TAG}-devel-centos${OS_TAG} From 5c1ef89da47bc20ec75a1ad56c824a492b91a84b Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Mon, 1 Jul 2019 20:18:58 +0200 Subject: [PATCH 02/10] [docker] change lines order: copy source first --- Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 38400415b1..836aae6f99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,14 @@ LABEL maintainer="AliceVision Team alicevision-team@googlegroups.com" # OS/Version (FILE): cat /etc/issue.net # Cuda version (ENV): $CUDA_VERSION +ENV AV_DEV=/opt/AliceVision_git \ + AV_BUILD=/tmp/AliceVision_build \ + AV_INSTALL=/opt/AliceVision_install \ + AV_BUNDLE=/opt/AliceVision_bundle \ + PATH="${PATH}:${AV_BUNDLE}" + +COPY . "${AV_DEV}" + # Install all compilation tools # - file and openssl are needed for cmake RUN yum -y install \ @@ -38,14 +46,6 @@ RUN yum -y install \ WORKDIR /opt RUN wget https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && tar zxvf cmake-3.13.2.tar.gz && cd cmake-3.13.2 && ./bootstrap --prefix=/usr/local -- -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_USE_OPENSSL:BOOL=ON && make -j8 && make install -ENV AV_DEV=/opt/AliceVision_git \ - AV_BUILD=/tmp/AliceVision_build \ - AV_INSTALL=/opt/AliceVision_install \ - AV_BUNDLE=/opt/AliceVision_bundle \ - PATH="${PATH}:${AV_BUNDLE}" - -COPY . "${AV_DEV}" - WORKDIR "${AV_BUILD}" RUN cmake "${AV_DEV}" -DCMAKE_BUILD_TYPE=Release -DALICEVISION_BUILD_DEPENDENCIES:BOOL=ON -DINSTALL_DEPS_BUILD:BOOL=ON -DCMAKE_INSTALL_PREFIX="${AV_INSTALL}" -DALICEVISION_BUNDLE_PREFIX="${AV_BUNDLE}" From f001b650e5683b518d28885e25018c3d0e20a1d9 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Mon, 1 Jul 2019 20:21:14 +0200 Subject: [PATCH 03/10] [cmake] all-in-one build: add opencv --- CMakeLists.txt | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19d216393e..6b7a819727 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ option(AV_BUILD_PNG "Enable building an embedded Png" ON) option(AV_BUILD_LIBRAW "Enable building an embedded libraw" ON) option(AV_BUILD_POPSIFT "Enable building an embedded PopSift" ON) option(AV_BUILD_OPENGV "Enable building an embedded OpenGV" ON) +option(AV_BUILD_OPENCV "Enable building an embedded OpenCV" ON) option(AV_BUILD_LAPACK "Enable building an embedded Lapack" ON) option(AV_BUILD_SUITESPARSE "Enable building an embedded SuiteSparse" ON) @@ -56,6 +57,7 @@ message(STATUS "AV_BUILD_PNG: ${AV_BUILD_PNG}") message(STATUS "AV_BUILD_LIBRAW: ${AV_BUILD_LIBRAW}") message(STATUS "AV_BUILD_POPSIFT: ${AV_BUILD_POPSIFT}") message(STATUS "AV_BUILD_OPENGV: ${AV_BUILD_OPENGV}") +message(STATUS "AV_BUILD_OPENCV: ${AV_BUILD_OPENCV}") message(STATUS "AV_BUILD_LAPACK: ${AV_BUILD_LAPACK}") message(STATUS "AV_BUILD_SUITESPARSE: ${AV_BUILD_SUITESPARSE}") message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") @@ -207,7 +209,6 @@ ExternalProject_Add(${OPENGV_TARGET} set(OPENGV_CMAKE_FLAGS -DOPENGV_DIR=${BUILD_DIR}/opengv_install) endif() - if(AV_BUILD_LAPACK) set(LAPACK_TARGET lapack) ExternalProject_Add(${LAPACK_TARGET} @@ -442,6 +443,49 @@ ExternalProject_Add(${ALEMBIC_TARGET} ) set(ALEMBIC_CMAKE_FLAGS -DAlembic_DIR:PATH=${BUILD_DIR}/alembic_build/lib/cmake/Alembic) +if(AV_BUILD_OPENCV) +set(OPENCV_TARGET opencv) +ExternalProject_Add(opencv_contrib + URL https://github.com/opencv/opencv_contrib/archive/3.4.2.zip + URL_MD5 171a0c9eabbdc3332164de6221684beb + SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/opencv_contrib + UPDATE_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" +) +ExternalProject_Add(${OPENCV_TARGET} + DEPENDS opencv_contrib ${TBB_TARGET} ${ZLIB_TARGET} + URL https://github.com/opencv/opencv/archive/3.4.2.zip + URL_MD5 9e9ebe9c1fe98c468f6e53f5c3c49716 + UPDATE_COMMAND "" + SOURCE_DIR ${OPENCV_SRC_PATH} + BINARY_DIR ${OPENCV_BUILD_PATH} + CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} -DCMAKE_INSTALL_PREFIX:PATH= + -DOPENCV_EXTRA_MODULES_PATH=${CMAKE_CURRENT_BINARY_DIR}/opencv_contrib/modules + -DWITH_TBB=ON + -DBUILD_opencv_python2=OFF + -DBUILD_opencv_python3=OFF + -DWITH_GTK_2_X=OFF + -DWITH_V4L=OFF + -DINSTALL_C_EXAMPLES=OFF + -DINSTALL_PYTHON_EXAMPLES=OFF + -DBUILD_EXAMPLES=OFF + -DWITH_QT=OFF + -DWITH_OPENGL=OFF + -DWITH_VTK=OFF + -DENABLE_PRECOMPILED_HEADERS=OFF + -DBUILD_SHARED_LIBS=ON + -DWITH_CUDA=OFF + -DWITH_OPENCL=OFF + -DBUILD_TESTS=OFF + -DBUILD_LIST=core,improc,video,imgcodecs,videoio,features2d,xfeatures2d + ../${OPENCV_SRC_PATH} +) +set(OPENCV_CMAKE_FLAGS -DOPENCV_DIR=${BUILD_DIR}/opencv_install) +endif() + + # Add PopSift if(AV_BUILD_POPSIFT) set(POPSIFT_TARGET popsift) @@ -468,6 +512,7 @@ set(AV_DEPS ${TBB_TARGET} ${EIGEN_TARGET} ${OPENGV_TARGET} + ${OPENCV_TARGET} ${LAPACK_TARGET} ${SUITESPARSE_TARGET} ${CERES_TARGET} @@ -489,7 +534,7 @@ ExternalProject_Add(aliceVision SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src BINARY_DIR ${BUILD_DIR}/aliceVision_build INSTALL_DIR ${BUILD_DIR}/aliceVision_build - CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS:BOOL=ON -DTARGET_ARCHITECTURE=core -DALICEVISION_ROOT=${ALICEVISION_ROOT} -DALICEVISION_USE_ALEMBIC=ON -DMINIGLOG=ON -DALICEVISION_USE_OPENCV=OFF -DALICEVISION_USE_OPENGV=ON -DALICEVISION_USE_POPSIFT=${AV_BUILD_POPSIFT} -DALICEVISION_USE_CUDA=${AV_USE_CUDA} -DALICEVISION_BUILD_DOC=OFF -DALICEVISION_BUILD_EXAMPLES=OFF ${ZLIB_CMAKE_FLAGS} ${EIGEN_CMAKE_FLAGS} ${OPENIMAGEIO_CMAKE_FLAGS} ${OPENEXR_CMAKE_FLAGS} ${BOOST_CMAKE_FLAGS} ${ALEMBIC_CMAKE_FLAGS} ${GEOGRAM_CMAKE_FLAGS} ${LAPACK_CMAKE_FLAGS} ${CERES_CMAKE_FLAGS} ${CUDA_CMAKE_FLAGS} ${POPSIFT_CMAKE_FLAGS} ${OPENGV_CMAKE_FLAGS} -DALICEVISION_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX:PATH= + CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS:BOOL=ON -DTARGET_ARCHITECTURE=core -DALICEVISION_ROOT=${ALICEVISION_ROOT} -DALICEVISION_USE_ALEMBIC=ON -DMINIGLOG=ON -DALICEVISION_USE_OPENCV=${AV_BUILD_OPENCV} -DALICEVISION_USE_OPENGV=${AV_BUILD_OPENGV} -DALICEVISION_USE_POPSIFT=${AV_BUILD_POPSIFT} -DALICEVISION_USE_CUDA=${AV_USE_CUDA} -DALICEVISION_BUILD_DOC=OFF -DALICEVISION_BUILD_EXAMPLES=OFF ${ZLIB_CMAKE_FLAGS} ${EIGEN_CMAKE_FLAGS} ${OPENIMAGEIO_CMAKE_FLAGS} ${OPENEXR_CMAKE_FLAGS} ${BOOST_CMAKE_FLAGS} ${ALEMBIC_CMAKE_FLAGS} ${GEOGRAM_CMAKE_FLAGS} ${LAPACK_CMAKE_FLAGS} ${CERES_CMAKE_FLAGS} ${CUDA_CMAKE_FLAGS} ${POPSIFT_CMAKE_FLAGS} ${OPENGV_CMAKE_FLAGS} ${OPENCV_CMAKE_FLAGS} -DALICEVISION_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX:PATH= DEPENDS ${AV_DEPS} ) From 70a984de4192141b2c83f20cd00d34c74e766fae Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Tue, 2 Jul 2019 17:56:50 +0200 Subject: [PATCH 04/10] [cmake] all-in-one build: add CCTag --- CMakeLists.txt | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b7a819727..35e4c65c2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ option(AV_BUILD_JPEG "Enable building an embedded Jpeg" ON) option(AV_BUILD_PNG "Enable building an embedded Png" ON) option(AV_BUILD_LIBRAW "Enable building an embedded libraw" ON) option(AV_BUILD_POPSIFT "Enable building an embedded PopSift" ON) +option(AV_BUILD_CCTAG "Enable building an embedded CCTag" ON) option(AV_BUILD_OPENGV "Enable building an embedded OpenGV" ON) option(AV_BUILD_OPENCV "Enable building an embedded OpenCV" ON) option(AV_BUILD_LAPACK "Enable building an embedded Lapack" ON) @@ -55,6 +56,7 @@ message(STATUS "AV_BUILD_TIFF: ${AV_BUILD_TIFF}") message(STATUS "AV_BUILD_JPEG: ${AV_BUILD_JPEG}") message(STATUS "AV_BUILD_PNG: ${AV_BUILD_PNG}") message(STATUS "AV_BUILD_LIBRAW: ${AV_BUILD_LIBRAW}") +message(STATUS "AV_BUILD_CCTAG: ${AV_BUILD_CCTAG}") message(STATUS "AV_BUILD_POPSIFT: ${AV_BUILD_POPSIFT}") message(STATUS "AV_BUILD_OPENGV: ${AV_BUILD_OPENGV}") message(STATUS "AV_BUILD_OPENCV: ${AV_BUILD_OPENCV}") @@ -173,8 +175,9 @@ ExternalProject_Add(${TBB_TARGET} INSTALL_DIR ${BUILD_DIR}/tbb_build CONFIGURE_COMMAND "" BUILD_COMMAND PREFIX= make PREFIX= - INSTALL_COMMAND mkdir -p /${CMAKE_INSTALL_LIBDIR} && echo "cp /build/linux_*_release/*.so /${CMAKE_INSTALL_LIBDIR}" > tbb_so_files.sh && sh tbb_so_files.sh && cp -r "/include" "" + INSTALL_COMMAND mkdir -p /${CMAKE_INSTALL_LIBDIR} && echo "cp /build/linux_*_release/*.so* /${CMAKE_INSTALL_LIBDIR}" > tbb_so_files.sh && sh tbb_so_files.sh && cp -r "/include" "" ) +set(TBB_CMAKE_FLAGS -DTBB_INCLUDE_DIRS:PATH=${BUILD_DIR}/tbb_build/include -DTBB_LIBRARIES=${BUILD_DIR}/tbb_build/${CMAKE_INSTALL_LIBDIR}/libtbb.so) # Add Eigen set(EIGEN_TARGET eigen) @@ -189,7 +192,7 @@ ExternalProject_Add(${EIGEN_TARGET} INSTALL_DIR ${BUILD_DIR}/eigen_build CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} -DCMAKE_INSTALL_PREFIX:PATH= ) -set(EIGEN_CMAKE_FLAGS -DEigen3_DIR:PATH=${BUILD_DIR}/eigen_build/share/eigen3/cmake -DEIGEN3_INCLUDE_DIR=${BUILD_DIR}/eigen_build/include/eigen3 -DEIGEN_INCLUDE_DIR=${BUILD_DIR}/eigen_build/include/eigen3) +set(EIGEN_CMAKE_FLAGS -DEigen3_DIR:PATH=${BUILD_DIR}/eigen_build/share/eigen3/cmake -DEIGEN3_INCLUDE_DIR=${BUILD_DIR}/eigen_build/include/eigen3 -DEIGEN_INCLUDE_DIR=${BUILD_DIR}/eigen_build/include/eigen3 -DEigen_INCLUDE_DIR=${BUILD_DIR}/eigen_build/include/eigen3) if(AV_BUILD_OPENGV) set(OPENGV_TARGET opengv) @@ -402,7 +405,7 @@ ExternalProject_Add(${BOOST_TARGET} SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/boost BINARY_DIR ${BUILD_DIR}/boost_build INSTALL_DIR ${BUILD_DIR}/boost_build - CONFIGURE_COMMAND cd && ./bootstrap.${SCRIPT_EXTENSION} --prefix= --with-libraries=atomic,container,date_time,exception,filesystem,graph,log,math,program_options,regex,serialization,system,test,thread + CONFIGURE_COMMAND cd && ./bootstrap.${SCRIPT_EXTENSION} --prefix= --with-libraries=atomic,container,date_time,exception,filesystem,graph,log,math,program_options,regex,serialization,system,test,thread,stacktrace,timer BUILD_COMMAND cd && ./b2 --prefix= variant=${DEPS_CMAKE_BUILD_TYPE_LOWERCASE} link=shared threading=multi -j8 INSTALL_COMMAND cd && ./b2 variant=${DEPS_CMAKE_BUILD_TYPE_LOWERCASE} link=shared threading=multi install DEPENDS ${ZLIB_TARGET} @@ -459,8 +462,9 @@ ExternalProject_Add(${OPENCV_TARGET} URL https://github.com/opencv/opencv/archive/3.4.2.zip URL_MD5 9e9ebe9c1fe98c468f6e53f5c3c49716 UPDATE_COMMAND "" - SOURCE_DIR ${OPENCV_SRC_PATH} - BINARY_DIR ${OPENCV_BUILD_PATH} + SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/opencv + BINARY_DIR ${BUILD_DIR}/opencv_build + INSTALL_DIR ${BUILD_DIR}/opencv_install CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} -DCMAKE_INSTALL_PREFIX:PATH= -DOPENCV_EXTRA_MODULES_PATH=${CMAKE_CURRENT_BINARY_DIR}/opencv_contrib/modules -DWITH_TBB=ON @@ -479,12 +483,31 @@ ExternalProject_Add(${OPENCV_TARGET} -DWITH_CUDA=OFF -DWITH_OPENCL=OFF -DBUILD_TESTS=OFF - -DBUILD_LIST=core,improc,video,imgcodecs,videoio,features2d,xfeatures2d + -DBUILD_LIST=core,improc,photo,objdetect,video,imgcodecs,videoio,features2d,xfeatures2d,version ../${OPENCV_SRC_PATH} ) -set(OPENCV_CMAKE_FLAGS -DOPENCV_DIR=${BUILD_DIR}/opencv_install) +# set(OPENCV_CMAKE_FLAGS -DOpenCV_DIR=${BUILD_DIR}/opencv_install -DCMAKE_PREFIX_PATH=${BUILD_DIR}/opencv_install) +set(OPENCV_CMAKE_FLAGS -DOpenCV_DIR=${BUILD_DIR}/opencv_install -DOPENCV_DIR=${BUILD_DIR}/opencv_install) endif() +# Add CCTag +if(AV_BUILD_CCTAG) +set(CCTAG_TARGET cctag) +ExternalProject_Add(${CCTAG_TARGET} + GIT_REPOSITORY https://github.com/alicevision/CCTag + GIT_TAG develop + PREFIX ${BUILD_DIR} + BUILD_IN_SOURCE 0 + BUILD_ALWAYS 0 + UPDATE_COMMAND "" + SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/cctag + BINARY_DIR ${BUILD_DIR}/cctag_build + INSTALL_DIR ${BUILD_DIR}/cctag_build + CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} ${BOOST_CMAKE_FLAGS} ${CUDA_CMAKE_FLAGS} ${OPENCV_CMAKE_FLAGS} ${EIGEN_CMAKE_FLAGS} ${TBB_CMAKE_FLAGS} -DCCTAG_WITH_CUDA:BOOL=ON -DBUILD_TESTS=OFF -DBUILD_APPS=OFF -DCMAKE_INSTALL_PREFIX:PATH= + DEPENDS ${BOOST_TARGET} ${CUDA_TARGET} ${OPENCV_TARGET} ${EIGEN_TARGET} ${TBB_TARGET} + ) +set(CCTAG_CMAKE_FLAGS -DCCTag_DIR:PATH=${BUILD_DIR}/cctag_build/lib/cmake/CCTag) +endif() # Add PopSift if(AV_BUILD_POPSIFT) @@ -524,6 +547,7 @@ set(AV_DEPS ${BOOST_TARGET} ${OPENIMAGEIO_TARGET} ${ALEMBIC_TARGET} + ${CCTAG_TARGET} ${POPSIFT_TARGET} ) @@ -534,7 +558,7 @@ ExternalProject_Add(aliceVision SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src BINARY_DIR ${BUILD_DIR}/aliceVision_build INSTALL_DIR ${BUILD_DIR}/aliceVision_build - CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS:BOOL=ON -DTARGET_ARCHITECTURE=core -DALICEVISION_ROOT=${ALICEVISION_ROOT} -DALICEVISION_USE_ALEMBIC=ON -DMINIGLOG=ON -DALICEVISION_USE_OPENCV=${AV_BUILD_OPENCV} -DALICEVISION_USE_OPENGV=${AV_BUILD_OPENGV} -DALICEVISION_USE_POPSIFT=${AV_BUILD_POPSIFT} -DALICEVISION_USE_CUDA=${AV_USE_CUDA} -DALICEVISION_BUILD_DOC=OFF -DALICEVISION_BUILD_EXAMPLES=OFF ${ZLIB_CMAKE_FLAGS} ${EIGEN_CMAKE_FLAGS} ${OPENIMAGEIO_CMAKE_FLAGS} ${OPENEXR_CMAKE_FLAGS} ${BOOST_CMAKE_FLAGS} ${ALEMBIC_CMAKE_FLAGS} ${GEOGRAM_CMAKE_FLAGS} ${LAPACK_CMAKE_FLAGS} ${CERES_CMAKE_FLAGS} ${CUDA_CMAKE_FLAGS} ${POPSIFT_CMAKE_FLAGS} ${OPENGV_CMAKE_FLAGS} ${OPENCV_CMAKE_FLAGS} -DALICEVISION_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX:PATH= + CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS:BOOL=ON -DTARGET_ARCHITECTURE=core -DALICEVISION_ROOT=${ALICEVISION_ROOT} -DALICEVISION_USE_ALEMBIC=ON -DMINIGLOG=ON -DALICEVISION_USE_CCTAG=${AV_BUILD_CCTAG} -DALICEVISION_USE_OPENCV=${AV_BUILD_OPENCV} -DALICEVISION_USE_OPENGV=${AV_BUILD_OPENGV} -DALICEVISION_USE_POPSIFT=${AV_BUILD_POPSIFT} -DALICEVISION_USE_CUDA=${AV_USE_CUDA} -DALICEVISION_BUILD_DOC=OFF -DALICEVISION_BUILD_EXAMPLES=OFF ${ZLIB_CMAKE_FLAGS} ${EIGEN_CMAKE_FLAGS} ${OPENIMAGEIO_CMAKE_FLAGS} ${OPENEXR_CMAKE_FLAGS} ${BOOST_CMAKE_FLAGS} ${ALEMBIC_CMAKE_FLAGS} ${GEOGRAM_CMAKE_FLAGS} ${LAPACK_CMAKE_FLAGS} ${CERES_CMAKE_FLAGS} ${CUDA_CMAKE_FLAGS} ${POPSIFT_CMAKE_FLAGS} ${OPENGV_CMAKE_FLAGS} ${OPENCV_CMAKE_FLAGS} -DALICEVISION_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX:PATH= DEPENDS ${AV_DEPS} ) From 51f13a3eecf49b07b6702761b35deff9f0de1d78 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Tue, 2 Jul 2019 17:57:58 +0200 Subject: [PATCH 05/10] [docker] update cmake to 3.15.5 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 836aae6f99..a33f8e162b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,9 +42,9 @@ RUN yum -y install \ openssl-devel \ gcc-gfortran -# Manually install cmake 3.11 +# Manually install cmake 3.14 WORKDIR /opt -RUN wget https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && tar zxvf cmake-3.13.2.tar.gz && cd cmake-3.13.2 && ./bootstrap --prefix=/usr/local -- -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_USE_OPENSSL:BOOL=ON && make -j8 && make install +RUN wget https://cmake.org/files/v3.14/cmake-3.14.5.tar.gz && tar zxvf cmake-3.14.5.tar.gz && cd cmake-3.14.5 && ./bootstrap --prefix=/usr/local -- -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_USE_OPENSSL:BOOL=ON && make -j8 && make install WORKDIR "${AV_BUILD}" RUN cmake "${AV_DEV}" -DCMAKE_BUILD_TYPE=Release -DALICEVISION_BUILD_DEPENDENCIES:BOOL=ON -DINSTALL_DEPS_BUILD:BOOL=ON -DCMAKE_INSTALL_PREFIX="${AV_INSTALL}" -DALICEVISION_BUNDLE_PREFIX="${AV_BUNDLE}" From 8a7e5b5779416f0bf54d9206705bff2432677c6b Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Tue, 16 Jul 2019 22:16:25 +0200 Subject: [PATCH 06/10] [cmake] all-in-one: add missing cctag flags --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35e4c65c2a..ca6793fa98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -558,7 +558,7 @@ ExternalProject_Add(aliceVision SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src BINARY_DIR ${BUILD_DIR}/aliceVision_build INSTALL_DIR ${BUILD_DIR}/aliceVision_build - CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS:BOOL=ON -DTARGET_ARCHITECTURE=core -DALICEVISION_ROOT=${ALICEVISION_ROOT} -DALICEVISION_USE_ALEMBIC=ON -DMINIGLOG=ON -DALICEVISION_USE_CCTAG=${AV_BUILD_CCTAG} -DALICEVISION_USE_OPENCV=${AV_BUILD_OPENCV} -DALICEVISION_USE_OPENGV=${AV_BUILD_OPENGV} -DALICEVISION_USE_POPSIFT=${AV_BUILD_POPSIFT} -DALICEVISION_USE_CUDA=${AV_USE_CUDA} -DALICEVISION_BUILD_DOC=OFF -DALICEVISION_BUILD_EXAMPLES=OFF ${ZLIB_CMAKE_FLAGS} ${EIGEN_CMAKE_FLAGS} ${OPENIMAGEIO_CMAKE_FLAGS} ${OPENEXR_CMAKE_FLAGS} ${BOOST_CMAKE_FLAGS} ${ALEMBIC_CMAKE_FLAGS} ${GEOGRAM_CMAKE_FLAGS} ${LAPACK_CMAKE_FLAGS} ${CERES_CMAKE_FLAGS} ${CUDA_CMAKE_FLAGS} ${POPSIFT_CMAKE_FLAGS} ${OPENGV_CMAKE_FLAGS} ${OPENCV_CMAKE_FLAGS} -DALICEVISION_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX:PATH= + CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_SHARED_LIBS:BOOL=ON -DTARGET_ARCHITECTURE=core -DALICEVISION_ROOT=${ALICEVISION_ROOT} -DALICEVISION_USE_ALEMBIC=ON -DMINIGLOG=ON -DALICEVISION_USE_CCTAG=${AV_BUILD_CCTAG} -DALICEVISION_USE_OPENCV=${AV_BUILD_OPENCV} -DALICEVISION_USE_OPENGV=${AV_BUILD_OPENGV} -DALICEVISION_USE_POPSIFT=${AV_BUILD_POPSIFT} -DALICEVISION_USE_CUDA=${AV_USE_CUDA} -DALICEVISION_BUILD_DOC=OFF -DALICEVISION_BUILD_EXAMPLES=OFF ${ZLIB_CMAKE_FLAGS} ${EIGEN_CMAKE_FLAGS} ${OPENIMAGEIO_CMAKE_FLAGS} ${OPENEXR_CMAKE_FLAGS} ${BOOST_CMAKE_FLAGS} ${ALEMBIC_CMAKE_FLAGS} ${GEOGRAM_CMAKE_FLAGS} ${LAPACK_CMAKE_FLAGS} ${CERES_CMAKE_FLAGS} ${CUDA_CMAKE_FLAGS} ${POPSIFT_CMAKE_FLAGS} ${OPENGV_CMAKE_FLAGS} ${OPENCV_CMAKE_FLAGS} ${CCTAG_CMAKE_FLAGS} -DALICEVISION_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX:PATH= DEPENDS ${AV_DEPS} ) From ee54ed348a6321e8bbf415f37c1fee34fe96a1c4 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Tue, 16 Jul 2019 22:16:58 +0200 Subject: [PATCH 07/10] [cmake] all-in-one: update OpenCV to 4.1.0 --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca6793fa98..9c2331fd8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -449,8 +449,8 @@ set(ALEMBIC_CMAKE_FLAGS -DAlembic_DIR:PATH=${BUILD_DIR}/alembic_build/lib/cmake/ if(AV_BUILD_OPENCV) set(OPENCV_TARGET opencv) ExternalProject_Add(opencv_contrib - URL https://github.com/opencv/opencv_contrib/archive/3.4.2.zip - URL_MD5 171a0c9eabbdc3332164de6221684beb + URL https://github.com/opencv/opencv_contrib/archive/4.1.0.zip + URL_MD5 3cd00bbfdebb69ad24756ccfb801ebac SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/opencv_contrib UPDATE_COMMAND "" CONFIGURE_COMMAND "" @@ -459,8 +459,8 @@ ExternalProject_Add(opencv_contrib ) ExternalProject_Add(${OPENCV_TARGET} DEPENDS opencv_contrib ${TBB_TARGET} ${ZLIB_TARGET} - URL https://github.com/opencv/opencv/archive/3.4.2.zip - URL_MD5 9e9ebe9c1fe98c468f6e53f5c3c49716 + URL https://github.com/opencv/opencv/archive/4.1.0.zip + URL_MD5 5c5a9ce3519415b263d512e7f6a1e2af UPDATE_COMMAND "" SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/opencv BINARY_DIR ${BUILD_DIR}/opencv_build @@ -487,7 +487,7 @@ ExternalProject_Add(${OPENCV_TARGET} ../${OPENCV_SRC_PATH} ) # set(OPENCV_CMAKE_FLAGS -DOpenCV_DIR=${BUILD_DIR}/opencv_install -DCMAKE_PREFIX_PATH=${BUILD_DIR}/opencv_install) -set(OPENCV_CMAKE_FLAGS -DOpenCV_DIR=${BUILD_DIR}/opencv_install -DOPENCV_DIR=${BUILD_DIR}/opencv_install) +set(OPENCV_CMAKE_FLAGS -DOpenCV_DIR=${BUILD_DIR}/opencv_install/${CMAKE_INSTALL_LIBDIR}/cmake/opencv4 -DOPENCV_DIR=${BUILD_DIR}/opencv_install/${CMAKE_INSTALL_LIBDIR}/cmake/opencv4) endif() # Add CCTag From d5a03c5902ae17102cdef544cb4267554faf9bd2 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Tue, 16 Jul 2019 22:17:49 +0200 Subject: [PATCH 08/10] [cmake] add boost timer to find_package as it is used in CCTag --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b2994cde5a..c7b083acf2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -251,7 +251,7 @@ endif() # Boost # ============================================================================== option(BOOST_NO_CXX11 "if Boost is compiled without C++11 support (as it is often the case in OS packages) this must be enabled to avoid symbol conflicts (SCOPED_ENUM)." OFF) -find_package(Boost 1.60.0 QUIET COMPONENTS atomic container date_time filesystem graph log log_setup program_options regex serialization system thread) +find_package(Boost 1.60.0 QUIET COMPONENTS atomic container date_time filesystem graph log log_setup program_options regex serialization system thread timer) if(Boost_FOUND) message(STATUS "Boost ${Boost_LIB_VERSION} found.") From cebc7da47e91da0837a755e5ae646e0ec358b4ae Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 18 Jul 2019 20:06:32 +0200 Subject: [PATCH 09/10] [cmake] add ILMBASE_INCLUDE_DIR --- src/cmake/FindOpenImageIO.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmake/FindOpenImageIO.cmake b/src/cmake/FindOpenImageIO.cmake index 0dd3ca775f..81de9249ea 100644 --- a/src/cmake/FindOpenImageIO.cmake +++ b/src/cmake/FindOpenImageIO.cmake @@ -134,7 +134,7 @@ endif (OPENIMAGEIO_LIBRARY AND # Set standard CMake FindPackage variables if found. if (OPENIMAGEIO_FOUND) - set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR}) + set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR} ${ILMBASE_INCLUDE_DIR}) set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY} ${ILMBASE_LIBRARIES}) endif (OPENIMAGEIO_FOUND) From c0c984497cbc056f831422f9f2aa5a3f3722f188 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 18 Jul 2019 20:07:52 +0200 Subject: [PATCH 10/10] [feature] compatibility with opencv4 --- src/aliceVision/feature/openCV/ImageDescriber_SIFT_OCV.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/aliceVision/feature/openCV/ImageDescriber_SIFT_OCV.cpp b/src/aliceVision/feature/openCV/ImageDescriber_SIFT_OCV.cpp index 55288603d9..84c723e4f5 100644 --- a/src/aliceVision/feature/openCV/ImageDescriber_SIFT_OCV.cpp +++ b/src/aliceVision/feature/openCV/ImageDescriber_SIFT_OCV.cpp @@ -99,7 +99,7 @@ bool ImageDescriber_SIFT_openCV::describe(const image::Image& ima filtered_keypoints.reserve(std::min(v_keypoints.size(), _params.maxTotalKeypoints)); rejected_keypoints.reserve(v_keypoints.size()); - cv::Mat countFeatPerCell(_params.gridSize, _params.gridSize, cv::DataType::type, cv::Scalar(0)); + cv::Mat countFeatPerCell(_params.gridSize, _params.gridSize, cv::DataType::type, cv::Scalar(0)); const std::size_t keypointsPerCell = _params.maxTotalKeypoints / countFeatPerCell.total(); const double regionWidth = image.Width() / double(countFeatPerCell.cols); const double regionHeight = image.Height() / double(countFeatPerCell.rows); @@ -117,8 +117,8 @@ bool ImageDescriber_SIFT_openCV::describe(const image::Image& ima // std::cout << "- countFeatPerCell: " << countFeatPerCell << std::endl; // std::cout << "- gridSize: " << _params.gridSize << std::endl; - const std::size_t count = countFeatPerCell.at(cellX, cellY); - countFeatPerCell.at(cellX, cellY) = count + 1; + const int count = countFeatPerCell.at(cellX, cellY); + countFeatPerCell.at(cellX, cellY) = count + 1; if(count < keypointsPerCell) filtered_keypoints.push_back(keypoint); else