google-coral / libcoral

C++ API for ML inferencing and transfer-learning on Coral devices
https://coral.ai
Apache License 2.0
84 stars 44 forks source link

libcoral C++ Build on Ubuntu 22.10 #34

Open ibiglari opened 1 year ago

ibiglari commented 1 year ago

Description

Hi, Just cloned the repo, and trying to compile libcoral. I was initially getting a complaint from Bazel 6.x.x about some errors in the build script but once I downgraded to Bazel 4.0.0, I am getting a Python error.

Please note the error message after running sudo apt install command as well. It was copy/pasted from libcoral's readme file.

Click to expand! ### Issue Type Build/Install, Documentation Bug ### Operating System Ubuntu ### Coral Device USB Accelerator ### Other Devices _No response_ ### Programming Language C++ ### Relevant Log Output ```shell iman@iman-ubuntu-vm:~/libcoral$ sudo sudo dpkg --add-architecture armhf && sudo dpkg --add-architecture arm64 && sudo apt -y install build-essential libpython3-dev libusb-1.0-0-dev crossbuild-essential-armhf libpython3-dev:armhf libusb-1.0-0-dev:armhf crossbuild-essential-arm64 libpython3-dev:arm64 libusb-1.0-0-dev:arm64 Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package libpython3-dev:armhf E: Unable to locate package libusb-1.0-0-dev:armhf E: Couldn't find any package by glob 'libusb-1.0-0-dev' E: Unable to locate package libpython3-dev:arm64 E: Unable to locate package libusb-1.0-0-dev:arm64 E: Couldn't find any package by glob 'libusb-1.0-0-dev' iman@iman-ubuntu-vm:~/libcoral$ make Loading: 0 packages loaded Loading: 0 packages loaded Loading: 0 packages loaded bazel build --compilation_mode=opt --cpu=k8 //coral/tools/partitioner:utils_test //coral/tools/partitioner:profiling_based_partitioner_test //coral/tools/partitioner:profiling_based_partitioner_ondevice_test //coral/tools/partitioner:parameter_count_based_partitioner_test //coral/tools:tflite_graph_util_test //coral/tools:automl_model_append_rnn_link_test //coral/pose_estimation:posenet_test //coral/pose_estimation:posenet_decoder_test //coral/pose_estimation:movenet_test //coral/pose_estimation:bodypix_test //coral/pipeline/internal:segment_runner_test //coral/pipeline/internal:memory_pool_allocator_test //coral/pipeline:pipelined_model_runner_test //coral/pipeline:models_test //coral/pipeline:detection_models_test //coral/learn/backprop:test_utils_test //coral/learn/backprop:softmax_regression_model_test //coral/learn/backprop:multi_variate_normal_distribution_test //coral/learn/backprop:layers_test //coral/learn:utils_test //coral/learn:imprinting_engine_test //coral/dmabuf:model_pipelining_dmabuf_devboard_test //coral/dmabuf:dmabuf_devboard_test //coral/detection:models_test //coral/detection:adapter_test //coral/classification:lstm_mnist_models_test //coral/classification:cocompiled_classification_models_test //coral/classification:classification_models_test //coral/classification:adapter_test //coral:tflite_utils_test //coral:test_utils_test //coral:segmentation_models_test //coral:multiple_tpus_inference_stress_test //coral:model_loading_stress_test //coral:inference_stress_test //coral:inference_repeatability_test //coral:error_reporter_test //coral:bbox_test INFO: Repository local_execution_config_python instantiated at: /home/iman/libcoral/WORKSPACE:31:14: in /home/iman/.cache/bazel/_bazel_iman/cd2872ec21a7aff33f91821ecfd6c464/external/org_tensorflow/tensorflow/workspace2.bzl:1108:19: in workspace /home/iman/.cache/bazel/_bazel_iman/cd2872ec21a7aff33f91821ecfd6c464/external/org_tensorflow/tensorflow/workspace2.bzl:84:27: in _tf_toolchains /home/iman/.cache/bazel/_bazel_iman/cd2872ec21a7aff33f91821ecfd6c464/external/tf_toolchains/toolchains/remote_config/configs.bzl:6:28: in initialize_rbe_configs /home/iman/.cache/bazel/_bazel_iman/cd2872ec21a7aff33f91821ecfd6c464/external/tf_toolchains/toolchains/remote_config/rbe_config.bzl:158:27: in _tensorflow_local_config Repository rule local_python_configure defined at: /home/iman/.cache/bazel/_bazel_iman/cd2872ec21a7aff33f91821ecfd6c464/external/org_tensorflow/third_party/py/python_configure.bzl:275:41: in ERROR: An error occurred during the fetch of repository 'local_execution_config_python': Traceback (most recent call last): File "/home/iman/.cache/bazel/_bazel_iman/cd2872ec21a7aff33f91821ecfd6c464/external/org_tensorflow/third_party/py/python_configure.bzl", line 212, column 41, in _create_local_python_repository python_include = _get_python_include(repository_ctx, python_bin) File "/home/iman/.cache/bazel/_bazel_iman/cd2872ec21a7aff33f91821ecfd6c464/external/org_tensorflow/third_party/py/python_configure.bzl", line 152, column 21, in _get_python_include result = execute( File "/home/iman/.cache/bazel/_bazel_iman/cd2872ec21a7aff33f91821ecfd6c464/external/org_tensorflow/third_party/remote_config/common.bzl", line 219, column 13, in execute fail( Error in fail: Problem getting python include path. :1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.10/distutils/__init__.py) Is the Python binary path set up right? (See ./configure or PYTHON_BIN_PATH.) Is distutils installed? ERROR: Error fetching repository: Traceback (most recent call last): File "/home/iman/.cache/bazel/_bazel_iman/cd2872ec21a7aff33f91821ecfd6c464/external/org_tensorflow/third_party/py/python_configure.bzl", line 212, column 41, in _create_local_python_repository python_include = _get_python_include(repository_ctx, python_bin) File "/home/iman/.cache/bazel/_bazel_iman/cd2872ec21a7aff33f91821ecfd6c464/external/org_tensorflow/third_party/py/python_configure.bzl", line 152, column 21, in _get_python_include result = execute( File "/home/iman/.cache/bazel/_bazel_iman/cd2872ec21a7aff33f91821ecfd6c464/external/org_tensorflow/third_party/remote_config/common.bzl", line 219, column 13, in execute fail( Error in fail: Problem getting python include path. :1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.10/distutils/__init__.py) Is the Python binary path set up right? (See ./configure or PYTHON_BIN_PATH.) Is distutils installed? ERROR: Analysis of target '//coral/tools/partitioner:utils_test' failed; build aborted: Problem getting python include path. :1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives Traceback (most recent call last): File "", line 1, in ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.10/distutils/__init__.py) Is the Python binary path set up right? (See ./configure or PYTHON_BIN_PATH.) Is distutils installed? INFO: Elapsed time: 0.520s INFO: 0 processes. FAILED: Build did NOT complete successfully (1 packages loaded, 0 targets configured) make: *** [Makefile:75: tests] Error 1 iman@iman-ubuntu-vm:~/libcoral$ ```
feranick commented 9 months ago

A new effort to modernize the edgetpu libraries is under way and with working repos. Please see here. https://github.com/google-coral/pycoral/issues/137#issuecomment-1972454039