Skip to content

Commit

Permalink
Initial refactoring commit and patching capability
Browse files Browse the repository at this point in the history
  • Loading branch information
themarpe committed May 12, 2020
1 parent 4fb8064 commit 463f77c
Show file tree
Hide file tree
Showing 105 changed files with 3,575 additions and 2,958 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,19 @@
build*/*
# Auto-generated
shared/version.hpp

#pybind11
build/
dist/
_build/
_generate/
*.so
*.py[cod]
*.egg-info

#depthai-cpp
depthai-cpp/.vscode/
depthai-cpp/build/

#ci
wheelhouse/
19 changes: 3 additions & 16 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
[submodule "host/py_module/3rdparty/pybind11"]
path = host/py_module/3rdparty/pybind11
url = https://github.com/pybind/pybind11.git
branch = stable
[submodule "host/core/3rdparty/loguru"]
path = host/core/3rdparty/loguru
url = https://github.com/emilk/loguru.git
[submodule "shared/3rdparty/dldt"]
path = shared/3rdparty/dldt
url = https://github.com/opencv/dldt.git
[submodule "shared/3rdparty/json"]
path = shared/3rdparty/json
url = https://github.com/nlohmann/json.git
[submodule "shared/3rdparty/json-schema-validator"]
path = shared/3rdparty/json-schema-validator
url = https://github.com/pboettch/json-schema-validator.git
[submodule "depthai-cpp/shared/depthai-shared"]
path = depthai-cpp/shared/depthai-shared
url = https://github.com/luxonis/depthai-shared.git
43 changes: 43 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
cmake_minimum_required(VERSION 3.2) # For Hunter

# Set compile with -fPIC (on all targets)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.253.tar.gz"
SHA1 "88ea6d37c897a81a080eb9ae0f69d7807bbb3c73"
FILEPATH ${CMAKE_CURRENT_LIST_DIR}/depthai-cpp/cmake/Hunter/config.cmake # Add depthai-cpp config (hunter limitation)
)

# Pybindings project
set(TARGET_NAME depthai)
project(${TARGET_NAME})

# Add depthai-cpp dependency
add_subdirectory(depthai-cpp EXCLUDE_FROM_ALL)

# Add pybind11 dependency
#add_subdirectory(pybind11-2.5.0)
hunter_add_package(pybind11)
find_package(pybind11 CONFIG REQUIRED)
# Find python lib
#find_package(PythonLibs REQUIRED)

# Add files for python module
pybind11_add_module(${TARGET_NAME}
src/py_bindings.cpp
src/host_data_packet_bindings.cpp
src/nnet_packet_bindings.cpp
src/py_tensor_entry_container_iterator.cpp
src/device_bindings.cpp
)
# Link with libraries
target_link_libraries(${TARGET_NAME}
PUBLIC
# pybind11
pybind11::pybind11
#pybind11::embed
#pybind11::module
depthai-cpp
)
8 changes: 8 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include README.md LICENSE
global-include CMakeLists.txt *.cmake
recursive-include src *
recursive-include pybind11/include *.h
graft depthai-cpp
prune depthai-cpp/build
prune example-cpp
prune build
47 changes: 0 additions & 47 deletions build_py_module.sh

This file was deleted.

25 changes: 25 additions & 0 deletions ci/build-wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -e -x

# Install a system package required by our library
#yum install -y atlas-devel
yum install -y libusb1-devel
#yum remove -y libusb1

# Compile wheels
for PYBIN in /opt/python/cp3*/bin; do
#"${PYBIN}/pip" install -r /io/requirements.txt
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done

# Bundle external shared libraries into the wheels
for whl in wheelhouse/*.whl; do
auditwheel repair "$whl" --plat $PLAT -w /io/wheelhouse/ \
|| echo "Skipping non-platform wheel $whl"
done

# Install packages and test
#for PYBIN in /opt/python/*/bin/; do
# "${PYBIN}/pip" install python-manylinux-demo --no-index -f /io/wheelhouse
# (cd "$HOME"; "${PYBIN}/nosetests" pymanylinuxdemo)
#done
Loading

0 comments on commit 463f77c

Please sign in to comment.