uldaq icon indicating copy to clipboard operation
uldaq copied to clipboard

libusb problem on M1 Mac

Open etjensen opened this issue 2 years ago • 8 comments

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.

etjensen avatar Apr 26 '22 02:04 etjensen

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 avatar Apr 26 '22 12:04 jeffreyg3

see also #43 #27

jeffreyg3 avatar Apr 26 '22 12:04 jeffreyg3

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

jeffreyg3 avatar May 02 '22 19:05 jeffreyg3

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`

etjensen avatar May 03 '22 03:05 etjensen

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.

jeffreyg3 avatar May 03 '22 12:05 jeffreyg3

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

sbazaz avatar May 03 '22 12:05 sbazaz

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

jaschawilcox avatar Sep 05 '23 06:09 jaschawilcox