edgenai / edgen

⚡ Edgen: Local, private GenAI server alternative to OpenAI. No GPU required. Run AI models locally: LLMs (Llama2, Mistral, Mixtral...), Speech-to-text (whisper) and many others.
https://docs.edgen.co/
Apache License 2.0
328 stars 15 forks source link

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

Closed a-rbts closed 7 months ago

a-rbts commented 7 months ago

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 commented 7 months ago

What error shows up when you set OBJCOPY_PATH?

a-rbts commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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

a-rbts commented 7 months ago

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

bruceunx commented 6 months ago

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