executorch icon indicating copy to clipboard operation
executorch copied to clipboard

Llama example build failure on MacOS

Open GregoryComer opened this issue 1 year ago • 1 comments

When building the llama_main target on MacOS, build fails with the following error:

[100%] Linking CXX executable llama_main
ld: warning: -s is obsolete
ld: unknown options: --gc-sections
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [llama_main] Error 1
make[1]: *** [CMakeFiles/llama_main.dir/all] Error 2

In the top-level CMakeLists.txt, the --gc-sections flag is conditionally excluded when building for apple (https://github.com/GregoryComer/executorch/blob/c69861ddcee5705d37e7d47e2cccdeac741c71e8/CMakeLists.txt#L510). We may just need to do the same thing in the Llama example?

GregoryComer avatar May 14 '24 14:05 GregoryComer

cc @cccclai - i also encountered this problem on my macbook pro laptop

mergennachin avatar May 14 '24 14:05 mergennachin

are there any solutions or workarounds for this? I am also getting this error when building for Mac

afwcole avatar Jun 06 '24 02:06 afwcole

Fixed in https://github.com/pytorch/executorch/pull/4473

cccclai avatar Jul 31 '24 19:07 cccclai