From 7acd169bef320b6b6e872b6107383d2047e6a410 Mon Sep 17 00:00:00 2001 From: Will Rosecrans Date: Mon, 8 Jan 2018 14:48:58 -0800 Subject: [PATCH 1/4] Tidy build script --- build_cmake_pybullet_double.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/build_cmake_pybullet_double.sh b/build_cmake_pybullet_double.sh index 0bddae1a5..802b87d04 100755 --- a/build_cmake_pybullet_double.sh +++ b/build_cmake_pybullet_double.sh @@ -1,10 +1,16 @@ #!/bin/sh -rm CMakeCache.txt -mkdir build_cmake + +if [ -e CMakeCache.txt ]; then + rm CMakeCache.txt +fi +mkdir -p build_cmake cd build_cmake cmake -DBUILD_PYBULLET=ON -DBUILD_PYBULLET_NUMPY=OFF -DUSE_DOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=Release .. -make -j12 +make -j $(command nproc || echo 12) cd examples cd pybullet -ln -s pybullet.dylib pybullet.so +if [ -e pybullet.dylib ]; then + rm pybullet.so + ln -s pybullet.dylib pybullet.so +fi From e2105dfaad7782405b0a3be84531465d9bc59d13 Mon Sep 17 00:00:00 2001 From: Will Rosecrans Date: Mon, 8 Jan 2018 15:00:20 -0800 Subject: [PATCH 2/4] Fix nproc unavailable --- build_cmake_pybullet_double.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_cmake_pybullet_double.sh b/build_cmake_pybullet_double.sh index 802b87d04..48c0ccdc4 100755 --- a/build_cmake_pybullet_double.sh +++ b/build_cmake_pybullet_double.sh @@ -6,7 +6,7 @@ fi mkdir -p build_cmake cd build_cmake cmake -DBUILD_PYBULLET=ON -DBUILD_PYBULLET_NUMPY=OFF -DUSE_DOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=Release .. -make -j $(command nproc || echo 12) +make -j $(command nproc 2>/dev/null || echo 12) cd examples cd pybullet if [ -e pybullet.dylib ]; then From 6fa4945da0e3099f6a4e63c7b42ba5a53517fd05 Mon Sep 17 00:00:00 2001 From: Will Rosecrans Date: Mon, 8 Jan 2018 15:05:20 -0800 Subject: [PATCH 3/4] ln to force mode to suppress message if target already exists. --- build_cmake_pybullet_double.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build_cmake_pybullet_double.sh b/build_cmake_pybullet_double.sh index 48c0ccdc4..ca77a9f1c 100755 --- a/build_cmake_pybullet_double.sh +++ b/build_cmake_pybullet_double.sh @@ -10,7 +10,6 @@ make -j $(command nproc 2>/dev/null || echo 12) cd examples cd pybullet if [ -e pybullet.dylib ]; then - rm pybullet.so - ln -s pybullet.dylib pybullet.so + ln -f -s pybullet.dylib pybullet.so fi From a6e817756e864b36b8fff91067c66c83fee73634 Mon Sep 17 00:00:00 2001 From: Will Rosecrans Date: Mon, 8 Jan 2018 15:07:14 -0800 Subject: [PATCH 4/4] Bail if cmake or make fails. PRint a friendly message if you make it to the end. --- build_cmake_pybullet_double.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build_cmake_pybullet_double.sh b/build_cmake_pybullet_double.sh index ca77a9f1c..c1a7d403a 100755 --- a/build_cmake_pybullet_double.sh +++ b/build_cmake_pybullet_double.sh @@ -5,11 +5,11 @@ if [ -e CMakeCache.txt ]; then fi mkdir -p build_cmake cd build_cmake -cmake -DBUILD_PYBULLET=ON -DBUILD_PYBULLET_NUMPY=OFF -DUSE_DOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=Release .. -make -j $(command nproc 2>/dev/null || echo 12) +cmake -DBUILD_PYBULLET=ON -DBUILD_PYBULLET_NUMPY=OFF -DUSE_DOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=Release .. || exit 1 +make -j $(command nproc 2>/dev/null || echo 12) || exit 1 cd examples cd pybullet if [ -e pybullet.dylib ]; then ln -f -s pybullet.dylib pybullet.so fi - +echo "Completed build of Bullet."