Skip to content

Commit

Permalink
Bump to version 0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
nachovizzo committed Mar 23, 2022
1 parent 126143f commit 8d01832
Show file tree
Hide file tree
Showing 20 changed files with 214 additions and 87 deletions.
34 changes: 14 additions & 20 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,22 @@ format:
ubuntu:cpp:build:
stage: build
script:
- mkdir build && cd build && cmake ..
- make -j$(nproc --all) all
artifacts:
paths:
- build/
- mkdir build && cd build && cmake .. && make -j$(nproc --all) all install
- make uninstall

ubuntu:cpp:install:
ubuntu:cpp:example:
stage: build
needs: ["ubuntu:cpp:build"]
script:
- cd build
- make install
- mkdir build && cd build && cmake -DBUILD_CXX_EXAMPLE=ON .. && make -j$(nproc --all) install
- make uninstall

ubuntu:cpp:example:
ubuntu:cpp:standalone_example:
stage: build
needs: ["ubuntu:cpp:install"]
script:
needs: ["ubuntu:cpp:build"]
script:
- mkdir build && cd build && cmake -DBUILD_CXX_EXAMPLE=ON .. && make install && cd ..
- cd examples/cpp/ && mkdir build && cd build && cmake ..
- make -j$(nproc --all) all
- mkdir build && cd build && cmake .. && make -j$(nproc --all) install && cd ..
- cd examples/cpp/ && mkdir build && cd build && cmake .. && make -j$(nproc --all)

#----- ubuntu python jobs ---------------------------------------------------------------------------
ubuntu:py:wheel:
Expand Down Expand Up @@ -103,9 +97,9 @@ manylinux:wheels:
image: docker:19.03.12
needs: ["ubuntu:py:wheel"]
rules:
- if: $CI_COMMIT_TAG
- if: $CI_MERGE_REQUEST_IID
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: "$CI_COMMIT_TAG != null && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
variables:
DOCKER_IMAGE: "quay.io/pypa/manylinux2014_x86_64"
PLAT: "manylinux2014_x86_64"
Expand Down Expand Up @@ -133,9 +127,9 @@ manylinux:test:
needs: ["manylinux:wheels"]
image: docker:19.03.12
rules:
- if: $CI_COMMIT_TAG
- if: $CI_MERGE_REQUEST_IID
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: "$CI_COMMIT_TAG != null && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
variables:
DOCKER_IMAGE: "quay.io/pypa/manylinux2014_x86_64"
PLAT: "manylinux2014_x86_64"
Expand All @@ -153,12 +147,12 @@ testpypi:
stage: deploy
needs: ["manylinux:test"]
rules:
- if: "$CI_COMMIT_TAG != null && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
- if: $CI_COMMIT_TAG
variables:
TWINE_PASSWORD: "${TESTPYPI_ACCESS_TOKEN}"
TWINE_USERNAME: "__token__"
script:
- twine upload --skip-existing --repository testpypi wheelhouse/*.whl
- twine upload --verbose --skip-existing --repository testpypi wheelhouse/*.whl
artifacts:
paths:
- wheelhouse/
Expand All @@ -167,9 +161,9 @@ pypi:
stage: deploy
needs: ["testpypi"]
rules:
- if: "$CI_COMMIT_TAG != null && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
- if: $CI_COMMIT_TAG
variables:
TWINE_PASSWORD: "${PYPI_ACCESS_TOKEN}"
TWINE_USERNAME: "__token__"
script:
- twine upload --skip-existing --repository pypi wheelhouse/*.whl
- twine upload --verbose --skip-existing --repository pypi wheelhouse/*.whl
15 changes: 9 additions & 6 deletions 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ if(NOT USE_SYSTEM_EIGEN3 OR NOT EIGEN3_FOUND)
include(${CMAKE_CURRENT_LIST_DIR}/eigen/eigen.cmake)
endif()

if(USE_SYSTEM_PYBIND11)
find_package(pybind11 QUIET)
endif()
if(NOT USE_SYSTEM_PYBIND11 OR NOT pybind11_FOUND)
set(USE_SYSTEM_PYBIND11 OFF)
include(${CMAKE_CURRENT_LIST_DIR}/pybind11/pybind11.cmake)
if(BUILD_PYTHON_BINDINGS)
if(USE_SYSTEM_PYBIND11)
find_package(pybind11 QUIET)
endif()
if(NOT USE_SYSTEM_PYBIND11 OR NOT pybind11_FOUND)
message(STATUS "ASDASDAS")
set(USE_SYSTEM_PYBIND11 OFF)
include(${CMAKE_CURRENT_LIST_DIR}/pybind11/pybind11.cmake)
endif()
endif()

if(USE_SYSTEM_OPENVDB)
Expand Down
6 changes: 4 additions & 2 deletions 3rdparty/pybind11/pybind11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ include(FetchContent)
FetchContent_Declare(
ext_pybind11
PREFIX pybind11
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.6.2.tar.gz
URL_HASH SHA256=8ff2fff22df038f5cd02cea8af56622bc67f5b64534f1b83b9f133b8366acff2)
#TODO: Update to a release when this gets merged: https://github.com/pybind/pybind11/pull/3743
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG master
GIT_SHALLOW ON)

FetchContent_MakeAvailable(ext_pybind11)
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
cmake_minimum_required(VERSION 3.10)
project(VDBFusion VERSION 0.1.5 LANGUAGES CXX)
project(VDBFusion VERSION 0.1.6 LANGUAGES CXX)

# Setup build options
option(USE_CCACHE "Build using Ccache if found on the path" ON)
option(USE_SYSTEM_EIGEN3 "Use system pre-installed eigen3" ON)
option(USE_SYSTEM_OPENVDB "Use system pre-installed OpenVDB" ON)
option(USE_SYSTEM_PYBIND11 "Use system pre-installed pybind11" ON)
option(PYOPENVDB_SUPPORT "Add suuport for pyopenvdb, this depends on boost::python" OFF)
option(SILENCE_WARNINGS "To build manylinux packages only, disable on the global scope" OFF)
option(BUILD_CXX_EXAMPLE "Build C++ examples" OFF)
option(BUILD_PYTHON_BINDINGS "Build the python module" OFF)

mark_as_advanced(USE_CCACHE USE_SYSTEM_OPENVDB PYOPENVDB_SUPPORT SILENCE_WARNINGS)
mark_as_advanced(USE_CCACHE USE_SYSTEM_OPENVDB SILENCE_WARNINGS BUILD_PYTHON_BINDINGS)

if(SILENCE_WARNINGS)
message(WARNING "Disable all warnings for all targets in the build system, only for the CI/CD")
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
.PHONY: docker
.PHONY: install docker
install:
pip3 -v install . && cp build/*/compile_commands.json build/

uninstall:
pip3 -v uninstall vdbfusion

dev:
pip3 -v install -e . && cp build/*/compile_commands.json build/

test:
pytest .

Expand Down
2 changes: 1 addition & 1 deletion ci/test-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ for PYBIN in /opt/python/*/bin/; do
"${PYBIN}/pip" install -r /io/requirements.txt
"${PYBIN}/pip" install -r /io/dev-requirements.txt
"${PYBIN}/pip" install --no-index -f /io/wheelhouse vdbfusion
(cd "$HOME"; "${PYBIN}/pytest" /io/)
(cd "$HOME"; "${PYBIN}/pytest" --capture=sys /io/)
done
1 change: 1 addition & 0 deletions docker/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ RUN git clone --depth 1 https://github.com/nachovizzo/openvdb.git -b nacho/vdbfu
&& cmake \
-DOPENVDB_BUILD_PYTHON_MODULE=ON \
-DUSE_NUMPY=ON \
-DPYOPENVDB_INSTALL_DIRECTORY="/usr/local/lib/python3.8/dist-packages" \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DUSE_ZLIB=OFF \
..\
Expand Down
2 changes: 2 additions & 0 deletions examples/python/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vdbfusion:
@make -C ../../
6 changes: 3 additions & 3 deletions examples/python/config/kitti.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ space_carving: False
out_dir: "results/"

# Reconstruction
fill_holes: True
fill_holes: False
min_weight: 5.0

# Kitti
apply_pose: True
min_range: 2.0
max_range: 70.0
min_range: 2.5
max_range: 120.0
correct_scan: True
2 changes: 1 addition & 1 deletion examples/python/vdbfusion_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _get_o3d_mesh(tsdf_volume, cfg):

def _print_metrics(self):
# If PYOPENVDB_SUPPORT has not been enabled then we can't report any metrics
if not hasattr(self._tsdf_volume, "tsdf"):
if not self._tsdf_volume.pyopenvdb_support_enabled:
print("No metrics available, please compile with PYOPENVDB_SUPPORT")
return

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name=vdbfusion
author = Ignacio Martin Vizzo (aka Nacho) and Cyrill Stachniss
author_email=ignaciovizzo@gmail.com
license_files = LICENSE.txt
version=0.1.5
version=0.1.6
description=3D Volumetric Surface Reconstruction using the VDB data structure
long_description=file:README.md,
long_description_content_type=text/markdown
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def build_extension(self, ext):
# EXAMPLE_VERSION_INFO shows you how to pass a value into the C++ code
# from Python.
cmake_args = [
f"-DBUILD_PYTHON_BINDINGS=ON",
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}",
f"-DPYTHON_EXECUTABLE={sys.executable}",
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
Expand Down
4 changes: 3 additions & 1 deletion src/vdbfusion/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
add_subdirectory(pybind)
add_subdirectory(vdbfusion)
if(BUILD_PYTHON_BINDINGS)
add_subdirectory(pybind)
endif()
2 changes: 1 addition & 1 deletion src/vdbfusion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.1.5"
__version__ = "0.1.6"
from .pybind.vdb_volume import VDBVolume
10 changes: 9 additions & 1 deletion src/vdbfusion/pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
pybind11_add_module(vdbfusion_pybind vdbfusion_pybind.cpp)
target_compile_options(vdbfusion_pybind PRIVATE -Werror -Wall -Wextra)
target_link_libraries(vdbfusion_pybind PRIVATE VDBFusion::vdbfusion)

# PYOPENVDB_SUPPORT is defined only by the existence of the pyopenvdb library.
find_package(Python COMPONENTS Interpreter)
execute_process(COMMAND
${PYTHON_EXECUTABLE} "-c" "import pyopenvdb; print(True)"
OUTPUT_VARIABLE PYOPENVDB_SUPPORT
ERROR_QUIET)
if(PYOPENVDB_SUPPORT)
find_package(Boost COMPONENTS python REQUIRED)
find_package(Boost COMPONENTS python Required)
target_compile_definitions(vdbfusion_pybind PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:PYOPENVDB_SUPPORT>")
target_link_libraries(vdbfusion_pybind PRIVATE Boost::python)
message(STATUS "PYOPENVDB_SUPPORT enabled")
endif()
Loading

0 comments on commit 8d01832

Please sign in to comment.