Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 35adcfd

Browse files
authored
Merge pull request #223 from mz2/fpic-fix
Fix CUDA linking error by ensuring -fPIC for position-independent code
2 parents de30f9c + 4cb3b97 commit 35adcfd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sys/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ fn main() {
175175

176176
if cfg!(feature = "cuda") {
177177
config.define("GGML_CUDA", "ON");
178+
config.define("CMAKE_POSITION_INDEPENDENT_CODE", "ON");
179+
config.define("CMAKE_CUDA_FLAGS", "-Xcompiler=-fPIC");
178180
}
179181

180182
if cfg!(feature = "hipblas") {

0 commit comments

Comments
 (0)