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 a6dee84
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,10 @@ jobs:
python_ver: "3.10"
simd: avx2,f16c
batched: b8_AVX2,b8_AVX512,b16_AVX512
setenvs: export LLVM_VERSION=17.0.6
LLVM_DISTRO_NAME=ubuntu-22.04
setenvs: export LLVM_VERSION=18.1.8
xLLVM_VERSION=17.0.6
LLVM_DISTRO_NAME=ubuntu-18.04
xLLVM_DISTRO_NAME=ubuntu-22.04
OPENCOLORIO_VERSION=main
PUGIXML_VERSION=master
- desc: clang14/C++17 llvm14 py3.8 avx2 batch-b16avx512
Expand Down
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
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 a6dee84

Please sign in to comment.