Skip to content

Commit 1789eed

Browse files
SConstruct : Support building with Xcode 15
Xcode 15's new linker now complains when asked to link to the same library multiple times. I've removed the duplicates from the modules required to build a regular Cortex release, though I haven't touched the DCC specific modules. If the existing duplicate library specification turns out to be necessary for other platforms, we could alternately disable the linker warning here with `-no_warn_duplicate_libraries`. The new linker also complains that the `-single_module` flag is obsolete. `-single_module` became the default behaviour way back in OSX 10.4, so we should be fairly safe to remove it here. Disabling FMA via `--ffp-contract=off` fixes a test failure with `MeshPrimitiveEvaluator.pointAtUV()` returning an incorrect value in `TestMeshPrimitive.testPlane()`. Curiously, even with `--ffp-contract=off`, this test still fails when run on a virtualized instance of macOS. GitHub's macOS runners are vitualized, so we'll end up skipping this test when we enable macOS CI...
1 parent cdf6a7a commit 1789eed

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

SConstruct

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,14 @@ if env["PLATFORM"] != "win32" :
10891089
# deprecation of gluBuild2DMipmaps() in OSX 10.9.
10901090
if osxVersion[0] == 10 and osxVersion[1] > 7 :
10911091
env.Append( CXXFLAGS = [ "-Wno-unused-local-typedef", "-Wno-deprecated-declarations" ] )
1092+
clangVersion = subprocess.check_output( [ env["CXX"], "-dumpversion" ], env=env["ENV"], universal_newlines=True ).strip()
1093+
clangVersion = [ int( v ) for v in clangVersion.split( "." ) ]
1094+
# Work around Boost issues with Xcode 15 where `std::unary_function` has been removed.
1095+
if clangVersion >= [ 15, 0, 0 ] :
1096+
env.Append( CXXFLAGS = [ "-DBOOST_NO_CXX98_FUNCTION_BASE", "-D_HAS_AUTO_PTR_ETC=0" ] )
1097+
# Disable FMA on arm64 builds to limit floating point discrepancies with x86_64 builds.
1098+
if platform.machine() == "arm64" :
1099+
env.Append( CXXFLAGS = [ "-ffp-contract=off" ] )
10921100

10931101
elif env["PLATFORM"]=="posix" :
10941102
if "g++" in os.path.basename( env["CXX"] ) and not "clang++" in os.path.basename( env["CXX"] ) :
@@ -1304,11 +1312,11 @@ if doConfigure :
13041312
Exit( 1 )
13051313

13061314
for line in open( str( boostVersionHeader ) ) :
1307-
m = re.compile( "^#define BOOST_LIB_VERSION \"(.*)\"\s*$" ).match( line )
1315+
m = re.compile( r"^#define BOOST_LIB_VERSION \"(.*)\"\s*$" ).match( line )
13081316
if m :
13091317
boostVersion = m.group( 1 )
13101318
if boostVersion :
1311-
m = re.compile( "^([0-9]+)_([0-9]+)(?:_([0-9]+)|)$" ).match( boostVersion )
1319+
m = re.compile( r"^([0-9]+)_([0-9]+)(?:_([0-9]+)|)$" ).match( boostVersion )
13121320
boostMajorVersion, boostMinorVersion, boostPatchVersion = m.group( 1, 2, 3 )
13131321
env["BOOST_MAJOR_VERSION"] = boostMajorVersion
13141322
env["BOOST_MINOR_VERSION"] = boostMinorVersion
@@ -1494,9 +1502,6 @@ pythonModuleEnv = pythonEnv.Clone()
14941502
pythonModuleEnv["SHLIBPREFIX"] = ""
14951503
pythonModuleEnv["SHLIBSUFFIX"] = ".so" if env["PLATFORM"] != "win32" else ".pyd"
14961504

1497-
if pythonModuleEnv["PLATFORM"]=="darwin" :
1498-
pythonModuleEnv.Append( SHLINKFLAGS = "-single_module" )
1499-
15001505
###########################################################################################
15011506
# An environment for running tests
15021507
###########################################################################################
@@ -1940,9 +1945,7 @@ if doConfigure :
19401945
imagePythonModuleEnv.Append( **imageEnvPrepends )
19411946
imagePythonModuleEnv.Append(
19421947
LIBS = [
1943-
os.path.basename( coreEnv.subst( "$INSTALL_LIB_NAME" ) ),
19441948
os.path.basename( imageEnv.subst( "$INSTALL_LIB_NAME" ) ),
1945-
os.path.basename( corePythonEnv.subst( "$INSTALL_PYTHONLIB_NAME" ) ),
19461949
]
19471950
)
19481951
imagePythonModule = imagePythonModuleEnv.SharedLibrary( "python/IECoreImage/_IECoreImage", imagePythonSources + imagePythonModuleSources )
@@ -2277,9 +2280,7 @@ if env["WITH_GL"] and doConfigure :
22772280
glPythonModuleEnv.Append( **glEnvAppends )
22782281
glPythonModuleEnv.Append(
22792282
LIBS = [
2280-
os.path.basename( coreEnv.subst( "$INSTALL_LIB_NAME" ) ),
22812283
os.path.basename( glEnv.subst( "$INSTALL_LIB_NAME" ) ),
2282-
os.path.basename( corePythonEnv.subst( "$INSTALL_PYTHONLIB_NAME" ) ),
22832284
os.path.basename( imageEnv.subst( "$INSTALL_LIB_NAME" ) ),
22842285
os.path.basename( sceneEnv.subst( "$INSTALL_LIB_NAME" ) ),
22852286
]

include/IECore/MatrixInterpolator.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct CubicInterpolator< Imath::Matrix44< T > >
130130

131131
Imath::Vec3<T> s0( 1 ), s1( 1 ), s2( 1 ), s3( 1 ), sx( 1 );
132132
Imath::Vec3<T> h0( 0 ), h1( 0 ), h2( 0 ), h3( 0 ), hx( 0 );
133-
Imath::Vec3<T> r0( 0 ), r1( 0 ), r2( 0 ), r3( 0 ), rx( 0 );
133+
Imath::Vec3<T> r0( 0 ), r1( 0 ), r2( 0 ), r3( 0 );
134134
Imath::Vec3<T> t0( 0 ), t1( 0 ), t2( 0 ), t3( 0 ), tx( 0 );
135135

136136
extractSHRT(y0, s0, h0, r0, t0);

test/IECore/InterpolatorTest.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ void MatrixCubicInterpolatorTest<T>::testSimple()
429429
CubicInterpolator< Matrix > interp;
430430
CubicInterpolator< Vector > vectorInterp;
431431

432-
Vector s0( 1, 1, 1 ), h0( 0, 0, 0 ), r0( 0, 0, 0 ), t0( 5, 0, 0 );
432+
Vector s0( 1, 1, 1 ), h0( 0, 0, 0 ), t0( 5, 0, 0 );
433433
Vector s1( 1, 2, 3 ), h1( 1, 2, 3 ), r1( 0, 1, 0 ), t1( 10, 0, 0 );
434434
Vector s2( 0.5, 1.4, 5 ), h2( 2, 3, 4 ), r2( 0, 0.5, 0 ), t2( 20, 0, 0 );
435435
Vector s3( 1, 2, 3 ), h3( 1, 2, 3 ), r3( 0, 1, 0 ), t3( 0, 0, 0 );
@@ -492,7 +492,7 @@ void MatrixCubicInterpolatorTest<T>::testTyped()
492492
CubicInterpolator< MatrixData > interp;
493493
CubicInterpolator< Vector > vectorInterp;
494494

495-
Vector s0( 1, 1, 1 ), h0( 0, 0, 0 ), r0( 0, 0, 0 ), t0( 5, 0, 0 );
495+
Vector s0( 1, 1, 1 ), h0( 0, 0, 0 ), t0( 5, 0, 0 );
496496
Vector s1( 1, 2, 3 ), h1( 1, 2, 3 ), r1( 0, 1, 0 ), t1( 10, 0, 0 );
497497
Vector s2( 0.5, 1.4, 5 ), h2( 2, 3, 4 ), r2( 0, 0.5, 0 ), t2( 20, 0, 0 );
498498
Vector s3( 1, 2, 3 ), h3( 1, 2, 3 ), r3( 0, 1, 0 ), t3( 0, 0, 0 );

0 commit comments

Comments
 (0)