diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4f567fe073..1767764a13 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -20,7 +20,7 @@ jobs: build-linux: runs-on: ubuntu-latest container: - image: alicevision/alicevision-deps:ci-2021-08-05-centos7-cuda10.2 + image: alicevision/alicevision-deps:ci-2021-10-28-centos7-cuda10.2 env: DEPS_INSTALL_DIR: /opt/AliceVision_install BUILD_TYPE: Release @@ -104,7 +104,7 @@ jobs: tripletPath: '${{ github.workspace }}\..\vcpkg\triplets\community\x64-windows-release.cmake' BUILD_TYPE: Release CTEST_OUTPUT_ON_FAILURE: 1 - COMMIT_ID: 261c458af6e3eed5d099144aff95d2b5035f656b + COMMIT_ID: 7678fa940527fa675b3a1eabf3fb77814d0f81e7 steps: - name: Checkout uses: actions/checkout@v2 @@ -116,7 +116,7 @@ jobs: # git clone https://github.com/microsoft/vcpkg.git --branch 2021.05.12 https://github.com/DanielDelaporus/vcpkg.git --branch alembic-fix-build-types run: | cd .. - git clone https://github.com/microsoft/vcpkg.git + git clone https://github.com/fabiencastan/vcpkg.git cd vcpkg git checkout ${{ env.COMMIT_ID }} cd ${{ github.workspace }} @@ -175,6 +175,7 @@ jobs: assimp # without "cuda" for now vcpkgTriplet: x64-windows-release + # doNotCache: true # Ensure the vcpkg artifacts are cached, they are generated in the 'CMAKE_BINARY_DIR/vcpkg_installed' directory. additionalCachedPaths: ${{ env.buildDir }}/vcpkg_installed diff --git a/CMakeLists.txt b/CMakeLists.txt index bdfa2ffde9..8f6beec656 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,6 +129,7 @@ set(ASSIMP_AV_VERSION 5.0.1) set(ASSIMP_FILENAME v${ASSIMP_AV_VERSION}.tar.gz) ExternalProject_Add(${ASSIMP_TARGET} URL https://github.com/assimp/assimp/archive/refs/tags/${ASSIMP_FILENAME} + URL_HASH MD5=eb7b7385a5c3194ab46d7f869d7ac6cf DOWNLOAD_DIR ${BUILD_DIR}/download/assimp PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 @@ -210,9 +211,17 @@ ExternalProject_Add(${TBB_TARGET} BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/tbb INSTALL_DIR ${CMAKE_INSTALL_PREFIX} CONFIGURE_COMMAND "" - BUILD_COMMAND $(MAKE) PREFIX= + BUILD_COMMAND OS=Linux $(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" "" ) +# TODO: need to upgrade code in cctag +# URL https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.4.0.tar.gz +# URL_HASH MD5=fa317f16003e31e33a57ae7d888403e4# +# == Build v2021.4.0 +# TBB_ALLOCATOR_TRAITS_BROKEN: https://github.com/oneapi-src/oneTBB/issues/383 +# CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} -DCMAKE_CXX_FLAGS=-DTBB_ALLOCATOR_TRAITS_BROKEN -DCMAKE_INSTALL_PREFIX:PATH= +# Use default build / install +# set(TBB_CMAKE_FLAGS -DTBB_INCLUDE_DIRS:PATH=${CMAKE_INSTALL_PREFIX}/include -DTBB_LIBRARIES=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libtbb.so) # Add Eigen @@ -221,10 +230,8 @@ set(EIGEN_DISABLE_ALIGN_FLAGS "-DCMAKE_CXX_FLAGS:STRING=-DEIGEN_MAX_ALIGN_BYTES=0 -DEIGEN_MAX_STATIC_ALIGN_BYTES=0" "-DCMAKE_C_FLAGS:STRING=-DEIGEN_MAX_ALIGN_BYTES=0 -DEIGEN_MAX_STATIC_ALIGN_BYTES=0") ExternalProject_Add(${EIGEN_TARGET} - URL https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.bz2 - URL_HASH MD5=2d5a8dac126c4937fd94d5d10fcd7dd1 - # URL https://gitlab.com/libeigen/eigen/-/archive/3.4-rc1/eigen-3.4-rc1.tar.bz2 - # URL_HASH MD5=9a656206a91152c77fd9d16b24345688 + URL https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.bz2 + URL_HASH MD5=132dde48fe2b563211675626d29f1707 DOWNLOAD_DIR ${BUILD_DIR}/download/eigen PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 @@ -260,9 +267,8 @@ endif() if(AV_BUILD_LAPACK) set(LAPACK_TARGET lapack) ExternalProject_Add(${LAPACK_TARGET} - # http://www.netlib.org/lapack/lapack-3.9.0.tar.gz - URL https://github.com/Reference-LAPACK/lapack/archive/v3.9.0.tar.gz - URL_HASH MD5=0b251e2a8d5f949f99b50dd5e2200ee2 + URL https://github.com/Reference-LAPACK/lapack/archive/v3.10.0.tar.gz + URL_HASH MD5=d70fc27a8bdebe00481c97c728184f09 DOWNLOAD_DIR ${BUILD_DIR}/download/lapack PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 @@ -311,9 +317,8 @@ ExternalProject_add(mpfr set(SUITESPARSE_TARGET suitesparse) set(SUITESPARSE_INTERNAL_MAKE_CMD MPFR_ROOT=${CMAKE_INSTALL_PREFIX} GMP_ROOT=${CMAKE_INSTALL_PREFIX} LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} $(MAKE) BLAS="${BLAS_LIBRARIES}" LAPACK="${LAPACK_LIBRARIES}") ExternalProject_Add(${SUITESPARSE_TARGET} - # URL https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v4.5.6.tar.gz - # URL https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v5.8.1.tar.gz # requires gxx >= 4.9, centos 7 use gxx-4.8.5 by default - # URL_HASH MD5=c414679bbc9432a3def01b31ad921140 + # URL https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v5.10.1.tar.gz # requires gxx >= 4.9, centos 7 use gxx-4.8.5 by default + # URL_HASH MD5=1 GIT_REPOSITORY https://github.com/alicevision/SuiteSparse GIT_TAG fix/gmp_mpfr # based on v5.8.1 # DOWNLOAD_DIR ${BUILD_DIR}/download/suitesparse @@ -336,12 +341,8 @@ endif() # Add ceres-solver: A Nonlinear Least Squares Minimizer set(CERES_TARGET ceres) ExternalProject_Add(${CERES_TARGET} - # TODO: update ceres to 2.0 - #URL https://github.com/ceres-solver/ceres-solver/archive/2.0.0.tar.gz - #URL_HASH MD5=94246057ac520313e3b582c45a30db6e - # URL https://github.com/ceres-solver/ceres-solver/archive/1.14.0.tar.gz - GIT_REPOSITORY https://github.com/alicevision/ceres-solver - GIT_TAG compatibility_gcc_4 # specific commit from the WIP 2.0 version with a fix for gcc-4 + GIT_REPOSITORY https://github.com/ceres-solver/ceres-solver + GIT_TAG 31008453fe979f947e594df15a7e254d6631881b # 2021/10/06 PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 BUILD_ALWAYS 0 @@ -358,24 +359,10 @@ set(CERES_CMAKE_FLAGS ${SUITESPARSE_CMAKE_FLAGS} -DCeres_DIR=${CMAKE_INSTALL_PRE # Add OpenEXR set(OPENEXR_TARGET openexr) ExternalProject_Add(${OPENEXR_TARGET} - # vfxplatform CY2020: 2.4.x, but we use 2.5.x to avoid cmake issues - #URL https://github.com/openexr/openexr/archive/v2.4.1.tar.gz - #URL_HASH MD5=f7f7f893cf38786f88c306dec127113f - URL https://github.com/AcademySoftwareFoundation/openexr/archive/v2.5.4.tar.gz - URL_HASH MD5=e84577f884f05f7432b235432dfec455 + # vfxplatform CY2022: 3.1.x + URL https://github.com/AcademySoftwareFoundation/openexr/archive/v3.1.2.tar.gz + URL_HASH MD5=2e976f5fb610abb6f75d8f20014cf72a DOWNLOAD_DIR ${BUILD_DIR}/download/openexr - # URL https://github.com/openexr/openexr/archive/v2.2.1.tar.gz - # The release 2.2.1 has troubles with C++17, which breaks compilation with recent compilers. - # The problem has been fixed https://github.com/openexr/openexr/issues/235 - # but there is no release yet, so we use the development version. - # GIT_REPOSITORY https://github.com/openexr/openexr - # Use the latest commit with g++4.X compatibility - # GIT_TAG 74b5c1dc2dfbdce74987a57f5e011dc711f9ca65 - # Finally use a custom version for a cmake fix - # GIT_REPOSITORY https://github.com/alicevision/openexr - # GIT_TAG develop_compatibility_gxx4 - # GIT_REPOSITORY https://github.com/openexr/openexr - # GIT_TAG a12937f6d7650d4fb81b469900ee2fd4c082c208 PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 BUILD_ALWAYS 0 @@ -384,7 +371,7 @@ ExternalProject_Add(${OPENEXR_TARGET} BINARY_DIR ${BUILD_DIR}/openexr_build INSTALL_DIR ${CMAKE_INSTALL_PREFIX} CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} -DOPENEXR_BUILD_PYTHON_LIBS=OFF -DOPENEXR_ENABLE_TESTS=OFF ${ZLIB_CMAKE_FLAGS} -DCMAKE_INSTALL_PREFIX= - BUILD_COMMAND $(MAKE) + BUILD_COMMAND VERBOSE=1 $(MAKE) DEPENDS ${ZLIB_TARGET} ) set(ILMBASE_CMAKE_FLAGS -DILMBASE_ROOT=${CMAKE_INSTALL_PREFIX} -DILMBASE_INCLUDE_PATH=${CMAKE_INSTALL_PREFIX}/include/OpenEXR) @@ -394,8 +381,8 @@ set(OPENEXR_CMAKE_FLAGS ${ILMBASE_CMAKE_FLAGS} -DOPENEXR_ROOT=${CMAKE_INSTALL_PR if(AV_BUILD_TIFF) set(TIFF_TARGET tiff) ExternalProject_Add(${TIFF_TARGET} - URL http://download.osgeo.org/libtiff/tiff-4.2.0.tar.gz - URL_HASH MD5=2bbf6db1ddc4a59c89d6986b368fc063 + URL http://download.osgeo.org/libtiff/tiff-4.3.0.tar.gz + URL_HASH MD5=0a2e4744d1426a8fc8211c0cdbc3a1b3 DOWNLOAD_DIR ${BUILD_DIR}/download/tiff PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 @@ -440,8 +427,8 @@ if(AV_BUILD_JPEG) set(JPEG_TARGET turbojpeg) # Add turbojpeg ExternalProject_Add(${JPEG_TARGET} - URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.6.tar.gz - URL_HASH MD5=22aad1e0772cd797306a87428dd744c7 + URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.1.1.tar.gz + URL_HASH MD5=167d52e2348b6f1af33c70f63197edd8 DOWNLOAD_DIR ${BUILD_DIR}/download/libjpeg-turbo PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 @@ -499,14 +486,11 @@ endif() # Add Boost set(BOOST_TARGET boost) +# vfxplatform CY2021: 1.73 +# vfxplatform CY2022: 1.76 ExternalProject_Add(${BOOST_TARGET} - # vfxplatform CY2020: 1.70 - URL https://github.com/alicevision/AliceVisionDependencies/releases/download/boost-src-1.70.0/boost_1_70_0.tar.bz2 - # http://sourceforge.net/projects/boost/files/boost/1.70.0/boost_1_70_0.tar.bz2 - # https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz - # GIT_REPOSITORY https://github.com/boostorg/boost.git - # GIT_TAG boost-1.70.0 - URL_HASH MD5=242ecc63507711d6706b9b0c0d0c7d4f + URL https://github.com/alicevision/AliceVisionDependencies/releases/download/boost-src-1.76.0/boost_1_76_0.tar.bz2 + URL_HASH MD5=33334dd7f862e8ac9fe1cc7c6584fb6d # 1.76 DOWNLOAD_DIR ${BUILD_DIR}/download/boost PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 @@ -554,7 +538,7 @@ if(AV_BUILD_FFMPEG) # ) ExternalProject_add(libvpx GIT_REPOSITORY https://chromium.googlesource.com/webm/libvpx.git - GIT_TAG v1.9.0 + GIT_TAG v1.10.0 GIT_PROGRESS ON PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 @@ -568,8 +552,8 @@ ExternalProject_add(libvpx set(FFMPEG_TARGET ffmpeg) ExternalProject_add(${FFMPEG_TARGET} - URL http://ffmpeg.org/releases/ffmpeg-4.3.1.tar.bz2 - URL_HASH MD5=804707549590e90880e8ecd4e5244fd8 + URL http://ffmpeg.org/releases/ffmpeg-4.4.tar.bz2 + URL_HASH MD5=aa46d2168f30becd4fd3b22d2e8a91ec DOWNLOAD_DIR ${BUILD_DIR}/download/ffmpeg PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 @@ -599,8 +583,8 @@ endif() # Add OpenImageIO set(OPENIMAGEIO_TARGET openimageio) ExternalProject_Add(${OPENIMAGEIO_TARGET} - URL https://github.com/OpenImageIO/oiio/archive/Release-2.2.11.1.tar.gz - URL_HASH MD5=43eb3e6cc6ca1cbfd55bbb2f19688c95 + URL https://github.com/OpenImageIO/oiio/archive/refs/tags/v2.3.7.2.tar.gz + URL_HASH MD5=3a6fe4e0b45e611dad378f99b44a696b DOWNLOAD_DIR ${BUILD_DIR}/download/oiio PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 @@ -611,7 +595,9 @@ ExternalProject_Add(${OPENIMAGEIO_TARGET} INSTALL_DIR ${CMAKE_INSTALL_PREFIX} CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX} - -DBOOST_ROOT=${CMAKE_INSTALL_PREFIX} -DOIIO_BUILD_TESTS:BOOL=OFF + -DBOOST_ROOT=${CMAKE_INSTALL_PREFIX} + -DOIIO_BUILD_TESTS:BOOL=OFF + -DOIIO_BUILD_TOOLS:BOOL=OFF -DILMBASE_HOME=${CMAKE_INSTALL_PREFIX} -DOPENEXR_HOME=${CMAKE_INSTALL_PREFIX} ${TIFF_CMAKE_FLAGS} ${ZLIB_CMAKE_FLAGS} ${PNG_CMAKE_FLAGS} ${JPEG_CMAKE_FLAGS} ${LIBRAW_CMAKE_FLAGS} ${OPENEXR_CMAKE_FLAGS} @@ -635,9 +621,9 @@ set(OPENIMAGEIO_CMAKE_FLAGS -DOpenImageIO_DIR=${CMAKE_INSTALL_PREFIX}) # Add Alembic: I/O for Point Cloud and Cameras set(ALEMBIC_TARGET alembic) ExternalProject_Add(${ALEMBIC_TARGET} - # vfxplatform CY2020 1.7.x - URL https://github.com/alembic/alembic/archive/1.7.16.tar.gz - URL_HASH MD5=effcc86e42fe6605588e3de57bde6677 + # vfxplatform CY2022 1.8.x + URL https://github.com/alembic/alembic/archive/1.8.3.tar.gz + URL_HASH MD5=2cd8d6e5a3ac4a014e24a4b04f4fadf9 DOWNLOAD_DIR ${BUILD_DIR}/download/alembic PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 @@ -655,8 +641,8 @@ set(ALEMBIC_CMAKE_FLAGS -DAlembic_DIR:PATH=${CMAKE_INSTALL_PREFIX}/lib/cmake/Ale if(AV_BUILD_OPENCV) set(OPENCV_TARGET opencv) ExternalProject_Add(opencv_contrib - URL https://github.com/opencv/opencv_contrib/archive/4.5.2.zip - URL_MD5 1f5218d9c47994cb38bc018596534e4d + URL https://github.com/opencv/opencv_contrib/archive/4.5.3.zip + URL_MD5 bdf41b61fbb998e118ffd2e81437d44f DOWNLOAD_DIR ${BUILD_DIR}/download/opencv_contrib SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/opencv_contrib BUILD_ALWAYS 0 @@ -667,8 +653,8 @@ ExternalProject_Add(opencv_contrib ) ExternalProject_Add(${OPENCV_TARGET} DEPENDS opencv_contrib ${TBB_TARGET} ${ZLIB_TARGET} ${OPENEXR_TARGET} ${TIFF_TARGET} ${PNG_TARGET} ${JPEG_TARGET} ${LIBRAW_TARGET} ${FFMPEG_TARGET} - URL https://github.com/opencv/opencv/archive/4.5.2.zip - URL_MD5 f100177ab3e7b884f490cba4cff8e074 + URL https://github.com/opencv/opencv/archive/4.5.3.zip + URL_MD5 e4e25de494ba3dfb676c9f51d7c853fb DOWNLOAD_DIR ${BUILD_DIR}/download/opencv UPDATE_COMMAND "" BUILD_IN_SOURCE 0 @@ -711,8 +697,7 @@ if(AV_BUILD_CCTAG) set(CCTAG_TARGET cctag) ExternalProject_Add(${CCTAG_TARGET} GIT_REPOSITORY https://github.com/alicevision/CCTag - # GIT_TAG boost-no-cxx11-constexpr - GIT_TAG ba0daba0ff1e2c4e2698220ab6ccfc06e5ede589 + GIT_TAG a0f4630d018ac9026299e3443ff3cde64f850dc8 PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 BUILD_ALWAYS 0 @@ -731,8 +716,10 @@ endif() if(AV_BUILD_APRILTAG) set(APRILTAG_TARGET apriltag) ExternalProject_Add(${APRILTAG_TARGET} - GIT_REPOSITORY https://github.com/AprilRobotics/apriltag - GIT_TAG a0b37ad165d1908fc0c400898f28fb4bb16deb1b + # GIT_REPOSITORY https://github.com/AprilRobotics/apriltag + # GIT_TAG v3.1.7 + GIT_REPOSITORY https://github.com/alicevision/apriltag.git + GIT_TAG 25ccfab4230a35fb000814c9c1749d9902173012 # commit 2021/10/26 PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 BUILD_ALWAYS 0 @@ -740,7 +727,7 @@ ExternalProject_Add(${APRILTAG_TARGET} SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/apriltag BINARY_DIR ${BUILD_DIR}/apriltag_build INSTALL_DIR ${CMAKE_INSTALL_PREFIX} - CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} -DCMAKE_INSTALL_PREFIX:PATH= + CONFIGURE_COMMAND ${CMAKE_COMMAND} ${CMAKE_CORE_BUILD_FLAGS} -DBUILD_PYTHON_WRAPPER=OFF -DOpenCV_FOUND=OFF -DCMAKE_INSTALL_PREFIX:PATH= BUILD_COMMAND $(MAKE) ) set(APRILTAG_CMAKE_FLAGS -Dapriltag_DIR:PATH=${CMAKE_INSTALL_PREFIX}/share/apriltag/cmake) @@ -751,7 +738,7 @@ if(AV_BUILD_POPSIFT) set(POPSIFT_TARGET popsift) ExternalProject_Add(${POPSIFT_TARGET} GIT_REPOSITORY https://github.com/alicevision/popsift - GIT_TAG 5bbd332f94a280535d54928ced9c3fb74f16a3fb #v1.0.0-rc3 + GIT_TAG 4c22d41579c17d7326938929c00c54cfa01a4592 PREFIX ${BUILD_DIR} BUILD_IN_SOURCE 0 BUILD_ALWAYS 0 diff --git a/INSTALL.md b/INSTALL.md index 4a2a35f64e..1ed7fec59e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -32,7 +32,7 @@ AliceVision depends on external libraries: * [Ceres >= 1.10.0](https://github.com/ceres-solver/ceres-solver) * [Eigen >= 3.3.4](https://gitlab.com/libeigen/eigen) * [Geogram >= 1.7.5](https://gforge.inria.fr/frs/?group_id=5833) -* [OpenEXR >= 2.4.0](https://github.com/AcademySoftwareFoundation/openexr) +* [OpenEXR >= 2.5](https://github.com/AcademySoftwareFoundation/openexr) * [OpenImageIO >= 2.1.0](https://github.com/OpenImageIO/oiio) * [zlib](https://www.zlib.net) diff --git a/docker/Dockerfile_centos_deps b/docker/Dockerfile_centos_deps index 71c42bc5ad..86cdcfdd3e 100644 --- a/docker/Dockerfile_centos_deps +++ b/docker/Dockerfile_centos_deps @@ -60,17 +60,18 @@ RUN $YUM_INSTALL centos-release-scl-rh && \ # SHELL [ "/usr/bin/scl", "enable", "devtoolset-6" ] ENV PATH="/opt/rh/devtoolset-6/root/usr/bin:${PATH}" \ LD_LIBRARY_PATH="/opt/rh/devtoolset-6/root/usr/lib:/opt/rh/devtoolset-6/root/usr/lib64:/opt/rh/devtoolset-6/root/usr/lib64/dyninst:${LD_LIBRARY_PATH}" \ - MAKE=/opt/rh/devtoolset-6/root/usr/bin/make + MAKE=/opt/rh/devtoolset-6/root/usr/bin/make \ + CMAKE_VERSION=3.21.3 COPY dl/vlfeat_K80L3.SIFT.tree ${AV_INSTALL}/share/aliceVision/ RUN echo "export ALICEVISION_VOCTREE=${AV_INSTALL}/share/aliceVision/vlfeat_K80L3.SIFT.tree" > /etc/profile.d/alicevision.sh -# Manually install cmake 3.16 +# Manually install cmake WORKDIR /opt -COPY dl/cmake-3.16.3.tar.gz /tmp -RUN tar zxf /tmp/cmake-3.16.3.tar.gz && \ - rm /tmp/cmake-3.16.3.tar.gz && \ - cd cmake-3.16.3 && \ +COPY dl/cmake-${CMAKE_VERSION}.tar.gz /tmp +RUN tar zxf /tmp/cmake-${CMAKE_VERSION}.tar.gz && \ + rm /tmp/cmake-${CMAKE_VERSION}.tar.gz && \ + cd cmake-${CMAKE_VERSION} && \ ./bootstrap --parallel="$(nproc)" --prefix=/usr/local -- -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_USE_OPENSSL:BOOL=ON && \ make -j"$(nproc)" && \ make install @@ -91,28 +92,29 @@ RUN cmake "${AV_DEV}" \ RUN mkdir -p "${AV_INSTALL}/lib" && \ ln -s lib "${AV_INSTALL}/lib64" -#RUN make -j"$(nproc)" zlib -#RUN make -j"$(nproc)" geogram -#RUN make -j"$(nproc)" tbb -#RUN make -j"$(nproc)" eigen -#RUN make -j"$(nproc)" opengv -#RUN make -j"$(nproc)" lapack - RUN test -e /usr/local/cuda/lib64/libcublas.so || ln -s /usr/lib64/libcublas.so /usr/local/cuda/lib64/libcublas.so -#RUN make -j"$(nproc)" suitesparse -#RUN make -j"$(nproc)" ceres -#RUN make -j"$(nproc)" openexr -#RUN make -j"$(nproc)" tiff -#RUN make -j"$(nproc)" png -#RUN make -j"$(nproc)" turbojpeg -#RUN make -j"$(nproc)" libraw -#RUN make -j"$(nproc)" boost -#RUN make -j"$(nproc)" openimageio -#RUN make -j"$(nproc)" alembic -#RUN make -j"$(nproc)" popsift -#RUN make -j"$(nproc)" ffmpeg -#RUN make -j"$(nproc)" opencv -#RUN make -j"$(nproc)" cctag + +# RUN make -j"$(nproc)" cctag +# RUN make -j"$(nproc)" openexr +# RUN make -j"$(nproc)" tbb +# RUN make -j"$(nproc)" assimp +# RUN make -j"$(nproc)" zlib +# RUN make -j"$(nproc)" geogram +# RUN make -j"$(nproc)" eigen +# RUN make -j"$(nproc)" opengv +# RUN make -j"$(nproc)" lapack +# RUN make -j"$(nproc)" suitesparse +# RUN make -j"$(nproc)" ceres +# RUN make -j"$(nproc)" tiff +# RUN make -j"$(nproc)" png +# RUN make -j"$(nproc)" turbojpeg +# RUN make -j"$(nproc)" libraw +# RUN make -j"$(nproc)" boost +# RUN make -j"$(nproc)" openimageio +# RUN make -j"$(nproc)" alembic +# RUN make -j"$(nproc)" popsift +# RUN make -j"$(nproc)" ffmpeg +# RUN make -j"$(nproc)" opencv RUN cmake --build . -j "$(nproc)" && \ mv "${AV_INSTALL}/bin" "${AV_INSTALL}/bin-deps" && \ diff --git a/docker/fetch.sh b/docker/fetch.sh index 40706a2072..9c83539c37 100755 --- a/docker/fetch.sh +++ b/docker/fetch.sh @@ -18,8 +18,10 @@ test -d dl || \ mkdir dl test -f dl/vlfeat_K80L3.SIFT.tree || \ wget https://gitlab.com/alicevision/trainedVocabularyTreeData/raw/master/vlfeat_K80L3.SIFT.tree -O dl/vlfeat_K80L3.SIFT.tree -test -f dl/cmake-3.16.3.tar.gz || \ - wget https://cmake.org/files/v3.16/cmake-3.16.3.tar.gz -O dl/cmake-3.16.3.tar.gz +export CMAKE_VERSION=3.21.3 +export CMAKE_VERSION_MM=3.21 +test -f dl/cmake-${CMAKE_VERSION}.tar.gz || \ + wget https://cmake.org/files/v${CMAKE_VERSION_MM}/cmake-${CMAKE_VERSION}.tar.gz -O dl/cmake-${CMAKE_VERSION}.tar.gz test -d dl/deps || \ mkdir dl/deps diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3a5c91d301..16394db109 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -281,20 +281,17 @@ endif() # ============================================================================== -# OpenEXR +# OpenEXR >= 2.5 # ============================================================================== -find_package(OpenEXR) -if(TARGET OpenEXR::IlmImf) - message(STATUS "OpenEXR found. (Version ${OpenEXR_VERSION})") -else() - # fallback for old openexr versions (<2.5) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/openexr) - find_package(OpenEXR REQUIRED) - if(OPENEXR_FOUND) - message(STATUS "OpenEXR found (without config). (Version ${OPENEXR_VERSION})") +find_package(OpenEXR REQUIRED) +if(TARGET OpenEXR::OpenEXR OR TARGET IlmBase::Half) + if(OpenEXR_VERSION VERSION_GREATER_EQUAL 2.5) + message(STATUS "OpenEXR found. (Version ${OpenEXR_VERSION})") else() - message(SEND_ERROR "Failed to find OpenEXR.") + message(SEND_ERROR "OpenEXR: Version found is ${OpenEXR_VERSION}, the minimal version required is 2.5.") endif() +else() + message(SEND_ERROR "Failed to find OpenEXR.") endif() # ============================================================================== diff --git a/src/aliceVision/half.hpp b/src/aliceVision/half.hpp new file mode 100644 index 0000000000..7b13584441 --- /dev/null +++ b/src/aliceVision/half.hpp @@ -0,0 +1,21 @@ +// This file is part of the AliceVision project. +// Copyright (c) 2016 AliceVision contributors. +// Copyright (c) 2012 openMVG contributors. +// This Source Code Form is subject to the terms of the Mozilla Public License, +// v. 2.0. If a copy of the MPL was not distributed with this file, +// You can obtain one at https://mozilla.org/MPL/2.0/. + +#pragma once + +#if __has_include() + // Try to use the modern header first: OpenEXR >= 3.0 + #include +#elif __has_include() + // Try fallback for compatibility with OpenEXR < 3.0 + #include +#else + // Generate an error using the modern header + #include +#endif + + diff --git a/src/aliceVision/image/CMakeLists.txt b/src/aliceVision/image/CMakeLists.txt index 531ec861f3..ac21efc702 100644 --- a/src/aliceVision/image/CMakeLists.txt +++ b/src/aliceVision/image/CMakeLists.txt @@ -31,13 +31,12 @@ alicevision_add_library(aliceVision_image SOURCES ${image_files_headers} ${image_files_sources} PUBLIC_LINKS aliceVision_numeric - ${OPENIMAGEIO_LIBRARIES} + OpenImageIO::OpenImageIO + OpenImageIO::OpenImageIO_Util PRIVATE_LINKS aliceVision_system ${OPENEXR_LIBRARIES} Boost::filesystem - PUBLIC_INCLUDE_DIRS - ${OPENIMAGEIO_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR} ) diff --git a/src/aliceVision/image/io.cpp b/src/aliceVision/image/io.cpp index 5f590eef72..9362b23c56 100644 --- a/src/aliceVision/image/io.cpp +++ b/src/aliceVision/image/io.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/src/aliceVision/keyframe/CMakeLists.txt b/src/aliceVision/keyframe/CMakeLists.txt index 7beb2b41e3..4963899122 100644 --- a/src/aliceVision/keyframe/CMakeLists.txt +++ b/src/aliceVision/keyframe/CMakeLists.txt @@ -15,11 +15,9 @@ alicevision_add_library(aliceVision_keyframe aliceVision_dataio aliceVision_feature aliceVision_voctree - ${OPENIMAGEIO_LIBRARIES} + OpenImageIO::OpenImageIO PRIVATE_LINKS aliceVision_sensorDB aliceVision_system Boost::filesystem - PUBLIC_INCLUDE_DIRS - ${OPENIMAGEIO_INCLUDE_DIRS} ) diff --git a/src/aliceVision/mvsData/CMakeLists.txt b/src/aliceVision/mvsData/CMakeLists.txt index ca7dc9ab43..bc55c4aab4 100644 --- a/src/aliceVision/mvsData/CMakeLists.txt +++ b/src/aliceVision/mvsData/CMakeLists.txt @@ -43,8 +43,8 @@ alicevision_add_library(aliceVision_mvsData ${ZLIB_LIBRARIES} Boost::filesystem Boost::boost - ${OPENIMAGEIO_LIBRARIES} + OpenImageIO::OpenImageIO + OpenImageIO::OpenImageIO_Util PUBLIC_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR} - ${OPENIMAGEIO_INCLUDE_DIRS} ) diff --git a/src/aliceVision/mvsData/imageIO.cpp b/src/aliceVision/mvsData/imageIO.cpp index 1fe494ad9f..e6568ad9c9 100644 --- a/src/aliceVision/mvsData/imageIO.cpp +++ b/src/aliceVision/mvsData/imageIO.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include diff --git a/src/aliceVision/mvsUtils/CMakeLists.txt b/src/aliceVision/mvsUtils/CMakeLists.txt index 5ae2b4b503..d6286f066d 100644 --- a/src/aliceVision/mvsUtils/CMakeLists.txt +++ b/src/aliceVision/mvsUtils/CMakeLists.txt @@ -20,6 +20,7 @@ alicevision_add_library(aliceVision_mvsUtils aliceVision_numeric aliceVision_multiview aliceVision_mvsData + OpenImageIO::OpenImageIO_Util PRIVATE_LINKS aliceVision_system Boost::filesystem diff --git a/src/aliceVision/panorama/imageOps.hpp b/src/aliceVision/panorama/imageOps.hpp index 624f027d2e..039c214ea2 100644 --- a/src/aliceVision/panorama/imageOps.hpp +++ b/src/aliceVision/panorama/imageOps.hpp @@ -1,11 +1,10 @@ #pragma once -#include #include "cachedImage.hpp" -#include +#include +#include -namespace aliceVision -{ +namespace aliceVision { template bool downscale(aliceVision::image::Image& outputColor, const aliceVision::image::Image& inputColor) diff --git a/src/aliceVision/panorama/warper.cpp b/src/aliceVision/panorama/warper.cpp index bd6b775eb1..a356fb0216 100644 --- a/src/aliceVision/panorama/warper.cpp +++ b/src/aliceVision/panorama/warper.cpp @@ -1,8 +1,7 @@ #include "warper.hpp" -#include +#include -namespace aliceVision -{ +namespace aliceVision { bool Warper::warp(const CoordinatesMap& map, const aliceVision::image::Image& source) { @@ -146,4 +145,4 @@ bool GaussianWarper::warp(const CoordinatesMap& map, const GaussianPyramidNoMask return true; } -} // namespace aliceVision \ No newline at end of file +} // namespace aliceVision diff --git a/src/cmake/AliceVisionConfig.cmake.in b/src/cmake/AliceVisionConfig.cmake.in index 25582917c7..56f4927262 100644 --- a/src/cmake/AliceVisionConfig.cmake.in +++ b/src/cmake/AliceVisionConfig.cmake.in @@ -48,6 +48,8 @@ include(CMakeFindDependencyMacro) set(Ceres_DIR @Ceres_DIR@) find_dependency(Ceres) +find_dependency(OpenImageIO 2.1) + # whether it is built with CCTags set(ALICEVISION_HAVE_CCTAG @ALICEVISION_HAVE_CCTAG@) diff --git a/src/cmake/FindOpenImageIO.cmake b/src/cmake/FindOpenImageIO.cmake deleted file mode 100644 index 81de9249ea..0000000000 --- a/src/cmake/FindOpenImageIO.cmake +++ /dev/null @@ -1,153 +0,0 @@ -find_package (OpenEXR REQUIRED) - -macro(OPENIMAGEIO_RESET_FIND_LIBRARY_PREFIX) - if (MSVC) - set(CMAKE_FIND_LIBRARY_PREFIXES "${CALLERS_CMAKE_FIND_LIBRARY_PREFIXES}") - endif (MSVC) -endmacro(OPENIMAGEIO_RESET_FIND_LIBRARY_PREFIX) - -# Called if we failed to find OpenImageIO or any of it's required dependencies, -# unsets all public (designed to be used externally) variables and reports -# error message at priority depending upon [REQUIRED/QUIET/] argument. -macro(OPENIMAGEIO_REPORT_NOT_FOUND REASON_MSG) - unset(OPENIMAGEIO_FOUND) - unset(OPENIMAGEIO_INCLUDE_DIRS) - unset(OPENIMAGEIO_LIBRARIES) - # Make results of search visible in the CMake GUI if OpenImageIO has not - # been found so that user does not have to toggle to advanced view. - mark_as_advanced(CLEAR OPENIMAGEIO_INCLUDE_DIR - OPENIMAGEIO_LIBRARY) - - openimageio_reset_find_library_prefix() - - # Note _FIND_[REQUIRED/QUIETLY] variables defined by FindPackage() - # use the camelcase library name, not uppercase. - if (OpenImageIO_FIND_QUIETLY) - message(STATUS "Failed to find OpenImageIO - " ${REASON_MSG} ${ARGN}) - elseif (OpenImageIO_FIND_REQUIRED) - message(FATAL_ERROR "Failed to find OpenImageIO - " ${REASON_MSG} ${ARGN}) - else() - # Neither QUIETLY nor REQUIRED, use no priority which emits a message - # but continues configuration and allows generation. - message("-- Failed to find OpenImageIO - " ${REASON_MSG} ${ARGN}) - endif () -endmacro(OPENIMAGEIO_REPORT_NOT_FOUND) - -# Handle possible presence of lib prefix for libraries on MSVC, see -# also OPENIMAGEIO_RESET_FIND_LIBRARY_PREFIX(). -if (MSVC) - # Preserve the caller's original values for CMAKE_FIND_LIBRARY_PREFIXES - # s/t we can set it back before returning. - set(CALLERS_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}") - # The empty string in this list is important, it represents the case when - # the libraries have no prefix (shared libraries / DLLs). - set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "" "${CMAKE_FIND_LIBRARY_PREFIXES}") -endif (MSVC) - -# Search user-installed locations first, so that we prefer user installs -# to system installs where both exist. -list(APPEND OPENIMAGEIO_CHECK_INCLUDE_DIRS - /usr/local/include - /usr/local/homebrew/include # Mac OS X - /opt/local/var/macports/software # Mac OS X. - /opt/local/include - /usr/include) -# Windows (for C:/Program Files prefix). -list(APPEND OPENIMAGEIO_CHECK_PATH_SUFFIXES - include - Include - openimageio/include - openimageio/Include - OpenImageIO/include - OpenImageIO/Include) - -list(APPEND OPENIMAGEIO_CHECK_LIBRARY_DIRS - /usr/local/lib - /usr/local/homebrew/lib # Mac OS X. - /opt/local/lib - /usr/lib) -# Windows (for C:/Program Files prefix). -list(APPEND OPENIMAGEIO_CHECK_LIBRARY_SUFFIXES - lib - Lib - lib64 - Lib64 - openimageio/lib - openimageio/Lib - OpenImageIO/lib - OpenImageIO/Lib) - - -# Search supplied hint directories first if supplied. -find_path(OPENIMAGEIO_INCLUDE_DIR - NAMES OpenImageIO/imageio.h - HINTS - ${OPENIMAGEIO_INCLUDE_DIR_HINTS} - #${OPENIMAGEIO_CHECK_INCLUDE_DIRS} - PATH_SUFFIXES ${OPENIMAGEIO_CHECK_PATH_SUFFIXES}) -if (NOT OPENIMAGEIO_INCLUDE_DIR OR - NOT EXISTS ${OPENIMAGEIO_INCLUDE_DIR}) - openimageio_report_not_found( - "Could not find OpenImageIO include directory, set OPENIMAGEIO_INCLUDE_DIR " - "to directory containing OpenImageIO/imageio.h") -endif (NOT OPENIMAGEIO_INCLUDE_DIR OR - NOT EXISTS ${OPENIMAGEIO_INCLUDE_DIR}) - -find_library(OPENIMAGEIO_LIBRARY NAMES OpenImageIO - HINTS - ${OPENIMAGEIO_LIBRARY_DIR_HINTS} - # ${OPENIMAGEIO_CHECK_LIBRARY_DIRS} - PATH_SUFFIXES ${OPENIMAGEIO_CHECK_LIBRARY_SUFFIXES}) -if (NOT OPENIMAGEIO_LIBRARY OR - NOT EXISTS ${OPENIMAGEIO_LIBRARY}) - openimageio_report_not_found( - "Could not find OpenImageIO library, set OPENIMAGEIO_LIBRARY " - "to full path to libopenimageio.") -endif (NOT OPENIMAGEIO_LIBRARY OR - NOT EXISTS ${OPENIMAGEIO_LIBRARY}) - -# Mark internally as found, then verify. OPENIMAGEIO_REPORT_NOT_FOUND() unsets -# if called. -set(OPENIMAGEIO_FOUND TRUE) - -# OpenImageIO does not seem to provide any record of the version in its -# source tree, thus cannot extract version. - -# Catch case when caller has set OPENIMAGEIO_INCLUDE_DIR in the cache / GUI and -# thus FIND_[PATH/LIBRARY] are not called, but specified locations are -# invalid, otherwise we would report the library as found. -if (OPENIMAGEIO_INCLUDE_DIR AND - NOT EXISTS ${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO/imageio.h) - openimageio_report_not_found( - "Caller defined OPENIMAGEIO_INCLUDE_DIR:" - " ${OPENIMAGEIO_INCLUDE_DIR} does not contain OpenImageIO/imageio.h header.") -endif (OPENIMAGEIO_INCLUDE_DIR AND - NOT EXISTS ${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO/imageio.h) -string(TOLOWER "${OPENIMAGEIO_LIBRARY}" LOWERCASE_OPENIMAGEIO_LIBRARY) -if (OPENIMAGEIO_LIBRARY AND - NOT "${LOWERCASE_OPENIMAGEIO_LIBRARY}" MATCHES ".*openimageio[^/]*") - openimageio_report_not_found( - "Caller defined OPENIMAGEIO_LIBRARY: " - "${OPENIMAGEIO_LIBRARY} does not match OpenImageIO.") -endif (OPENIMAGEIO_LIBRARY AND - NOT "${LOWERCASE_OPENIMAGEIO_LIBRARY}" MATCHES ".*openimageio[^/]*") - -# Set standard CMake FindPackage variables if found. -if (OPENIMAGEIO_FOUND) - set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR} ${ILMBASE_INCLUDE_DIR}) - set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY} ${ILMBASE_LIBRARIES}) -endif (OPENIMAGEIO_FOUND) - -openimageio_reset_find_library_prefix() - -# Handle REQUIRED / QUIET optional arguments. -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(OpenImageIO DEFAULT_MSG - OPENIMAGEIO_INCLUDE_DIRS OPENIMAGEIO_LIBRARIES) - -# Only mark internal variables as advanced if we found OpenImageIO, otherwise -# leave them visible in the standard GUI for the user to set manually. -if (OPENIMAGEIO_FOUND) - mark_as_advanced(FORCE OPENIMAGEIO_INCLUDE_DIR - OPENIMAGEIO_LIBRARY) -endif (OPENIMAGEIO_FOUND)