Skip to content

Commit

Permalink
[cpu] Make runtime library build on Linux too (#75)
Browse files Browse the repository at this point in the history
macOS gcc supports `-rpath` directly in the compilation driver, but on
Linux we need to pass it directly to the linker. Fortunately this works
on macOS too.
  • Loading branch information
int3 authored Jul 25, 2024
1 parent cc65f44 commit 932383c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/triton/runtime/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _build(name, src, srcdir, library_dirs, include_dirs, libraries):
cc_cmd += [f"-L{dir}" for dir in library_dirs]
cc_cmd += [f"-I{dir}" for dir in include_dirs]
for dir in library_dirs:
cc_cmd.extend(["-rpath", dir])
cc_cmd.extend(["-Wl,-rpath", dir])
# CPU backend uses C++ (driver.cpp). Some old version compilers need a specific C++17 flag.
if src.endswith(".cpp") or src.endswith(".cc"):
cc_cmd += ["-std=c++17", "-fopenmp"]
Expand Down

0 comments on commit 932383c

Please sign in to comment.