Skip to content

Commit

Permalink
Travis: run microbenchmarks (#1710)
Browse files Browse the repository at this point in the history
* benchmark tests: add license

* travis: run benchmarks

* run-travis.sh: fix var name

* run-travis.sh: cleaner cmake param arg display
  • Loading branch information
pvarvak authored Apr 17, 2020
1 parent 4d5d1e0 commit f3c7158
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 13 deletions.
26 changes: 26 additions & 0 deletions src/Benchmark/Geometry/KDTreeFlann.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
26 changes: 26 additions & 0 deletions src/Benchmark/Geometry/SamplePoints.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
34 changes: 21 additions & 13 deletions util/scripts/run-travis.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -e
set -euo pipefail

python --version
cmake --version
Expand All @@ -11,37 +11,45 @@ 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..."
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 \
Expand Down

0 comments on commit f3c7158

Please sign in to comment.