-
Notifications
You must be signed in to change notification settings - Fork 402
/
Copy pathinstall_open3d_python.sh
executable file
·67 lines (46 loc) · 1.66 KB
/
install_open3d_python.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
# Author: Luigi Freda
# Author: Luigi Freda
# This file is part of https://github.com/luigifreda/pyslam
#set -e
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # get script dir
SCRIPT_DIR=$(readlink -f $SCRIPT_DIR) # this reads the actual path if a symbolic directory is used
ROOT_DIR="$SCRIPT_DIR"
# ====================================================
# import the bash utils
. "$ROOT_DIR"/bash_utils.sh
# ====================================================
# NOTE: this is required under mac where I got unexpected segmentation fault errors
# on open3d dynamic library loading
STARTING_DIR=`pwd`
cd "$ROOT_DIR"
print_blue "Installing open3d-python from source"
#pip install --upgrade pip
pip uninstall -y open3d
cd thirdparty
if [ ! -d open3d ]; then
git clone https://github.com/isl-org/Open3D.git open3d
cd open3d
# This commit 0f06a149c4fb9406fd3e432a5cb0c024f38e2f0e didn't work. It corresponds to open3d 0.18.0 -> https://github.com/isl-org/Open3D/commits/v0.18.0
#git checkout 0f06a149c4fb9406fd3e432a5cb0c024f38e2f0e
# This commit worked!
git checkout c8856fc0d4ec89f8d53591db245fd29ad946f9cb
cd ..
fi
cd open3d
if [ ! -d build ]; then
mkdir build
fi
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release $EXTERNAL_OPTION
make -j$(sysctl -n hw.physicalcpu)
# Activate the virtualenv first
# Install pip package in the current python environment
make install-pip-package
# Create Python package in build/lib
make python-package
# Create pip wheel in build/lib
# This creates a .whl file that you can install manually.
make pip-package
sudo make install
cd "$STARTING_DIR"