From f3c7158a98456f80a8a544cae93c59d63289d18b Mon Sep 17 00:00:00 2001 From: pvarvak <60749825+pvarvak@users.noreply.github.com> Date: Fri, 17 Apr 2020 08:28:38 -0700 Subject: [PATCH] Travis: run microbenchmarks (#1710) * benchmark tests: add license * travis: run benchmarks * run-travis.sh: fix var name * run-travis.sh: cleaner cmake param arg display --- src/Benchmark/Geometry/KDTreeFlann.cpp | 26 +++++++++++++++++++ src/Benchmark/Geometry/SamplePoints.cpp | 26 +++++++++++++++++++ util/scripts/run-travis.sh | 34 +++++++++++++++---------- 3 files changed, 73 insertions(+), 13 deletions(-) diff --git a/src/Benchmark/Geometry/KDTreeFlann.cpp b/src/Benchmark/Geometry/KDTreeFlann.cpp index 9148db90535..5dbc9cf47f5 100644 --- a/src/Benchmark/Geometry/KDTreeFlann.cpp +++ b/src/Benchmark/Geometry/KDTreeFlann.cpp @@ -1,3 +1,29 @@ +// ---------------------------------------------------------------------------- +// - Open3D: www.open3d.org - +// ---------------------------------------------------------------------------- +// The MIT License (MIT) +// +// Copyright (c) 2018 www.open3d.org +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// ---------------------------------------------------------------------------- + #include "Open3D/Geometry/KDTreeFlann.h" #include "Open3D/Geometry/PointCloud.h" #include "Open3D/Geometry/TriangleMesh.h" diff --git a/src/Benchmark/Geometry/SamplePoints.cpp b/src/Benchmark/Geometry/SamplePoints.cpp index 08d4874a1e7..650516b6595 100644 --- a/src/Benchmark/Geometry/SamplePoints.cpp +++ b/src/Benchmark/Geometry/SamplePoints.cpp @@ -1,3 +1,29 @@ +// ---------------------------------------------------------------------------- +// - Open3D: www.open3d.org - +// ---------------------------------------------------------------------------- +// The MIT License (MIT) +// +// Copyright (c) 2018 www.open3d.org +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +// ---------------------------------------------------------------------------- + #include "Open3D/Geometry/TriangleMesh.h" #include "Open3D/IO/ClassIO/TriangleMeshIO.h" #include "benchmark/benchmark.h" diff --git a/util/scripts/run-travis.sh b/util/scripts/run-travis.sh index 84968f37255..4b4b85e2090 100755 --- a/util/scripts/run-travis.sh +++ b/util/scripts/run-travis.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -e +set -euo pipefail python --version cmake --version @@ -11,25 +11,26 @@ echo "cmake configure the Open3D project..." date mkdir build cd build -if [ "$BUILD_DEPENDENCY_FROM_SOURCE" == "OFF" ]; then - cmake -DBUILD_SHARED_LIBS=$SHARED \ + +runBenchmarks=true +cmakeOptions="-DBUILD_SHARED_LIBS=$SHARED \ -DBUILD_UNIT_TESTS=ON \ -DBUILD_BENCHMARKS=ON \ -DCMAKE_INSTALL_PREFIX=${OPEN3D_INSTALL_DIR} \ - -DPYTHON_EXECUTABLE=$(which python) \ - .. -else - cmake -DBUILD_SHARED_LIBS=$SHARED \ - -DBUILD_UNIT_TESTS=ON \ + -DPYTHON_EXECUTABLE=$(which python)" + +if [ "$BUILD_DEPENDENCY_FROM_SOURCE" == "ON" ]; then + cmakeOptions="$cmakeOptions \ -DBUILD_EIGEN3=ON \ -DBUILD_FLANN=ON \ -DBUILD_GLEW=ON \ -DBUILD_GLFW=ON \ - -DBUILD_PNG=ON \ - -DCMAKE_INSTALL_PREFIX=${OPEN3D_INSTALL_DIR} \ - -DPYTHON_EXECUTABLE=$(which python) \ - .. + -DBUILD_PNG=ON" fi + +echo +echo "Running cmake" $cmakeOptions .. +cmake $cmakeOptions .. echo echo "build & install Open3D..." @@ -37,11 +38,18 @@ date make install -j$NPROC echo -echo "running the Open3D unit tests..." +echo "running Open3D unit tests..." date ./bin/unitTests echo +if $runBenchmarks; then + echo "running Open3D benchmarks..." + date + ./bin/benchmarks + echo +fi + echo "test find_package(Open3D)..." date test=$(cmake --find-package \