我正在尝试为 Mac M1 Pro(即 Apple 芯片)重建 Nordic 的pc-ble-driver-py 。我正在关注其存储库中的自述文件,并且(我认为)设法重建了底层的pc-ble-driver,arm64
现在我正在尝试构建和打包 Python 绑定py-ble-driver-py。
运行打包命令时:
python setup.py bdist_wheel --build-type Release
我收到以下错误(为简洁起见):
[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
...
显然,有些事情不太正确,但我不确定从哪里开始寻找,因为我对 CMake 并不太熟悉。在看到有关架构不匹配的线程中的一些可能相关信息后,我尝试调整CMakeCache.txt中的一些值。
谁能帮助我推进构建或进一步了解问题?