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

Failure to build on MacOS due to missing objectcopy. #59

Closed
a-rbts opened this issue Feb 13, 2024 · 6 comments
Closed

Failure to build on MacOS due to missing objectcopy. #59

a-rbts opened this issue Feb 13, 2024 · 6 comments

Comments

@a-rbts
Copy link

a-rbts commented Feb 13, 2024

Despite binutils installed, the compilation on macos fails with objectcopy not found. Setting the path specifically as suggested doesn't seem to help either.

  Looking for "objcopy" or an equivalent tool

  --- stderr
  thread 'main' panicked at /Users/evariste/.cargo/git/checkouts/llama_cpp-rs-b9d51cabb4b43824/bc38e77/crates/llama_cpp_sys/build.rs:521:54:
  No suitable tool equivalent to "objcopy" has been found in PATH, if one is already installed, either add it to PATH or set OBJCOPY_PATH to its full path
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@pedro-devv
Copy link
Contributor

What error shows up when you set OBJCOPY_PATH?

@a-rbts
Copy link
Author

a-rbts commented Feb 13, 2024

It cannot execute it. I don't think objcopy is meant to be used in the macos process.

  --- stderr
  /Users/evariste/usr/bin/objcopy: /Users/evariste/usr/bin/objcopy: cannot execute binary file
  thread 'main' panicked at /Users/evariste/.cargo/git/checkouts/llama_cpp-rs-b9d51cabb4b43824/bc38e77/crates/llama_cpp_sys/build.rs:418:13:
  An error as occurred while modifying global symbols from library file (exit status: 126)

@pedro-devv
Copy link
Contributor

I see, you might be right about binutils's objcopy on MacOS, I'll have to change the error message depending on OS. Try installing a recent version LLVM and using llvm-objcopy, that should work.

@a-rbts
Copy link
Author

a-rbts commented Feb 13, 2024

Setting OBJCOPY_PATH to the full llvm-objcopy binary fixes the compilation errors. Thanks

@a-rbts a-rbts closed this as completed Feb 13, 2024
@a-rbts
Copy link
Author

a-rbts commented Feb 13, 2024

Setting OBJCOPY_PATH to the full llvm-objcopy binary fixes the compilation errors. Thanks!

@bruceunx
Copy link

Same problem with macos + m2 chip, just brew install llvm and add path to environment to fix problem.

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

3 participants