-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild_linux.sh
More file actions
72 lines (61 loc) · 1.9 KB
/
build_linux.sh
File metadata and controls
72 lines (61 loc) · 1.9 KB
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
68
69
70
71
72
#!/usr/bin/env bash
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ODE_SRC_DIR="$SCRIPT_DIR/thirdparty/ode_src"
ODE_PREFIX="$ODE_SRC_DIR/_prefix"
ODE_LIB="$ODE_PREFIX/lib/libode.a"
if [ ! -d "$ODE_SRC_DIR" ]; then
echo "not found: $ODE_SRC_DIR"
echo "cloning ODE.."
git clone https://github.com/thomasmarsh/ODE $ODE_SRC_DIR
if [ -d "$ODE_SRC_DIR" ]; then
cd $ODE_SRC_DIR
git checkout 0.16.3
fi
fi
if [ -d "$ODE_SRC_DIR" ]; then
echo "found: $ODE_SRC_DIR"
if [ ! -f "$ODE_LIB" ]; then
echo "not found: $ODE_LIB"
echo "building ODE.."
cd $ODE_SRC_DIR
# 0.13.1
#./bootstrap
#./configure --prefix=$ODE_PREFIX --enable-static=yes --enable-shared=no --with-trimesh=opcode --enable-ou --disable-asserts --disable-demos --with-drawstuff=none
#make
#make install
# 0.16.3
cmake -S "." -B "_build" \
-DCMAKE_INSTALL_PREFIX="$ODE_PREFIX" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DODE_16BIT_INDICES=ON \
-DODE_WITH_OPCODE=ON \
-DODE_WITH_OU=ON \
-DODE_DOUBLE_PRECISION=OFF \
-DODE_NO_BUILTIN_THREADING_IMPL=OFF \
-DODE_NO_THREADING_INTF=OFF \
-DODE_OLD_TRIMESH=OFF \
-DODE_WITH_DEMOS=OFF \
-DODE_WITH_GIMPACT=OFF \
-DODE_WITH_LIBCCD=OFF \
-DODE_WITH_TESTS=OFF
cmake --build "_build" --config Release --parallel 4 --target install
fi
fi
echo "building ProjectD.."
cd $SCRIPT_DIR
cmake -S "." -B "build"
cmake --build "build" --config Release --parallel 4
version_str=$(python3 --version 2>&1)
version_num=$(echo "$version_str" | awk '{print $2}')
pymajor=$(echo "$version_num" | cut -d. -f1)
pyminor=$(echo "$version_num" | cut -d. -f2)
module_name="PyProjectD.cpython-${pymajor}${pyminor}-x86_64-linux-gnu.so"
if [ -f "$SCRIPT_DIR/build/libPyProjectD.so" ]; then
if [ ! -f "$SCRIPT_DIR/build/$module_name" ]; then
echo "creating python module symlink.."
cd $SCRIPT_DIR/build
ln -s libPyProjectD.so $module_name
fi
fi
echo "DONE"