Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubertooth does not build on macOS 12.6.1, python 3.10.8 #507

Open
michelcrypt4d4mus opened this issue Oct 31, 2022 · 2 comments
Open

Ubertooth does not build on macOS 12.6.1, python 3.10.8 #507

michelcrypt4d4mus opened this issue Oct 31, 2022 · 2 comments

Comments

@michelcrypt4d4mus
Copy link

michelcrypt4d4mus commented Oct 31, 2022

Steps to reproduce

Follow the build from git instructions on macOS using homebrew:

  1. brew install as per this issue's updated recommendation seems to work fine, though I do get a warning about libpcap linking (see below)
  2. building libbtbb from source or the other way seems to work fine though there are some ominous warnings about requesting the python version ''... and also the command sudo ldconfig at the last step gives command not found
  3. Running cmake for ubertooth finds libbtbb ok (or seems to) but throws warning about Could NOT find LIBBLUETOOTH (missing: LIBBLUETOOTH_LIBRARIES LIBBLUETOOTH_INCLUDE_DIR). Unclear if it actually succeeded.
  4. make fails for ubertooth on missing libusb:
    [  3%] Building C object libubertooth/src/CMakeFiles/ubertooth.dir/ubertooth.c.o
    In file included from /Users/uzer/workspace/ubertooth/ubertooth/host/libubertooth/src/ubertooth.c:30:
    In file included from /Users/uzer/workspace/ubertooth/ubertooth/host/libubertooth/src/ubertooth.h:25:
    /Users/uzer/workspace/ubertooth/ubertooth/host/libubertooth/src/ubertooth_control.h:25:10: fatal error: 'libusb-1.0/libusb.h' 
    file not found
    #include <libusb-1.0/libusb.h>
             ^~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    make[2]: *** [libubertooth/src/CMakeFiles/ubertooth.dir/ubertooth.c.o] Error 1
    make[1]: *** [libubertooth/src/CMakeFiles/ubertooth.dir/all] Error 2
    make: *** [all] Error 2
    
  5. also fails if i set LDFLAGS / CPPFLAGS as suggested by homebrew for the pcap library

Expected behaviour

It should build

Actual behaviour

See 4. above.

Version information

Operating system: macOS 12.6.1

Python: 3.10.8

Ubertooth tools version (ubertooth-rx -V): 2020-12-R1 (i think? just checked out of git today)

libbtbb version: /usr/local/lib/libbtbb.1.0.dylib so i guess 1.0?

Ubertooth firmware version (ubertooth-util -v): Didn't get that far yet.

Output

brew install as per the other issue

==> libpcap
libpcap is keg-only, which means it was not symlinked into /opt/homebrew,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have libpcap first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/libpcap/bin:$PATH"' >> /Users/uzer/.bash_profile

For compilers to find libpcap you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/libpcap/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/libpcap/include"


Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake
Warning: libusb 1.0.26 is already installed and up-to-date.
To reinstall 1.0.26, run:
  brew reinstall libusb
Warning: wget 1.21.3 is already installed and up-to-date.
To reinstall 1.21.3, run:
  brew reinstall wget
Warning: cmake 3.24.2 is already installed and up-to-date.
To reinstall 3.24.2, run:
  brew reinstall cmake
Warning: pkg-config 0.29.2_3 is already installed and up-to-date.
To reinstall 0.29.2_3, run:
  brew reinstall pkg-config

Build libtbb

$ make
Consolidate compiler generated dependencies of target btbb
[ 88%] Built target btbb
[100%] Built target pcapdump
[100%] Built target btaptap
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/pkgconfig/libbtbb.pc
-- Installing: /usr/local/lib/libbtbb.1.0.dylib
-- Up-to-date: /usr/local/lib/libbtbb.1.dylib
-- Up-to-date: /usr/local/lib/libbtbb.dylib
-- Installing: /usr/local/include/btbb.h
/opt/homebrew/lib/python3.10/site-packages/setuptools/dist.py:544: UserWarning: The version specified ('') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  warnings.warn(
running build
running build_py
running install
/opt/homebrew/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/opt/homebrew/lib/python3.10/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
creating /Users/uzer/workspace/ubertooth/libbtbb/python/pcaptools/pcapdump.egg-info
writing /Users/uzer/workspace/ubertooth/libbtbb/python/pcaptools/pcapdump.egg-info/PKG-INFO
writing dependency_links to /Users/uzer/workspace/ubertooth/libbtbb/python/pcaptools/pcapdump.egg-info/dependency_links.txt
writing top-level names to /Users/uzer/workspace/ubertooth/libbtbb/python/pcaptools/pcapdump.egg-info/top_level.txt
writing manifest file '/Users/uzer/workspace/ubertooth/libbtbb/python/pcaptools/pcapdump.egg-info/SOURCES.txt'
reading manifest file '/Users/uzer/workspace/ubertooth/libbtbb/python/pcaptools/pcapdump.egg-info/SOURCES.txt'
writing manifest file '/Users/uzer/workspace/ubertooth/libbtbb/python/pcaptools/pcapdump.egg-info/SOURCES.txt'
installing library code to /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg
running install_lib
creating /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64
creating /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg
creating /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg/pcapdump
copying /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/lib/pcapdump/pcapdump.py -> /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg/pcapdump
copying /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/lib/pcapdump/__init__.py -> /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg/pcapdump
byte-compiling /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg/pcapdump/pcapdump.py to pcapdump.cpython-310.pyc
byte-compiling /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg/pcapdump/__init__.py to __init__.cpython-310.pyc
creating /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg/EGG-INFO
copying /Users/uzer/workspace/ubertooth/libbtbb/python/pcaptools/pcapdump.egg-info/PKG-INFO -> /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg/EGG-INFO
copying /Users/uzer/workspace/ubertooth/libbtbb/python/pcaptools/pcapdump.egg-info/SOURCES.txt -> /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg/EGG-INFO
copying /Users/uzer/workspace/ubertooth/libbtbb/python/pcaptools/pcapdump.egg-info/dependency_links.txt -> /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg/EGG-INFO
copying /Users/uzer/workspace/ubertooth/libbtbb/python/pcaptools/pcapdump.egg-info/top_level.txt -> /Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/pcapdump-0.0.0-py3.10.egg' and adding '/Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg' to it
removing '/Users/uzer/workspace/ubertooth/libbtbb/build/python/pcaptools/build/bdist.macosx-12-arm64/egg' (and everything under it)
Processing pcapdump-0.0.0-py3.10.egg
Removing /opt/homebrew/lib/python3.10/site-packages/pcapdump-0.0.0-py3.10.egg
Copying pcapdump-0.0.0-py3.10.egg to /opt/homebrew/lib/python3.10/site-packages
pcapdump 0.0.0 is already the active version in easy-install.pth

Installed /opt/homebrew/lib/python3.10/site-packages/pcapdump-0.0.0-py3.10.egg
Processing dependencies for pcapdump==0.0.0
Finished processing dependencies for pcapdump==0.0.0
-- Installing: /usr/local/bin/btaptap

Running cmake for ubertooth warnings and maybe failure?:

$ cmake ..
CMake Deprecation Warning at CMakeLists.txt:23 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is AppleClang 14.0.0.14000029
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:28 (set):
  implicitly converting 'INT' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:29 (set):
  implicitly converting 'INT' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Setting version string git-3e9de91
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2") 
-- Found LIBBTBB: /usr/local/lib/libbtbb.dylib  
-- Checking for module 'libusb-1.0'
--   Found libusb-1.0, version 1.0.26
-- Found LIBUSB: /opt/homebrew/lib/libusb-1.0.dylib  
-- Building shared library
-- Checking for module 'bluez'
--   No package 'bluez' found
-- Could NOT find LIBBLUETOOTH (missing:  LIBBLUETOOTH_LIBRARIES LIBBLUETOOTH_INCLUDE_DIR) 
CMake Deprecation Warning at misc/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at misc/udev/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Found Python3: /opt/homebrew/Frameworks/Python.framework/Versions/3.10/bin/python3.10 (found version "3.10.8") found components: Interpreter 
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   ubertooth

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/uzer/workspace/ubertooth/ubertooth/host/build

(Without cmake, make also fails)

uzer@comput0r:~/workspace/ubertooth/ubertooth/host/build(master)$ make
[  3%] Building C object libubertooth/src/CMakeFiles/ubertooth.dir/ubertooth.c.o
In file included from /Users/uzer/workspace/ubertooth/ubertooth/host/libubertooth/src/ubertooth.c:30:
In file included from /Users/uzer/workspace/ubertooth/ubertooth/host/libubertooth/src/ubertooth.h:25:
/Users/uzer/workspace/ubertooth/ubertooth/host/libubertooth/src/ubertooth_control.h:25:10: fatal error: 'libusb-1.0/libusb.h' file not found
#include <libusb-1.0/libusb.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [libubertooth/src/CMakeFiles/ubertooth.dir/ubertooth.c.o] Error 1
make[1]: *** [libubertooth/src/CMakeFiles/ubertooth.dir/all] Error 2
make: *** [all] Error 2
@michelcrypt4d4mus
Copy link
Author

Perhaps worth noting that I definitely have libusb.h... in fact I have a couple:

/opt/homebrew/include has one:

$ find /opt/homebrew/ -iname "*libusb*"
/opt/homebrew//include/libusb-1.0
/opt/homebrew//var/homebrew/linked/libusb
/opt/homebrew//Library/Taps/homebrew/homebrew-core/Formula/libusb.rb
/opt/homebrew//Library/Taps/homebrew/homebrew-core/Formula/libusbmuxd.rb
/opt/homebrew//Library/Taps/homebrew/homebrew-core/Formula/libusb-compat.rb
/opt/homebrew//lib/pkgconfig/libusb-1.0.pc
/opt/homebrew//lib/libusb-1.0.dylib
/opt/homebrew//lib/libusb-1.0.0.dylib
/opt/homebrew//lib/libusb-1.0.a
/opt/homebrew//opt/libusb
/opt/homebrew//Cellar/libusb
/opt/homebrew//Cellar/libusb/1.0.26/.brew/libusb.rb
/opt/homebrew//Cellar/libusb/1.0.26/include/libusb-1.0
/opt/homebrew//Cellar/libusb/1.0.26/include/libusb-1.0/libusb.h
/opt/homebrew//Cellar/libusb/1.0.26/lib/pkgconfig/libusb-1.0.pc
/opt/homebrew//Cellar/libusb/1.0.26/lib/libusb-1.0.dylib
/opt/homebrew//Cellar/libusb/1.0.26/lib/libusb-1.0.0.dylib
/opt/homebrew//Cellar/libusb/1.0.26/lib/libusb-1.0.a
/opt/homebrew//Cellar/libusb/1.0.26/share/libusb
/opt/homebrew//Cellar/libusb/1.0.26/share/libusb/examples/testlibusb.c
/opt/homebrew//share/libusb

/usr/local/MacGPG2/include also has one:

$ find /usr/local -iname "*libusb*"
/usr/local/MacGPG2/include/libusb-1.0
/usr/local/MacGPG2/include/libusb-1.0/libusb.h
/usr/local/MacGPG2/lib/libusb-1.0.dylib
/usr/local/MacGPG2/lib/libusb-1.0.0.dylib
  1. I'm wondering if there's some way the MacGPG2 copy of libusb.h is in the way?
  2. This seems like it should be fixable by setting some kind of env var when running cmake? CPPFLAGS or something? but alas i haven't actually written C++ in like, a very long time, and i've never had to deal w/cmake.

@ihatecascardo
Copy link

I ran into the same problem building the ubertooth-* tools regarding libusb-1.0.0. I edited /host/libubertooth/src/ubertooth_control.h file and provided an explicit path to my libusb. This seemed to work and the make install finished. Unfortunately when I tried to execute ubertooth-btle it errored with this

dyld[36380]: Library not loaded: libubertooth.1.dylib Referenced from: <C557E36A-C2A9-3B94-9918-28ED42DA88AB> /usr/local/bin/ubertooth-btle Reason: tried: 'libubertooth.1.dylib' (no such file)....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants