Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,49 @@
name: build

on:
name: build
on:
push:
branches:
branches:
- master
pull_request:
branches:
- master

jobs:

build-debug:
name: CMake Debug Build
runs-on: ubuntu-20.04

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install-eigen
- uses: actions/checkout@v4
- name: install-dependencies
run: sudo apt install libeigen3-dev
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug ..
- name: build
run: cmake --build build

build-release:
name: CMake Release Build
runs-on: ubuntu-20.04

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install-eigen
- uses: actions/checkout@v4
- name: install-dependencies
run: sudo apt install libeigen3-dev
- name: configure
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..
- name: build
run: cmake --build build
- name: test
run: cd build && ctest all

python:
name: Python Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup-python
uses: actions/setup-python@v5
with: {python-version: '3.x'}
- name: install-dependencies
run: sudo apt install libeigen3-dev
- name: upgrade-pip
run: python -m pip install --upgrade pip
- name: build
run: python -m pip install ${{github.workspace}}
- name: test
run: python -c "import teaserpp_python; print('☺')"
59 changes: 3 additions & 56 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.16)
project(teaserpp VERSION 1.0.0)

set(CMAKE_CXX_STANDARD 14)
Expand All @@ -18,10 +18,11 @@ if (DEFINED SKBUILD)
endif ()

# Options
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(BUILD_TESTS "Build tests" ON)
option(BUILD_TEASER_FPFH "Build TEASER++ wrappers for PCL FPFH estimation." OFF)
option(BUILD_MATLAB_BINDINGS "Build MATLAB bindings" OFF)
option(BUILD_PYTHON_BINDINGS "Build Python bindings" ON)
option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF)
option(BUILD_DOC "Build documentation" ON)
option(BUILD_WITH_MARCH_NATIVE "Build with flag march=native" OFF)
option(ENABLE_MKL "Try to use Eigen with MKL" OFF)
Expand All @@ -32,11 +33,6 @@ if (ENABLE_DIAGNOSTIC_PRINT)
add_definitions(-DTEASER_DIAG_PRINT)
endif ()

# Cache Variables
if (NOT TEASERPP_PYTHON_VERSION)
set(TEASERPP_PYTHON_VERSION "" CACHE STRING "Python version to use for TEASER++ bindings.")
endif ()

# Find dependencies
# Eigen3
find_package(Eigen3 3.2 QUIET REQUIRED NO_MODULE)
Expand Down Expand Up @@ -78,44 +74,6 @@ if (BUILD_TEASER_FPFH)
endif()
endif ()

# googletest
configure_file(cmake/GoogleTest.CMakeLists.txt.in googletest-download/CMakeLists.txt)
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googletest-download")
execute_process(COMMAND "${CMAKE_COMMAND}" --build .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googletest-download")
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory("${CMAKE_BINARY_DIR}/googletest-src"
"${CMAKE_BINARY_DIR}/googletest-build" EXCLUDE_FROM_ALL)

# pmc (Parallel Maximum Clique)
configure_file(cmake/pmc.CMakeLists.txt.in pmc-download/CMakeLists.txt)
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/pmc-download")
execute_process(COMMAND "${CMAKE_COMMAND}" --build .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/pmc-download")
add_subdirectory("${CMAKE_BINARY_DIR}/pmc-src"
"${CMAKE_BINARY_DIR}/pmc-build")

# tinyply
configure_file(cmake/tinyply.CMakeLists.txt.in tinyply-download/CMakeLists.txt)
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/tinyply-download")
execute_process(COMMAND "${CMAKE_COMMAND}" --build .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/tinyply-download")
add_subdirectory("${CMAKE_BINARY_DIR}/tinyply-src"
"${CMAKE_BINARY_DIR}/tinyply-build")
target_include_directories(tinyply PUBLIC
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/tinyply-src/source>)

# spectra
configure_file(cmake/spectra.CMakeLists.txt.in spectra-download/CMakeLists.txt)
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/spectra-download")
execute_process(COMMAND "${CMAKE_COMMAND}" --build .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/spectra-download")
set(SPECTRA_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/spectra-src/include")

# Building Targets
set(TEASERPP_ROOT ${CMAKE_CURRENT_LIST_DIR})
add_subdirectory(teaser)
Expand All @@ -135,17 +93,6 @@ if (BUILD_MATLAB_BINDINGS)
endif ()

if (BUILD_PYTHON_BINDINGS)
set(PYBIND11_PYTHON_VERSION ${TEASERPP_PYTHON_VERSION})

# download the pybind11 repo
configure_file(cmake/pybind11.CMakeLists.txt.in pybind11-download/CMakeLists.txt)
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/pybind11-download")
execute_process(COMMAND "${CMAKE_COMMAND}" --build .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/pybind11-download")
add_subdirectory("${CMAKE_BINARY_DIR}/pybind11-src"
"${CMAKE_BINARY_DIR}/pybind11-build")

message(STATUS "TEASER++ Python binding will be built.")
add_subdirectory(python)
endif ()
Expand Down
14 changes: 0 additions & 14 deletions cmake/GoogleTest.CMakeLists.txt.in

This file was deleted.

15 changes: 0 additions & 15 deletions cmake/pmc.CMakeLists.txt.in

This file was deleted.

15 changes: 0 additions & 15 deletions cmake/spectra.CMakeLists.txt.in

This file was deleted.

15 changes: 0 additions & 15 deletions cmake/tinyply.CMakeLists.txt.in

This file was deleted.

7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ Homepage = "https://github.com/MIT-SPARK/TEASER-plusplus"

[tool.scikit-build]
build-dir = "build/{wheel_tag}"
build.verbose = false
build.verbose = true
cmake.version = ">=3.16"
wheel.install-dir = "teaserpp_python.libs"

[tool.scikit-build.cmake.define]
BUILD_PYTHON_BINDINGS = "ON"
BUILD_TESTS = "OFF"
BUILD_SHARED_LIBS = "OFF"

[tool.cibuildwheel]
archs = ["auto64"]
skip = ["*-musllinux*", "pp*", "cp36-*"]
Expand Down
45 changes: 2 additions & 43 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
cmake_minimum_required(VERSION 3.10)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

project(teaser_python_bindings)
find_package(pybind11 REQUIRED)

pybind11_add_module(teaserpp_python teaserpp_python/teaserpp_python.cc)

message(STATUS "Python Interpreter Version: ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
if (NOT (PYTHON_VERSION_MAJOR EQUAL 2 AND PYTHON_VERSION_MINOR EQUAL 7))
# Hack: VTK used in PCL might add /usr/include/python2.7 to all targets'
# INCLUDE_DIRECTORIES properties. We need to remove it.
get_target_property(TEASERPY_NEW_INCLUDE_DIRS teaserpp_python INTERFACE_INCLUDE_DIRECTORIES)
list(FILTER TEASERPY_NEW_INCLUDE_DIRS EXCLUDE REGEX ".*python2.7$")
set_target_properties(teaserpp_python
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${TEASERPY_NEW_INCLUDE_DIRS}")
endif ()

target_link_libraries(teaserpp_python PUBLIC teaser_registration)

# fix for clang
# see: https://github.com/pybind/pybind11/issues/1818
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(teaserpp_python PUBLIC -fno-sized-deallocation)
target_compile_options(teaserpp_python PUBLIC -fno-sized-deallocation)
endif ()

# make sure to output the build file to teaserpp_python folder
Expand All @@ -29,35 +15,8 @@ SET_TARGET_PROPERTIES(teaserpp_python
OUTPUT_NAME "_teaserpp"
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/teaserpp_python"
INSTALL_RPATH "$ORIGIN/../teaserpp_python.libs/lib;$ORIGIN/../../teaser/"
BUILD_WITH_INSTALL_RPATH TRUE
)

# copy package __init__.py file
configure_file(teaserpp_python/__init__.py
${CMAKE_CURRENT_BINARY_DIR}/teaserpp_python/__init__.py
)

configure_file(teaserpp_python/__init__.py
${CMAKE_CURRENT_BINARY_DIR}/teaserpp_python/_teaserpp.pyi
)

# copy setup.py file
configure_file(setup.py.in
${CMAKE_CURRENT_BINARY_DIR}/setup.py
)

file(COPY .
DESTINATION .
FILES_MATCHING
PATTERN *.py)

if (DEFINED SKBUILD)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/teaserpp/
DESTINATION "../teaserpp"
FILES_MATCHING PATTERN "*.py"
PATTERN "*.pyi"
PATTERN "*.so"
)
install(TARGETS teaserpp_python DESTINATION "../teaserpp_python")
endif ()
12 changes: 0 additions & 12 deletions python/setup.py.in

This file was deleted.

Loading