-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_macos.sh
executable file
·51 lines (40 loc) · 2.51 KB
/
build_macos.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
#!/usr/bin/env bash
set -euo pipefail
# From build/bin directory:
# ./scripts/platforms/mac/sign_macos_app.sh ~/cloudViewer_install/ACloudViewer/ACloudViewer.app ./eCV/Mac/ACloudViewer.entitlements <apple-id> <cert-name> <team-id> <app-password>
# bundle app libs
# python /Users/asher/develop/code/github/ACloudViewer/scripts/platforms/mac/bundle/lib_bundle_app.py ACloudViewer ~/cloudViewer_install/ACloudViewer
# sign apps mannually
# python /Users/asher/develop/code/github/ACloudViewer/scripts/platforms/mac/bundle/signature_app.py ACloudViewer /Users/asher/cloudViewer_install/ACloudViewer
# test wheel
# python -W default -c "import cloudViewer; print('Installed:', cloudViewer); print('BUILD_CUDA_MODULE: ', cloudViewer._build_config['BUILD_CUDA_MODULE'])"
# python -W default -c "import cloudViewer; print('CUDA available: ', cloudViewer.core.cuda.is_available())"
# python -W default -c "import cloudViewer.ml.torch; print('PyTorch Ops library loaded:', cloudViewer.ml.torch._loaded)"
# test reconstruction
# python -W default -c "import cloudViewer; print('Installed:', cloudViewer); print('BUILD_RECONSTRUCTION: ', cloudViewer._build_config['BUILD_RECONSTRUCTION'])"
# python -W default -c "import cloudViewer as cv3d; cv3d.reconstruction.gui.run_graphical_gui()"
ACloudViewer_INSTALL=~/cloudViewer_install
CLOUDVIEWER_SOURCE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null 2>&1 && pwd)"
CLOUDVIEWER_BUILD_DIR=${CLOUDVIEWER_SOURCE_ROOT}/build
export CLOUDVIEWER_ML_ROOT=/Users/asher/develop/code/github/CloudViewer-ML
MACOS_APP_BUILD_SHELL=${CLOUDVIEWER_SOURCE_ROOT}/scripts/build_macos_app.sh
if ! find "$ACloudViewer_INSTALL" -maxdepth 1 -name "ACloudViewer*.dmg" | grep -q .; then
echo "Start building ACloudViewer app with python3.11"
rm -rf ${CLOUDVIEWER_BUILD_DIR}/* && ${MACOS_APP_BUILD_SHELL} 3.11
else
echo "Ignore ACloudViewer GUI app building due to have builded before..."
fi
echo
echo "Start to build wheel with python3.8-3.12 On MacOS..."
echo
PYTHON_VERSIONS=("3.8" "3.9" "3.10" "3.11" "3.12")
MACOS_WHL_BUILD_SHELL=${CLOUDVIEWER_SOURCE_ROOT}/scripts/build_macos_whl.sh
for version in "${PYTHON_VERSIONS[@]}"; do
if ! find "$ACloudViewer_INSTALL" -maxdepth 1 -name "cloudViewer*cp${version//./}*.whl" | grep -q .; then
echo "Start building cloudViewer wheel with python${version}..."
rm -rf ${CLOUDVIEWER_BUILD_DIR}/* && ${MACOS_WHL_BUILD_SHELL} ${version}
else
echo "Ignore cloudViewer wheel with python${version}..."
fi
done
echo "All install to ${ACloudViewer_INSTALL}"