Skip to content

Commit f365786

Browse files
committed
build: Support for LLVM 19 (#1873)
Signed-off-by: Larry Gritz <[email protected]>
1 parent 96054e2 commit f365786

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ NEW or CHANGED dependencies since the last major release are **bold**.
4747
$OpenImageIO_ROOT/lib to be in your LD_LIBRARY_PATH (or
4848
DYLD_LIBRARY_PATH on OS X).
4949

50-
* [LLVM](http://www.llvm.org) 9, 10, 11, 12, 13, 14, 15, 16, 17, or 18, including
51-
clang libraries.
50+
* [LLVM](http://www.llvm.org) 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, or 19,
51+
including clang libraries.
5252

5353
* (optional) For GPU rendering on NVIDIA GPUs:
5454
* [OptiX](https://developer.nvidia.com/rtx/ray-tracing/optix) 7.0 or higher.

src/build-scripts/gh-installdeps.bash

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,12 @@ else
9595
libopencolorio-dev
9696

9797
if [[ "${QT_VERSION:-5}" == "5" ]] ; then
98-
time sudo apt-get -q install -y \
99-
qt5-default || /bin/true
98+
time sudo apt-get -q install -y qt5-default || /bin/true
10099
elif [[ "${QT_VERSION}" == "6" ]] ; then
101-
time sudo apt-get -q install -y \
102-
qt6-base-dev || /bin/true
100+
time sudo apt-get -q install -y qt6-base-dev || /bin/true
101+
fi
102+
if [[ "${EXTRA_DEP_PACKAGES}" != "" ]] ; then
103+
time sudo apt-get -q install -y ${EXTRA_DEP_PACKAGES}
103104
fi
104105

105106
export CMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu:$CMAKE_PREFIX_PATH

src/cmake/externalpackages.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ checked_find_package (pugixml REQUIRED
117117
# LLVM library setup
118118
checked_find_package (LLVM REQUIRED
119119
VERSION_MIN 9.0
120-
VERSION_MAX 18.9
120+
VERSION_MAX 19.9
121121
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES)
122122
# ensure include directory is added (in case of non-standard locations
123123
include_directories (BEFORE SYSTEM "${LLVM_INCLUDES}")

src/liboslexec/llvm_passes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <llvm/IR/IRBuilder.h>
1313
#include <llvm/IR/Instruction.h>
1414
#include <llvm/IR/Instructions.h>
15+
#include <llvm/IR/Module.h>
1516
#include <llvm/IR/PassManager.h>
1617
#include <llvm/IR/Type.h>
1718
#include <llvm/Pass.h>

src/liboslexec/llvm_util.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,12 @@ static llvm::StringMap<bool> sCpuFeatures;
11661166
static bool
11671167
populateCpuFeatures()
11681168
{
1169+
#if OSL_LLVM_VERSION >= 190
1170+
sCpuFeatures = llvm::sys::getHostCPUFeatures();
1171+
return true;
1172+
#else
11691173
return llvm::sys::getHostCPUFeatures(sCpuFeatures);
1174+
#endif
11701175
}
11711176

11721177

@@ -1294,6 +1299,7 @@ static cspan<const char*>
12941299
get_required_cpu_features_for(TargetISA target)
12951300
{
12961301
switch (target) {
1302+
case TargetISA::UNKNOWN:
12971303
case TargetISA::NONE: return {};
12981304
case TargetISA::x64: return required_cpu_features_by_x64;
12991305
case TargetISA::SSE4_2: return required_cpu_features_by_SSE4_2;
@@ -1544,10 +1550,12 @@ LLVM_Util::make_jit_execengine(std::string* err, TargetISA requestedISA,
15441550
#if OSL_LLVM_VERSION < 120
15451551
options.StackAlignmentOverride = 0;
15461552
#endif
1547-
options.FunctionSections = true;
1548-
options.UseInitArray = false;
1549-
options.FloatABIType = llvm::FloatABI::Default;
1553+
options.FunctionSections = true;
1554+
options.UseInitArray = false;
1555+
options.FloatABIType = llvm::FloatABI::Default;
1556+
#if OSL_LLVM_VERSION < 190
15501557
options.RelaxELFRelocations = false;
1558+
#endif
15511559
//options.DebuggerTuning = llvm::DebuggerKind::GDB;
15521560

15531561
// TODO: Find equivalent function for PrintMachineCode post LLVM 12

0 commit comments

Comments
 (0)