This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

CMakeLists.txt issue - compiling pc-ble-driver-py and would like to reference pc-ble-driver which I have compiled

I am using NRF52840 DevKit on Ubuntu 18.04 (bionic). I have successfully compiled pc-ble-driver and hex connectivity/softdevice.

I have now download pc-ble-driver-py and would like to reference the compiled version of pc-ble-driver (the one I compiled from source). I am running into following error, which suggests that I can not use my own compiled version of pc-ble-driver. I would like to get a working CMakeLists.txt which can reference the compiled version of pc-ble-driver.

I see following error when I run the "cmake -G "Unix Makefiles" .." command.

My code is structured as:

<ROOT> pc-ble-driver-master - driver and connectivity is compiled successfully here.

<ROOT> pc-ble-driver-py-master - Reference pc-ble-driver-master.

mukul@soumya-SH370:~/nordic/nordic-driver/pc-ble-driver-py-master/build$ cmake -G "Unix Makefiles" ..
CMake Error at CMakeLists.txt:20 (include):
 include could not find load file:

   pc-ble-driver/cmake/pc-ble-driver.cmake


CMake Error at CMakeLists.txt:21 (add_subdirectory):
 The source directory

   /home/mukul/nordic/nordic-driver/pc-ble-driver-py-master/pc-ble-driver

 does not contain a CMakeLists.txt file.


CMake Error at CMakeLists.txt:156 (build_metadata):
 Unknown CMake command "build_metadata".


-- Configuring incomplete, errors occurred!

Thanks,

Mukul

  • Hi, the pc-ble-driver python wrapper is not updated to work with the newest version of pc-ble-driver. Use the version which is referenced by the git submodule in the pc-ble-driver-py repository.

    The easiest way to use the python wrapper is to install it using PyPI:

    pip install pc-ble-driver-py
  • That is an easy answer. I got that one from local FAE and that works.

    However, what is the technical reason for not being able to use latest pc-ble-driver ?

    This is what I am now running into:

    I downloaded latest pc-ble-driver and pc-ble-driver-py. Dir structure is:

    <ROOT>pc-ble-driver-py

    <ROOT>pc-ble-driver-py/pc-ble-driver

    My cmake version is 3.14. When I compile pc-ble-driver-py it gives me SWIG_ADD_LIBRARY error. I have tried to change the SWIG_ADD_MODULE to SWIG_ADD_LIBRARY but that hasn't worked. Would like to be able to use latest pc-ble-driver instead of using the specific version.

    ukul@soumya-SH370:~/nordic/nordic-driver/pc-ble-driver-py/build$ cmake -G "Unix Makefiles" ..
    -- Architecture not set, using native 64-bit toolchain.
    -- Building with build type: .
    -- NRF_BLE_DRIVER_VERSION not specified, setting it to 0.0.0
    -- Compiled examples are installed in directory "bin"
    -- Did not find clang-tidy, target tidy is disabled.
    -- If clang-tidy is installed, make sure run-clang-tidy.py and clang-tidy is in PATH
    -- Boost version: 1.69.0
    CMake Deprecation Warning at /usr/local/share/cmake-3.14/Modules/UseSWIG.cmake:559 (message):
    SWIG_ADD_MODULE is deprecated. Use SWIG_ADD_LIBRARY instead.
    Call Stack (most recent call first):
    CMakeLists.txt:80 (swig_add_module)

    Thanks,

    Mukul

  • Can I pls get a response to my questions ? Thanks!

  • Hi, even if you got the cmake compilation to work, the python wrapper will not work with the newest version of the pc-ble-driver library. The SD API has changed and would require the python wrapper to be updated. This is work in progress by the pc-ble-driver team. First the python wrapper will be updated to work with SD 5 then SD 6 later. Unfortunately I can't give you an ETA atm.

    I would suggest that you use the pc-ble-driver directly if you want to use the newest version. There are examples to help you getting started: https://github.com/NordicSemiconductor/pc-ble-driver/tree/master/examples

Related