Hi,
I'm trying to run the pc-ble-driver-py examples on a RockPi 4 (https://wiki.radxa.com/Rockpi4). If I install pc-ble-driver-py directly and try to run the serial_port_enum.py example, I get the following error message:
Traceback (most recent call last):
File "serial_port_enum.py", line 83, in <module>
init(sys.argv[1])
File "serial_port_enum.py", line 48, in init
from pc_ble_driver_py.ble_driver import BLEDriver, Flasher
File "/home/support/.local/lib/python2.7/site-packages/pc_ble_driver_py/ble_driver.py", line 106, in <module>
raise RuntimeError("Could not load shared library {} : '{}'.".format(shlib_path, error))
RuntimeError: Could not load shared library /home/support/.local/lib/python2.7/site-packages/pc_ble_driver_py/lib/linux/x86_64/libpc_ble_driver_shared_sd_api_v3.so : '/home/support/.local/lib/python2.7/site-packages/pc_ble_driver_py/lib/linux/x86_64/libpc_ble_driver_shared_sd_api_v3.so: cannot open shared object file: No such file or directory'.
Realizing that I probably need to compile it myself because the library seemingly tries to open a x64 binary, I try exactly that. I followed the instructions on the github repo, created a custom vcpkg triplet for arm64 and installed the nrf-ble-driver via vcpkg like this:
vcpkg install nrf-ble-driver:arm64-linux
My arm64-linux triplet looks like this:
set(VCPKG_TARGET_ARCHITECTURE arm64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME Linux)
Vcpkg says that nrf-ble-driver installs successfully. However, when I try to run the setup.py, it tells me that nrf-ble-driver configuration cannot be found?
$ python3 setup.py bdist_wheel --build-type Release
/home/support/.local/lib/python3.6/site-packages/setuptools/distutils_patch.py:26: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
"Distutils was imported before Setuptools. This usage is discouraged "
--------------------------------------------------------------------------------
-- Trying "Ninja" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is GNU 7.5.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/support/pc-ble-driver-py/_cmake_test_compile/build
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying "Ninja" generator - success
--------------------------------------------------------------------------------
CMake Error at CMakeLists.txt:29 (find_package):
Could not find a package configuration file provided by "nrf-ble-driver"
(requested version 4.1.1) with any of the following names:
nrf-ble-driverConfig.cmake
nrf-ble-driver-config.cmake
Add the installation prefix of "nrf-ble-driver" to CMAKE_PREFIX_PATH or set
"nrf-ble-driver_DIR" to a directory containing one of the above files. If
"nrf-ble-driver" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
See also "/home/support/pc-ble-driver-py/_skbuild/linux-aarch64-3.6/cmake-build/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "/home/support/.local/lib/python3.6/site-packages/skbuild/setuptools_wrap.py", line 575, in setup
languages=cmake_languages
File "/home/support/.local/lib/python3.6/site-packages/skbuild/cmaker.py", line 232, in configure
os.path.abspath(CMAKE_BUILD_DIR())))
An error occurred while configuring with CMake.
Command:
"cmake" "/home/support/pc-ble-driver-py" "-G" "Ninja" "-DCMAKE_INSTALL_PREFIX:PATH=/home/support/pc-ble-driver-py/_skbuild/linux-aarch64-3.6/cmake-install" "-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3" "-DPYTHON_VERSION_STRING:STRING=3.6.9" "-DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.6m" "-DPYTHON_LIBRARY:FILEPATH=libpython3.6m.a" "-DSKBUILD:BOOL=TRUE" "-DCMAKE_MODULE_PATH:PATH=/home/support/.local/lib/python3.6/site-packages/skbuild/resources/cmake" "-DCMAKE_BUILD_TYPE:STRING=Release"
Source directory:
/home/support/pc-ble-driver-py
Working directory:
/home/support/pc-ble-driver-py/_skbuild/linux-aarch64-3.6/cmake-build
Please see CMake's output for more information.
How can I fix this issue? Or is building on arm64 completely unsupported?