Having trouble building on M1 arm64 from MacOS build script

1,134 views
Skip to first unread message

Whigmal Whim

unread,
Jul 17, 2021, 8:33:09 PM7/17/21
to psmove

Hello,

I installed the most recent libusb from brew and disabled C tests via the cmake before the build.

I also modified the Mac build script so it should, *theoretically* , builds the universal binary version by using both flags: export ARCHFLAGS='-arch x86_64 -arch arm64'  and     -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"  when needed.

However I still get stuck with this error:

ld: warning: ignoring file /opt/homebrew/lib/libusb-1.0.a, building for macOS-x86_64 but attempting to link with file built for macOS-arm64


Alexander Nitsch

unread,
Jul 19, 2021, 6:20:54 PM7/19/21
to psm...@googlegroups.com
> I installed the most recent libusb from brew and disabled C tests via the
> cmake before the build.
>
> I also modified the Mac build script so it should, *theoretically* , builds
> the universal binary version by using both flags: *export ARCHFLAGS='-arch
> x86_64 -arch arm64' * and *-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"*
> when needed.
>
> However I still get stuck with this error:
>
> *ld: warning: ignoring file /opt/homebrew/lib/libusb-1.0.a, building for
> macOS-x86_64 but attempting to link with file built for macOS-arm64*

Unforunately, I cannot help you with issues on the Mac, but there is a
very similar issue currently active on the project's GitHub page:

https://github.com/thp/psmoveapi/issues/440

Maybe you can join in there.

Whigmal Whim

unread,
Jul 21, 2021, 9:31:20 PM7/21/21
to psmove

Yes, I made that exact Github issue and figured I could get help here as well.

Thanks!
Reply all
Reply to author
Forward
0 new messages