mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-28 06:25:00 +00:00
feat(arm64): enable single-binary builds (#2490)
* ci: try to build for arm64 Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Allow to skip hipblas on make dist Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * use arm64 cross compiler Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * correctly target go arm64 Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * create a separate target Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * cross-compile grpc Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Add Protobuf include dirs Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * temp disable CUDA build Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * aarch64 builds: Reduce backends Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Even less backends Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Even less backends Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * feat(startup): allow to load libs from extracted assets Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * makefile: set arch Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
88af1033d6
commit
6c087ae743
3 changed files with 131 additions and 1 deletions
|
@ -51,5 +51,25 @@ func ExtractFiles(content embed.FS, extractDir string) error {
|
|||
return nil
|
||||
})
|
||||
|
||||
// If there is a lib directory, set LD_LIBRARY_PATH to include it
|
||||
// we might use this mechanism to carry over e.g. Nvidia CUDA libraries
|
||||
// from the embedded FS to the target directory
|
||||
|
||||
// Skip this if LOCALAI_SKIP_LD_LIBRARY_PATH is set
|
||||
if os.Getenv("LOCALAI_SKIP_LD_LIBRARY_PATH") != "" {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, libDir := range []string{filepath.Join(extractDir, "backend_assets", "lib"), filepath.Join(extractDir, "lib")} {
|
||||
if _, err := os.Stat(libDir); err == nil {
|
||||
ldLibraryPath := os.Getenv("LD_LIBRARY_PATH")
|
||||
if ldLibraryPath == "" {
|
||||
ldLibraryPath = libDir
|
||||
} else {
|
||||
ldLibraryPath = fmt.Sprintf("%s:%s", ldLibraryPath, libDir)
|
||||
}
|
||||
os.Setenv("LD_LIBRARY_PATH", ldLibraryPath)
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue