mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-12 16:57:04 +00:00
Build multiple CPU variants and pick the best
This reduces the built-in linux version to not use any vector extensions which enables the resulting builds to run under Rosetta on MacOS in Docker. Then at runtime it checks for the actual CPU vector extensions and loads the best CPU library available
This commit is contained in:
@@ -11,13 +11,13 @@ import (
|
||||
var libEmbed embed.FS
|
||||
|
||||
func updatePath(dir string) {
|
||||
pathComponents := strings.Split(os.Getenv("PATH"), ":")
|
||||
pathComponents := strings.Split(os.Getenv("LD_LIBRARY_PATH"), ":")
|
||||
for _, comp := range pathComponents {
|
||||
if comp == dir {
|
||||
return
|
||||
}
|
||||
}
|
||||
newPath := strings.Join(append(pathComponents, dir), ":")
|
||||
log.Printf("Updating PATH to %s", newPath)
|
||||
os.Setenv("PATH", newPath)
|
||||
newPath := strings.Join(append([]string{dir}, pathComponents...), ":")
|
||||
log.Printf("Updating LD_LIBRARY_PATH to %s", newPath)
|
||||
os.Setenv("LD_LIBRARY_PATH", newPath)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user