Skip to content

Commit c048a33

Browse files
authored
build: Fix libclang link order (#1946)
Apparently, in LLVM 18, some things shifted between libraries and that requires a slightly different link order. But only on Linux, or maybe only with static libraries, so even though our Mac and Windows CI tests have used LLVM 18, it wasn't symptomatic there. We didn't discover this earlier because we didn't actually test against LLVM 18 on any of the Linux CI runs. So we add that. Also, to alleviate the pain in adjusting LLVM versions and often needing to modify our build_llvm.bash script, I'm trying out a GHA marketplace action KyleMayes/install-llvm-action, and it works well and saved me time, so we may switch to that for other cases over time as well. Signed-off-by: Larry Gritz <[email protected]>
1 parent 6cfa972 commit c048a33

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

.github/workflows/build-steps.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ on:
4444
type: string
4545
python_ver:
4646
type: string
47+
llvm_action_ver:
48+
type: string
4749
setenvs:
4850
type: string
4951
simd:
@@ -125,6 +127,11 @@ jobs:
125127
run: |
126128
${{inputs.setenvs}}
127129
src/build-scripts/ci-startup.bash
130+
- name: Install LLVM and Clang
131+
if: inputs.llvm_action_ver != ''
132+
uses: KyleMayes/install-llvm-action@e0a8dc9cb8a22e8a7696e8a91a4e9581bec13181 # v2.0.5
133+
with:
134+
version: ${{ inputs.llvm_action_ver }}
128135
- name: Dependencies
129136
shell: bash
130137
run: |

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ jobs:
234234
ctest_test_timeout: ${{ matrix.ctest_test_timeout || '800' }}
235235
coverage: ${{ matrix.coverage || 0 }}
236236
sonar: ${{ matrix.sonar || 0 }}
237+
llvm_action_ver: ${{ matrix.llvm_action_ver }}
237238
strategy:
238239
fail-fast: false
239240
matrix:
@@ -438,11 +439,10 @@ jobs:
438439
openimageio_ver: main
439440
pybind11_ver: master
440441
python_ver: "3.12"
442+
llvm_action_ver: "18.1.7"
441443
simd: avx2,f16c
442444
batched: b8_AVX2,b8_AVX512,b16_AVX512
443-
setenvs: export LLVM_VERSION=17.0.6
444-
LLVM_DISTRO_NAME=ubuntu-22.04
445-
PUGIXML_VERSION=master
445+
setenvs: export PUGIXML_VERSION=master
446446
- desc: clang14/C++17 llvm14 py3.10 avx2 batch-b16avx512
447447
nametag: linux-latest-releases-clang
448448
runner: ubuntu-22.04

src/build-scripts/gh-installdeps.bash

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ else
132132
set +e; source /opt/intel/oneapi/setvars.sh --config oneapi_2022.1.0.cfg; set -e
133133
fi
134134

135-
source src/build-scripts/build_llvm.bash
135+
if [[ "$LLVM_VERSION" != "" ]] ; then
136+
source src/build-scripts/build_llvm.bash
137+
fi
136138
fi
137139

138140
if [[ "$CMAKE_VERSION" != "" ]] ; then

src/cmake/externalpackages.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ checked_find_package (pugixml REQUIRED
5959
checked_find_package (LLVM REQUIRED
6060
VERSION_MIN 11.0
6161
VERSION_MAX 19.9
62-
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES)
62+
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES
63+
LLVM_SHARED_MODE)
6364
# ensure include directory is added (in case of non-standard locations
6465
include_directories (BEFORE SYSTEM "${LLVM_INCLUDES}")
6566
link_directories ("${LLVM_LIB_DIR}")

src/cmake/modules/FindLLVM.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ endif ()
115115

116116
foreach (COMPONENT clangFrontend clangDriver clangSerialization
117117
clangParse clangSema clangAnalysis clangAST
118-
clangASTMatchers clangBasic clangEdit clangLex
119-
clangSupport clangAPINotes)
118+
clangASTMatchers clangEdit clangLex
119+
clangSupport clangAPINotes clangBasic)
120120
find_library ( _CLANG_${COMPONENT}_LIBRARY
121121
NAMES ${COMPONENT}
122122
PATHS ${LLVM_LIB_DIR}

0 commit comments

Comments
 (0)