Skip to content

Commit 928fdb3

Browse files
committed
[native] Switch to use Clang for the Linux debug build in the CI
Using GCC12.1 results in consuming more disk space than available in the github runners. Tests show that Clang debug builds generate much smaller libraries for the velox submodule - around 12GB+ vs 7.4G. And for presto itself it is 3GB vs 1.6GB.
1 parent a8a6ffd commit 928fdb3

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

.github/workflows/prestocpp-linux-build.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
image: prestodb/presto-native-dependency:0.291-20250108164449-87d82ed
1515
env:
1616
CCACHE_DIR: "${{ github.workspace }}/ccache"
17+
CC: /usr/bin/clang-15
18+
CXX: /usr/bin/clang++-15
1719
steps:
1820
- uses: actions/checkout@v4
1921

@@ -49,9 +51,12 @@ jobs:
4951
- name: Disk space consumption before build
5052
run: df
5153

54+
- name: Install Clang
55+
run: |
56+
presto-native-execution/velox/scripts/setup-centos9.sh install_clang15
57+
5258
- name: Build engine
5359
run: |
54-
source /opt/rh/gcc-toolset-12/enable
5560
cd presto-native-execution
5661
cmake \
5762
-B _build/debug \

presto-native-execution/presto_cpp/main/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ add_executable(presto_server PrestoMain.cpp)
107107
target_link_libraries(presto_server presto_server_lib velox_hive_connector
108108
velox_tpch_connector)
109109

110+
# Clang requires explicit linking with libatomic.
111+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
112+
AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL 15)
113+
target_link_libraries(presto_server atomic)
114+
endif()
115+
110116
if(PRESTO_ENABLE_REMOTE_FUNCTIONS)
111117
add_library(presto_server_remote_function JsonSignatureParser.cpp
112118
RemoteFunctionRegisterer.cpp)

presto-native-execution/presto_cpp/main/tests/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ target_link_libraries(
5353
GTest::gtest
5454
GTest::gtest_main)
5555

56+
# Clang requires explicit linking with libatomic.
57+
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
58+
AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL 15)
59+
target_link_libraries(presto_server_test atomic)
60+
endif()
61+
5662
set_property(TARGET presto_server_test PROPERTY JOB_POOL_LINK
5763
presto_link_job_pool)
5864

0 commit comments

Comments
 (0)