Skip to content

Commit be6ec02

Browse files
authored
Install (#27)
* CMake config update. * Version updated to 0.7.5.
1 parent e61324f commit be6ec02

File tree

5 files changed

+9
-39
lines changed

5 files changed

+9
-39
lines changed

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: actions/checkout@v3
4141
with:
4242
repository: opencv/opencv
43-
ref: 4.5.2
43+
ref: 4.6.0
4444
path: opencv
4545

4646
- name: CMake Google Test

CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# CMake version 3.12 provides FindPython.
2-
# CMake version 3.11 generalizes in which directories find_package() searches
3-
# for XxxConfig.cmake or FindXxx.cmake under Lin, Win, etc.
42
# CMake version 3.9 provides OpenMP per language.
53
cmake_minimum_required(VERSION 3.12)
64

75
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/utils.cmake)
86

97
project(pico_tree
108
LANGUAGES CXX
11-
VERSION 0.7.4
9+
VERSION 0.7.5
1210
DESCRIPTION "PicoTree is a C++ header only library with Python bindings for nearest neighbor searches and range searches using a KdTree."
1311
HOMEPAGE_URL "https://github.com/Jaybro/pico_tree")
1412

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ See the table below to get an impression of the performance provided by the [KdT
1212
| [SciPy KDTree][spkd] v1.6.3 | ... | 5.0s | ... | 547.2s |
1313
| [Scikit-learn KDTree][skkd] 0.22.2 | ... | 12.2s | ... | 44.5s |
1414
| [pykdtree][pykd] 1.3.6 | ... | 1.0s | ... | 6.6s |
15-
| [OpenCV FLANN][cvfn] 4.5.2 | 1.9s | ... | 4.7s | ... |
16-
| PicoTree KdTree v0.7.4 | 0.9s | 1.0s | 2.8s | 3.1s |
15+
| [OpenCV FLANN][cvfn] 4.6.0 | 1.9s | ... | 4.7s | ... |
16+
| PicoTree KdTree v0.7.5 | 0.9s | 1.0s | 2.8s | 3.1s |
1717

1818
It compares the performance of the build and query algorithms using two [LiDAR](./docs/benchmark.md) based point clouds of sizes 7733372 and 7200863. The first point cloud is used to compare build times and both are used to compare query times. All benchmarks were generated with the following parameters: `max_leaf_size=10`, `knn=1` and `OMP_NUM_THREADS=1`. A more detailed [C++ comparison](./docs/benchmark.md) of PicoTree is available with respect to [nanoflann][nano].
1919

setup.py

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,18 @@
11
#!/usr/bin/env python3
22

3-
import sys
43
from skbuild import setup
54

65

7-
def compile_cxx_flags():
8-
cxx_flags = []
9-
10-
if sys.platform == 'win32':
11-
# Old versions of CPython have a bug where "hypot" is defined as
12-
# "_hypot". This definition conflicts with the one from math.h and as a
13-
# result causes the following compile error in cmath using MinGW:
14-
# cmath:1121:11: error: '::hypot' has not been declared
15-
# using ::hypot;
16-
# Issue and backport reference: https://github.com/python/cpython/pull/11283
17-
# Issue solved: https://github.com/python/cpython/blob/v3.7.3/PC/pyconfig.h
18-
python_version = sys.version_info[:3]
19-
if python_version < (3, 7, 3):
20-
cxx_flags.append('-D_hypot=hypot')
21-
22-
return cxx_flags
23-
24-
25-
def compile_cmake_args():
26-
cmake_args = []
27-
28-
cxx_flags = compile_cxx_flags()
29-
if cxx_flags:
30-
cmake_args.append('-DCMAKE_CXX_FLAGS="' + ' '.join(cxx_flags) + '"')
31-
32-
return cmake_args
33-
34-
356
setup(name='pico_tree',
367
# The same as the CMake project version.
37-
version='0.7.4',
8+
version='0.7.5',
389
description='PicoTree Python Bindings',
3910
author='Jonathan Broere',
4011
url='https://github.com/Jaybro/pico_tree',
4112
license='MIT',
4213
packages=['pico_tree'],
4314
package_dir={'': 'src/pyco_tree'},
4415
cmake_install_dir='src/pyco_tree/pico_tree',
45-
cmake_args=compile_cmake_args(),
46-
python_requires='>=3.7',
16+
python_requires='>=3.7.3',
4717
install_requires=['numpy'],
4818
)

src/pico_tree/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ if(NOT SKBUILD)
4444
# See target_include_directories
4545
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_PACKAGE_TARGETS_NAME})
4646

47+
# Allows the target to be exported from the build tree.
4748
export(EXPORT ${PROJECT_PACKAGE_TARGETS_NAME}
4849
FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_PACKAGE_TARGETS_NAME}.cmake"
4950
NAMESPACE ${PROJECT_PACKAGE_NAME}::)
5051

52+
# The config mode search procedure uses this path for both Unix and Windows.
5153
set(PACKAGE_INSTALL_DESTINATION
52-
${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_PACKAGE_NAME}/cmake)
54+
${PROJECT_PACKAGE_NAME}/share/cmake/${PROJECT_PACKAGE_NAME})
5355

5456
include(CMakePackageConfigHelpers)
5557
write_basic_package_version_file(

0 commit comments

Comments
 (0)