|
1 | 1 | #!/usr/bin/env bash |
2 | | -# |
3 | | -# The following environment variables are required: |
4 | | -# - NPROC |
5 | | -# |
6 | | -TENSORFLOW_VER="2.8.2" |
7 | | -TORCH_GLNX_VER="1.13.1+cpu" |
8 | | -# OPENVINO_DEV_VER="2021.4.2" # Numpy version conflict with TF 2.8.2 |
9 | | -PIP_VER="21.1.1" |
10 | | -WHEEL_VER="0.38.4" |
11 | | -STOOLS_VER="67.3.2" |
12 | | -YAPF_VER="0.30.0" |
13 | | -PYTEST_VER="7.1.2" |
14 | | -PYTEST_RANDOMLY_VER="3.8.0" |
15 | 2 |
|
16 | 3 | set -euo pipefail |
17 | 4 |
|
| 5 | +NPROC=${NPROC:?'env var must be set to number of available CPUs.'} |
| 6 | +PIP_VER="23.2.1" |
| 7 | + |
18 | 8 | echo 1. Prepare the Open3D-ML repo and install dependencies |
19 | 9 | echo |
20 | | -export PATH_TO_OPEN3D_ML=$(pwd) |
21 | | -# the build system of the main repo expects a master branch. make sure master exists |
22 | | -git checkout -b master || true |
23 | | -python -m pip install -U pip==$PIP_VER \ |
24 | | - wheel=="$WHEEL_VER" \ |
25 | | - setuptools=="$STOOLS_VER" \ |
26 | | - yapf=="$YAPF_VER" \ |
27 | | - pytest=="$PYTEST_VER" \ |
28 | | - pytest-randomly=="$PYTEST_RANDOMLY_VER" |
29 | | - |
30 | | -python -m pip install -r requirements.txt |
31 | | -echo $PATH_TO_OPEN3D_ML |
| 10 | +export PATH_TO_OPEN3D_ML="$PWD" |
| 11 | +echo "$PATH_TO_OPEN3D_ML" |
| 12 | +# the build system of the main repo expects a main branch. make sure main exists |
| 13 | +git checkout -b main || true |
| 14 | +python -m pip install -U pip==$PIP_VER |
| 15 | +python -m pip install -r requirements.txt \ |
| 16 | + -r requirements-torch.txt |
| 17 | +# -r requirements-tensorflow.txt # TF disabled on Linux (Open3D PR#6288) |
| 18 | +# -r requirements-openvino.txt # Numpy version conflict with TF 2.8.2 |
32 | 19 | cd .. |
33 | 20 | python -m pip install -U Cython |
34 | 21 |
|
35 | 22 | echo 2. clone Open3D and install dependencies |
36 | 23 | echo |
37 | | -git clone --recursive --branch master https://github.com/isl-org/Open3D.git |
| 24 | +git clone --branch main https://github.com/isl-org/Open3D.git |
38 | 25 |
|
39 | 26 | ./Open3D/util/install_deps_ubuntu.sh assume-yes |
40 | | -python -m pip install -U tensorflow-cpu==$TENSORFLOW_VER \ |
41 | | - torch==${TORCH_GLNX_VER} --extra-index-url https://download.pytorch.org/whl/cpu/ |
42 | | -# openvino-dev=="$OPENVINO_DEV_VER" |
| 27 | +python -m pip install -r Open3D/python/requirements.txt \ |
| 28 | + -r Open3D/python/requirements_style.txt \ |
| 29 | + -r Open3D/python/requirements_test.txt |
43 | 30 |
|
44 | 31 | echo 3. Configure for bundling the Open3D-ML part |
45 | 32 | echo |
46 | 33 | mkdir Open3D/build |
47 | 34 | pushd Open3D/build |
| 35 | +# TF disabled on Linux (Open3D PR#6288) |
48 | 36 | cmake -DBUNDLE_OPEN3D_ML=ON \ |
49 | | - -DOPEN3D_ML_ROOT=$PATH_TO_OPEN3D_ML \ |
| 37 | + -DOPEN3D_ML_ROOT="${PATH_TO_OPEN3D_ML}" \ |
50 | 38 | -DGLIBCXX_USE_CXX11_ABI=OFF \ |
51 | | - -DBUILD_TENSORFLOW_OPS=ON \ |
| 39 | + -DBUILD_TENSORFLOW_OPS=OFF \ |
52 | 40 | -DBUILD_PYTORCH_OPS=ON \ |
53 | 41 | -DBUILD_GUI=ON \ |
54 | 42 | -DBUILD_UNIT_TESTS=OFF \ |
|
66 | 54 | popd |
67 | 55 | mkdir test_workdir |
68 | 56 | pushd test_workdir |
69 | | -mv $PATH_TO_OPEN3D_ML/tests . |
| 57 | +mv "$PATH_TO_OPEN3D_ML/tests" . |
70 | 58 | echo Add --randomly-seed=SEED to the test command to reproduce test order. |
71 | 59 | python -m pytest tests |
72 | 60 |
|
73 | | -echo ... now do the same but in dev mode by setting OPEN3D_ML_ROOT |
74 | | -export OPEN3D_ML_ROOT=$PATH_TO_OPEN3D_ML |
| 61 | +echo "... now do the same but in dev mode by setting OPEN3D_ML_ROOT" |
| 62 | +echo |
| 63 | +export OPEN3D_ML_ROOT="$PATH_TO_OPEN3D_ML" |
75 | 64 | echo Add --randomly-seed=SEED to the test command to reproduce test order. |
76 | 65 | python -m pytest tests |
77 | 66 | unset OPEN3D_ML_ROOT |
|
0 commit comments