From 6237498297cb8228744049806ee4510fc79d3975 Mon Sep 17 00:00:00 2001 From: Shang Chieh Tseng Date: Sat, 8 Nov 2025 21:20:26 +0800 Subject: [PATCH] Fix Makefile to use custom-built GCC 10 instead of non-existent gcc-toolset-10 - Replace 'scl enable gcc-toolset-10' with 'bash -l' (login shell) - Login shell sources /etc/profile.d/cuda-11.4.sh and go.sh for PATH - Explicitly set CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ (custom-built GCC 10) - Fix run-cmake, run-build, run-go-build, and shell targets - Enables CMake to find nvcc and use correct compiler toolchain --- docker/Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index 3ac0d5ed..55156bee 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -122,19 +122,19 @@ copy-source: start-builder run-cmake: copy-source @echo "→ Running CMake configuration (preset: $(CMAKE_PRESET))..." @docker exec -w /usr/local/src/ollama37 $(CONTAINER_NAME) \ - scl enable gcc-toolset-10 -- bash -c 'cmake --preset "$(CMAKE_PRESET)"' + bash -l -c 'CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ cmake --preset "$(CMAKE_PRESET)"' # Run CMake build (C/C++/CUDA compilation) run-build: run-cmake @echo "→ Building C/C++/CUDA libraries (using $(NPROC) cores)..." @docker exec -w /usr/local/src/ollama37 $(CONTAINER_NAME) \ - scl enable gcc-toolset-10 -- bash -c 'cmake --build build -j$(NPROC)' + bash -l -c 'CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ cmake --build build -j$(NPROC)' # Run Go build run-go-build: run-build @echo "→ Building Go binary..." @docker exec -w /usr/local/src/ollama37 $(CONTAINER_NAME) \ - scl enable gcc-toolset-10 -- bash -c 'go build -o ollama .' + bash -l -c 'go build -o ollama .' # Copy build artifacts from container to host copy-artifacts: run-go-build @@ -153,8 +153,7 @@ copy-artifacts: run-go-build # Open an interactive shell in the builder container shell: start-builder @echo "→ Opening shell in builder container..." - @docker exec -it -w /usr/local/src/ollama37 $(CONTAINER_NAME) \ - scl enable gcc-toolset-10 -- bash + @docker exec -it -w /usr/local/src/ollama37 $(CONTAINER_NAME) bash -l # Test the built binary test: build