Rebuilding pc-ble-driver-py and the underlying driver for Apple Silicon

Hi Nordic,

I have got quite far in my journey to rebuild pc-ble-driver-py for my Apple Macbook M1 Pro under Python 3.9.9. I'm following your README on GitHub. I'm failing at this stage when attempting to run:

python setup.py bdist_wheel --build-type Release

Here is the primary error. Note, there are many more missing symbols, I've just included the first line for brevity:

[4/7] Linking CXX shared library _nrf_ble_driver_sd_api_v2.so
FAILED: _nrf_ble_driver_sd_api_v2.so
: && /Library/Developer/CommandLineTools/usr/bin/c++ -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk -mmacosx-version-min=12.0 -dynamiclib -Wl,-headerpad_max_install_names  -o _nrf_ble_driver_sd_api_v2.so -install_name @rpath/_nrf_ble_driver_sd_api_v2.so CMakeFiles/nrf_ble_driver_sd_api_v2.dir/outdir/nrf_ble_driver_sd_api_v2PYTHON_wrap.c.o  /opt/homebrew/Cellar/vcpkg/2021.05.12/libexec/installed/arm64-osx/lib/libnrf-ble-driver-sd_api_v2.a  /Library/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib  -framework CoreFoundation  -framework IOKit && :
ld: warning: ignoring file /opt/homebrew/Cellar/vcpkg/2021.05.12/libexec/installed/arm64-osx/lib/libnrf-ble-driver-sd_api_v2.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
  "_sd_ble_enable", referenced from:
      _wrap_sd_ble_enable(_object*, _object*) in nrf_ble_driver_sd_api_v2PYTHON_wrap.c.o

So, it seems that something's not being built correctly for the arm64 architecture, but all of the build information until this point looked OK.

Can you offer some assistance or point me in the right direction? It would also be good to know when you're planning to release an official binary for the M1.

Cheers,

Ed

ds

  • Hi Ed King,

    Can you offer some assistance or point me in the right direction?

    Thanks for checking with us, I see there is already a discussion related to Mac M1 on the Github repo. I suggest you follow up or raise a new issue there to get help from the developer directly. Please also share the issue link here, I will try to prioritize your issue.

    It would also be good to know when you're planning to release an official binary for the M1.

    Yes, good suggestion. We have already planned for it, but I do not have an exact release date to share by far. Please keep monitoring the state from the pc-ble-driver-py repo.

    Best regards,

    Charlie

  • Hi Charlie,

    Thank you. I've reposted this directly on GitHub and will hope for some assistance there. In the meantime, I'll continue to try to rebuild the Python binding myself.

    Cheers,
    Ed

Related