Skip to content

Commit

Permalink
Build LLVMAarch64CodeGen if CMAKE_OSX_ARCHITECTURES is arm64. (#4637)
Browse files Browse the repository at this point in the history
I'm trying to make arm64 Triton builds work. I've found that on my
machine, everything works if I make this change and build with
CMAKE_OSX_ARCHITECTURES=arm64.
    
I'm not totally sure why this change is needed. From talking to chatgpt,
it should be sufficient to run the build with `arch -arm64`; that should
set CMAKE_SYSTEM_PROCESSOR. But...it doesn't. And you are not allowed to
override this variable from the command-line.
    
Anyway this seems to work, and who among us can say they truly
understand cmake?
  • Loading branch information
jlebar committed Sep 3, 2024
1 parent 15325e6 commit c2aee0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ if(TRITON_BUILD_PYTHON_MODULE)

)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR # Linux arm64
CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") # macOS arm64
CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" OR # macOS arm64
CMAKE_OSX_ARCHITECTURES MATCHES "arm64") # also macOS arm64
list(APPEND TRITON_LIBRARIES
LLVMAArch64CodeGen
LLVMAArch64AsmParser
Expand Down

0 comments on commit c2aee0d

Please sign in to comment.