Skip to content

Commit 668deaf

Browse files
committed
allow building RV with older version of OIIO
Newer version of RV (>=2022.3.0) is crashing randomly on startup. After few trial and error the combination that seems to work is to build cortex for RV by using OIIO libraries packaged with RV. That library is older enough so to not contain OpenImageIO_Util library which is assumed to exist in SConstruct configuration. These changes will allow to use that older version. There still occasional "double memory free" crushes on application close. But I could not yet figure out how to address that. Theoretically that crash is because of incompatible version of boost. However, using proper version of boost doesn't seem enough.
1 parent 2daf829 commit 668deaf

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

SConstruct

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ o.Add(
260260
"",
261261
)
262262

263+
o.Add(
264+
BoolVariable( "WITH_OIIO_UTIL", "Build with OpenImageIO_Util", True ),
265+
)
266+
263267
# Blosc options
264268

265269
o.Add(
@@ -1861,13 +1865,14 @@ imageEnvPrepends = {
18611865
],
18621866
"LIBS" : [
18631867
"OpenImageIO$OIIO_LIB_SUFFIX",
1864-
"OpenImageIO_Util$OIIO_LIB_SUFFIX",
18651868
],
18661869
"CXXFLAGS" : [
18671870
"-DIECoreImage_EXPORTS",
18681871
systemIncludeArgument, "$OIIO_INCLUDE_PATH"
18691872
]
18701873
}
1874+
if imageEnv.get( "WITH_OIIO_UTIL", True ):
1875+
imageEnvPrepends["LIBS"].append( "OpenImageIO_Util$OIIO_LIB_SUFFIX" )
18711876

18721877
imageEnv.Prepend( **imageEnvPrepends )
18731878
# Windows uses PATH for to find libraries, we must append to it to make sure we don't overwrite existing PATH entries.
@@ -2219,11 +2224,12 @@ if env["WITH_GL"] and doConfigure :
22192224
os.path.basename( imageEnv.subst( "$INSTALL_LIB_NAME" ) ),
22202225
os.path.basename( sceneEnv.subst( "$INSTALL_LIB_NAME" ) ),
22212226
"OpenImageIO$OIIO_LIB_SUFFIX",
2222-
"OpenImageIO_Util$OIIO_LIB_SUFFIX",
22232227
"GLEW$GLEW_LIB_SUFFIX",
22242228
"boost_wave$BOOST_LIB_SUFFIX",
22252229
]
22262230
)
2231+
if glEnv.get( "WITH_OIIO_UTIL", True ):
2232+
glEnv.Append( LIBS = [ "OpenImageIO_Util$OIIO_LIB_SUFFIX", ] )
22272233

22282234
if env["PLATFORM"]=="darwin" :
22292235
glEnv.Append(

config/ie/options

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ oiioRoot = os.path.join( "/software", "apps", "OpenImageIO", oiioVersion, platfo
196196
OIIO_INCLUDE_PATH = os.path.join( oiioRoot, "include" )
197197
OIIO_LIB_PATH = os.path.join( oiioRoot, "lib64" )
198198
OIIO_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix( "OpenImageIO", oiioLibSuffix )
199+
WITH_OIIO_UTIL = "true"
199200

200201
FREETYPE_LIB_PATH = os.path.join( "/software", "tools", "lib", platform, compiler, compilerVersion )
201202
FREETYPE_INCLUDE_PATH = "/usr/include/freetype2"
@@ -436,6 +437,9 @@ if targetApp=="rv" :
436437
# the default `OIIO_INCLUDE_PATH` value.
437438
OIIO_LIB_PATH = rvLibs
438439
OIIO_LIB_SUFFIX = rvReg.get( "OpenImageIOLibSuffix", OIIO_LIB_SUFFIX )
440+
# current version of OIIO used by RV doesn't include the Util library
441+
# this variable will tell the build process to not require it
442+
WITH_OIIO_UTIL = rvReg.get( "WithOpenImageIOUtil", WITH_OIIO_UTIL )
439443

440444
# find doxygen
441445
DOXYGEN = os.path.join( "/software/apps/doxygen", os.environ["DOXYGEN_VERSION"], platform, "bin", "doxygen" )

0 commit comments

Comments
 (0)