Skip to content

Commit c9a37f5

Browse files
authored
build: Fixes to build and test against OpenImageIO 2.5 (#1742)
The newly released OIIO 2.5 (and changes in master) adjusts a few of its minimum dependencies (cmake, openexr, fmt) in ways that break some of our CI test cases for OSL 1.12, and also deprecated a helper method called ustringHash that OSL referenced in a few places. These have already been addressed in the OSL main branch (what will soon be OSL 1.13), and in some cases OSL-next has also bumped some of the very same dependencies. But this PR is dealing with the 1.12 branch, in which we cannot raise minimum dependencies that OSL requires. So here we are only adjusting which versions of those dependencies we are using or building for the specific tests in our CI matrix that use the sufficiently new OIIO that it needs the updated changes. Signed-off-by: Larry Gritz <[email protected]>
1 parent c59d74f commit c9a37f5

File tree

9 files changed

+23
-13
lines changed

9 files changed

+23
-13
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,35 @@ jobs:
4545
openimageio_ver: v2.2.17.0
4646
python_ver: 2.7
4747
pybind11_ver: v2.4.2
48-
- desc: clang9/C++14 llvm9 oiio-release boost1.66 avx2 exr2.3 py2.7
48+
- desc: clang9/C++14 llvm9 oiio-release boost1.66 avx2 exr2.4 py2.7
4949
nametag: linux-clang9-llvm9
5050
os: ubuntu-20.04
5151
container: aswftesting/ci-osl:2019-clang9
5252
vfxyear: 2019
5353
cc_compiler: clang
5454
cxx_compiler: clang++
5555
cxx_std: 14
56+
openexr_ver: v2.4.3
5657
openimageio_ver: release
5758
python_ver: 2.7
5859
# pybind11_ver: v2.9.0
5960
simd: avx
60-
- desc: GPU Cuda10 gcc6/C++14 llvm10 py2.7 boost-1.70 exr-2.3 OIIO-master avx2
61+
setenvs: export CMAKE_VERSION=3.15.5
62+
- desc: GPU Cuda10 gcc6/C++14 llvm10 py2.7 boost-1.70 exr-2.4 OIIO-master avx2
6163
nametag: linux-optix7-2019
6264
os: ubuntu-latest
6365
container: aswftesting/ci-osl:2019-clang10
6466
vfxyear: 2019
6567
cxx_std: 14
68+
openexr_ver: v2.4.3
6669
openimageio_ver: master
6770
python_ver: 2.7
6871
# pybind11_ver: v2.9.0
6972
simd: avx2,f16c
7073
skip_tests: 1
7174
setenvs: export OSL_CMAKE_FLAGS="-DUSE_OPTIX=1" OPTIX_VERSION=7.0
7275
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=8.1.1
76+
CMAKE_VERSION=3.15.5
7377
- desc: gcc6/C++14 llvm10 py3.7 boost1.70 exr2.4 oiio2.2 sse4
7478
nametag: linux-vfx2020
7579
os: ubuntu-latest
@@ -191,6 +195,7 @@ jobs:
191195
OSL_OPTIONS=llvm_debugging_symbols=1
192196
TESTRENDER_AA=1
193197
OSL_TESTSUITE_SKIP_DIFF=1
198+
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=9.1.0
194199
# Sanitizer notes:
195200
# - There are a handful of tests we disable entirely with
196201
# CTEST_EXCLUSIONS because they are irrelevant or just cannot be

src/build-scripts/gh-installdeps.bash

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ else
125125
source src/build-scripts/build_llvm.bash
126126
fi
127127

128+
if [[ "$CMAKE_VERSION" != "" ]] ; then
129+
source src/build-scripts/build_cmake.bash
130+
fi
131+
cmake --version
128132

129133

130134
if [[ "$OPTIX_VERSION" != "" ]] ; then

src/include/OSL/oslconfig.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ using OIIO::TextureOpt;
102102
// And some other things we borrow from OIIO...
103103
using OIIO::ErrorHandler;
104104
using OIIO::ustring;
105+
#ifdef OIIO_USTRING_HAS_STDHASH
106+
using ustringHash = std::hash<ustring>;
107+
#else
105108
using OIIO::ustringHash;
109+
#endif
106110
using OIIO::string_view;
107111
using OIIO::span;
108112
using OIIO::cspan;

src/liboslexec/oslexec_pvt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ using OIIO::ParamValueList;
5858
using OIIO::RefCnt;
5959
using OIIO::spin_lock;
6060
using OIIO::spin_mutex;
61-
using OIIO::ustringHash;
6261
namespace Strutil = OIIO::Strutil;
6362

6463

src/testrender/optix_stringtable.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
OSL_NAMESPACE_ENTER
1616

17-
typedef std::unordered_map<OIIO::ustring, int64_t, OIIO::ustringHash>
18-
StringTableMap;
17+
typedef std::unordered_map<OIIO::ustring, int64_t, ustringHash> StringTableMap;
1918

2019

2120
// The OptiXStringTable manages a block of CUDA device memory designated

src/testrender/optixraytracer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ class OptixRaytracer final : public SimpleRaytracer {
133133
#endif
134134

135135
std::string m_materials_ptx;
136-
std::unordered_map<OIIO::ustring, optix::TextureSampler, OIIO::ustringHash>
136+
std::unordered_map<OIIO::ustring, optix::TextureSampler, ustringHash>
137137
m_samplers;
138-
std::unordered_map<OIIO::ustring, uint64_t, OIIO::ustringHash> m_globals_map;
138+
std::unordered_map<OIIO::ustring, uint64_t, ustringHash> m_globals_map;
139139
};
140140

141141

src/testshade/optixgridrender.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ class OptixGridRenderer final : public SimpleRenderer {
139139
std::unordered_map<uint64_t, const char*> m_hash_map;
140140
#endif
141141
std::string m_materials_ptx;
142-
std::unordered_map<OIIO::ustring, optix::TextureSampler, OIIO::ustringHash>
142+
std::unordered_map<OIIO::ustring, optix::TextureSampler, ustringHash>
143143
m_samplers;
144-
std::unordered_map<OIIO::ustring, uint64_t, OIIO::ustringHash> m_globals_map;
144+
std::unordered_map<OIIO::ustring, uint64_t, ustringHash> m_globals_map;
145145

146146
OSL::Matrix44 m_shader2common; // "shader" space to "common" space matrix
147147
OSL::Matrix44 m_object2common; // "object" space to "common" space matrix

testsuite/example-cuda/cuda_grid_renderer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#include "cuda_string_table.h"
1313

1414
using GlobalsMap
15-
= std::unordered_map<OIIO::ustring, uint64_t, OIIO::ustringHash>;
15+
= std::unordered_map<OIIO::ustring, uint64_t, ustringHash>;
1616
using TextureSamplerMap
17-
= std::unordered_map<OIIO::ustring, cudaTextureObject_t, OIIO::ustringHash>;
17+
= std::unordered_map<OIIO::ustring, cudaTextureObject_t, ustringHash>;
1818

1919
// Just use 4x4 matrix for transformations
2020
typedef OSL::Matrix44 Transformation;

testsuite/example-cuda/cuda_string_table.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
#include <OSL/oslexec.h>
1414
#include <OpenImageIO/ustring.h>
1515

16-
typedef std::unordered_map<OIIO::ustring, int64_t, OIIO::ustringHash>
17-
StringTableMap;
16+
typedef std::unordered_map<OIIO::ustring, int64_t, ustringHash> StringTableMap;
1817

1918
// The CudaStringTable manages a block of CUDA device memory designated
2019
// to hold all of the string constants that a shader might access during

0 commit comments

Comments
 (0)