Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
restore-keys: ${{inputs.nametag}}
- name: Install LLVM and Clang
if: inputs.llvm_action_ver != ''
uses: KyleMayes/install-llvm-action@98e68e10c96dffcb7bfed8b2144541a66b49aa02 # v2.0.8
uses: KyleMayes/install-llvm-action@ebc0426251bc40c7cd31162802432c68818ab8f0 # v2.0.9
with:
version: ${{ inputs.llvm_action_ver }}
- name: Dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ jobs:
setenvs: export LLVM_VERSION=14.0.0 LLVM_DISTRO_NAME=ubuntu-18.04
OPENIMAGEIO_CMAKE_FLAGS="-DBUILD_FMT_VERSION=7.0.1"
PUGIXML_VERSION=v1.10
- desc: latest releases gcc13/C++17 llvm18 oiio-rel exr3.4 py3.12 avx2 batch-b16avx512
- desc: latest releases gcc13/C++17 llvm20 oiio-rel exr3.4 py3.12 avx2 batch-b16avx512
nametag: linux-latest-releases
runner: ubuntu-24.04
cc_compiler: gcc-14
Expand Down Expand Up @@ -604,7 +604,7 @@ jobs:
# Windows 2022 / MSVS 17 case is below. It's not working yet,
# work in progress.
#
- desc: Windows-2022 VS2022
- desc: Windows-2022 VS2022 llvm20 oiio3.1
runner: windows-2022
nametag: windows-2022
generator: "Visual Studio 17 2022"
Expand All @@ -617,7 +617,7 @@ jobs:
PUGIXML_VERSION=v1.14
OpenImageIO_BUILD_MISSING_DEPS="Freetype;TIFF;libdeflate;libjpeg-turbo"
LLVM_GOOGLE_DRIVE_ID="1uy7PNVlTQ-H56unXGOS6siRWtNcdS1J7"
- desc: Windows-2025 VS2022
- desc: Windows-2025 VS2022 llvm20 oiio3.1
runner: windows-2025
nametag: windows-2025
generator: "Visual Studio 17 2022"
Expand Down
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ NEW or CHANGED minimum dependencies since the last major release are **bold**.

* A suitable C++17 compiler to build OSL itself, which may be any of:
- GCC 9.3 or newer (tested through gcc 14)
- Clang 5 or newer (tested through clang 20)
- Clang 5 or newer (tested through clang 22)
- Microsoft Visual Studio 2017 or newer
- Intel C++ compiler icc version 19 or newer or LLVM-based icx compiler
version 2022 or newer.
Expand All @@ -50,7 +50,7 @@ NEW or CHANGED minimum dependencies since the last major release are **bold**.
DYLD_LIBRARY_PATH on OS X).

* [LLVM](http://www.llvm.org) **14.0 or newer**, 15, 16, 17, 18, 19, 20, 21,
including clang libraries.
22, 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 14.0
VERSION_MAX 21.9
VERSION_MAX 22.9
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES
LLVM_SHARED_MODE)
# ensure include directory is added (in case of non-standard locations
Expand Down
4 changes: 4 additions & 0 deletions src/liboslcomp/oslcomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ OSLCompilerImpl::preprocess_buffer(const std::string& buffer,
inst.setTarget(target);

inst.createFileManager();
#if OSL_LLVM_VERSION >= 220
inst.createSourceManager();
#else
inst.createSourceManager(inst.getFileManager());
#endif
clang::SourceManager& sm = inst.getSourceManager();
sm.setMainFileID(sm.createFileID(std::move(mbuf), clang::SrcMgr::C_User));

Expand Down
15 changes: 14 additions & 1 deletion src/liboslexec/llvm_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,11 @@ LLVM_Util::make_jit_execengine(std::string* err, TargetISA requestedISA,
// TODO: investigate if reciprocals can be disabled by other means.
// Perhaps enable UnsafeFPMath, then modify creation of DIV instructions
// to remove the arcp (allow reciprocal) flag on that instructions
#if OSL_LLVM_VERSION < 220
// UnsafeFPMath was removed from TargetOptions in LLVM 22; FP math
// control is now handled via per-instruction fast-math flags in IR.
options.UnsafeFPMath = false;
#endif
// Since there are OSL language functions isinf and isnan,
// we cannot assume there will not be infs and NANs
options.NoInfsFPMath = false;
Expand Down Expand Up @@ -1805,7 +1809,11 @@ LLVM_Util::nvptx_target_machine()
// N.B. 'Standard' only allow fusion of 'blessed' ops (currently just
// fmuladd). To truly disable FMA and never fuse FP-ops, we need to
// instead use llvm::FPOpFusion::Strict.
options.UnsafeFPMath = 1;
#if OSL_LLVM_VERSION < 220
// UnsafeFPMath was removed from TargetOptions in LLVM 22; FP math
// control is now handled via per-instruction fast-math flags in IR.
options.UnsafeFPMath = 1;
#endif
options.NoInfsFPMath = 1;
options.NoNaNsFPMath = 1;
options.HonorSignDependentRoundingFPMathOption = 0;
Expand All @@ -1817,8 +1825,13 @@ LLVM_Util::nvptx_target_machine()

// Verify that the NVPTX target has been initialized
std::string error;
#if OSL_LLVM_VERSION >= 220
const llvm::Target* llvm_target
= llvm::TargetRegistry::lookupTarget(ModuleTriple, error);
#else
const llvm::Target* llvm_target
= llvm::TargetRegistry::lookupTarget(ModuleTriple.str(), error);
#endif
OSL_ASSERT(llvm_target
&& "PTX compile error: LLVM Target is not initialized");

Expand Down
Loading