fix: pre-set CMAKE_HIP_COMPILER="" for CPU build to prevent HIP detection
This commit is contained in:
@@ -42,12 +42,13 @@ ENV CMAKE_GENERATOR=Ninja
|
||||
ENV LDFLAGS=-s
|
||||
|
||||
# Step 1: Build CPU backends with GCC (no ROCm preset)
|
||||
# Remove /opt/rocm from PATH to prevent check_language(HIP) from
|
||||
# finding a HIP compiler, which would trigger the HIP block that
|
||||
# requires find_package(hip) with proper CMAKE_PREFIX_PATH.
|
||||
# Pre-set CMAKE_HIP_COMPILER="" to prevent check_language(HIP) from
|
||||
# finding a HIP compiler (it searches /opt/rocm even without PATH).
|
||||
# Remove /opt/rocm from PATH to prevent find_program from finding hipcc.
|
||||
RUN mkdir -p build-cpu && cd build-cpu && \
|
||||
PATH=/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release && \
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_HIP_COMPILER="" && \
|
||||
cmake --build . --target ggml-cpu -- -l $(nproc) && \
|
||||
cmake --install . --component CPU --strip --prefix /build/dist
|
||||
|
||||
|
||||
Reference in New Issue
Block a user