From 87e176c61f04860e254a08880c87ab4c3a8fc118 Mon Sep 17 00:00:00 2001 From: ivanimanishi Date: Wed, 11 Sep 2024 14:14:09 -0700 Subject: [PATCH 1/9] SConstruct : Add PYBIND11_INCLUDE_PATH option --- Changes | 4 ++++ SConstruct | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 1252a5a4f3..3c3f6c146a 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,11 @@ 10.5.x.x (relative to 10.5.10.0) ======== +Build +----- +- SConstruct : + - Added `PYBIND11_INCLUDE_PATH` option. 10.5.10.0 (relative to 10.5.9.5) ========= diff --git a/SConstruct b/SConstruct index 9aac440659..57a174b135 100644 --- a/SConstruct +++ b/SConstruct @@ -557,6 +557,12 @@ o.Add( "", ) +o.Add( + "PYBIND11_INCLUDE_PATH", + "The path to the pybind11 include directory.", + "", +) + # Build options o.Add( @@ -2036,7 +2042,8 @@ vdbEnvPrepends = { ], "LIBS" : ["openvdb$VDB_LIB_SUFFIX"], "CXXFLAGS" : [ - systemIncludeArgument, "$VDB_INCLUDE_PATH" + systemIncludeArgument, "$VDB_INCLUDE_PATH", + systemIncludeArgument, "$PYBIND11_INCLUDE_PATH", ] } From aae8af482ccac458d9ff9f69ef0bfe992f832631 Mon Sep 17 00:00:00 2001 From: ivanimanishi Date: Tue, 17 Sep 2024 15:52:41 -0700 Subject: [PATCH 2/9] SConstruct : Add VDB_PYTHON_PATH to USD tests --- Changes | 1 + SConstruct | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 3c3f6c146a..afa6e800aa 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,7 @@ Build - SConstruct : - Added `PYBIND11_INCLUDE_PATH` option. + - Added `VDB_PYTHON_PATH` to USD tests. 10.5.10.0 (relative to 10.5.9.5) ========= diff --git a/SConstruct b/SConstruct index 57a174b135..0752d66cb6 100644 --- a/SConstruct +++ b/SConstruct @@ -3129,7 +3129,7 @@ if doConfigure : # tests usdTestEnv = testEnv.Clone() - usdTestEnv["ENV"]["PYTHONPATH"] += os.pathsep + "./contrib/IECoreUSD/python" + usdTestEnv["ENV"]["PYTHONPATH"] += os.pathsep + "./contrib/IECoreUSD/python" + os.pathsep + usdTestEnv["VDB_PYTHON_PATH"] usdLibPath = coreEnv.subst("$USD_LIB_PATH") usdPythonPath = os.path.join(usdLibPath, "python") From 48b6b19281a917884b429a58b2cd7fc7b83dc978 Mon Sep 17 00:00:00 2001 From: ivanimanishi Date: Thu, 19 Sep 2024 12:20:49 -0700 Subject: [PATCH 3/9] SConstruct : Add INSTALL_CREATE_SYMLINKS --- Changes | 1 + SConstruct | 125 ++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 86 insertions(+), 40 deletions(-) diff --git a/Changes b/Changes index afa6e800aa..97cf4f0e4c 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,7 @@ Build - SConstruct : - Added `PYBIND11_INCLUDE_PATH` option. - Added `VDB_PYTHON_PATH` to USD tests. + - Added `INSTALL_CREATE_SYMLINKS`, which allows you to disable the creation of version symlinks at the end of the install. 10.5.10.0 (relative to 10.5.9.5) ========= diff --git a/SConstruct b/SConstruct index 0752d66cb6..1633982dce 100644 --- a/SConstruct +++ b/SConstruct @@ -851,6 +851,11 @@ o.Add( "" ) +o.Add( + BoolVariable( "INSTALL_CREATE_SYMLINKS", "Whether to create symlinks post install", True ) +) + + # Test options o.Add( @@ -1730,7 +1735,8 @@ corePythonScripts = glob.glob( "python/IECore/*.py" ) coreLibrary = coreEnv.SharedLibrary( "lib/" + os.path.basename( coreEnv.subst( "$INSTALL_LIB_NAME" ) ), coreSources ) coreLibraryInstall = coreEnv.Install( os.path.dirname( coreEnv.subst( "$INSTALL_LIB_NAME" ) ), coreLibrary ) coreEnv.NoCache( coreLibraryInstall ) -coreEnv.AddPostAction( coreLibraryInstall, lambda target, source, env : makeLibSymLinks( coreEnv ) ) +if env["INSTALL_CREATE_SYMLINKS"] : + coreEnv.AddPostAction( coreLibraryInstall, lambda target, source, env : makeLibSymLinks( coreEnv ) ) coreEnv.Alias( "install", [ coreLibraryInstall ] ) coreEnv.Alias( "installCore", [ coreLibraryInstall ] ) coreEnv.Alias( "installLib", [ coreLibraryInstall ] ) @@ -1753,7 +1759,8 @@ versionHeaderInstall = env.Substfile( ) # handle the remaining core headers headerInstall = coreEnv.Install( "$INSTALL_HEADER_DIR/IECore", coreHeaders ) -coreEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECore", lambda target, source, env : makeSymLinks( coreEnv, coreEnv["INSTALL_HEADER_DIR"] ) ) +if env["INSTALL_CREATE_SYMLINKS"]: + coreEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECore", lambda target, source, env : makeSymLinks( coreEnv, coreEnv["INSTALL_HEADER_DIR"] ) ) if env["INSTALL_PKG_CONFIG_FILE"]: coreEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECore", lambda target, source, env : writePkgConfig( coreEnv, corePythonEnv ) ) coreEnv.Alias( "install", [ headerInstall, versionHeaderInstall ] ) @@ -1764,7 +1771,8 @@ corePythonEnv.Append( LIBS = os.path.basename( coreEnv.subst( "$INSTALL_LIB_NAME corePythonLibrary = corePythonEnv.SharedLibrary( "lib/" + os.path.basename( corePythonEnv.subst( "$INSTALL_PYTHONLIB_NAME" ) ), corePythonSources ) corePythonLibraryInstall = corePythonEnv.Install( os.path.dirname( corePythonEnv.subst( "$INSTALL_PYTHONLIB_NAME" ) ), corePythonLibrary ) corePythonEnv.NoCache( corePythonLibraryInstall ) -corePythonEnv.AddPostAction( corePythonLibraryInstall, lambda target, source, env : makeLibSymLinks( corePythonEnv, libNameVar="INSTALL_PYTHONLIB_NAME" ) ) +if env["INSTALL_CREATE_SYMLINKS"] : + corePythonEnv.AddPostAction( corePythonLibraryInstall, lambda target, source, env : makeLibSymLinks( corePythonEnv, libNameVar="INSTALL_PYTHONLIB_NAME" ) ) corePythonEnv.Alias( "install", [ corePythonLibraryInstall ] ) corePythonEnv.Alias( "installCore", [ corePythonLibraryInstall ] ) corePythonEnv.Alias( "installLib", [ corePythonLibraryInstall ] ) @@ -1782,7 +1790,8 @@ corePythonModuleEnv.Depends( corePythonModule, coreLibrary ) corePythonModuleEnv.Depends( corePythonModule, corePythonLibrary ) corePythonModuleInstall = corePythonModuleEnv.Install( "$INSTALL_PYTHON_DIR/IECore", corePythonScripts + corePythonModule ) -corePythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECore", lambda target, source, env : makeSymLinks( corePythonEnv, corePythonEnv["INSTALL_PYTHON_DIR"] ) ) +if env["INSTALL_CREATE_SYMLINKS"]: + corePythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECore", lambda target, source, env : makeSymLinks( corePythonEnv, corePythonEnv["INSTALL_PYTHON_DIR"] ) ) corePythonModuleEnv.Alias( "install", corePythonModuleInstall ) corePythonModuleEnv.Alias( "installCore", corePythonModuleInstall ) @@ -1791,7 +1800,8 @@ for cls in env['INSTALL_IECORE_OPS'] : stubName = os.path.basename( cls[1] ) stubEnv = corePythonModuleEnv.Clone( IECORE_NAME=os.path.join( cls[1], stubName ) ) stubInstall = stubEnv.Command( "$INSTALL_IECORE_OP_PATH", None, 'echo "from %s import %s as %s" > $TARGET' % ( cls[0].rpartition( "." )[0], cls[0].rpartition( "." )[-1], stubName ) ) - stubEnv.AddPostAction( stubInstall, lambda target, source, env : makeSymLinks( env, env["INSTALL_IECORE_OP_PATH"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + stubEnv.AddPostAction( stubInstall, lambda target, source, env : makeSymLinks( env, env["INSTALL_IECORE_OP_PATH"] ) ) stubEnv.Alias( "install", stubInstall ) stubEnv.Alias( "installCore", stubInstall ) stubEnv.Alias( "installStubs", stubInstall ) @@ -1900,14 +1910,16 @@ if doConfigure : imageLibrary = imageEnv.SharedLibrary( "lib/" + os.path.basename( imageEnv.subst( "$INSTALL_LIB_NAME" ) ), imageSources ) imageLibraryInstall = imageEnv.Install( os.path.dirname( imageEnv.subst( "$INSTALL_LIB_NAME" ) ), imageLibrary ) imageEnv.NoCache( imageLibraryInstall ) - imageEnv.AddPostAction( imageLibraryInstall, lambda target, source, env : makeLibSymLinks( imageEnv ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + imageEnv.AddPostAction( imageLibraryInstall, lambda target, source, env : makeLibSymLinks( imageEnv ) ) imageEnv.Alias( "install", imageLibraryInstall ) imageEnv.Alias( "installImage", imageLibraryInstall ) imageEnv.Alias( "installLib", [ imageLibraryInstall ] ) # headers imageHeaderInstall = imageEnv.Install( "$INSTALL_HEADER_DIR/IECoreImage", imageHeaders ) - imageEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreImage", lambda target, source, env : makeSymLinks( imageEnv, imageEnv["INSTALL_HEADER_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + imageEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreImage", lambda target, source, env : makeSymLinks( imageEnv, imageEnv["INSTALL_HEADER_DIR"] ) ) imageEnv.Alias( "install", imageHeaderInstall ) imageEnv.Alias( "installImage", imageHeaderInstall ) @@ -1931,7 +1943,8 @@ if doConfigure : # python module install imagePythonModuleInstall = imagePythonModuleEnv.Install( "$INSTALL_PYTHON_DIR/IECoreImage", imagePythonScripts + imagePythonModule ) - imagePythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreImage", lambda target, source, env : makeSymLinks( imagePythonModuleEnv, imagePythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + imagePythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreImage", lambda target, source, env : makeSymLinks( imagePythonModuleEnv, imagePythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) imagePythonModuleEnv.Alias( "install", imagePythonModuleInstall ) imagePythonModuleEnv.Alias( "installImage", imagePythonModuleInstall ) @@ -1987,14 +2000,16 @@ if doConfigure : sceneLibrary = sceneEnv.SharedLibrary( "lib/" + os.path.basename( sceneEnv.subst( "$INSTALL_LIB_NAME" ) ), sceneSources ) sceneLibraryInstall = sceneEnv.Install( os.path.dirname( sceneEnv.subst( "$INSTALL_LIB_NAME" ) ), sceneLibrary ) sceneEnv.NoCache( sceneLibraryInstall ) - sceneEnv.AddPostAction( sceneLibraryInstall, lambda target, source, env : makeLibSymLinks( sceneEnv ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + sceneEnv.AddPostAction( sceneLibraryInstall, lambda target, source, env : makeLibSymLinks( sceneEnv ) ) sceneEnv.Alias( "install", [ sceneLibraryInstall ] ) sceneEnv.Alias( "installScene", [ sceneLibraryInstall ] ) sceneEnv.Alias( "installSceneLib", [ sceneLibraryInstall ] ) # headers sceneHeaderInstall = sceneEnv.Install( "$INSTALL_HEADER_DIR/IECoreScene", sceneHeaders ) - sceneEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreScene", lambda target, source, env : makeSymLinks( sceneEnv, sceneEnv["INSTALL_HEADER_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + sceneEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreScene", lambda target, source, env : makeSymLinks( sceneEnv, sceneEnv["INSTALL_HEADER_DIR"] ) ) sceneEnv.Alias( "install", sceneHeaderInstall ) sceneEnv.Alias( "installScene", sceneHeaderInstall ) @@ -2006,7 +2021,8 @@ if doConfigure : scenePythonModuleEnv.Depends( scenePythonModule, sceneLibrary ) scenePythonModuleInstall = scenePythonModuleEnv.Install( "$INSTALL_PYTHON_DIR/IECoreScene", scenePythonScripts + scenePythonModule ) - scenePythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreScene", lambda target, source, env : makeSymLinks( scenePythonModuleEnv, scenePythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + scenePythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreScene", lambda target, source, env : makeSymLinks( scenePythonModuleEnv, scenePythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) scenePythonModuleEnv.Alias( "install", scenePythonModuleInstall ) scenePythonModuleEnv.Alias( "installScene", scenePythonModuleInstall ) @@ -2083,14 +2099,16 @@ if doConfigure : vdbLibrary = vdbEnv.SharedLibrary( "lib/" + os.path.basename( vdbEnv.subst( "$INSTALL_LIB_NAME" ) ), vdbSources ) vdbLibraryInstall = vdbEnv.Install( os.path.dirname( vdbEnv.subst( "$INSTALL_LIB_NAME" ) ), vdbLibrary ) vdbEnv.NoCache( vdbLibraryInstall ) - vdbEnv.AddPostAction( vdbLibraryInstall, lambda target, source, env : makeLibSymLinks( vdbEnv ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + vdbEnv.AddPostAction( vdbLibraryInstall, lambda target, source, env : makeLibSymLinks( vdbEnv ) ) vdbEnv.Alias( "install", [ vdbLibraryInstall ] ) vdbEnv.Alias( "installVDB", [ vdbLibraryInstall ] ) vdbEnv.Alias( "installVDBLib", [ vdbLibraryInstall ] ) # headers vdbHeaderInstall = sceneEnv.Install( "$INSTALL_HEADER_DIR/IECoreVDB", vdbHeaders ) - sceneEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreVDB", lambda target, source, env : makeSymLinks( vdbEnv, vdbEnv["INSTALL_HEADER_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + sceneEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreVDB", lambda target, source, env : makeSymLinks( vdbEnv, vdbEnv["INSTALL_HEADER_DIR"] ) ) sceneEnv.Alias( "install", vdbHeaderInstall ) sceneEnv.Alias( "installVDB", vdbHeaderInstall ) @@ -2105,7 +2123,8 @@ if doConfigure : vdbPythonModuleEnv.Depends( vdbPythonModule, vdbLibrary ) vdbPythonModuleInstall = vdbPythonModuleEnv.Install( "$INSTALL_PYTHON_DIR/IECoreVDB", vdbPythonScripts + vdbPythonModule ) - vdbPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreVDB", lambda target, source, env : makeSymLinks( vdbPythonModuleEnv, vdbPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + vdbPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreVDB", lambda target, source, env : makeSymLinks( vdbPythonModuleEnv, vdbPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) vdbPythonModuleEnv.Alias( "install", vdbPythonModuleInstall ) vdbPythonModuleEnv.Alias( "installVDB", vdbPythonModuleInstall ) @@ -2220,26 +2239,30 @@ if env["WITH_GL"] and doConfigure : glLibrary = glEnv.SharedLibrary( "lib/" + os.path.basename( glEnv.subst( "$INSTALL_LIB_NAME" ) ), glSources ) glLibraryInstall = glEnv.Install( os.path.dirname( glEnv.subst( "$INSTALL_LIB_NAME" ) ), glLibrary ) glEnv.NoCache( glLibraryInstall ) - glEnv.AddPostAction( glLibraryInstall, lambda target, source, env : makeLibSymLinks( glEnv ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + glEnv.AddPostAction( glLibraryInstall, lambda target, source, env : makeLibSymLinks( glEnv ) ) glEnv.Alias( "install", glLibraryInstall ) glEnv.Alias( "installGL", glLibraryInstall ) glEnv.Alias( "installLib", [ glLibraryInstall ] ) glHeaders = glob.glob( "include/IECoreGL/*.h" ) + glob.glob( "include/IECoreGL/*.inl" ) glHeaderInstall = glEnv.Install( "$INSTALL_HEADER_DIR/IECoreGL", glHeaders ) - glEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreGL", lambda target, source, env : makeSymLinks( glEnv, glEnv["INSTALL_HEADER_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + glEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreGL", lambda target, source, env : makeSymLinks( glEnv, glEnv["INSTALL_HEADER_DIR"] ) ) glEnv.Alias( "install", glHeaderInstall ) glEnv.Alias( "installGL", glHeaderInstall ) glslHeaders = glob.glob( "glsl/IECoreGL/*.h" ) glslHeaderInstall = glEnv.Install( "$INSTALL_GLSL_HEADER_DIR/IECoreGL", glslHeaders ) - glEnv.AddPostAction( "$INSTALL_GLSL_HEADER_DIR/IECoreGL", lambda target, source, env : makeSymLinks( glEnv, glEnv["INSTALL_GLSL_HEADER_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + glEnv.AddPostAction( "$INSTALL_GLSL_HEADER_DIR/IECoreGL", lambda target, source, env : makeSymLinks( glEnv, glEnv["INSTALL_GLSL_HEADER_DIR"] ) ) glEnv.Alias( "install", glslHeaderInstall ) glEnv.Alias( "installGL", glslHeaderInstall ) glslShaderFiles = glob.glob( "glsl/*.frag" ) + glob.glob( "glsl/*.vert" ) glslShaderInstall = glEnv.Install( "$INSTALL_GLSL_SHADER_DIR", glslShaderFiles ) - glEnv.AddPostAction( "$INSTALL_GLSL_SHADER_DIR", lambda target, source, env : makeSymLinks( glEnv, glEnv["INSTALL_GLSL_SHADER_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + glEnv.AddPostAction( "$INSTALL_GLSL_SHADER_DIR", lambda target, source, env : makeSymLinks( glEnv, glEnv["INSTALL_GLSL_SHADER_DIR"] ) ) glEnv.Alias( "install", glslShaderInstall ) glEnv.Alias( "installGL", glslShaderInstall ) @@ -2259,7 +2282,8 @@ if env["WITH_GL"] and doConfigure : glPythonScripts = glob.glob( "python/IECoreGL/*.py" ) glPythonModuleInstall = glPythonModuleEnv.Install( "$INSTALL_PYTHON_DIR/IECoreGL", glPythonScripts + glPythonModule ) - glPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreGL", lambda target, source, env : makeSymLinks( glPythonModuleEnv, glPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + glPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreGL", lambda target, source, env : makeSymLinks( glPythonModuleEnv, glPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) glPythonModuleEnv.Alias( "install", glPythonModuleInstall ) glPythonModuleEnv.Alias( "installGL", glPythonModuleInstall ) @@ -2376,7 +2400,8 @@ if doConfigure : mayaLibrary = mayaEnv.SharedLibrary( "lib/" + os.path.basename( mayaEnv.subst( "$INSTALL_MAYALIB_NAME" ) ), mayaSources ) mayaLibraryInstall = mayaEnv.Install( os.path.dirname( mayaEnv.subst( "$INSTALL_MAYALIB_NAME" ) ), mayaLibrary ) mayaEnv.NoCache( mayaLibraryInstall ) - mayaEnv.AddPostAction( mayaLibraryInstall, lambda target, source, env : makeLibSymLinks( mayaEnv, "INSTALL_MAYALIB_NAME" ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + mayaEnv.AddPostAction( mayaLibraryInstall, lambda target, source, env : makeLibSymLinks( mayaEnv, "INSTALL_MAYALIB_NAME" ) ) mayaEnv.Alias( "install", mayaLibraryInstall ) mayaEnv.Alias( "installMaya", mayaLibraryInstall ) mayaEnv.Alias( "installLib", [ mayaLibraryInstall ] ) @@ -2384,13 +2409,15 @@ if doConfigure : # maya headers mayaHeaderInstall = mayaEnv.Install( "$INSTALL_HEADER_DIR/IECoreMaya", mayaHeaders ) mayaHeaderInstall += mayaEnv.Install( "$INSTALL_HEADER_DIR/IECoreMaya/bindings", mayaBindingHeaders ) - mayaEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreMaya", lambda target, source, env : makeSymLinks( mayaEnv, mayaEnv["INSTALL_HEADER_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + mayaEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreMaya", lambda target, source, env : makeSymLinks( mayaEnv, mayaEnv["INSTALL_HEADER_DIR"] ) ) mayaEnv.Alias( "install", mayaHeaderInstall ) mayaEnv.Alias( "installMaya", mayaHeaderInstall ) # maya mel mayaMelInstall = mayaEnv.Install( "$INSTALL_MEL_DIR", mayaMel ) - mayaEnv.AddPostAction( "$INSTALL_MEL_DIR", lambda target, source, env : makeSymLinks( mayaEnv, mayaEnv["INSTALL_MEL_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + mayaEnv.AddPostAction( "$INSTALL_MEL_DIR", lambda target, source, env : makeSymLinks( mayaEnv, mayaEnv["INSTALL_MEL_DIR"] ) ) mayaEnv.Alias( "install", mayaMelInstall ) mayaEnv.Alias( "installMaya", mayaMelInstall ) @@ -2426,7 +2453,8 @@ if doConfigure : mayaPluginLoader = mayaPluginLoaderEnv.SharedLibrary( mayaPluginTarget, mayaPluginLoaderSources, SHLIBPREFIX="" ) mayaPluginLoaderInstall = mayaPluginLoaderEnv.InstallAs( mayaPluginLoaderEnv.subst( "$INSTALL_MAYAPLUGIN_NAME$SHLIBSUFFIX" ), mayaPluginLoader ) - mayaPluginLoaderEnv.AddPostAction( mayaPluginLoaderInstall, lambda target, source, env : makeSymLinks( mayaPluginLoaderEnv, mayaPluginLoaderEnv["INSTALL_MAYAPLUGIN_NAME"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + mayaPluginLoaderEnv.AddPostAction( mayaPluginLoaderInstall, lambda target, source, env : makeSymLinks( mayaPluginLoaderEnv, mayaPluginLoaderEnv["INSTALL_MAYAPLUGIN_NAME"] ) ) mayaPluginLoaderEnv.Alias( "install", mayaPluginLoaderInstall ) mayaPluginLoaderEnv.Alias( "installMaya", mayaPluginLoaderInstall ) @@ -2439,7 +2467,8 @@ if doConfigure : mayaPluginInstall = mayaPluginEnv.Install( os.path.dirname( mayaPluginEnv.subst( "$INSTALL_MAYAPLUGIN_NAME" ) ), mayaPlugin ) mayaPluginEnv.Depends( mayaPlugin, corePythonModule ) - mayaPluginEnv.AddPostAction( mayaPluginInstall, lambda target, source, env : makeSymLinks( mayaPluginEnv, mayaPluginEnv["INSTALL_MAYAPLUGIN_NAME"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + mayaPluginEnv.AddPostAction( mayaPluginInstall, lambda target, source, env : makeSymLinks( mayaPluginEnv, mayaPluginEnv["INSTALL_MAYAPLUGIN_NAME"] ) ) mayaPluginEnv.Alias( "install", mayaPluginInstall ) mayaPluginEnv.Alias( "installMaya", mayaPluginInstall ) @@ -2455,7 +2484,8 @@ if doConfigure : mayaPythonModuleEnv.Depends( mayaPythonModule, mayaLibrary ) mayaPythonModuleInstall = mayaPythonModuleEnv.Install( "$INSTALL_PYTHON_DIR/IECoreMaya", mayaPythonScripts + mayaPythonModule ) - mayaPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreMaya", lambda target, source, env : makeSymLinks( mayaPythonModuleEnv, mayaPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + mayaPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreMaya", lambda target, source, env : makeSymLinks( mayaPythonModuleEnv, mayaPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) mayaPythonModuleEnv.Alias( "install", mayaPythonModuleInstall ) mayaPythonModuleEnv.Alias( "installMaya", mayaPythonModuleInstall ) @@ -2650,7 +2680,8 @@ if doConfigure : # nuke library nukeLibrary = nukeEnv.SharedLibrary( "lib/" + os.path.basename( nukeEnv.subst( "$INSTALL_NUKELIB_NAME" ) ), nukeSources ) nukeLibraryInstall = nukeEnv.Install( os.path.dirname( nukeEnv.subst( "$INSTALL_NUKELIB_NAME" ) ), nukeLibrary ) - nukeEnv.AddPostAction( nukeLibraryInstall, lambda target, source, env : makeLibSymLinks( nukeEnv, "INSTALL_NUKELIB_NAME" ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + nukeEnv.AddPostAction( nukeLibraryInstall, lambda target, source, env : makeLibSymLinks( nukeEnv, "INSTALL_NUKELIB_NAME" ) ) nukeEnv.Alias( "install", nukeLibraryInstall ) nukeEnv.Alias( "installNuke", nukeLibraryInstall ) nukeEnv.Alias( "installLib", [ nukeLibraryInstall ] ) @@ -2658,7 +2689,8 @@ if doConfigure : # nuke headers nukeHeaderInstall = nukeEnv.Install( "$INSTALL_HEADER_DIR/IECoreNuke", nukeHeaders ) - nukeEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreNuke", lambda target, source, env : makeSymLinks( nukeEnv, nukeEnv["INSTALL_HEADER_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + nukeEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreNuke", lambda target, source, env : makeSymLinks( nukeEnv, nukeEnv["INSTALL_HEADER_DIR"] ) ) nukeEnv.Alias( "installNuke", nukeHeaderInstall ) nukeEnv.Alias( "install", nukeHeaderInstall ) @@ -2666,7 +2698,8 @@ if doConfigure : nukePythonModule = nukePythonModuleEnv.SharedLibrary( "python/IECoreNuke/_IECoreNuke", nukePythonSources ) nukePythonModuleInstall = nukePythonModuleEnv.Install( "$INSTALL_NUKEPYTHON_DIR/IECoreNuke", nukePythonScripts + nukePythonModule ) - nukePythonModuleEnv.AddPostAction( "$INSTALL_NUKEPYTHON_DIR/IECoreNuke", lambda target, source, env : makeSymLinks( nukePythonModuleEnv, nukePythonModuleEnv["INSTALL_NUKEPYTHON_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + nukePythonModuleEnv.AddPostAction( "$INSTALL_NUKEPYTHON_DIR/IECoreNuke", lambda target, source, env : makeSymLinks( nukePythonModuleEnv, nukePythonModuleEnv["INSTALL_NUKEPYTHON_DIR"] ) ) nukePythonModuleEnv.Alias( "install", nukePythonModuleInstall ) nukePythonModuleEnv.Alias( "installNuke", nukePythonModuleInstall ) nukePythonModuleEnv.Depends( nukePythonModule, corePythonModule ) @@ -2688,7 +2721,8 @@ if doConfigure : nukePlugin = nukePluginEnv.SharedLibrary( nukePluginTarget, nukePluginSources, SHLIBPREFIX="" ) nukePluginInstall = nukePluginEnv.Install( os.path.dirname( nukePluginEnv.subst( "$INSTALL_NUKEPLUGIN_NAME" ) ), nukePlugin ) - nukePluginEnv.AddPostAction( nukePluginInstall, lambda target, source, env : makeSymLinks( nukePluginEnv, nukePluginEnv["INSTALL_NUKEPLUGIN_NAME"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + nukePluginEnv.AddPostAction( nukePluginInstall, lambda target, source, env : makeSymLinks( nukePluginEnv, nukePluginEnv["INSTALL_NUKEPLUGIN_NAME"] ) ) nukePluginEnv.Alias( "install", nukePluginInstall ) nukePluginEnv.Alias( "installNuke", nukePluginInstall ) @@ -2861,7 +2895,8 @@ if doConfigure : houdiniLib = houdiniEnv.SharedLibrary( "lib/" + os.path.basename( houdiniEnv.subst( "$INSTALL_HOUDINILIB_NAME" ) ), houdiniSources ) houdiniLibInstall = houdiniEnv.Install( os.path.dirname( houdiniEnv.subst( "$INSTALL_HOUDINILIB_NAME" ) ), houdiniLib ) houdiniEnv.NoCache( houdiniLibInstall ) - houdiniEnv.AddPostAction( houdiniLibInstall, lambda target, source, env : makeLibSymLinks( houdiniEnv, "INSTALL_HOUDINILIB_NAME" ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + houdiniEnv.AddPostAction( houdiniLibInstall, lambda target, source, env : makeLibSymLinks( houdiniEnv, "INSTALL_HOUDINILIB_NAME" ) ) houdiniEnv.Alias( "install", houdiniLibInstall ) houdiniEnv.Alias( "installHoudini", houdiniLibInstall ) houdiniEnv.Alias( "installLib", [ houdiniLibInstall ] ) @@ -2871,7 +2906,8 @@ if doConfigure : #===== houdiniHeaderInstall = houdiniEnv.Install( "$INSTALL_HEADER_DIR/IECoreHoudini", houdiniHeaders ) houdiniHeaderInstall += houdiniEnv.Install( "$INSTALL_HEADER_DIR/IECoreHoudini/bindings", houdiniBindingHeaders ) - houdiniEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreHoudini", lambda target, source, env : makeSymLinks( houdiniEnv, houdiniEnv["INSTALL_HEADER_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + houdiniEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreHoudini", lambda target, source, env : makeSymLinks( houdiniEnv, houdiniEnv["INSTALL_HEADER_DIR"] ) ) houdiniEnv.Alias( "install", houdiniHeaderInstall ) houdiniEnv.Alias( "installHoudini", houdiniHeaderInstall ) @@ -2887,7 +2923,8 @@ if doConfigure : houdiniPlugin = houdiniPluginEnv.SharedLibrary( houdiniPluginTarget, houdiniPluginSources, SHLIBPREFIX="" ) houdiniPluginInstall = houdiniPluginEnv.Install( os.path.dirname( houdiniPluginEnv.subst( "$INSTALL_HOUDINIPLUGIN_NAME" ) ), houdiniPlugin ) houdiniPluginEnv.Depends( houdiniPlugin, corePythonModule ) - houdiniPluginEnv.AddPostAction( houdiniPluginInstall, lambda target, source, env : makeSymLinks( houdiniPluginEnv, houdiniPluginEnv["INSTALL_HOUDINIPLUGIN_NAME"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + houdiniPluginEnv.AddPostAction( houdiniPluginInstall, lambda target, source, env : makeSymLinks( houdiniPluginEnv, houdiniPluginEnv["INSTALL_HOUDINIPLUGIN_NAME"] ) ) houdiniPluginEnv.Alias( "install", houdiniPluginInstall ) houdiniPluginEnv.Alias( "installHoudini", houdiniPluginInstall ) @@ -2905,7 +2942,8 @@ if doConfigure : houdiniPythonModule = houdiniPythonModuleEnv.SharedLibrary( "python/IECoreHoudini/_IECoreHoudini", houdiniPythonSources ) houdiniPythonModuleEnv.Depends( houdiniPythonModule, houdiniLib ) houdiniPythonModuleInstall = houdiniPythonModuleEnv.Install( "$INSTALL_PYTHON_DIR/IECoreHoudini", houdiniPythonScripts + houdiniPythonModule ) - houdiniPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreHoudini", lambda target, source, env : makeSymLinks( houdiniPythonModuleEnv, houdiniPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + houdiniPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreHoudini", lambda target, source, env : makeSymLinks( houdiniPythonModuleEnv, houdiniPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) houdiniPythonModuleEnv.Alias( "install", houdiniPythonModuleInstall ) houdiniPythonModuleEnv.Alias( "installHoudini", houdiniPythonModuleInstall ) @@ -3083,14 +3121,16 @@ if doConfigure : usdLibrary = usdEnv.SharedLibrary( "lib/" + os.path.basename( usdEnv.subst( "$INSTALL_USDLIB_NAME" ) ), usdSources ) usdLibraryInstall = usdEnv.Install( os.path.dirname( usdEnv.subst( "$INSTALL_USDLIB_NAME" ) ), usdLibrary ) usdEnv.NoCache( usdLibraryInstall ) - usdEnv.AddPostAction( usdLibraryInstall, lambda target, source, env : makeLibSymLinks( usdEnv ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + usdEnv.AddPostAction( usdLibraryInstall, lambda target, source, env : makeLibSymLinks( usdEnv ) ) usdEnv.Alias( "install", usdLibraryInstall ) usdEnv.Alias( "installUSD", usdLibraryInstall ) usdEnv.Alias( "installLib", [ usdLibraryInstall ] ) # headers usdHeaderInstall = usdEnv.Install( "$INSTALL_HEADER_DIR/IECoreUSD", usdHeaders ) - usdEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreUSD", lambda target, source, env : makeSymLinks( usdEnv, usdEnv["INSTALL_HEADER_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + usdEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreUSD", lambda target, source, env : makeSymLinks( usdEnv, usdEnv["INSTALL_HEADER_DIR"] ) ) usdEnv.Alias( "install", usdHeaderInstall ) usdEnv.Alias( "installUSD", usdHeaderInstall ) @@ -3105,7 +3145,8 @@ if doConfigure : ).replace( "\\", "\\\\" ), } ) - usdEnv.AddPostAction( "$INSTALL_USD_RESOURCE_DIR/IECoreUSD", lambda target, source, env : makeSymLinks( usdEnv, usdEnv["INSTALL_USD_RESOURCE_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + usdEnv.AddPostAction( "$INSTALL_USD_RESOURCE_DIR/IECoreUSD", lambda target, source, env : makeSymLinks( usdEnv, usdEnv["INSTALL_USD_RESOURCE_DIR"] ) ) usdEnv.Alias( "install", usdResourceInstall ) usdEnv.Alias( "installUSD", usdResourceInstall ) @@ -3121,7 +3162,8 @@ if doConfigure : usdPythonModuleEnv.Depends( usdPythonModule, usdLibrary ) usdPythonModuleInstall = usdPythonModuleEnv.Install( "$INSTALL_PYTHON_DIR/IECoreUSD", usdPythonScripts + usdPythonModule ) - usdPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreUSD", lambda target, source, env : makeSymLinks( usdPythonModuleEnv, usdPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + usdPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreUSD", lambda target, source, env : makeSymLinks( usdPythonModuleEnv, usdPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) usdPythonModuleEnv.Alias( "install", usdPythonModuleInstall ) usdPythonModuleEnv.Alias( "installUSD", usdPythonModuleInstall ) @@ -3231,14 +3273,16 @@ if doConfigure : alembicLibrary = alembicEnv.SharedLibrary( "lib/" + os.path.basename( alembicEnv.subst( "$INSTALL_ALEMBICLIB_NAME" ) ), alembicSources ) alembicLibraryInstall = alembicEnv.Install( os.path.dirname( alembicEnv.subst( "$INSTALL_ALEMBICLIB_NAME" ) ), alembicLibrary ) alembicEnv.NoCache( alembicLibraryInstall ) - alembicEnv.AddPostAction( alembicLibraryInstall, lambda target, source, env : makeLibSymLinks( alembicEnv ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + alembicEnv.AddPostAction( alembicLibraryInstall, lambda target, source, env : makeLibSymLinks( alembicEnv ) ) alembicEnv.Alias( "install", alembicLibraryInstall ) alembicEnv.Alias( "installAlembic", alembicLibraryInstall ) alembicEnv.Alias( "installLib", [ alembicLibraryInstall ] ) # headers alembicHeaderInstall = alembicEnv.Install( "$INSTALL_HEADER_DIR/IECoreAlembic", alembicHeaders ) - alembicEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreAlembic", lambda target, source, env : makeSymLinks( alembicEnv, alembicEnv["INSTALL_HEADER_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + alembicEnv.AddPostAction( "$INSTALL_HEADER_DIR/IECoreAlembic", lambda target, source, env : makeSymLinks( alembicEnv, alembicEnv["INSTALL_HEADER_DIR"] ) ) alembicEnv.Alias( "install", alembicHeaderInstall ) alembicEnv.Alias( "installAlembic", alembicHeaderInstall ) @@ -3256,7 +3300,8 @@ if doConfigure : alembicPythonModuleEnv.Depends( alembicPythonModule, scenePythonModule ) alembicPythonModuleInstall = alembicPythonModuleEnv.Install( "$INSTALL_PYTHON_DIR/IECoreAlembic", alembicPythonScripts + alembicPythonModule ) - alembicPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreAlembic", lambda target, source, env : makeSymLinks( alembicPythonModuleEnv, alembicPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) + if env[ "INSTALL_CREATE_SYMLINKS" ] : + alembicPythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECoreAlembic", lambda target, source, env : makeSymLinks( alembicPythonModuleEnv, alembicPythonModuleEnv["INSTALL_PYTHON_DIR"] ) ) alembicPythonModuleEnv.Alias( "install", alembicPythonModuleInstall ) alembicPythonModuleEnv.Alias( "installAlembic", alembicPythonModuleInstall ) From 478a3bae44f0a378fc8feeb23722f8611925465f Mon Sep 17 00:00:00 2001 From: ivanimanishi Date: Wed, 18 Sep 2024 16:16:03 -0700 Subject: [PATCH 4/9] SConstruct : Prepend OIIO includes when building IECoreHoudini --- SConstruct | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SConstruct b/SConstruct index 1633982dce..e2b5ac9a14 100644 --- a/SConstruct +++ b/SConstruct @@ -2830,6 +2830,10 @@ houdiniEnv.Append( **houdiniEnvAppends ) houdiniEnv.Append( SHLINKFLAGS = pythonEnv["PYTHON_LINK_FLAGS"].split() ) houdiniEnv.Prepend( SHLINKFLAGS = "$HOUDINI_LINK_FLAGS" ) +# Prepend OIIO path for houdini to allow for non-namespaced includes to be used +# Houdini ships with a namespaced OpenImageIO (HOIIO) as part of $HOUDINI_INCLUDE_PATH. +# If you do want to use it, set OIIO_INCLUDE_PATH to that. +houdiniEnv.Prepend( CXXFLAGS = [ systemIncludeArgument, "$OIIO_INCLUDE_PATH"] ) houdiniPythonModuleEnv = pythonModuleEnv.Clone( **houdiniEnvSets ) houdiniPythonModuleEnv.Append( **houdiniEnvAppends ) From 0da346b7a837c542a35f21d398edf780a0412b59 Mon Sep 17 00:00:00 2001 From: ivanimanishi Date: Wed, 11 Sep 2024 14:15:32 -0700 Subject: [PATCH 5/9] ie/options : Update to support vfx platform 2023+ builds Also includes style changes. --- config/ie/buildAll | 187 ++++----- config/ie/options | 945 ++++++++++++++++++++++++++++----------------- 2 files changed, 684 insertions(+), 448 deletions(-) diff --git a/config/ie/buildAll b/config/ie/buildAll index 50128aa9f6..30c6622bc6 100755 --- a/config/ie/buildAll +++ b/config/ie/buildAll @@ -5,9 +5,9 @@ import subprocess import sys import os import os.path -import shutil import VersionControl -VersionControl.setVersion( "IEBuild" ) + +VersionControl.setVersion("IEBuild") import IEBuild ########################################################################## @@ -15,124 +15,139 @@ import IEBuild ########################################################################## ## \todo: this is duplicated from ./options but can we centralize it instead? -def cortexRegistryVersion() : - - import re - varsFound = {} - varsToFind = [ "ieCoreMilestoneVersion", "ieCoreMajorVersion" ] - - with open( "SConstruct", "r" ) as f : - for line in f : - for varName in varsToFind : - match = re.match( "^\s*%s\s*=\s*(?P\d+).*$" % varName, line ) - if match : - varsFound[varName] = match.groupdict()["value"] - varsToFind.remove( varName ) - break - if not varsToFind: - break - - if varsToFind : - raise Exception( "Could not find the Cortex version in the SConstruct file. Please review the parsing rules." ) - - return varsFound["ieCoreMilestoneVersion"] + "." + varsFound["ieCoreMajorVersion"] +def cortexVersion(): + import re + + varsFound = {} + varNames = [ + "ieCoreMilestoneVersion", "ieCoreMajorVersion", "ieCoreMinorVersion", "ieCorePatchVersion" + ] + varsToFind = list(varNames) + + with open("SConstruct", "r") as f: + for line in f: + for varName in varsToFind: + match = re.match("^\s*%s\s*=\s*(?P\d+).*$" % varName, line) + if match: + varsFound[varName] = match.groupdict()["value"] + varsToFind.remove(varName) + break + if not varsToFind: + break + + if varsToFind: + raise Exception( + "Could not find the Cortex version in the SConstruct file. Please review the parsing" + " rules." + ) + + return ".".join([varsFound[k] for k in varNames]) + + +currentCortexVersion = cortexVersion() +cortexReg = IEEnv.findRegistryRoot("cortex", currentCortexVersion) platform = IEEnv.platform() -cortexCompatibilityVersion = cortexRegistryVersion() -cortexReg = IEEnv.registry["libraries"]["cortex"][cortexCompatibilityVersion][platform] ########################################################################## # Run a single build ########################################################################## -def build( extraArgs = [] ) : - sysArgs = sys.argv[1:] +def build(extraArgs=[]): + sysArgs = sys.argv[1:] - install = False - if "install" in sysArgs : - install = True - sysArgs.remove( "install" ) + install = False + if "install" in sysArgs: + install = True + sysArgs.remove("install") - release = False - if "RELEASE=1" in sysArgs : - release = True + release = False + if "RELEASE=1" in sysArgs: + release = True - if "J=" in " ".join( sysArgs ) : - sysArgs = " ".join( sysArgs ).replace( "J=", "-j " ).split( " " ) + if "J=" in " ".join(sysArgs): + sysArgs = " ".join(sysArgs).replace("J=", "-j ").split(" ") - installPrefix = "/software" if release else os.path.expanduser( "~" ) - buildArgs = [ "INSTALL_PREFIX=" + installPrefix ] - buildArgs.extend( extraArgs ) - buildArgs.extend( sysArgs ) + installPrefix = "/software" if release else os.path.expanduser("~") + buildArgs = ["INSTALL_PREFIX=" + installPrefix] + buildArgs.extend(extraArgs) + buildArgs.extend(sysArgs) - argsToValidate = [ "CORTEX_VERSION={}".format( cortexCompatibilityVersion ) ] + extraArgs - if not IEEnv.Registry.validateVariation( argsToValidate ) : - print( "Skipped invalid variation combination: " + str(argsToValidate) + "\n" ) - return + argsToValidate = ["CORTEX_VERSION={}".format(currentCortexVersion)] + extraArgs + if not IEEnv.Registry.validateVariation(argsToValidate): + print("Skipped invalid variation combination: " + str(argsToValidate) + "\n") + return - cmd = [ "scons", "install" ] if install or release else [ "scons" ] + cmd = ["scons", "install"] if install or release else ["scons"] - print( " ".join( cmd + buildArgs ) ) - if "DRYRUN=1" in sysArgs : - return + print(" ".join(cmd + buildArgs)) + if "DRYRUN=1" in sysArgs: + return + + if subprocess.call(cmd + buildArgs) != 0: + raise RuntimeError("Error : " + str(" ".join(cmd + buildArgs))) + print("Build succeeded: " + " ".join(cmd + buildArgs) + "\n") - if subprocess.call( cmd + buildArgs ) != 0 : - raise RuntimeError( "Error : " + str( " ".join( cmd + buildArgs ) ) ) - print( "Build succeeded: " + " ".join( cmd + buildArgs ) + "\n" ) ########################################################################## # Build docs only ########################################################################## -def installDocs() : - sysArgs = sys.argv[1:] +def installDocs(): + sysArgs = sys.argv[1:] - if "RELEASE=1" not in sysArgs : - return + if "RELEASE=1" not in sysArgs: + return - buildArgs = [ "INSTALL_PREFIX=/software" ] - buildArgs.extend( sysArgs ) + buildArgs = ["INSTALL_PREFIX=/software"] + buildArgs.extend(sysArgs) - cmd = [ "scons", "installDoc" ] - print( " ".join( cmd + buildArgs ) ) - if "DRYRUN=1" in sysArgs : - return + cmd = ["scons", "installDoc"] + print(" ".join(cmd + buildArgs)) + if "DRYRUN=1" in sysArgs: + return - if subprocess.call( cmd + buildArgs ) != 0 : + if subprocess.call(cmd + buildArgs) != 0: + raise RuntimeError("Error : scons installDoc " + str(" ".join(buildArgs))) - raise RuntimeError("Error : scons installDoc " + str( " ".join( buildArgs ) ) ) ########################################################################## # Loop over all builds ########################################################################## -compilerVersions = IEBuild.utils.versionsToInstall( "gcc" ) -pythonVersions = IEBuild.utils.versionsToInstall( "python" ) -mayaVersions = IEBuild.utils.versionsToInstall( "maya" ) -nukeVersions = IEBuild.utils.versionsToInstall( "nuke" ) -houdiniVersions = IEBuild.utils.versionsToInstall( "houdini" ) -rvVersions = IEBuild.utils.versionsToInstall( "rv" ) +compilerVersions = IEBuild.utils.versionsToInstall("gcc") +pythonVersions = IEBuild.utils.versionsToInstall("python") +mayaVersions = IEBuild.utils.versionsToInstall("maya") +nukeVersions = IEBuild.utils.versionsToInstall("nuke") +houdiniVersions = IEBuild.utils.versionsToInstall("houdini") +rvVersions = IEBuild.utils.versionsToInstall("rv") for compilerVersion in compilerVersions: - for pythonVersion in pythonVersions : - build( [ "COMPILER_VERSION="+compilerVersion, "PYTHON_VERSION="+pythonVersion, "DL_VERSION=UNDEFINED" ] ) - -for mayaVersion in mayaVersions : - compilerVersion = IEEnv.registry["apps"]["maya"][mayaVersion][platform]["compilerVersion"] - build( [ "APP=maya", "APP_VERSION="+mayaVersion ] ) - -for nukeVersion in nukeVersions : - compilerVersion = IEEnv.registry["apps"]["nuke"][nukeVersion][platform]["compilerVersion"] - build( [ "APP=nuke", "APP_VERSION="+nukeVersion ] ) - -for houdiniVersion in houdiniVersions : - compilerVersion = IEEnv.registry["apps"]["houdini"][houdiniVersion][platform]["compilerVersion"] - build( [ "APP=houdini", "APP_VERSION="+houdiniVersion ] ) - -for rvVersion in rvVersions : - build( [ "APP=rv", "APP_VERSION="+rvVersion, "DL_VERSION=UNDEFINED" ] ) + for pythonVersion in pythonVersions: + build( + [ + "COMPILER_VERSION=" + compilerVersion, + "PYTHON_VERSION=" + pythonVersion, + "DL_VERSION=UNDEFINED", + ] + ) + +for mayaVersion in mayaVersions: + compilerVersion = IEEnv.registry["apps"]["maya"][mayaVersion][platform]["compilerVersion"] + build(["APP=maya", "APP_VERSION=" + mayaVersion]) + +for nukeVersion in nukeVersions: + compilerVersion = IEEnv.registry["apps"]["nuke"][nukeVersion][platform]["compilerVersion"] + build(["APP=nuke", "APP_VERSION=" + nukeVersion]) + +for houdiniVersion in houdiniVersions: + compilerVersion = IEEnv.registry["apps"]["houdini"][houdiniVersion][platform]["compilerVersion"] + build(["APP=houdini", "APP_VERSION=" + houdiniVersion]) + +for rvVersion in rvVersions: + build(["APP=rv", "APP_VERSION=" + rvVersion, "DL_VERSION=UNDEFINED"]) installDocs() diff --git a/config/ie/options b/config/ie/options index e650468f64..f4868268ff 100644 --- a/config/ie/options +++ b/config/ie/options @@ -33,24 +33,23 @@ ########################################################################## import distutils +from distutils.version import LooseVersion import os -import sys -import os.path import IEEnv import re -import copy import getpass -import string -def getOption( name, default ) : - import sys - result = default - for a in sys.argv: - if a[:len(name)+1]==name+"=" : - result = a[len(name)+1:] +def getOption(name, default): + import sys + + result = default + for a in sys.argv: + if a[: len(name) + 1] == name + "=": + result = a[len(name) + 1 :] + + return result - return result # decide what compiler/app we're targeting. we either pass COMPILER_VERSION, COMPILER and PYTHON_VERSION # to do a straight install in /software/apps/cortex//$PLATFORM/base/ or we pass an APP and APP_VERSION pair @@ -59,10 +58,10 @@ def getOption( name, default ) : platform = IEEnv.platform() -compiler = getOption( "COMPILER", None ) -compilerVersion = getOption( "COMPILER_VERSION", None ) -pythonVersion = getOption( "PYTHON_VERSION", None ) -targetApp = getOption( "APP", None ) +compiler = getOption("COMPILER", None) +compilerVersion = getOption("COMPILER_VERSION", None) +pythonVersion = getOption("PYTHON_VERSION", None) +targetApp = getOption("APP", None) # get cortex config information from the registry. if we have setting specific to this platform then use them, otherwise @@ -72,420 +71,642 @@ targetApp = getOption( "APP", None ) # parse SConstruct file for the cortex version ########################################################################## -def cortexRegistryVersion() : - - import re - varsFound = {} - varsToFind = [ "ieCoreMilestoneVersion", "ieCoreMajorVersion" ] - - with open( "SConstruct", "r" ) as f : - for line in f : - for varName in varsToFind : - match = re.match( "^\s*%s\s*=\s*(?P\d+).*$" % varName, line ) - if match : - varsFound[varName] = match.groupdict()["value"] - varsToFind.remove( varName ) - break - if not varsToFind: - break - - if varsToFind : - raise Exception( "Could not find the Cortex version in the SConstruct file. Please review the parsing rules." ) - - return varsFound["ieCoreMilestoneVersion"] + "." + varsFound["ieCoreMajorVersion"] - -cortexReg = IEEnv.registry["libraries"]["cortex"][cortexRegistryVersion()][platform] - -if targetApp : - - if targetApp not in ( "nuke", "maya", "houdini", "rv" ) : - raise RuntimeError( "Check config logic applies to the new app and remove this exception." ) - - if (compiler or compilerVersion) : - raise RuntimeError( "Must specify only one of COMPILER or APP" ) - - if pythonVersion : - raise RuntimeError( "Must specify only one of PYTHON_VERSION or APP" ) - - targetAppVersion = getOption( "APP_VERSION", os.environ.get( targetApp.upper() + "_VERSION" ) ) - - targetAppReg = IEEnv.registry["apps"][targetApp][targetAppVersion][platform] - compiler = targetAppReg["compiler"] - compilerVersion = targetAppReg["compilerVersion"] - cxxStd = targetAppReg.get( "cxxStd", cortexReg.get( "cxxStd", "c++11" ) ) - openEXRVersion = targetAppReg.get( "OpenEXRVersion", cortexReg["OpenEXRVersion"] ) - alembicVersion = targetAppReg.get( "AlembicVersion", cortexReg["AlembicVersion"] ) - vdbVersion = targetAppReg.get( "OpenVDBVersion", cortexReg["OpenVDBVersion"] ) - bloscVersion = targetAppReg.get( "bloscVersion", cortexReg["bloscVersion"] ) - hdf5Version = targetAppReg.get( "hdf5Version", cortexReg["hdf5Version"] ) - glewVersion = targetAppReg.get( "glewVersion", cortexReg["glewVersion"] ) - pythonVersion = targetAppReg["pythonVersion"] - boostVersion = targetAppReg.get( "boostVersion", cortexReg["boostVersion"] ) - oiioVersion = targetAppReg.get( "OpenImageIOVersion", cortexReg["OpenImageIOVersion"] ) - oiioLibSuffix = targetAppReg.get( "OpenImageIOLibSuffix", oiioVersion ) - tbbVersion = targetAppReg.get( "tbbVersion", cortexReg["tbbVersion"] ) - usdVersion = targetAppReg.get( "usdVersion", cortexReg.get("usdVersion", None) ) - targetAppMajorVersion = targetAppReg.get( "majorVersion", targetAppVersion ) - compatibilityVersion = targetAppReg.get( "compatibilityVersion", targetAppMajorVersion ) -else : - platformReg = IEEnv.registry["platformDefaults"][IEEnv.platform()] - if not compiler : - compiler = cortexReg.get( "compiler", platformReg["compiler"] ) - if not compilerVersion : - compilerVersion = cortexReg.get( "compilerVersion", platformReg["compilerVersion"] ) - if not pythonVersion : - pythonVersion = cortexReg["preferredPythonVersion"] - cxxStd = cortexReg.get( "cxxStd", "c++11" ) - openEXRVersion = cortexReg["OpenEXRVersion"] - alembicVersion = cortexReg["AlembicVersion"] - vdbVersion = cortexReg.get("OpenVDBVersion", "4.0.2") - bloscVersion = cortexReg.get("bloscVersion" ) - hdf5Version = cortexReg["hdf5Version"] - glewVersion = cortexReg["glewVersion"] - tbbVersion = cortexReg["tbbVersion"] - usdVersion = cortexReg.get("usdVersion", None) - boostVersion = cortexReg["boostVersion"] - oiioVersion = cortexReg["OpenImageIOVersion"] - oiioLibSuffix = oiioVersion + +def cortexVersion(): + import re + + varsFound = {} + varNames = [ + "ieCoreMilestoneVersion", + "ieCoreMajorVersion", + "ieCoreMinorVersion", + "ieCorePatchVersion", + ] + varsToFind = list(varNames) + + with open("SConstruct", "r") as f: + for line in f: + for varName in varsToFind: + match = re.match("^\s*%s\s*=\s*(?P\d+).*$" % varName, line) + if match: + varsFound[varName] = match.groupdict()["value"] + varsToFind.remove(varName) + break + if not varsToFind: + break + + if varsToFind: + raise Exception( + "Could not find the Cortex version in the SConstruct file. Please review the parsing" + " rules." + ) + + return ".".join([varsFound[k] for k in varNames]) + + +currentCortexVersion = cortexVersion() +cortexReg = IEEnv.findRegistryRoot("cortex", currentCortexVersion) + +if LooseVersion(currentCortexVersion) >= LooseVersion("10.5.9"): + INSTALL_CREATE_SYMLINKS = False + +if targetApp: + if targetApp not in ("nuke", "maya", "houdini", "rv"): + raise RuntimeError("Check config logic applies to the new app and remove this exception.") + + if compiler or compilerVersion: + raise RuntimeError("Must specify only one of COMPILER or APP") + + if pythonVersion: + raise RuntimeError("Must specify only one of PYTHON_VERSION or APP") + + targetAppVersion = getOption("APP_VERSION", os.environ.get(targetApp.upper() + "_VERSION")) + + targetAppReg = IEEnv.registry["apps"][targetApp][targetAppVersion][platform] + compiler = targetAppReg["compiler"] + compilerVersion = targetAppReg["compilerVersion"] + cxxStd = targetAppReg.get("cxxStd", cortexReg.get("cxxStd", "c++11")) + openEXRVersion = targetAppReg.get("OpenEXRVersion", cortexReg["OpenEXRVersion"]) + alembicVersion = targetAppReg.get("AlembicVersion", cortexReg["AlembicVersion"]) + vdbVersion = targetAppReg.get("OpenVDBVersion", cortexReg["OpenVDBVersion"]) + pybind11Version = targetAppReg.get("pybind11", cortexReg.get("pybind11", "2.10.4")) + bloscVersion = targetAppReg.get("bloscVersion", cortexReg["bloscVersion"]) + hdf5Version = targetAppReg.get("hdf5Version", cortexReg["hdf5Version"]) + glewVersion = targetAppReg.get("glewVersion", cortexReg["glewVersion"]) + pythonVersion = targetAppReg["pythonVersion"] + boostVersion = targetAppReg.get("boostVersion", cortexReg["boostVersion"]) + oiioVersion = targetAppReg.get("OpenImageIOVersion", cortexReg["OpenImageIOVersion"]) + oiioLibSuffix = targetAppReg.get("OpenImageIOLibSuffix", oiioVersion) + tbbVersion = targetAppReg.get("tbbVersion", cortexReg["tbbVersion"]) + usdVersion = targetAppReg.get("usdVersion", cortexReg.get("usdVersion", None)) + targetAppMajorVersion = targetAppReg.get("majorVersion", targetAppVersion) + compatibilityVersion = targetAppReg.get("compatibilityVersion", targetAppMajorVersion) +else: + platformReg = IEEnv.registry["platformDefaults"][IEEnv.platform()] + if not compiler: + compiler = cortexReg.get("compiler", platformReg["compiler"]) + if not compilerVersion: + compilerVersion = cortexReg.get("compilerVersion", platformReg["compilerVersion"]) + if not pythonVersion: + pythonVersion = cortexReg["preferredPythonVersion"] + cxxStd = cortexReg.get("cxxStd", "c++11") + openEXRVersion = cortexReg["OpenEXRVersion"] + alembicVersion = cortexReg["AlembicVersion"] + vdbVersion = cortexReg.get("OpenVDBVersion", "4.0.2") + pybind11Version = cortexReg.get("pybind11", "2.10.4") + bloscVersion = cortexReg.get("bloscVersion") + hdf5Version = cortexReg["hdf5Version"] + glewVersion = cortexReg["glewVersion"] + tbbVersion = cortexReg["tbbVersion"] + usdVersion = cortexReg.get("usdVersion", None) + boostVersion = cortexReg["boostVersion"] + oiioVersion = cortexReg["OpenImageIOVersion"] + oiioLibSuffix = oiioVersion # get the compiler location using the registry compilerReg = IEEnv.registry["compilers"][compiler][compilerVersion][platform] -CXX = os.path.join( compilerReg["location"], compilerReg["bin"] ) -CXXSTD = getOption( "CXXSTD", cxxStd ) +CXX = os.path.join(compilerReg["location"], compilerReg["bin"]) +CXXSTD = getOption("CXXSTD", cxxStd) -m = re.compile( "^([0-9]+)\.([0-9]+)\.([0-9]+)$" ).match( compilerVersion ) -if m : - compilerMajorVersion, compilerMinorVersion, compilerPatchVersion = m.group( 1, 2, 3 ) - compilerVersionInt = int(compilerMajorVersion) * 100 + int(compilerMinorVersion) * 10 + int(compilerPatchVersion) -else : - m = re.compile( "^([0-9]+)\.([0-9]+)$" ).match( compilerVersion ) - compilerMajorVersion, compilerMinorVersion = m.group( 1, 2 ) - compilerVersionInt = int(compilerMajorVersion) * 100 + int(compilerMinorVersion) * 10 + 9 +m = re.compile("^([0-9]+)\.([0-9]+)\.([0-9]+)$").match(compilerVersion) +if m: + compilerMajorVersion, compilerMinorVersion, compilerPatchVersion = m.group(1, 2, 3) + compilerVersionInt = ( + int(compilerMajorVersion) * 100 + int(compilerMinorVersion) * 10 + int(compilerPatchVersion) + ) +else: + m = re.compile("^([0-9]+)\.([0-9]+)$").match(compilerVersion) + compilerMajorVersion, compilerMinorVersion = m.group(1, 2) + compilerVersionInt = int(compilerMajorVersion) * 100 + int(compilerMinorVersion) * 10 + 9 -if not m : - raise RuntimeError( "Cannot determine compiler version (%s)" % compilerVersion ) +if not m: + raise RuntimeError("Cannot determine compiler version (%s)" % compilerVersion) -CXXFLAGS = [ "-pipe", "-Wall", "-Wextra", "-pthread" ] +# TODO: TBB_SUPPRESS_DEPRECATED_MESSAGES is required because tbb/mutex.h and tbb/recursive_mutex.h +# are deprecated by tbb. The recommendation is to use std::mutex and std:recursive_mutex +CXXFLAGS = ["-pipe", "-Wall", "-Wextra", "-pthread", "-DTBB_SUPPRESS_DEPRECATED_MESSAGES"] LINKFLAGS = [] # set the dependency paths -TBB_INCLUDE_PATH = os.path.join( "/software/apps/tbb", tbbVersion, platform, compiler, compilerVersion, "include" ) -TBB_LIB_PATH = os.path.join( "/software/apps/tbb", tbbVersion, platform, compiler, compilerVersion, "lib" ) -TBB_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix( "tbb", tbbVersion ) +TBB_INCLUDE_PATH = os.path.join( + "/software/apps/tbb", tbbVersion, platform, compiler, compilerVersion, "include" +) +TBB_LIB_PATH = os.path.join( + "/software/apps/tbb", tbbVersion, platform, compiler, compilerVersion, "lib" +) +TBB_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix("tbb", tbbVersion) -BOOST_INCLUDE_PATH = os.path.join( "/software/tools/include", platform, "boost", boostVersion ) -BOOST_LIB_PATH = os.path.join( "/software", "tools", "lib", platform, compiler, compilerVersion ) -BOOST_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix( "boost", boostVersion, { "compiler" : compiler, "compilerVersion" : compilerVersion } ) +BOOST_INCLUDE_PATH = os.path.join("/software/tools/include", platform, "boost", boostVersion) +BOOST_LIB_PATH = os.path.join("/software", "tools", "lib", platform, compiler, compilerVersion) +BOOST_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix( + "boost", boostVersion, {"compiler": compiler, "compilerVersion": compilerVersion} +) BOOST_PYTHON_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix( - "boost_python", boostVersion, { "compiler" : compiler, "compilerVersion" : compilerVersion, "pythonVersion" : pythonVersion } + "boost_python", + boostVersion, + {"compiler": compiler, "compilerVersion": compilerVersion, "pythonVersion": pythonVersion}, ) OPENEXR_INCLUDE_PATH = "/software/tools/include/" + platform + "/OpenEXR/" + openEXRVersion -OPENEXR_LIB_PATH = os.path.join( "/software", "tools", "lib", platform, compiler, compilerVersion ) -ILMBASE_LIB_PATH = os.path.join( "/software", "tools", "lib", platform, compiler, compilerVersion ) -OPENEXR_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix( "OpenEXR", openEXRVersion ) +OPENEXR_LIB_PATH = os.path.join("/software", "tools", "lib", platform, compiler, compilerVersion) +ILMBASE_LIB_PATH = os.path.join("/software", "tools", "lib", platform, compiler, compilerVersion) +OPENEXR_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix("OpenEXR", openEXRVersion) GLEW_INCLUDE_PATH = "/software/tools/include/" + platform + "/glew/" + glewVersion -GLEW_LIB_PATH = os.path.join( "/software", "tools", "lib", platform, compiler, compilerVersion ) -GLEW_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix( "glew", glewVersion ) +GLEW_LIB_PATH = os.path.join("/software", "tools", "lib", platform, compiler, compilerVersion) +GLEW_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix("glew", glewVersion) -oiioRoot = os.path.join( "/software", "apps", "OpenImageIO", oiioVersion, platform, compiler, compilerVersion ) -OIIO_INCLUDE_PATH = os.path.join( oiioRoot, "include" ) -OIIO_LIB_PATH = os.path.join( oiioRoot, "lib64" ) -OIIO_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix( "OpenImageIO", oiioLibSuffix ) +oiioRoot = os.path.join( + "/software", "apps", "OpenImageIO", oiioVersion, platform, compiler, compilerVersion +) +OIIO_INCLUDE_PATH = os.path.join(oiioRoot, "include") +OIIO_LIB_PATH = os.path.join(oiioRoot, "lib64") +OIIO_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix("OpenImageIO", oiioLibSuffix) WITH_OIIO_UTIL = "true" -FREETYPE_LIB_PATH = os.path.join( "/software", "tools", "lib", platform, compiler, compilerVersion ) +FREETYPE_LIB_PATH = os.path.join("/software", "tools", "lib", platform, compiler, compilerVersion) FREETYPE_INCLUDE_PATH = "/usr/include/freetype2" # find the right libraries based on compiler and platform -LIBPATH = ":".join( [ - os.path.join( "/software", "tools", "lib", platform, compiler, compilerVersion ), - os.path.join( "/software", "apps", compiler, compilerVersion, platform, "lib64" ), -] ) -if targetApp : - libPaths = [] - for libPath in targetAppReg.get( "libPaths", [] ): - libPaths.append( os.path.join( targetAppReg["location"], libPath ) ) - libPaths.append( LIBPATH ) - LIBPATH = ":".join( libPaths ) +LIBPATH = ":".join( + [ + os.path.join("/software", "tools", "lib", platform, compiler, compilerVersion), + os.path.join("/software", "apps", compiler, compilerVersion, platform, "lib64"), + ] +) +if targetApp: + libPaths = [] + for libPath in targetAppReg.get("libPaths", []): + libPaths.append(os.path.join(targetAppReg["location"], libPath)) + libPaths.append(LIBPATH) + LIBPATH = ":".join(libPaths) # ignore python-config stuff and specify it all explicitly ourselves -pythonReg = IEEnv.registry['apps']['python'][pythonVersion][platform] +pythonReg = IEEnv.registry["apps"]["python"][pythonVersion][platform] -pythonRoot = os.path.join( pythonReg["location"], compiler, compilerVersion ) +pythonRoot = os.path.join(pythonReg["location"], compiler, compilerVersion) PYTHON = "/software/tools/wrappers/iePython%s" % pythonVersion -PYTHON_INCLUDE_PATH = pythonReg["location"] + "/" + compiler + "/" + compilerVersion + "/" + pythonReg["include"] + "/python" + pythonVersion +PYTHON_INCLUDE_PATH = ( + pythonReg["location"] + + "/" + + compiler + + "/" + + compilerVersion + + "/" + + pythonReg["include"] + + "/python" + + pythonVersion +) PYTHON_LINK_FLAGS = pythonReg["moduleLinkFlags"] -if PYTHON_LINK_FLAGS=="" : - PYTHON_LINK_FLAGS = "-L" + pythonReg["location"] + "/" + compiler + "/" + compilerVersion + "/lib -lpython" + pythonVersion - -if distutils.version.LooseVersion( openEXRVersion ) < distutils.version.LooseVersion( "2.4.1" ) : - openEXRPythonModuleDir = os.path.join( "/software", "apps", "openexr", openEXRVersion, platform, compiler, compilerVersion, "python", pythonVersion, "boost", boostVersion, "lib64", "python" + pythonVersion, "site-packages" ) - openEXRPythonLibDir = os.path.join( "/software", "apps", "openexr", openEXRVersion, platform, compiler, compilerVersion, "python", pythonVersion, "boost", boostVersion, "lib" ) -else : - openEXRPythonModuleDir = os.path.join( "/software", "apps", "openexr", openEXRVersion, platform, compiler, compilerVersion, "python", pythonVersion, "boost", boostVersion, "lib", "python" + pythonVersion, "site-packages" ) - openEXRPythonLibDir = os.path.join( "/software", "apps", "openexr", openEXRVersion, platform, compiler, compilerVersion, "python", pythonVersion, "boost", boostVersion, "lib64" ) +if PYTHON_LINK_FLAGS == "": + PYTHON_LINK_FLAGS = ( + "-L" + + pythonReg["location"] + + "/" + + compiler + + "/" + + compilerVersion + + "/lib -lpython" + + pythonVersion + ) + +if distutils.version.LooseVersion(openEXRVersion) < distutils.version.LooseVersion("2.4.1"): + openEXRPythonModuleDir = os.path.join( + "/software", + "apps", + "openexr", + openEXRVersion, + platform, + compiler, + compilerVersion, + "python", + pythonVersion, + "boost", + boostVersion, + "lib64", + "python" + pythonVersion, + "site-packages", + ) + openEXRPythonLibDir = os.path.join( + "/software", + "apps", + "openexr", + openEXRVersion, + platform, + compiler, + compilerVersion, + "python", + pythonVersion, + "boost", + boostVersion, + "lib", + ) +else: + openEXRPythonModuleDir = os.path.join( + "/software", + "apps", + "openexr", + openEXRVersion, + platform, + compiler, + compilerVersion, + "lib", + "python" + pythonVersion, + "site-packages", + ) + openEXRPythonLibDir = os.path.join( + "/software", + "apps", + "openexr", + openEXRVersion, + platform, + compiler, + compilerVersion, + "lib", + ) PYTHONPATH = openEXRPythonModuleDir # get the installation locations right -INSTALL_PREFIX = getOption( "INSTALL_PREFIX", os.path.expanduser( "~" ) ) -installPrefix = os.path.join( "$INSTALL_PREFIX", "apps", "cortex", "${IECORE_VERSION}", platform ) +INSTALL_PREFIX = getOption("INSTALL_PREFIX", os.path.expanduser("~")) +installPrefix = os.path.join("$INSTALL_PREFIX", "apps", "cortex", "${IECORE_VERSION}", platform) # add the dev suffix to local builds -if getOption( "RELEASE", "0" )!="1" : - installPrefix = os.path.join( "$INSTALL_PREFIX", "apps", "cortex", "${IECORE_VERSION}dev", platform ) - -basePrefix = os.path.join( installPrefix, "base" ) -if targetApp : - if targetApp in ( "nuke", ): - appPrefix = os.path.join( installPrefix, targetApp, compatibilityVersion ) - else: - appPrefix = os.path.join( installPrefix, targetApp, targetAppMajorVersion ) +if getOption("RELEASE", "0") != "1": + installPrefix = os.path.join( + "$INSTALL_PREFIX", "apps", "cortex", "${IECORE_VERSION}dev", platform + ) + +basePrefix = os.path.join(installPrefix, "base") +if targetApp: + if targetApp in ("nuke",): + appPrefix = os.path.join(installPrefix, targetApp, compatibilityVersion) + else: + appPrefix = os.path.join(installPrefix, targetApp, targetAppMajorVersion) # ask for opengl support -WITH_GL=1 +WITH_GL = 1 # find alembic: -ALEMBIC_INCLUDE_PATH = os.path.join( "/software", "apps", "Alembic", alembicVersion, platform, compiler, compilerVersion, "include" ) -ALEMBIC_LIB_PATH = os.path.join( "/software", "apps", "Alembic", alembicVersion, platform, compiler, compilerVersion, "lib" ) -ALEMBIC_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix( "Alembic", alembicVersion ) - -VDB_INCLUDE_PATH = os.path.join( "/software", "apps", "OpenVDB", vdbVersion, platform, compiler, compilerVersion, "include" ) -VDB_LIB_PATH = os.path.join( "/software", "apps", "OpenVDB", vdbVersion, platform, compiler, compilerVersion, "lib" ) -VDB_PYTHON_PATH = os.path.join( "/software", "apps", "OpenVDB", vdbVersion, platform, compiler, compilerVersion, "python", "lib", "python"+pythonVersion ) +ALEMBIC_INCLUDE_PATH = os.path.join( + "/software", "apps", "Alembic", alembicVersion, platform, compiler, compilerVersion, "include" +) +ALEMBIC_LIB_PATH = os.path.join( + "/software", "apps", "Alembic", alembicVersion, platform, compiler, compilerVersion, "lib" +) +ALEMBIC_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix("Alembic", alembicVersion) -BLOSC_INCLUDE_PATH = os.path.join( "/software/tools/include/", platform, "blosc", bloscVersion ) -BLOSC_LIB_PATH = os.path.join("/software/tools/lib", platform, compiler, compilerVersion ) -BLOSC_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix( "blosc", bloscVersion ) +VDB_INCLUDE_PATH = os.path.join( + "/software", "apps", "OpenVDB", vdbVersion, platform, compiler, compilerVersion, "include" +) +VDB_LIB_PATH = os.path.join( + "/software", "apps", "OpenVDB", vdbVersion, platform, compiler, compilerVersion, "lib" +) +if LooseVersion(vdbVersion) < LooseVersion("10") and targetApp: + VDB_PYTHON_PATH = os.path.join( + "/software", + "apps", + "OpenVDB", + vdbVersion, + platform, + compiler, + compilerVersion, + "python", + "lib", + "python" + pythonVersion, + ) + +else: + VDB_PYTHON_PATH = os.path.join( + "/software", + "apps", + "OpenVDB", + vdbVersion, + platform, + compiler, + compilerVersion, + "python", + ) + + +PYBIND11_INCLUDE_PATH = os.path.join( + "/software", "tools", "include", platform, "pybind11", pybind11Version +) +BLOSC_INCLUDE_PATH = os.path.join("/software/tools/include/", platform, "blosc", bloscVersion) +BLOSC_LIB_PATH = os.path.join("/software/tools/lib", platform, compiler, compilerVersion) +BLOSC_LIB_SUFFIX = IEEnv.BuildUtil.libSuffix("blosc", bloscVersion) # find USD: -usdReg = IEEnv.registry["apps"]["usd"].get( usdVersion, {} ).get( platform ) -if usdReg : - if targetApp : - USD_INCLUDE_PATH = os.path.join( usdReg["location"], targetApp, compatibilityVersion, "include" ) - USD_LIB_PATH = os.path.join( usdReg["location"], targetApp, compatibilityVersion, "lib" ) - USD_LIB_PREFIX = "usd_" - else: - USD_INCLUDE_PATH = os.path.join( usdReg["location"], compiler, compilerVersion, "python", pythonVersion, "cortex", "$IECORE_COMPATIBILITY_VERSION", "include" ) - USD_LIB_PATH = os.path.join( usdReg["location"], compiler, compilerVersion, "python", pythonVersion, "cortex", "$IECORE_COMPATIBILITY_VERSION", "lib" ) - USD_LIB_PREFIX = "usd_" +usdReg = IEEnv.registry["apps"]["usd"].get(usdVersion, {}).get(platform) +if usdReg: + if LooseVersion(currentCortexVersion) < LooseVersion("10.5.9") and targetApp: + USD_INCLUDE_PATH = os.path.join( + usdReg["location"], targetApp, compatibilityVersion, "include" + ) + USD_LIB_PATH = os.path.join(usdReg["location"], targetApp, compatibilityVersion, "lib") + USD_LIB_PREFIX = "usd_" + else: + USD_INCLUDE_PATH = os.path.join( + usdReg["location"], + compiler, + compilerVersion, + "python", + pythonVersion, + "cortex", + "$IECORE_COMPATIBILITY_VERSION", + "include", + ) + USD_LIB_PATH = os.path.join( + usdReg["location"], + compiler, + compilerVersion, + "python", + pythonVersion, + "cortex", + "$IECORE_COMPATIBILITY_VERSION", + "lib", + ) + USD_LIB_PREFIX = "usd_" # find hdf5: -HDF5_INCLUDE_PATH = os.path.join( "/software/apps/hdf5", hdf5Version, platform, compiler, compilerVersion, "include" ) -HDF5_LIB_PATH = os.path.join( "/software/apps/hdf5", hdf5Version, platform, compiler, compilerVersion, "lib" ) +HDF5_INCLUDE_PATH = os.path.join( + "/software/apps/hdf5", hdf5Version, platform, compiler, compilerVersion, "include" +) +HDF5_LIB_PATH = os.path.join( + "/software/apps/hdf5", hdf5Version, platform, compiler, compilerVersion, "lib" +) + +# options file location (so we can refer to post install files later) +optionsFile = os.getenv("CORTEX_OPTIONS_FILE", "config/ie/options") +optionsDir = os.path.dirname(optionsFile) + +ieCoreLibSuffix = "" +ieCorePythonLibSuffix = "-python$PYTHON_VERSION" +if LooseVersion(currentCortexVersion) < LooseVersion("10.5.9") and targetApp: + ieCoreLibSuffix = "-$IECORE_COMPATIBILITY_VERSION" # find maya if we're building for maya -if targetApp=="maya" : - - mayaVersion = targetAppVersion - - mayaReg = IEEnv.registry["apps"]["maya"][mayaVersion][platform] - MAYA_ROOT = mayaReg["location"] - INSTALL_MAYALIB_NAME = os.path.join( appPrefix, "lib", "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION" ) - INSTALL_MEL_DIR = os.path.join( appPrefix, "mel", "$IECORE_NAME" ) - INSTALL_MAYAPLUGIN_NAME = os.path.join( appPrefix, "plugins", "$IECORE_NAME" ) - INSTALL_MAYAICON_DIR = os.path.join( appPrefix, "icons" ) - INSTALL_COREMAYA_POST_COMMAND="ieEnvExec {workingPath} scons -i -f config/ie/postCoreMayaInstall MAYA_VERSION='{mayaVersion}' INSTALLPREFIX={appPrefix} install".format( - workingPath = os.environ["IEENV_WORKING_PATH"], - mayaVersion = mayaVersion, - appPrefix = appPrefix - ) - WITH_MAYA_PLUGIN_LOADER = 1 - - mayaUsdVersion = mayaReg.get( "mayaUsdVersion" ) - mayaUsdReg = IEEnv.registry["apps"]["mayaUsd"].get( mayaUsdVersion, {} ).get( platform ) - # If the Maya usd plugin is not in the registry we build against our standalone USD version - if mayaUsdReg : - pluginUsdVersion = mayaUsdReg["usdVersion"] - # Maya ships the USD libraries with the installation, but not the header files... we use the one that are installed by standalone usd - usdReg = IEEnv.registry["apps"]["usd"].get( pluginUsdVersion, {} ).get( platform ) - if usdReg : - USD_INCLUDE_PATH = os.path.join( usdReg["location"], targetApp, compatibilityVersion, "include" ) - - mayaMajorVersion = mayaVersion.split(".")[0] - mayaLooseVersion = distutils.version.LooseVersion(mayaVersion) - if mayaLooseVersion >= "2022" and mayaLooseVersion < "2023": - # Maya 2022 installs the USD libs and the maya plugin itself for python 2 and 3. This is not the case for the 2020 version - # We make the assumption, that the python version suffix is for Maya 2022 only, because Maya 2023 will be python 3 exclusively. - mayaPythonMajorVersion = mayaReg["pythonVersion"].split(".")[0] - USD_LIB_PATH = os.path.join( mayaUsdReg["location"], mayaMajorVersion, "mayausd/USD{}/lib".format( mayaPythonMajorVersion ) ) - else: - USD_LIB_PATH = os.path.join( mayaUsdReg["location"], mayaMajorVersion, "mayausd/USD/lib" ) - - # Pixar introduced a library prefix `usd_` in USD v21.11, which Autodesk does not use yet, so we have to reset the prefix. - # See https://github.com/Autodesk/maya-usd/issues/2108 for reference - USD_LIB_PREFIX = "" if mayaUsdReg.get( "usdLibPrefix" ) == "" else mayaUsdReg.get( "usdLibPrefix" ) or USD_LIB_PREFIX +if targetApp == "maya": + mayaVersion = targetAppVersion + + mayaReg = IEEnv.registry["apps"]["maya"][mayaVersion][platform] + MAYA_ROOT = mayaReg["location"] + INSTALL_MAYALIB_NAME = os.path.join(appPrefix, "lib", "$IECORE_NAME{}".format(ieCoreLibSuffix)) + INSTALL_MEL_DIR = os.path.join(appPrefix, "mel", "$IECORE_NAME") + INSTALL_MAYAPLUGIN_NAME = os.path.join(appPrefix, "plugins", "$IECORE_NAME") + INSTALL_MAYAICON_DIR = os.path.join(appPrefix, "icons") + INSTALL_COREMAYA_POST_COMMAND = ( + "ieEnvExec {workingPath} scons -i -f {optionsDir}/postCoreMayaInstall" + " MAYA_VERSION='{mayaVersion}' INSTALLPREFIX={appPrefix} install".format( + optionsDir=optionsDir, + workingPath=os.environ["IEENV_WORKING_PATH"], + mayaVersion=mayaVersion, + appPrefix=appPrefix, + ) + ) + WITH_MAYA_PLUGIN_LOADER = 1 + + mayaUsdVersion = mayaReg.get("mayaUsdVersion") + mayaUsdReg = IEEnv.registry["apps"]["mayaUsd"].get(mayaUsdVersion, {}).get(platform) + # If the Maya usd plugin is not in the registry we build against our standalone USD version + if mayaUsdReg: + pluginUsdVersion = mayaUsdReg["usdVersion"] + # Maya ships the USD libraries with the installation, but not the header files... we use the one that are installed by standalone usd + usdReg = IEEnv.registry["apps"]["usd"].get(pluginUsdVersion, {}).get(platform) + if usdReg: + USD_INCLUDE_PATH = os.path.join( + usdReg["location"], targetApp, compatibilityVersion, "include" + ) + + mayaMajorVersion = mayaVersion.split(".")[0] + mayaLooseVersion = distutils.version.LooseVersion(mayaVersion) + if mayaLooseVersion >= "2022" and mayaLooseVersion < "2023": + # Maya 2022 installs the USD libs and the maya plugin itself for python 2 and 3. This is not the case for the 2020 version + # We make the assumption, that the python version suffix is for Maya 2022 only, because Maya 2023 will be python 3 exclusively. + mayaPythonMajorVersion = mayaReg["pythonVersion"].split(".")[0] + USD_LIB_PATH = os.path.join( + mayaUsdReg["location"], + mayaMajorVersion, + "mayausd/USD{}/lib".format(mayaPythonMajorVersion), + ) + else: + USD_LIB_PATH = os.path.join( + mayaUsdReg["location"], mayaMajorVersion, "mayausd/USD/lib" + ) + + # Pixar introduced a library prefix `usd_` in USD v21.11, which Autodesk does not use yet, so we have to reset the prefix. + # See https://github.com/Autodesk/maya-usd/issues/2108 for reference + USD_LIB_PREFIX = ( + "" + if mayaUsdReg.get("usdLibPrefix") == "" + else mayaUsdReg.get("usdLibPrefix") or USD_LIB_PREFIX + ) # find nuke if we're building for nuke -if targetApp=="nuke" : - - nukeVersion = targetAppVersion - nukeReg = IEEnv.registry["apps"]["nuke"][nukeVersion][platform] - NUKE_ROOT = nukeReg["location"] - NUKE_LICENSE_FILE = nukeReg["wrapperEnvVars"]["foundry_LICENSE"] - INSTALL_NUKELIB_NAME = os.path.join( appPrefix, "lib", "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION" ) - INSTALL_NUKEPYTHON_DIR = os.path.join( appPrefix, "python" ) - INSTALL_NUKEICON_DIR = os.path.join( appPrefix, "icons" ) - INSTALL_NUKEPLUGIN_NAME = os.path.join( appPrefix, "plugins", "$IECORE_NAME" ) +if targetApp == "nuke": + nukeVersion = targetAppVersion + nukeReg = IEEnv.registry["apps"]["nuke"][nukeVersion][platform] + NUKE_ROOT = nukeReg["location"] + NUKE_LICENSE_FILE = nukeReg["wrapperEnvVars"]["foundry_LICENSE"] + INSTALL_NUKELIB_NAME = os.path.join(appPrefix, "lib", "$IECORE_NAME{}".format(ieCoreLibSuffix)) + INSTALL_NUKEPYTHON_DIR = os.path.join(appPrefix, "python") + INSTALL_NUKEICON_DIR = os.path.join(appPrefix, "icons") + INSTALL_NUKEPLUGIN_NAME = os.path.join(appPrefix, "plugins", "$IECORE_NAME") + # Note: + # This is the recommended method for disabling the deprecation warnings for the legacy 3D + # system. + # From the foundry: + # ...it should be fine to continue using the classic 3D system, and these plugins, in Nuke 15.1 + # and, while we might eventually remove the classic 3D system in the future, there are currently + # no plans to do this. So with that said. it should be safe to ignore the deprecation warnings + # in the meantime. + CXXFLAGS.append("-DNUKE_DISABLE_DEPRECATIONS") # find houdini if we're building for houdini -if targetApp=="houdini" : - - houdiniVersion = targetAppVersion - - houdiniReg = IEEnv.registry["apps"]["houdini"][houdiniVersion][platform] - HOUDINI_ROOT = houdiniReg['location'] - - # we use out normal boost includes (and libs) because Houdini has mangled their - # boost install with an "h" prefix on the includes, libs, and even macros like HBOOST_VERSION. - BOOST_INCLUDE_PATH = "/software/tools/include/" + platform + "/boost/" + boostVersion - - # houdini 17 ships its own USD so we link against that - if distutils.version.LooseVersion(houdiniVersion) >= distutils.version.LooseVersion("17.0") : - TBB_INCLUDE_PATH = "$HOUDINI_INCLUDE_PATH" - TBB_LIB_PATH = "$HOUDINI_LIB_PATH" - TBB_LIB_SUFFIX = "" - GLEW_LIB_SUFFIX = "" - VDB_LIB_SUFFIX = "_sesi" - USD_INCLUDE_PATH = "$HOUDINI_INCLUDE_PATH" - USD_LIB_PATH = "$HOUDINI_LIB_PATH" - USD_LIB_PREFIX = "libpxr_" - WITH_USD_MONOLITHIC = True - if distutils.version.LooseVersion(houdiniVersion) >= distutils.version.LooseVersion("18.0") : - # SideFx is non building USD monolithically anymore - WITH_USD_MONOLITHIC = False - # we stop using SideFx namespaced library as much as possible. - VDB_LIB_SUFFIX = "" - - HOUDINI_CXX_FLAGS = " ".join( houdiniReg['compilerFlags'] ) - - INSTALL_HOUDINILIB_NAME = os.path.join( appPrefix, "lib", "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION" ) - INSTALL_HOUDINIPLUGIN_NAME = os.path.join( appPrefix, "plugins", "$IECORE_NAME" ) - INSTALL_HOUDINIOTL_DIR = os.path.join( appPrefix, "otls" ) - INSTALL_HOUDINIICON_DIR = os.path.join( appPrefix, "icons" ) - INSTALL_HOUDINITOOLBAR_DIR = os.path.join( appPrefix, "toolbar" ) - INSTALL_HOUDINIMENU_DIR = os.path.join( appPrefix, "generic" ) - - WITH_MANTRA = True - INSTALL_MANTRALIB_NAME = os.path.join( appPrefix, "lib", "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION" ) - INSTALL_MANTRAPROCEDURAL_NAME = os.path.join( appPrefix, "plugins", "mantra", "$IECORE_NAME" ) - - # Temporarily disable IECoreGL until we sort out our dependency trauma - # Houdini 16.0 requires Boost 1.55.0 - # IECoreGL requires IECoreImage requires OpenImageIO 1.8.4dev requires Boost 1.61.0 - # We need to sort this out before Cortex 10 is officially released, - # but chances are by that points Houdini 16.5 will be released. - if distutils.version.LooseVersion(houdiniVersion) >= distutils.version.LooseVersion("16.5"): - WITH_GL = 1 - else: - WITH_GL = False - -if targetApp=="rv" : - - rvVersion = targetAppVersion - rvReg = IEEnv.registry["apps"]["rv"][rvVersion][platform] - rvRoot = rvReg["location"] - rvIncludes = os.path.join( rvRoot, "include" ) - rvLibs = os.path.join( rvRoot, "lib" ) - - WITH_GL = False - - if distutils.version.LooseVersion(rvVersion) >= distutils.version.LooseVersion("7.8.0"): - if "boostVersion" in rvReg: - BOOST_INCLUDE_PATH = rvIncludes - BOOST_LIB_PATH = rvLibs - BOOST_LIB_SUFFIX = rvReg.get( "boostLibSuffix", BOOST_LIB_SUFFIX ) - - if "OpenImageIOVersion" in rvReg: - # NOTE: At the moment RV doesn't provide OIIO headers, so we rely on - # the default `OIIO_INCLUDE_PATH` value. - OIIO_LIB_PATH = rvLibs - OIIO_LIB_SUFFIX = rvReg.get( "OpenImageIOLibSuffix", OIIO_LIB_SUFFIX ) - # current version of OIIO used by RV doesn't include the Util library - # this variable will tell the build process to not require it - WITH_OIIO_UTIL = rvReg.get( "WithOpenImageIOUtil", WITH_OIIO_UTIL ) +if targetApp == "houdini": + houdiniVersion = targetAppVersion + + houdiniReg = IEEnv.registry["apps"]["houdini"][houdiniVersion][platform] + HOUDINI_ROOT = houdiniReg["location"] + + # houdini 17 ships its own USD so we link against that + if distutils.version.LooseVersion(houdiniVersion) >= distutils.version.LooseVersion("17.0"): + TBB_INCLUDE_PATH = "$HOUDINI_INCLUDE_PATH" + TBB_LIB_PATH = "$HOUDINI_LIB_PATH" + TBB_LIB_SUFFIX = "" + GLEW_LIB_SUFFIX = "" + VDB_LIB_SUFFIX = "_sesi" + USD_INCLUDE_PATH = "$HOUDINI_INCLUDE_PATH" + USD_LIB_PATH = "$HOUDINI_LIB_PATH" + USD_LIB_PREFIX = "libpxr_" + WITH_USD_MONOLITHIC = True + if distutils.version.LooseVersion(houdiniVersion) >= distutils.version.LooseVersion("18.0"): + # SideFx is non building USD monolithically anymore + WITH_USD_MONOLITHIC = False + # we stop using SideFx namespaced library as much as possible. + VDB_LIB_SUFFIX = "" + + HOUDINI_CXX_FLAGS = " ".join(houdiniReg["compilerFlags"]) + + INSTALL_HOUDINILIB_NAME = os.path.join( + appPrefix, "lib", "$IECORE_NAME{}".format(ieCoreLibSuffix) + ) + INSTALL_HOUDINIPLUGIN_NAME = os.path.join(appPrefix, "plugins", "$IECORE_NAME") + INSTALL_HOUDINIOTL_DIR = os.path.join(appPrefix, "otls") + INSTALL_HOUDINIICON_DIR = os.path.join(appPrefix, "icons") + INSTALL_HOUDINITOOLBAR_DIR = os.path.join(appPrefix, "toolbar") + INSTALL_HOUDINIMENU_DIR = os.path.join(appPrefix, "generic") + + WITH_MANTRA = True + INSTALL_MANTRALIB_NAME = os.path.join( + appPrefix, "lib", "$IECORE_NAME{}".format(ieCoreLibSuffix) + ) + INSTALL_MANTRAPROCEDURAL_NAME = os.path.join(appPrefix, "plugins", "mantra", "$IECORE_NAME") + + # Temporarily disable IECoreGL until we sort out our dependency trauma + # Houdini 16.0 requires Boost 1.55.0 + # IECoreGL requires IECoreImage requires OpenImageIO 1.8.4dev requires Boost 1.61.0 + # We need to sort this out before Cortex 10 is officially released, + # but chances are by that points Houdini 16.5 will be released. + if distutils.version.LooseVersion(houdiniVersion) >= distutils.version.LooseVersion("16.5"): + WITH_GL = 1 + else: + WITH_GL = False + +if targetApp == "rv": + # DEPRECATED: We no longer need to build cortex for rv + rvVersion = targetAppVersion + rvReg = IEEnv.registry["apps"]["rv"][rvVersion][platform] + rvRoot = rvReg["location"] + rvIncludes = os.path.join(rvRoot, "include") + rvLibs = os.path.join(rvRoot, "lib") + + WITH_GL = False + + if distutils.version.LooseVersion(rvVersion) >= distutils.version.LooseVersion("7.8.0"): + if "boostVersion" in rvReg: + BOOST_INCLUDE_PATH = rvIncludes + BOOST_LIB_PATH = rvLibs + BOOST_LIB_SUFFIX = rvReg.get("boostLibSuffix", BOOST_LIB_SUFFIX) + + if "OpenImageIOVersion" in rvReg: + # NOTE: At the moment RV doesn't provide OIIO headers, so we rely on + # the default `OIIO_INCLUDE_PATH` value. + OIIO_LIB_PATH = rvLibs + OIIO_LIB_SUFFIX = rvReg.get("OpenImageIOLibSuffix", OIIO_LIB_SUFFIX) + # current version of OIIO used by RV doesn't include the Util library + # this variable will tell the build process to not require it + WITH_OIIO_UTIL = rvReg.get("WithOpenImageIOUtil", WITH_OIIO_UTIL) # find doxygen -DOXYGEN = os.path.join( "/software/apps/doxygen", os.environ["DOXYGEN_VERSION"], platform, "bin", "doxygen" ) +DOXYGEN = os.path.join( + "/software/apps/doxygen", os.environ["DOXYGEN_VERSION"], platform, "bin", "doxygen" +) # import vars we need to get our doxygen and python wrappers working envVarsToImport = [ - "PATH", - "PYTHONPATH", - "IEENV_ROOT", - "IEENV_WORKING_PATH", - "IEENV_LIBRARY_PREFIX_PATH", - "DOXYGEN_VERSION", - "IEENV_DEBUG", - "IEENV_DEBUG_PYTHON", - "IEENV_DEBUGGER", - "IEENV_DEBUGGER_ARGS", - "DELIGHT_CONF", - "SCONS_VERSION", - "DL_VERSION", - "DL_SHADERS_PATH", - "DL_DISPLAYS_PATH", - "solidangle_LICENSE", - "CORTEX_POINTDISTRIBUTION_TILESET", - "OCIO", - "IECORE_DEBUG_WAIT", - "CORTEX_PERFORMANCE_TEST", - "IECORE_RTLD_GLOBAL", + "PATH", + "PYTHONPATH", + "IEENV_ROOT", + "IEENV_WORKING_PATH", + "IEENV_LIBRARY_PREFIX_PATH", + "DOXYGEN_VERSION", + "IEENV_DEBUG", + "IEENV_DEBUG_PYTHON", + "IEENV_DEBUGGER", + "IEENV_DEBUGGER_ARGS", + "DELIGHT_CONF", + "SCONS_VERSION", + "DL_VERSION", + "DL_SHADERS_PATH", + "DL_DISPLAYS_PATH", + "solidangle_LICENSE", + "CORTEX_POINTDISTRIBUTION_TILESET", + "OCIO", + "IECORE_DEBUG_WAIT", + "CORTEX_PERFORMANCE_TEST", + "IECORE_RTLD_GLOBAL", ] -ENV_VARS_TO_IMPORT= " ".join(envVarsToImport) +ENV_VARS_TO_IMPORT = " ".join(envVarsToImport) # make sure the tests can run testLibs = [ - openEXRPythonLibDir, - os.path.join( pythonReg["location"], compiler, compilerVersion, "lib" ), - os.path.join( compilerReg["location"], "lib" ), + openEXRPythonLibDir, + os.path.join(pythonReg["location"], compiler, compilerVersion, "lib"), + os.path.join(compilerReg["location"], "lib"), ] -TEST_LIBPATH = ":".join( testLibs ) +TEST_LIBPATH = ":".join(testLibs) TEST_LIBRARY_PATH_ENV_VAR = "IEENV_LIBRARY_PREFIX_PATH" # install the op stubs and procedural stubs -INSTALL_IECORE_PROCEDURAL_PATH = os.path.join( basePrefix, "procedurals", "$IECORE_NAME-${IECORE_COMPATIBILITY_VERSION}.py" ) +INSTALL_IECORE_PROCEDURAL_PATH = os.path.join( + basePrefix, "procedurals", "$IECORE_NAME-${IECORE_COMPATIBILITY_VERSION}.py" +) # ClassLoader requires integer versioning in the op filenames, so we use milestone version over compatibility version -INSTALL_IECORE_OP_PATH = os.path.join( basePrefix, "ops", "$IECORE_NAME-${IECORE_MILESTONE_VERSION}.py" ) - -if targetApp : - INSTALL_HEADER_DIR = os.path.join( appPrefix, "include" ) - INSTALL_USD_RESOURCE_DIR = os.path.join( appPrefix, "resource" ) - INSTALL_LIB_NAME = os.path.join( appPrefix, "lib", "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION" ) - INSTALL_PYTHONLIB_NAME = os.path.join( appPrefix, "lib", "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION-python$PYTHON_VERSION" ) - INSTALL_PYTHON_DIR = os.path.join( appPrefix, "python" ) - INSTALL_ALEMBICLIB_NAME = os.path.join( appPrefix, "lib", "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION" ) - INSTALL_USDLIB_NAME = os.path.join( appPrefix, "lib", "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION" ) -else : - INSTALL_HEADER_DIR = os.path.join( basePrefix, "include" ) - INSTALL_USD_RESOURCE_DIR = os.path.join( basePrefix, "resource" ) - INSTALL_LIB_NAME = os.path.join( basePrefix, "lib", compiler, compilerVersion, "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION" ) - INSTALL_PYTHONLIB_NAME = os.path.join( basePrefix, "lib", compiler, compilerVersion, "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION-python$PYTHON_VERSION" ) - INSTALL_PYTHON_DIR = os.path.join( basePrefix, "python", pythonVersion, compiler, compilerVersion ) - INSTALL_ALEMBICLIB_NAME = os.path.join( basePrefix, "lib", compiler, compilerVersion, "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION" ) - INSTALL_USDLIB_NAME = os.path.join( basePrefix, "lib", compiler, compilerVersion, "$IECORE_NAME-$IECORE_COMPATIBILITY_VERSION" ) - - # only installing for the base installation as the CORTEX_STARTUP_PATHS will load these within target apps as well - INSTALL_CORESCENE_POST_COMMAND = "ieEnvExec {workingPath} scons -i -f config/ie/postCoreSceneInstall INSTALLPREFIX={prefix} install".format( - workingPath = os.environ["IEENV_WORKING_PATH"], prefix = basePrefix - ) - INSTALL_COREIMAGE_POST_COMMAND = "ieEnvExec {workingPath} scons -i -f config/ie/postCoreImageInstall INSTALLPREFIX={prefix} install".format( - workingPath = os.environ["IEENV_WORKING_PATH"], prefix = basePrefix - ) - -INSTALL_GLSL_HEADER_DIR = os.path.join( basePrefix, "glsl" ) -INSTALL_GLSL_SHADER_DIR = os.path.join( basePrefix, "glsl" ) -INSTALL_RSL_HEADER_DIR = os.path.join( basePrefix, "rsl" ) -INSTALL_DOC_DIR = os.path.join( installPrefix, "doc" ) +INSTALL_IECORE_OP_PATH = os.path.join( + basePrefix, "ops", "$IECORE_NAME-${IECORE_MILESTONE_VERSION}.py" +) + +if targetApp: + INSTALL_HEADER_DIR = os.path.join(appPrefix, "include") + INSTALL_USD_RESOURCE_DIR = os.path.join(appPrefix, "resource") + INSTALL_LIB_NAME = os.path.join(appPrefix, "lib", "$IECORE_NAME{}".format(ieCoreLibSuffix)) + INSTALL_PYTHONLIB_NAME = os.path.join( + appPrefix, "lib", "$IECORE_NAME{}{}".format(ieCoreLibSuffix, ieCorePythonLibSuffix) + ) + INSTALL_PYTHON_DIR = os.path.join(appPrefix, "python") + INSTALL_ALEMBICLIB_NAME = os.path.join( + appPrefix, "lib", "$IECORE_NAME{}".format(ieCoreLibSuffix) + ) + INSTALL_USDLIB_NAME = os.path.join(appPrefix, "lib", "$IECORE_NAME{}".format(ieCoreLibSuffix)) +else: + INSTALL_HEADER_DIR = os.path.join(basePrefix, "include") + INSTALL_USD_RESOURCE_DIR = os.path.join(basePrefix, "resource") + INSTALL_LIB_NAME = os.path.join( + basePrefix, "lib", compiler, compilerVersion, "$IECORE_NAME{}".format(ieCoreLibSuffix) + ) + INSTALL_PYTHONLIB_NAME = os.path.join( + basePrefix, + "lib", + compiler, + compilerVersion, + "$IECORE_NAME{}{}".format(ieCoreLibSuffix, ieCorePythonLibSuffix), + ) + INSTALL_PYTHON_DIR = os.path.join( + basePrefix, "python", pythonVersion, compiler, compilerVersion + ) + INSTALL_ALEMBICLIB_NAME = os.path.join( + basePrefix, "lib", compiler, compilerVersion, "$IECORE_NAME{}".format(ieCoreLibSuffix) + ) + INSTALL_USDLIB_NAME = os.path.join( + basePrefix, "lib", compiler, compilerVersion, "$IECORE_NAME{}".format(ieCoreLibSuffix) + ) + + # only installing for the base installation as the CORTEX_STARTUP_PATHS will load these within target apps as well + INSTALL_CORESCENE_POST_COMMAND = ( + "ieEnvExec {workingPath} scons -i -f {optionsDir}/postCoreSceneInstall" + " INSTALLPREFIX={prefix} install".format( + optionsDir=optionsDir, workingPath=os.environ["IEENV_WORKING_PATH"], prefix=basePrefix + ) + ) + INSTALL_COREIMAGE_POST_COMMAND = ( + "ieEnvExec {workingPath} scons -i -f {optionsDir}/postCoreImageInstall" + " INSTALLPREFIX={prefix} install".format( + optionsDir=optionsDir, workingPath=os.environ["IEENV_WORKING_PATH"], prefix=basePrefix + ) + ) + +INSTALL_GLSL_HEADER_DIR = os.path.join(basePrefix, "glsl") +INSTALL_GLSL_SHADER_DIR = os.path.join(basePrefix, "glsl") +INSTALL_RSL_HEADER_DIR = os.path.join(basePrefix, "rsl") +INSTALL_DOC_DIR = os.path.join(installPrefix, "doc") INSTALL_PKG_CONFIG_FILE = "0" # speed up the build a bit hopefully. @@ -494,5 +715,5 @@ BUILD_CACHEDIR = os.environ["IEBUILD_CACHEDIR"] # build build will embed full paths to source code paths in the dwarf information # Disabling the build cache to ensure our debug builds are correct rather than fast. -if getOption( "DEBUG", False ) and os.path.exists("/disk1") : - BUILD_CACHEDIR = '/disk1/{0}/scons-cache'.format( getpass.getuser() ) +if getOption("DEBUG", False) and os.path.exists("/disk1"): + BUILD_CACHEDIR = "/disk1/{0}/scons-cache".format(getpass.getuser()) From 5e120cc26e80448054a7b9f76ca8441fbf7e3595 Mon Sep 17 00:00:00 2001 From: ivanimanishi Date: Wed, 11 Sep 2024 14:22:15 -0700 Subject: [PATCH 6/9] IECoreHoudini : Update to support Houdini 20.0 and 20.5 --- Changes | 5 ++++ include/IECoreHoudini/GEO_CortexPrimitive.h | 10 ++++++++ include/IECoreHoudini/GR_CortexPrimitive.h | 16 +++++++++--- src/IECoreHoudini/DetailSplitter.cpp | 1 + src/IECoreHoudini/GEO_CobIOTranslator.cpp | 2 ++ src/IECoreHoudini/GEO_CortexPrimitive.cpp | 17 +++++++++++++ src/IECoreHoudini/GR_CortexPrimitive.cpp | 27 ++++++++++++++++----- 7 files changed, 68 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index 97cf4f0e4c..19bd6f118c 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,11 @@ 10.5.x.x (relative to 10.5.10.0) ======== +Improvements +------------ + +- IECoreHoudini : Updated to support Houdini 20.0 and 20.5. + Build ----- diff --git a/include/IECoreHoudini/GEO_CortexPrimitive.h b/include/IECoreHoudini/GEO_CortexPrimitive.h index ca16b08004..87446f1635 100644 --- a/include/IECoreHoudini/GEO_CortexPrimitive.h +++ b/include/IECoreHoudini/GEO_CortexPrimitive.h @@ -109,9 +109,16 @@ class IECOREHOUDINI_API GEO_CortexPrimitive : public GEO_Primitive virtual GEO_Primitive * copy( int preserve_shared_pts ) const; virtual void copyPrimitive( const GEO_Primitive *src, GEO_Point **ptredirect ); +#if MIN_HOU_VERSION( 19, 5, 0 ) + virtual bool getBBox( UT_BoundingBox *bbox ) const; +#else virtual int getBBox( UT_BoundingBox *bbox ) const; +#endif virtual void enlargePointBounds( UT_BoundingBox &box ) const; virtual UT_Vector3 computeNormal() const; +#if MIN_HOU_VERSION( 19, 5, 0 ) + virtual UT_Vector3D computeNormalD() const; +#endif virtual int detachPoints( GA_PointGroup &grp ); #if UT_MAJOR_VERSION_INT >= 16 @@ -148,6 +155,9 @@ class IECOREHOUDINI_API GEO_CortexPrimitive : public GEO_Primitive virtual GEO_Primitive *convert( ConvertParms &parms, GA_PointGroup *usedpts = 0 ); virtual GEO_Primitive *convertNew( ConvertParms &parms ); virtual void normal( NormalComp &output ) const; +#if MIN_HOU_VERSION( 19, 5, 0 ) + virtual void normal( NormalCompD &output ) const; +#endif virtual int intersectRay( const UT_Vector3 &o, const UT_Vector3 &d, float tmax=1E17F, float tol=1E-12F, float *distance=0, UT_Vector3 *pos=0, UT_Vector3 *nml=0, int accurate=0, float *u=0, float *v=0, int ignoretrim=1 ) const; /// Set the IECore::Object contained by this GEO_Primitive. Note that in most situations diff --git a/include/IECoreHoudini/GR_CortexPrimitive.h b/include/IECoreHoudini/GR_CortexPrimitive.h index 6c258c4005..ab681ef043 100644 --- a/include/IECoreHoudini/GR_CortexPrimitive.h +++ b/include/IECoreHoudini/GR_CortexPrimitive.h @@ -35,6 +35,7 @@ #ifndef IECOREHOUDINI_GRCORTEXPRIMITIVE_H #define IECOREHOUDINI_GRCORTEXPRIMITIVE_H +#include "IECoreHoudini/CoreHoudiniVersion.h" #include "IECoreHoudini/Export.h" #include "IECoreScene/Renderable.h" @@ -73,20 +74,27 @@ class IECOREHOUDINI_API GR_CortexPrimitive : public GR_Primitive protected : +#if MIN_HOU_VERSION( 20, 0, 0 ) + virtual void update( RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p ); +#else virtual void update( RE_Render *r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p ); +#endif -#if UT_MAJOR_VERSION_INT >= 16 +#if MIN_HOU_VERSION( 20, 0, 0 ) + virtual void render( RE_RenderContext r, GR_RenderMode render_mode, GR_RenderFlags flags, GR_DrawParms parms); +#elif UT_MAJOR_VERSION_INT >= 16 virtual void render( RE_Render *r, GR_RenderMode render_mode, GR_RenderFlags flags, GR_DrawParms parms); - #else - virtual void render( RE_Render *r, GR_RenderMode render_mode, GR_RenderFlags flags, const GR_DisplayOption *opt, const UT_Array *materials ); - #endif +#if MIN_HOU_VERSION( 20, 0, 0 ) + virtual int renderPick( RE_RenderContext r, const GR_DisplayOption *opt, unsigned int pick_type, GR_PickStyle pick_style, bool has_pick_map ); +#else virtual void renderInstances( RE_Render *r, GR_RenderMode render_mode, GR_RenderFlags flags, const GR_DisplayOption *opt, const UT_Array *materials, int render_instance ); virtual int renderPick( RE_Render *r, const GR_DisplayOption *opt, unsigned int pick_type, GR_PickStyle pick_style, bool has_pick_map ); +#endif private : diff --git a/src/IECoreHoudini/DetailSplitter.cpp b/src/IECoreHoudini/DetailSplitter.cpp index e6d3b92d90..24a594276f 100644 --- a/src/IECoreHoudini/DetailSplitter.cpp +++ b/src/IECoreHoudini/DetailSplitter.cpp @@ -58,6 +58,7 @@ #include "boost/algorithm/string/join.hpp" #include "boost/algorithm/string/replace.hpp" #include "boost/regex.hpp" +#include "boost/container_hash/hash.hpp" #include "tbb/tbb.h" diff --git a/src/IECoreHoudini/GEO_CobIOTranslator.cpp b/src/IECoreHoudini/GEO_CobIOTranslator.cpp index 7e436f250c..0aa1639285 100644 --- a/src/IECoreHoudini/GEO_CobIOTranslator.cpp +++ b/src/IECoreHoudini/GEO_CobIOTranslator.cpp @@ -46,6 +46,8 @@ #include "UT/UT_Version.h" +#include + using namespace IECore; using namespace IECoreHoudini; diff --git a/src/IECoreHoudini/GEO_CortexPrimitive.cpp b/src/IECoreHoudini/GEO_CortexPrimitive.cpp index 76c16bab28..47149602c0 100644 --- a/src/IECoreHoudini/GEO_CortexPrimitive.cpp +++ b/src/IECoreHoudini/GEO_CortexPrimitive.cpp @@ -288,7 +288,11 @@ void GEO_CortexPrimitive::reverse() { } +#if MIN_HOU_VERSION( 19, 5, 0 ) +bool GEO_CortexPrimitive::getBBox( UT_BoundingBox *bbox ) const +#else int GEO_CortexPrimitive::getBBox( UT_BoundingBox *bbox ) const +#endif { if ( !m_object ) { @@ -323,6 +327,13 @@ UT_Vector3 GEO_CortexPrimitive::computeNormal() const return UT_Vector3( 0, 0, 0 ); } +#if MIN_HOU_VERSION( 19, 5, 0 ) +UT_Vector3D GEO_CortexPrimitive::computeNormalD() const +{ + return UT_Vector3D( 0, 0, 0 ); +} +#endif + int GEO_CortexPrimitive::detachPoints( GA_PointGroup &grp ) { #if UT_MAJOR_VERSION_INT >= 16 @@ -669,6 +680,12 @@ void GEO_CortexPrimitive::normal( NormalComp &output ) const { } +#if MIN_HOU_VERSION( 19, 5, 0 ) +void GEO_CortexPrimitive::normal( NormalCompD &output ) const +{ +} +#endif + #ifdef GA_PRIMITIVE_VERTEXLIST bool GEO_CortexPrimitive::saveVertexArray( UT_JSONWriter &w, const GA_SaveMap &map ) const diff --git a/src/IECoreHoudini/GR_CortexPrimitive.cpp b/src/IECoreHoudini/GR_CortexPrimitive.cpp index 7e471e62fd..c756fdb36c 100644 --- a/src/IECoreHoudini/GR_CortexPrimitive.cpp +++ b/src/IECoreHoudini/GR_CortexPrimitive.cpp @@ -55,6 +55,10 @@ #include "IECore/SimpleTypedData.h" #include "RE/RE_Render.h" +#if MIN_HOU_VERSION( 20, 0, 0 ) +#include "RE/RE_RenderContext.h" +#endif + #include "UT/UT_Version.h" #if UT_MAJOR_VERSION_INT >= 14 @@ -124,7 +128,11 @@ void GR_CortexPrimitive::resetPrimitives() m_renderable = 0; } +#if MIN_HOU_VERSION( 20, 0, 0 ) +void GR_CortexPrimitive::update( RE_RenderContext r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p ) +#else void GR_CortexPrimitive::update( RE_Render *r, const GT_PrimitiveHandle &primh, const GR_UpdateParms &p ) +#endif { #if UT_MAJOR_VERSION_INT >= 15 @@ -185,14 +193,12 @@ void GR_CortexPrimitive::update( RE_Render *r, const GT_PrimitiveHandle &primh, m_scene->setCamera( 0 ); // houdini will be providing the camera } -#if UT_MAJOR_VERSION_INT >= 16 - -void GR_CortexPrimitive::render( RE_Render* r, GR_RenderMode render_mode, GR_RenderFlags flags, GR_DrawParms dp ) - +#if MIN_HOU_VERSION( 20, 0, 0 ) +void GR_CortexPrimitive::render( RE_RenderContext r, GR_RenderMode render_mode, GR_RenderFlags flags, GR_DrawParms dp ) +#elif UT_MAJOR_VERSION_INT >= 16 +void GR_CortexPrimitive::render( RE_Render *r, GR_RenderMode render_mode, GR_RenderFlags flags, GR_DrawParms dp ) #else - void GR_CortexPrimitive::render( RE_Render *r, GR_RenderMode render_mode, GR_RenderFlags flags, const GR_DisplayOption *opt, const UT_Array *materials ) - #endif { if ( !m_scene ) @@ -276,6 +282,14 @@ void GR_CortexPrimitive::render( RE_Render *r, GR_RenderMode render_mode, GR_Ren } } +#if MIN_HOU_VERSION( 20, 0, 0 ) +int GR_CortexPrimitive::renderPick( RE_RenderContext r, const GR_DisplayOption *opt, unsigned int pick_type, GR_PickStyle pick_style, bool has_pick_map ) +{ + // return 0 to indicate we don't support component picking + return 0; +} + +#else void GR_CortexPrimitive::renderInstances( RE_Render *r, GR_RenderMode render_mode, GR_RenderFlags flags, const GR_DisplayOption *opt, const UT_Array *materials, int render_instance ) { /// \todo: implement this to support instanced rendering. @@ -294,6 +308,7 @@ int GR_CortexPrimitive::renderPick( RE_Render *r, const GR_DisplayOption *opt, u // return 0 to indicate we don't support component picking return 0; } +#endif IECoreGL::StatePtr GR_CortexPrimitive::g_lit = 0; IECoreGL::StatePtr GR_CortexPrimitive::g_shaded = 0; From f2f41dd86cbabdaa984870784c85a768caed55ca Mon Sep 17 00:00:00 2001 From: ivanimanishi Date: Wed, 18 Sep 2024 16:18:37 -0700 Subject: [PATCH 7/9] IECoreMaya : Avoid compilation warnings --- Changes | 1 + src/IECoreMaya/FromMayaInstancerConverter.cpp | 2 +- src/IECoreMaya/FromMayaParticleConverter.cpp | 2 +- src/IECoreMaya/SceneShapeUI.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 19bd6f118c..35d8bafe48 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,7 @@ Improvements ------------ - IECoreHoudini : Updated to support Houdini 20.0 and 20.5. +- IECoreMaya : Avoid compilation warnings with new gcc. Build ----- diff --git a/src/IECoreMaya/FromMayaInstancerConverter.cpp b/src/IECoreMaya/FromMayaInstancerConverter.cpp index 7186132582..3b10778102 100644 --- a/src/IECoreMaya/FromMayaInstancerConverter.cpp +++ b/src/IECoreMaya/FromMayaInstancerConverter.cpp @@ -141,7 +141,7 @@ IECore::QuatfVectorDataPtr eulerToQuat( IECore::V3fVectorData *eulerData, Imath: writableQuatData.reserve( readableEulerData.size() ); - for( const auto rotation : readableEulerData ) + for( const auto& rotation : readableEulerData ) { float x = isDegrees ? IECore::degreesToRadians( rotation.x ) : rotation.x; float y = isDegrees ? IECore::degreesToRadians( rotation.y ) : rotation.y; diff --git a/src/IECoreMaya/FromMayaParticleConverter.cpp b/src/IECoreMaya/FromMayaParticleConverter.cpp index 8b5adf6327..4545d26da2 100644 --- a/src/IECoreMaya/FromMayaParticleConverter.cpp +++ b/src/IECoreMaya/FromMayaParticleConverter.cpp @@ -305,7 +305,7 @@ IECoreScene::PrimitivePtr FromMayaParticleConverter::doPrimitiveConversion( MFnP writableQuatData.reserve( readableEulerData.size() ); - for( const auto rotation : readableEulerData ) + for( const auto& rotation : readableEulerData ) { float x = IECore::degreesToRadians( rotation.x ); float y = IECore::degreesToRadians( rotation.y ); diff --git a/src/IECoreMaya/SceneShapeUI.cpp b/src/IECoreMaya/SceneShapeUI.cpp index 25fa55810c..35b840a9ad 100644 --- a/src/IECoreMaya/SceneShapeUI.cpp +++ b/src/IECoreMaya/SceneShapeUI.cpp @@ -521,7 +521,7 @@ bool SceneShapeUI::snap( MSelectInfo &snapInfo ) const const std::vector &vertices( pointData->readable() ); // Find the vertex that is closest to the snap point. - Imath::V3d closestVertex; + Imath::V3d closestVertex(0, 0, 0); float closestDistance = std::numeric_limits::max(); for( std::vector::const_iterator it( vertices.begin() ); it != vertices.end(); ++it ) From a695f976ba800b2d2f55c9f606efd7ed138f8c13 Mon Sep 17 00:00:00 2001 From: Yannic Schoof Date: Thu, 24 Oct 2024 11:26:48 -0700 Subject: [PATCH 8/9] SceneCacheTest: Adjust for changed `add` node in Houdini 19.5 --- test/IECoreHoudini/SceneCacheTest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/IECoreHoudini/SceneCacheTest.py b/test/IECoreHoudini/SceneCacheTest.py index b4c489f896..371f3bdac5 100644 --- a/test/IECoreHoudini/SceneCacheTest.py +++ b/test/IECoreHoudini/SceneCacheTest.py @@ -3647,7 +3647,10 @@ def testCurveAndPoint( self ): curve = geo.createNode( "line" ) point = geo.createNode( "add" ) - point.parm( "usept0" ).set( True ) + if hou.applicationVersion()[0] < 19 : + point.parm( "usept0" ).set( True ) + else : + point.parm( "points" ).set( 1 ) merge = geo.createNode( "merge" ) merge.setInput( 0, curve ) From 9ead39daaceff3c16b98460a696feb08cf2bb6e2 Mon Sep 17 00:00:00 2001 From: Yannic Schoof Date: Mon, 28 Oct 2024 16:35:28 -0700 Subject: [PATCH 9/9] LiveSceneTest: Adjust for updated `MeshAlgo::segment` Commit 019589943c8a6066a6bc303f2a24017ecf82c2fd updated `MeshAlgo::segment` to use the new `MeshSplitter` introduced in commit bf2040e81d80c22a3ae81b60b00ed47792678231. The MeshSplitter does not preserve Vertex order as of now, which leads to changes in corner and crease Ids. NOTE: The round trip from Houdini Geometry to a Cortex MeshPrimitive and back to Houdini Geometry still works correctly. Corner and crease data is applied at the correct point positions, just the point number changes --- Changes | 3 +++ test/IECoreHoudini/LiveSceneTest.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 35d8bafe48..8d0f20ab5d 100644 --- a/Changes +++ b/Changes @@ -15,6 +15,9 @@ Build - Added `VDB_PYTHON_PATH` to USD tests. - Added `INSTALL_CREATE_SYMLINKS`, which allows you to disable the creation of version symlinks at the end of the install. +- CI : + - IECoreHoudini tests updated to pass on newer environments. + 10.5.10.0 (relative to 10.5.9.5) ========= diff --git a/test/IECoreHoudini/LiveSceneTest.py b/test/IECoreHoudini/LiveSceneTest.py index 71032ab6f5..1b27b2d880 100644 --- a/test/IECoreHoudini/LiveSceneTest.py +++ b/test/IECoreHoudini/LiveSceneTest.py @@ -1337,16 +1337,16 @@ def testCornersAndCreasesForSplitLocations( self ) : boxResult = scene.scene( [ "sub1", "box1" ] ).readObject( 0 ) self.assertTrue( boxResult.arePrimitiveVariablesValid() ) self.assertEqual( boxResult.keys(), [ "P" ] ) - self.assertEqual( boxResult.cornerIds(), IECore.IntVectorData( [ 7 ] ) ) + self.assertEqual( boxResult.cornerIds(), IECore.IntVectorData( [ 6 ] ) ) self.assertEqual( boxResult.cornerSharpnesses(), IECore.FloatVectorData( [ 10.0 ] ) ) self.assertEqual( boxResult.creaseLengths(), IECore.IntVectorData( [ 2 ] * 3 ) ) - self.assertEqual( boxResult.creaseIds(), IECore.IntVectorData( [ 1, 5, 4, 5, 5, 6 ] ) ) + self.assertEqual( boxResult.creaseIds(), IECore.IntVectorData( [ 3, 2, 1, 2, 2, 4 ] ) ) self.assertEqual( boxResult.creaseSharpnesses(), IECore.FloatVectorData( [ 1.29 ] * 3 ) ) torusResult = scene.scene( [ "sub1", "box1", "gap", "torus" ] ).readObject( 0 ) self.assertTrue( torusResult.arePrimitiveVariablesValid() ) self.assertEqual( torusResult.keys(), [ "P" ] ) - self.assertEqual( torusResult.cornerIds(), IECore.IntVectorData( [ 6, 7, 8, 9, 10, 11 ] ) ) + self.assertEqual( torusResult.cornerIds(), IECore.IntVectorData( [0, 1, 4, 6, 8, 10] ) ) self.assertEqual( torusResult.cornerSharpnesses(), IECore.FloatVectorData( [ 5.0 ] * 6 ) ) self.assertEqual( torusResult.creaseLengths(), IECore.IntVectorData( [ 2 ] * 6 ) ) self.assertEqual( torusResult.creaseIds(), IECore.IntVectorData( [ 30, 35, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35 ] ) )