Skip to content

Commit 9d912dc

Browse files
committed
Add support for GCC 15 by disabling AVX10.2 target in Highway
1 parent 2760524 commit 9d912dc

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ endif()
3939
FetchContent_Declare(highway GIT_REPOSITORY https://github.com/google/highway.git GIT_TAG c971dbe61bd2751923e3458666450bf95dfbbd98 EXCLUDE_FROM_ALL)
4040
FetchContent_MakeAvailable(highway)
4141

42+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
43+
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
44+
# Gemma does not currently use AVX10.2-specific Highway paths, and GCC 15
45+
# builds in CI can reject Highway's AVX10.2 target attribute.
46+
target_compile_definitions(hwy PUBLIC HWY_DISABLED_TARGETS=HWY_AVX10_2)
47+
endif()
48+
4249
## Note: absl needs to be installed by sentencepiece. This will only happen if
4350
## cmake is invoked with -DSPM_ENABLE_SHARED=OFF and -DSPM_ABSL_PROVIDER=module
4451
FetchContent_Declare(sentencepiece GIT_REPOSITORY https://github.com/google/sentencepiece GIT_TAG 9045b2f60fa2b323dfac0eaef8fc17565036f9f9 EXCLUDE_FROM_ALL)

examples/hello_world/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
2020
include(FetchContent)
2121
FetchContent_Declare(highway GIT_REPOSITORY https://github.com/google/highway.git GIT_TAG c971dbe61bd2751923e3458666450bf95dfbbd98)
2222
FetchContent_MakeAvailable(highway)
23+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
24+
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
25+
target_compile_definitions(hwy PUBLIC HWY_DISABLED_TARGETS=HWY_AVX10_2)
26+
endif()
2327
FetchContent_Declare(sentencepiece GIT_REPOSITORY https://github.com/google/sentencepiece GIT_TAG 9045b2f60fa2b323dfac0eaef8fc17565036f9f9)
2428
FetchContent_MakeAvailable(sentencepiece)
2529

examples/simplified_gemma/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
2020
include(FetchContent)
2121
FetchContent_Declare(highway GIT_REPOSITORY https://github.com/google/highway.git GIT_TAG c971dbe61bd2751923e3458666450bf95dfbbd98)
2222
FetchContent_MakeAvailable(highway)
23+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
24+
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15)
25+
target_compile_definitions(hwy PUBLIC HWY_DISABLED_TARGETS=HWY_AVX10_2)
26+
endif()
2327
FetchContent_Declare(sentencepiece GIT_REPOSITORY https://github.com/google/sentencepiece GIT_TAG 9045b2f60fa2b323dfac0eaef8fc17565036f9f9)
2428
FetchContent_MakeAvailable(sentencepiece)
2529

0 commit comments

Comments
 (0)