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

libusb problem on M1 Mac #44

Open
etjensen opened this issue Apr 26, 2022 · 8 comments
Open

libusb problem on M1 Mac #44

etjensen opened this issue Apr 26, 2022 · 8 comments

Comments

@etjensen
Copy link

I cannot build the library on an M1 Mac- ./configure gives an error:

checking operating system... arm-apple-darwin21.4.0
 Mac OS X
checking for libusb_init in -lusb-1.0... no

  Library libusb-1.0 was not found on this system.
  Please install it and re-run ./configure

even though I have installed libusb using homebrew and it claims that it is a universal build.

config.log says:
configure:16180: checking for libusb_init in -lusb-1.0 configure:16205: gcc -o conftest -O3 conftest.c -libusb-1.0 -framework IOKit -framework CoreFoundation >&5 ld: library not found for -libusb-1.0 clang: error: linker command failed with exit code 1 (use -v to see invocation) configure:16205: $? = 1 configure: failed program was: | /* confdefs.h */

The build on my x86 iMac seemed to work fine.

@jeffreyg3
Copy link

Hello,
unfortunately, uldaq is not currently compatible with MacBook Pro with M1 apple silicon.
At this time, I do not have a timeframe for when it will be.

Sorry for the inconvenience.

@jeffreyg3
Copy link

see also #43 #27

@jeffreyg3
Copy link

This worked for me:

Download the source from github.com:
https://github.com/libusb/libusb/releases/tag/v1.0.26

Build it in the standard way:

$ tar xvfj libusb-1.0.26.tar.bz2
$ cd libusb-1.0.26
$ ./configure
$ make
$ make check
$ sudo make install

Then you can continue on with uldaq installation at ./configure && make

@etjensen
Copy link
Author

etjensen commented May 3, 2022

Oddly I still get the same error on ./configure- possibly not connecting to the right "libusb"? I am stumped by this.
`checking how to hardcode library paths into programs... immediate
checking operating system... arm-apple-darwin21.4.0
Mac OS X
checking for libusb_init in -lusb-1.0... no

Library libusb-1.0 was not found on this system.
Please install it and re-run ./configure`

@jeffreyg3
Copy link

no promises but something else you could try, would be to install MacPorts
https://www.macports.org/install.php

While I was working on the solution on my MacBook Pro 14, I had installed this along the way.

@sbazaz
Copy link
Contributor

sbazaz commented May 3, 2022

@etjensen could you please check your /opt/homebrew/lib/ folder to see if the libusb-1.0.0.dylib file is installed there?

@jaschawilcox
Copy link

jaschawilcox commented Sep 5, 2023

I was able to get past this by adding some additional flags pointing directly at homebrew:
$./configure LDFLAGS="-L/opt/homebrew/lib" CPPFLAGS="-I/opt/homebrew/include"

Then we can make normally
$make

@larer
Copy link

larer commented Jul 9, 2024

Hi, I'm new here, so bear with me.
I have a Mac M2, with MacPorts, I got the same problem with configure complaining about libusb not being installed, which it was. I got past the configure problem by pointing the flags to MacPorts library:
./configure LDFLAGS="-L/opt/local/lib" CPPFLAGS="-I/opt/local/include"
Hope this helps someone.

Then I got some 27 warnings during
make
Most of them on "anonymous non-C-compatible type..." when void is used,
some other were "'kIOMasterPortDefault' is deprecated:" and "'sprintf' is deprecated:"

In summary I got it working and I can now collect data with my MCC USB-1808X, on my Mac.

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

5 participants