Skip to content

Commit 35a4ef8

Browse files
authored
build: Support for LLVM 19 (#1873)
Signed-off-by: Larry Gritz <[email protected]>
1 parent d8c6f9a commit 35a4ef8

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
@@ -94,11 +94,12 @@ else
9494
libopencolorio-dev
9595

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

104105
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
@@ -58,7 +58,7 @@ checked_find_package (pugixml REQUIRED
5858
# LLVM library setup
5959
checked_find_package (LLVM REQUIRED
6060
VERSION_MIN 9.0
61-
VERSION_MAX 18.9
61+
VERSION_MAX 19.9
6262
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES)
6363
# ensure include directory is added (in case of non-standard locations
6464
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
@@ -1173,7 +1173,12 @@ static llvm::StringMap<bool> sCpuFeatures;
11731173
static bool
11741174
populateCpuFeatures()
11751175
{
1176+
#if OSL_LLVM_VERSION >= 190
1177+
sCpuFeatures = llvm::sys::getHostCPUFeatures();
1178+
return true;
1179+
#else
11761180
return llvm::sys::getHostCPUFeatures(sCpuFeatures);
1181+
#endif
11771182
}
11781183

11791184

@@ -1301,6 +1306,7 @@ static cspan<const char*>
13011306
get_required_cpu_features_for(TargetISA target)
13021307
{
13031308
switch (target) {
1309+
case TargetISA::UNKNOWN:
13041310
case TargetISA::NONE: return {};
13051311
case TargetISA::x64: return required_cpu_features_by_x64;
13061312
case TargetISA::SSE4_2: return required_cpu_features_by_SSE4_2;
@@ -1551,10 +1557,12 @@ LLVM_Util::make_jit_execengine(std::string* err, TargetISA requestedISA,
15511557
#if OSL_LLVM_VERSION < 120
15521558
options.StackAlignmentOverride = 0;
15531559
#endif
1554-
options.FunctionSections = true;
1555-
options.UseInitArray = false;
1556-
options.FloatABIType = llvm::FloatABI::Default;
1560+
options.FunctionSections = true;
1561+
options.UseInitArray = false;
1562+
options.FloatABIType = llvm::FloatABI::Default;
1563+
#if OSL_LLVM_VERSION < 190
15571564
options.RelaxELFRelocations = false;
1565+
#endif
15581566
//options.DebuggerTuning = llvm::DebuggerKind::GDB;
15591567

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

0 commit comments

Comments
 (0)