Skip to content

Commit

Permalink
Merge pull request #1657 from alicevision/build/libe57format
Browse files Browse the repository at this point in the history
[build] Add `libe57format` as an internal dependency
  • Loading branch information
fabiencastan authored Feb 2, 2024
2 parents 3612d53 + acf48f4 commit a5579cf
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
build-linux:
runs-on: ubuntu-latest
container:
image: alicevision/alicevision-deps:2024.01.24-centos7-cuda11.3.1
image: alicevision/alicevision-deps:2024.01.31-centos7-cuda11.3.1
env:
DEPS_INSTALL_DIR: /opt/AliceVision_install
BUILD_TYPE: Release
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
uses: suisei-cn/[email protected]
id: vcpkgDownload
with:
url: "https://gitlab.com/alicevision/vcpkgArchive/-/raw/main/aliceVisionDeps-2023.10.02.zip?ref_type=heads&inline=false"
url: "https://gitlab.com/alicevision/vcpkgArchive/-/raw/main/aliceVisionDeps-2024.01.31.zip?ref_type=heads&inline=false"
target: "${{ env.vcpkgDir }}"
filename: installed.zip

Expand Down
1 change: 1 addition & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ vcpkg install ^
assimp ^
pcl ^
clp ^
libe57format ^
--triplet x64-windows
```

Expand Down
8 changes: 6 additions & 2 deletions docker/Dockerfile_centos_deps
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ RUN $YUM_INSTALL centos-release-scl-rh && \
$YUM_INSTALL python3 && \
$YUM_INSTALL python3-devel && \
yum clean all && \
$YUM_INSTALL devtoolset-10-toolchain devtoolset-10-libatomic-devel --nogpgcheck && \
$YUM_INSTALL devtoolset-10-toolchain devtoolset-10-libatomic-devel \
devtoolset-10-libasan-devel devtoolset-10-libubsan-devel --nogpgcheck && \
$YUM_INSTALL --enablerepo=extras epel-release && \
$YUM_INSTALL file \
git \
Expand All @@ -51,7 +52,8 @@ RUN $YUM_INSTALL centos-release-scl-rh && \
automake \
which \
openssl-devel \
pcre2-devel
pcre2-devel \
xerces-c-devel

# Install numpy for Python3
RUN pip3 install numpy
Expand Down Expand Up @@ -137,6 +139,8 @@ RUN test -e /usr/local/cuda/lib64/libcublas.so || ln -s /usr/lib64/libcublas.so
# RUN make -j ${CPU_CORES} opencv
# RUN make -j ${CPU_CORES} expat
# RUN make -j ${CPU_CORES} SWIG
# RUN make -j ${CPU_CORES} E57Format

# RUN make -j ${CPU_CORES} cctag
# RUN make -j ${CPU_CORES} popsift

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile_ubuntu_deps
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ RUN . ./etc/os-release && \
cmake \
gfortran \
clang-format \
libxerces-c-dev \
gcc-10 \
g++-10 \
cpp-10 \
Expand Down Expand Up @@ -113,6 +114,8 @@ RUN test -e /usr/local/cuda/lib64/libcublas.so || ln -s /usr/lib/x86_64-linux-gn
# RUN make -j ${CPU_CORES} opencv
# RUN make -j ${CPU_CORES} expat
# RUN make -j ${CPU_CORES} SWIG
# RUN make -j ${CPU_CORES} E57Format

# RUN make -j ${CPU_CORES} popsift
# RUN make -j ${CPU_CORES} cctag

Expand Down
2 changes: 1 addition & 1 deletion docker/build-centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test -e docker/fetch.sh || {
exit 1
}

test -z "$AV_DEPS_VERSION" && AV_DEPS_VERSION=2024.01.24
test -z "$AV_DEPS_VERSION" && AV_DEPS_VERSION=2024.01.31
test -z "$AV_VERSION" && AV_VERSION="$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse --short HEAD)"
test -z "$CUDA_VERSION" && CUDA_VERSION=11.3.1
test -z "$CENTOS_VERSION" && CENTOS_VERSION=7
Expand Down
2 changes: 1 addition & 1 deletion docker/build-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test -e docker/fetch.sh || {
exit 1
}

test -z "$AV_DEPS_VERSION" && AV_DEPS_VERSION=2024.01.24
test -z "$AV_DEPS_VERSION" && AV_DEPS_VERSION=2024.01.31
test -z "$AV_VERSION" && AV_VERSION="$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse --short HEAD)"
test -z "$CUDA_VERSION" && CUDA_VERSION=11.3.1
test -z "$UBUNTU_VERSION" && UBUNTU_VERSION=20.04
Expand Down
28 changes: 23 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ option(ALICEVISION_BUILD_PANORAMA "Build AliceVision panorama part" ON)
option(ALICEVISION_BUILD_SOFTWARE "Build AliceVision command line tools." ON)
option(ALICEVISION_BUILD_COVERAGE "Enable code coverage generation (gcc only)" OFF)
option(ALICEVISION_BUILD_SWIG_BINDING "Build the Python binding with SWIG." OFF)
trilean_option(ALICEVISION_BUILD_LIDAR "Build AliceVision LIDAR part" AUTO)
trilean_option(ALICEVISION_BUILD_DOC "Build AliceVision documentation" AUTO)

trilean_option(ALICEVISION_USE_OPENMP "Enable OpenMP parallelization" ON)
Expand Down Expand Up @@ -94,6 +95,7 @@ if(NOT ALICEVISION_BUILD_SFM)
SET(ALICEVISION_BUILD_SEGMENTATION OFF)
SET(ALICEVISION_BUILD_STEREOPHOTOMETRY OFF)
SET(ALICEVISION_BUILD_PANORAMA OFF)
SET(ALICEVISION_BUILD_LIDAR OFF)
endif()

# ==============================================================================
Expand Down Expand Up @@ -454,10 +456,6 @@ if(ALICEVISION_BUILD_SFM)
endif()
endif()

if(ALICEVISION_BUILD_SFM)
find_package(E57Format CONFIG)
endif()

# ==============================================================================
# CoinUtils, Clp, Osi
# ==============================================================================
Expand All @@ -467,11 +465,26 @@ if(ALICEVISION_BUILD_SFM)
find_package(Osi REQUIRED)
endif()


# ==============================================================================
# Lemon
# ==============================================================================
if(ALICEVISION_BUILD_SFM)
find_package(LEMON REQUIRED)
endif()

# ==============================================================================
# libE57Format
# ==============================================================================
if(NOT ALICEVISION_BUILD_LIDAR STREQUAL "OFF")
find_package(E57Format)

if(E57Format_FOUND)
message(STATUS "E57Format found")
elseif(ALICEVISION_BUILD_LIDAR STREQUAL "ON")
message(SEND_ERROR "Failed to find E57Format")
endif()
endif()


# ==============================================================================
# Assimp
Expand Down Expand Up @@ -942,6 +955,7 @@ message("** Target architecture: " ${TARGET_ARCHITECTURE})
message("** Build Shared libs: " ${BUILD_SHARED_LIBS})
message("** Build SfM part: " ${ALICEVISION_BUILD_SFM})
message("** Build MVS part: " ${ALICEVISION_BUILD_MVS})
message("** Build LIDAR part: " ${ALICEVISION_BUILD_LIDAR})
message("** Build AliceVision tests: " ${ALICEVISION_BUILD_TESTS})
message("** Build AliceVision documentation: " ${ALICEVISION_HAVE_DOC})
message("** Build AliceVision+OpenCV samples programs: " ${ALICEVISION_HAVE_OPENCV})
Expand Down Expand Up @@ -972,6 +986,10 @@ if(ALICEVISION_BUILD_SFM)
message(STATUS "LEMON: " ${LEMON_VERSION} "")
endif()

if(NOT ALICEVISION_BUILD_LIDAR STREQUAL "OFF")
message(STATUS "E57FORMAT: " ${E57Format} "")
endif()

if(ALICEVISION_BUILD_SWIG_BINDING)
message("\n")
message(STATUS "SWIG: " ${SWIG_VERSION} "")
Expand Down
8 changes: 4 additions & 4 deletions src/aliceVision/dataio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if(ALICEVISION_HAVE_OPENCV)
list(APPEND dataio_files_sources VideoFeed.cpp)
endif()

if(TARGET E57Format)
if(NOT ALICEVISION_BUILD_LIDAR STREQUAL "OFF")
list(APPEND dataio_files_headers E57Reader.hpp)
list(APPEND dataio_files_sources E57Reader.cpp)
endif()
Expand All @@ -40,6 +40,6 @@ if(ALICEVISION_HAVE_OPENCV)
target_link_libraries(aliceVision_dataio PRIVATE ${OpenCV_LIBS})
endif()

if (TARGET E57Format)
target_link_libraries(aliceVision_dataio PRIVATE E57Format)
endif()
if(NOT ALICEVISION_BUILD_LIDAR STREQUAL "OFF")
target_link_libraries(aliceVision_dataio PRIVATE E57Format)
endif()
27 changes: 27 additions & 0 deletions src/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ option(AV_BUILD_OSI "Enable building an embedded Osi" ON)
option(AV_BUILD_CLP "Enable building an embedded Clp" ON)
option(AV_BUILD_FLANN "Enable building an embedded Flann" ON)
option(AV_BUILD_LEMON "Enable building an embedded LEMON library" ON)
option(AV_BUILD_E57FORMAT "Enable building an embedded E57Format" ON)
option(AV_BUILD_PCL "Enable building an embedded PointCloud library" OFF)
option(AV_BUILD_USD "Enable building an embedded USD library" OFF)
option(AV_BUILD_GEOGRAM "Enable building an embedded Geogram library" ON)
Expand Down Expand Up @@ -76,6 +77,7 @@ message(STATUS "AV_BUILD_FLANN: ${AV_BUILD_FLANN}")
message(STATUS "AV_BUILD_PCL: ${AV_BUILD_PCL}")
message(STATUS "AV_BUILD_USD: ${AV_BUILD_USD}")
message(STATUS "AV_BUILD_LEMON: ${AV_BUILD_LEMON}")
message(STATUS "AV_BUILD_E57FORMAT: ${AV_BUILD_E57FORMAT}")
message(STATUS "AV_BUILD_GEOGRAM: ${AV_BUILD_GEOGRAM}")
message(STATUS "AV_BUILD_TBB ${AV_BUILD_TBB}")
message(STATUS "AV_BUILD_EIGEN ${AV_BUILD_EIGEN}")
Expand Down Expand Up @@ -1277,6 +1279,29 @@ if(AV_BUILD_SWIG)
)
endif()

if(AV_BUILD_E57FORMAT)
# Add libE57Format
set(E57FORMAT_TARGET E57Format)

ExternalProject_add(${E57FORMAT_TARGET}
GIT_REPOSITORY https://github.com/asmaloney/libE57Format.git
GIT_TAG v3.1.1
DOWNLOAD_DIR ${BUILD_DIR}/download/${E57FORMAT_TARGET}
PREFIX ${BUILD_DIR}
BUILD_IN_SOURCE 0
BUILD_ALWAYS 0
UPDATE_COMMAND ""
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${E57FORMAT_TARGET}
BINARY_DIR ${BUILD_DIR}/${E57FORMAT_TARGET}_build
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> <SOURCE_DIR>
BUILD_COMMAND $(MAKE) -j${AV_BUILD_DEPENDENCIES_PARALLEL}
)

set(E57FORMAT_CMAKE_FLAGS -DE57FORMAT_DIR:PATH=${CMAKE_INSTALL_PREFIX}/share/E57Format)
endif()

set(AV_DEPS
${ZLIB_TARGET}
${ASSIMP_TARGET}
Expand Down Expand Up @@ -1310,6 +1335,7 @@ set(AV_DEPS
${LZ4_TARGET}
${LEMON_TARGET}
${SWIG_TARGET}
${E57FORMAT_TARGET}
)

if(AV_BUILD_ALICEVISION)
Expand Down Expand Up @@ -1359,6 +1385,7 @@ if(AV_BUILD_ALICEVISION)
${PCL_CMAKE_FLAGS}
${USD_CMAKE_FLAGS}
${SWIG_CMAKE_FLAGS}
${E57FORMAT_CMAKE_FLAGS}

-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> <SOURCE_DIR>
DEPENDS ${AV_DEPS}
Expand Down

0 comments on commit a5579cf

Please sign in to comment.