"tests/git@developer.sourcefind.cn:OpenDAS/mmcv.git" did not exist on "519b4ec028bdf2cc4ec32195fb78e6111774a004"
Commit ddbfa6fe authored by Daniel Hiltgen's avatar Daniel Hiltgen
Browse files

Fix CPU only builds

Go embed doesn't like when there's no matching files, so put
a dummy placeholder in to allow building without any GPU support
If no "server" library is found, it's safely ignored at runtime.
parent c7ea8f23
...@@ -35,6 +35,9 @@ BUILD_DIR="gguf/build/linux/cpu" ...@@ -35,6 +35,9 @@ BUILD_DIR="gguf/build/linux/cpu"
build build
install install
# Placeholder to keep go embed happy until we start building dynamic CPU lib variants
touch ${BUILD_DIR}/lib/dummy.so
if [ -d /usr/local/cuda/lib64/ ]; then if [ -d /usr/local/cuda/lib64/ ]; then
echo "CUDA libraries detected - building dynamic CUDA library" echo "CUDA libraries detected - building dynamic CUDA library"
init_vars init_vars
......
...@@ -147,9 +147,9 @@ func extractDynamicLibs(workDir, glob string) ([]string, error) { ...@@ -147,9 +147,9 @@ func extractDynamicLibs(workDir, glob string) ([]string, error) {
if err != nil || len(files) == 0 { if err != nil || len(files) == 0 {
return nil, payloadMissing return nil, payloadMissing
} }
libs := make([]string, len(files)) libs := []string{}
for i, file := range files { for _, file := range files {
pathComps := strings.Split(file, "/") pathComps := strings.Split(file, "/")
if len(pathComps) != 7 { if len(pathComps) != 7 {
log.Printf("unexpected payload components: %v", pathComps) log.Printf("unexpected payload components: %v", pathComps)
...@@ -169,7 +169,7 @@ func extractDynamicLibs(workDir, glob string) ([]string, error) { ...@@ -169,7 +169,7 @@ func extractDynamicLibs(workDir, glob string) ([]string, error) {
destFile := filepath.Join(targetDir, filepath.Base(file)) destFile := filepath.Join(targetDir, filepath.Base(file))
if strings.Contains(destFile, "server") { if strings.Contains(destFile, "server") {
libs[i] = destFile libs = append(libs, destFile)
} }
_, err = os.Stat(destFile) _, err = os.Stat(destFile)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment