-
Notifications
You must be signed in to change notification settings - Fork 301
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
macOS "building for macOS-x86_64 but attempting to link with file built for unknown-arm64" #223
Comments
Hi @rajrana22, It sounds like you built objects to one target arch (x86_64) and are trying to force link the library to another (arm64). I would suggest you do all testing with a single target first. Perhaps you did some override to force a cross macOS-x86_64 CFLAGS to the compiler but the corresponding args didn't get passed to the linker. |
Thanks for the quick reply, @gbtucker. Unfortunately, I'm not very well-versed in compilers/architectures. Luckily, for the time being, I am working on a separate server that runs CentOS, and I am able to get my work done there for now. While there is no rush, I would still like to get back to working on my own MacBook. Do you know how/where I can check for something that might have messed with the compiler? |
Could you report the steps you took to setup and build? On an x86_64 mac it used to be pretty simple. You can even use brew now to install isa-l on mac but the formula is only x86_64 for now. |
I already had nasm installed, so I just used Autotools to build and install as mentioned in the README:
|
So you are building for x86_64 on the M1 chip, which is arm64. The errors suggest that it tries to build for x86_64 but instead finds all these files that are compiled for arm64. The compiler selects the native arm64 architecture by default (which is reasonable). So I guess you could cross-compile to x86_64 by setting the correct compile flags?
That makes it very confusing. The Apple M1 chip shouldn't be able to succesfully compile ISA-L (the PR #164 is not merged yet), unless it is cross-compiling for x86_64. I have no clue why it would be able to compile before. |
@rhpvorderman Thank you so much! Your reply got me thinking and I found a solution. The issue was indeed what you were talking about, and I noticed that while in my regular terminal the output of The solution was to run the following command: However, I'm still having issues. When I run
This error seems identical to one referenced in issue 86, but I'm not sure if a solution was mentioned. |
Disclaimer: I am not affiliated with this project, I am just a user like you. Due to my work on python-isal I have experience compiling ISA-L on multiple platforms, but M1 macs are not one of them. I do not own the hardware so I cannot test on it. Take a look at #164. You might be able to get that branch working. If not, I am sure the contributors of that branch would appreciate the feedback. |
I was recently working on an erasure coding project that was based on this ISA-L library. Everything was going fine, and I was just debugging for a while and then I left the project for about one day. Then the next day when I got back to it I ran into the error listed below. I hadn't made any changes to the code or to my Mac that I know of between the time I was off.
So I tried to start simple so I cloned the original ISA-L library again and tried to build again. Then, when I ran
make
I got the same errors again.I'm running on macOS Monterey 12.5 with the M1 Apple chip.
Here is the full display of the error message:
I have tried multiple solutions online, but none of them seem to work. Does anybody know how to fix this issue?
The text was updated successfully, but these errors were encountered: