undreamai / LlamaLib

MIT License
9 stars 1 forks source link

MacOS executable appears to be looking at the wrong location for dylib #6

Open dmitry-zaitsev opened 2 months ago

dmitry-zaitsev commented 2 months ago

When running:

./undreamai_server -h

I am getting this output:

dyld[71063]: Library not loaded: @rpath/libundreamai_macos-arm64-acc.dylib
  Referenced from: <02971BFB-67DD-3BF7-B76D-47EF05738393> /Users/dima/projects/llm-server/macos-arm64-acc/undreamai_server
  Reason: tried: '/Users/runner/work/LlamaLib/LlamaLib/build/libs/libundreamai_macos-arm64-acc.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/LlamaLib/LlamaLib/build/libs/libundreamai_macos-arm64-acc.dylib' (no such file), '/Users/runner/work/LlamaLib/LlamaLib/build/libs/libundreamai_macos-arm64-acc.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/LlamaLib/LlamaLib/build/libs/libundreamai_macos-arm64-acc.dylib' (no such file)
[1]    71063 abort      ./undreamai_server -m  --port 3001

The dylib file in question does exist at the current location, but apparently that is not where undreamai_server is checking for it. Looking at the paths in the error, I have a suspicion that the developer's or CI's working directory was somehow hardcoded in the output?

dmitry-zaitsev commented 2 months ago

For anyone running into the same problem (if it is not fixed by then), running this from the server's directory fixes the problem (as it adds the current dir to the lookup path):

export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:.

P.S. Thank you folks for the awesome project!

amakropoulos commented 2 months ago

Thanks for the issue, I'll look into it!