Skip to content

Commit

Permalink
build: Support for LLVM 19
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Gritz <lg@larrygritz.com>
  • Loading branch information
lgritz committed Sep 24, 2024
1 parent f8b8242 commit 568b66a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ NEW or CHANGED dependencies since the last major release are **bold**.
$OpenImageIO_ROOT/lib to be in your LD_LIBRARY_PATH (or
DYLD_LIBRARY_PATH on OS X).

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

* (optional) For GPU rendering on NVIDIA GPUs:
* [OptiX](https://developer.nvidia.com/rtx/ray-tracing/optix) 7.0 or higher.
Expand Down
11 changes: 6 additions & 5 deletions src/build-scripts/gh-installdeps.bash
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,15 @@ else
libtiff-dev libgif-dev libpng-dev \
flex bison libbison-dev \
libpugixml-dev \
libopencolorio-dev
libopencolorio-dev ${}

if [[ "${QT_VERSION:-5}" == "5" ]] ; then
time sudo apt-get -q install -y \
qt5-default || /bin/true
time sudo apt-get -q install -y qt5-default || /bin/true
elif [[ "${QT_VERSION}" == "6" ]] ; then
time sudo apt-get -q install -y \
qt6-base-dev || /bin/true
time sudo apt-get -q install -y qt6-base-dev || /bin/true
fi
if [[ "${EXTRA_DEP_PACKAGES}" != "" ]] ; then
time sudo apt-get -q install -y ${EXTRA_DEP_PACKAGES}
fi

export CMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu:$CMAKE_PREFIX_PATH
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/externalpackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ checked_find_package (pugixml REQUIRED
# LLVM library setup
checked_find_package (LLVM REQUIRED
VERSION_MIN 9.0
VERSION_MAX 18.9
VERSION_MAX 19.9
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES)
# ensure include directory is added (in case of non-standard locations
include_directories (BEFORE SYSTEM "${LLVM_INCLUDES}")
Expand Down
1 change: 1 addition & 0 deletions src/liboslexec/llvm_passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Instruction.h>
#include <llvm/IR/Instructions.h>
#include <llvm/IR/Module.h>
#include <llvm/IR/PassManager.h>
#include <llvm/IR/Type.h>
#include <llvm/Pass.h>
Expand Down
13 changes: 10 additions & 3 deletions src/liboslexec/llvm_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,12 @@ static llvm::StringMap<bool> sCpuFeatures;
static bool
populateCpuFeatures()
{
#if OSL_LLVM_VERSION >= 190
sCpuFeatures = llvm::sys::getHostCPUFeatures();
return true;
#else
return llvm::sys::getHostCPUFeatures(sCpuFeatures);
#endif
}


Expand Down Expand Up @@ -1551,10 +1556,12 @@ LLVM_Util::make_jit_execengine(std::string* err, TargetISA requestedISA,
#if OSL_LLVM_VERSION < 120
options.StackAlignmentOverride = 0;
#endif
options.FunctionSections = true;
options.UseInitArray = false;
options.FloatABIType = llvm::FloatABI::Default;
options.FunctionSections = true;
options.UseInitArray = false;
options.FloatABIType = llvm::FloatABI::Default;
#if OSL_LLVM_VERSION < 190
options.RelaxELFRelocations = false;
#endif
//options.DebuggerTuning = llvm::DebuggerKind::GDB;

// TODO: Find equivalent function for PrintMachineCode post LLVM 12
Expand Down

0 comments on commit 568b66a

Please sign in to comment.