Skip to content

Commit

Permalink
fix ubuntu 22.04 dependency installation (#5302)
Browse files Browse the repository at this point in the history
  • Loading branch information
yxlao authored Jul 21, 2022
1 parent 99c361c commit 2573daf
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 26 deletions.
31 changes: 27 additions & 4 deletions 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,24 @@ if(BUILD_GUI)
endif()
# If the default version is not sufficient, look for some specific versions
if(NOT FILAMENT_C_COMPILER OR NOT FILAMENT_CXX_COMPILER)
find_program(CLANG_VERSIONED_CC NAMES clang-12 clang-11 clang-10 clang-9 clang-8 clang-7)
find_program(CLANG_VERSIONED_CXX NAMES clang++-12 clang++11 clang++-10 clang++-9 clang++-8 clang++-7)
find_program(CLANG_VERSIONED_CC NAMES
clang-14
clang-13
clang-12
clang-11
clang-10
clang-9
clang-8
clang-7)
find_program(CLANG_VERSIONED_CXX NAMES
clang-14
clang-13
clang++-12
clang++11
clang++-10
clang++-9
clang++-8
clang++-7)
if (CLANG_VERSIONED_CC AND CLANG_VERSIONED_CXX)
set(FILAMENT_C_COMPILER "${CLANG_VERSIONED_CC}")
set(FILAMENT_CXX_COMPILER "${CLANG_VERSIONED_CXX}")
Expand Down Expand Up @@ -1243,8 +1259,15 @@ if(BUILD_GUI)
# Find CLANG_LIBDIR if it is not defined. Mutiple paths will be searched.
if (NOT CLANG_LIBDIR)
find_library(CPPABI_LIBRARY c++abi PATH_SUFFIXES
llvm-12/lib llvm-11/lib llvm-10/lib llvm-9/lib llvm-8/lib llvm-7/lib
REQUIRED)
llvm-14/lib
llvm-13/lib
llvm-12/lib
llvm-11/lib
llvm-10/lib
llvm-9/lib
llvm-8/lib
llvm-7/lib
REQUIRED)
get_filename_component(CLANG_LIBDIR ${CPPABI_LIBRARY} DIRECTORY)
endif()
# Find clang libraries at the exact path ${CLANG_LIBDIR}.
Expand Down
13 changes: 7 additions & 6 deletions docker/Dockerfile.openblas
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt-get update && apt-get install -y \
RUN apt-get update && apt-get install -y \
build-essential \
clang-7 \
git \
git \
&& rm -rf /var/lib/apt/lists/*

# Install ccache after build-essential (gcc, g++).
Expand Down Expand Up @@ -116,11 +116,6 @@ COPY ./util/install_deps_ubuntu.sh /root/Open3D/util/
RUN /root/Open3D/util/install_deps_ubuntu.sh assume-yes \
&& rm -rf /var/lib/apt/lists/*

# Open3D repo
# Always keep /root/Open3D as the WORKDIR
COPY . /root/Open3D
WORKDIR /root/Open3D

# Build Python wheel
RUN pyenv install $(pyenv install --list | sort -r --version-sort | grep -m1 "^ *${PYTHON_VERSION}\.")
RUN pyenv local $(pyenv versions | grep ${PYTHON_VERSION})
Expand All @@ -133,6 +128,12 @@ RUN which python \
yapf=="0.30.0" \
pytest=="6.0.1"

# Open3D repo
# Always keep /root/Open3D as the WORKDIR
COPY . /root/Open3D
WORKDIR /root/Open3D

# Build
RUN mkdir build \
&& cd build \
&& cmake \
Expand Down
4 changes: 4 additions & 0 deletions docker/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
# This make the Docker image reproducible across different machines.
set -euo pipefail

# Disable Docker build kit to show all outputs, as `--progress plain`` does not
# work on all systems.
export DOCKER_BUILDKIT=0

__usage_docker_build="USAGE:
$(basename $0) [OPTION]
Expand Down
1 change: 1 addition & 0 deletions python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
numpy>=1.18.0
configargparse
40 changes: 24 additions & 16 deletions util/install_deps_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/usr/bin/env bash
# Install Open3D build dependencies from Ubuntu repositories
# CUDA (v10.1) and CUDNN (v7.6.5) are optional dependencies and are not
# installed here
# Use: install_deps_ubuntu.sh [ assume-yes ]

set -ev
Expand All @@ -13,30 +10,41 @@ else
APT_CONFIRM=""
fi

dependencies=(
# Open3D deps
deps=(
# Open3D
xorg-dev
libglu1-mesa-dev
python3-dev
# Filament build-from-source deps
# Filament build-from-source
libsdl2-dev
libc++-7-dev
libc++abi-7-dev
libc++-dev
libc++abi-dev
ninja-build
libxi-dev
# OpenBLAS build-from-source deps
gfortran
# ML deps
# ML
libtbb-dev
# Headless rendering deps
# Headless rendering
libosmesa6-dev
# RealSense deps
# RealSense
libudev-dev
autoconf
libtool
)

# Ubuntu ARM64
if [ "$(uname -m)" == "aarch64" ]; then
# For LAPACK
deps+=("gfortran")

# For compiling Filament from source
# Ubuntu 18.04 ARM64's libc++-dev and libc++abi-dev are version 6, but we need 7+.
source /etc/lsb-release
if [ "$DISTRIB_ID" == "Ubuntu" -a "$DISTRIB_RELEASE" == "18.04" ]; then
deps=("${deps[@]/libc++-dev/libc++-7-dev}")
deps=("${deps[@]/libc++abi-dev/libc++abi-7-dev}")
fi
fi

echo "apt-get install ${deps[*]}"
$SUDO apt-get update
for package in "${dependencies[@]}"; do
$SUDO apt-get install "$APT_CONFIRM" "$package"
done
$SUDO apt-get install ${APT_CONFIRM} ${deps[*]}

0 comments on commit 2573daf

Please sign in to comment.