diff --git a/README.md b/README.md
index a83365e..e73bf4a 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# TEASER++: fast & certifiable 3D registration
+# TEASER++: fast & certifiable 3D registration
[](https://opensource.org/licenses/MIT)
[](https://teaser.readthedocs.io/en/latest/?badge=latest)
[
](https://github.com/MIT-SPARK/TEASER-plusplus/actions)
@@ -97,11 +97,11 @@ sudo apt install cmake libeigen3-dev libboost-all-dev
conda create -n teaser_test python=3.6 numpy
conda activate teaser_test
conda install -c open3d-admin open3d=0.9.0.0
+
git clone https://github.com/MIT-SPARK/TEASER-plusplus.git
-cd TEASER-plusplus && mkdir build && cd build
-cmake -DTEASERPP_PYTHON_VERSION=3.6 .. && make teaserpp_python
-cd python && pip install .
-cd ../.. && cd examples/teaser_python_ply
+cd TEASER-plusplus
+pip install .
+cd examples/teaser_python_ply
python teaser_python_ply.py
```
You should see output similar to this:
@@ -137,19 +137,20 @@ Number of outliers: 1700
Time taken (s): 0.9492652416229248
```
-### Reproduce the GIF Above
+### Reproduce the GIF Above
Run the following script:
```shell script
sudo apt install cmake libeigen3-dev libboost-all-dev
conda create -n teaser_3dsmooth python=3.6 numpy
conda activate teaser_3dsmooth
conda install -c open3d-admin open3d=0.9.0.0
-conda install scikit-learn
+conda install scikit-learn
+
git clone https://github.com/MIT-SPARK/TEASER-plusplus.git
-cd TEASER-plusplus && mkdir build && cd build
-cmake -DTEASERPP_PYTHON_VERSION=3.6 .. && make teaserpp_python
-cd python && pip install .
-cd ../.. && cd examples/teaser_python_3dsmooth
+cd TEASER-plusplus
+pip install .
+
+cd examples/teaser_python_3dsmooth
python teaser_python_3dsmooth.py
```
You should be able to see Open3D windows showing registration results:
diff --git a/cmake/teaserppConfig.cmake b/cmake/teaserppConfig.cmake
index 554eab2..cd1967a 100644
--- a/cmake/teaserppConfig.cmake
+++ b/cmake/teaserppConfig.cmake
@@ -2,7 +2,5 @@ get_filename_component(TEASERPP_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(CMakeFindDependencyMacro)
find_dependency(Eigen3 3.3 REQUIRED)
-find_dependency(OpenMP REQUIRED)
include("${TEASERPP_CMAKE_DIR}/teaserppTargets.cmake")
-
diff --git a/doc/installation.rst b/doc/installation.rst
index 41665c3..d06a952 100644
--- a/doc/installation.rst
+++ b/doc/installation.rst
@@ -116,23 +116,13 @@ Make sure you have compiled the project, then run:
Installing Python bindings
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-TEASER++ uses `pybind11 `_ to allow for minimal-effort interoperability between C++ and Python. To compile Python binding, run the following in the ``build`` folder you just created:
+TEASER++ uses `pybind11 `_ to allow for minimal-effort interoperability between C++ and Python. To compile Python binding, run the following in the cloned repository you just created:
.. code-block:: sh
- cmake -DTEASERPP_PYTHON_VERSION=3.6 ..
- make teaserpp_python
-
-You can replace ``3.6`` with the desired Python version you want to use TEASER++ with.
-
-Then, in the `build` folder, there should be a folder named ``python``. You can use the following commands to install the binding with ``pip``:
-
-.. code-block:: sh
-
- cd python
pip install .
-If you are using virtual environments or Anaconda, make sure to activate your environment before compiling and during ``pip install``. Make sure the targeted Python interpreter is the one in your desired environment, or otherwise there might be segmentation faults.
+If you are using virtual environments or Anaconda, make sure to activate your environment before run ``pip install``.
Installing MATLAB Bindings
^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/teaser/CMakeLists.txt b/teaser/CMakeLists.txt
index b96e2f3..a112f7c 100644
--- a/teaser/CMakeLists.txt
+++ b/teaser/CMakeLists.txt
@@ -65,6 +65,7 @@ target_include_directories(teaser_registration
$
PRIVATE
$
+ $
)
if(NOT BUILD_SHARED_LIBS)
set_property(TARGET teaser_registration PROPERTY POSITION_INDEPENDENT_CODE 1)
@@ -72,8 +73,7 @@ endif()
find_package(OpenMP)
if(OpenMP_CXX_FOUND)
- target_link_libraries(teaser_registration PUBLIC OpenMP::OpenMP_CXX)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
+ target_link_libraries(teaser_registration PRIVATE OpenMP::OpenMP_CXX)
endif()
add_library(teaserpp::teaser_registration ALIAS teaser_registration)
diff --git a/teaser/include/teaser/registration.h b/teaser/include/teaser/registration.h
index fb20f5b..0e16f33 100644
--- a/teaser/include/teaser/registration.h
+++ b/teaser/include/teaser/registration.h
@@ -16,8 +16,6 @@
#include
#include
-#include "omp.h"
-
#include "teaser/graph.h"
#include "teaser/geometry.h"
@@ -26,6 +24,8 @@
namespace teaser {
+int teaser_default_max_threads();
+
/**
* Struct to hold solution to a registration problem
*/
@@ -418,7 +418,6 @@ class RobustRegistrationSolver {
* Note: the default values needed to be changed accordingly for best performance.
*/
struct Params {
-
/**
* A bound on the noise of each provided measurement.
*/
@@ -511,7 +510,7 @@ class RobustRegistrationSolver {
/**
* Number of threads used for the maximum clique solver
*/
- int max_clique_num_threads = omp_get_max_threads();
+ int max_clique_num_threads = teaser_default_max_threads();
};
RobustRegistrationSolver() = default;
diff --git a/teaser/src/certification.cc b/teaser/src/certification.cc
index cb4cc58..367b20d 100644
--- a/teaser/src/certification.cc
+++ b/teaser/src/certification.cc
@@ -17,7 +17,7 @@
#include
#include "teaser/certification.h"
-#include "teaser/linalg.h"
+#include "linalg.h" // private header for testing
teaser::CertificationResult
teaser::DRSCertifier::certify(const Eigen::Matrix3d& R_solution,
diff --git a/teaser/include/teaser/linalg.h b/teaser/src/linalg.h
similarity index 99%
rename from teaser/include/teaser/linalg.h
rename to teaser/src/linalg.h
index 8ee6963..3fb7024 100644
--- a/teaser/include/teaser/linalg.h
+++ b/teaser/src/linalg.h
@@ -10,6 +10,8 @@
#include
+#include
+
#include
#include
#include
diff --git a/teaser/src/registration.cc b/teaser/src/registration.cc
index 01b6174..3e88099 100644
--- a/teaser/src/registration.cc
+++ b/teaser/src/registration.cc
@@ -14,10 +14,16 @@
#include
#include
+#include
+
#include "teaser/utils.h"
#include "teaser/graph.h"
#include "teaser/macros.h"
+int teaser::teaser_default_max_threads() {
+ return omp_get_max_threads();
+}
+
void teaser::ScalarTLSEstimator::estimate(const Eigen::RowVectorXd& X,
const Eigen::RowVectorXd& ranges, double* estimate,
Eigen::Matrix* inliers) {
diff --git a/test/teaser/CMakeLists.txt b/test/teaser/CMakeLists.txt
index d628e94..d0c8ad2 100644
--- a/test/teaser/CMakeLists.txt
+++ b/test/teaser/CMakeLists.txt
@@ -35,6 +35,12 @@ endif ()
# Executable for running unit tests
add_executable(all_tests ${TEST_SRCS})
target_link_libraries(all_tests ${TEST_LINK_LIBRARIES})
+target_include_directories(all_tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../teaser/src)
+
+find_package(OpenMP)
+if(OpenMP_CXX_FOUND)
+ target_link_libraries(all_tests OpenMP::OpenMP_CXX)
+endif()
gtest_add_tests(TARGET all_tests
TEST_LIST allTests)
diff --git a/test/teaser/linalg-test.cc b/test/teaser/linalg-test.cc
index 19af286..b034ce2 100644
--- a/test/teaser/linalg-test.cc
+++ b/test/teaser/linalg-test.cc
@@ -13,7 +13,7 @@
#include
-#include "teaser/linalg.h"
+#include "linalg.h"
TEST(LinalgTest, HatMap) {
{