-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAYA-125649 - Build MayaUsd on RHEL8 with new ABI when Maya switches #2675
MAYA-125649 - Build MayaUsd on RHEL8 with new ABI when Maya switches #2675
Conversation
…to new ABI MAYA-125320 - Enable UB2 on MacOSX - Support for RHEL8 with new ABI. If Maya was built with new ABI then MayaUsd must also be. - Detect if Maya was built with UB2 and issue warning if MayaUsd is UB2, but Maya is not.
a83ec3c
to
4782bc2
Compare
if(APPLE AND BUILD_UB2 AND NOT MAYA_MACOSX_BUILT_WITH_UB2) | ||
message(WARNING "Maya was NOT built with Universal Binary 2") | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply issue a warning plugin is being built with UB2 but Maya was not. Should not cause any problems, but its extra compilation not needed.
@@ -106,7 +106,7 @@ function(mayaUsd_compile_config TARGET) | |||
if(IS_LINUX) | |||
target_compile_definitions(${TARGET} | |||
PRIVATE | |||
_GLIBCXX_USE_CXX11_ABI=0 # USD is built with old ABI | |||
_GLIBCXX_USE_CXX11_ABI=$<IF:$<BOOL:${MAYA_LINUX_BUILT_WITH_CXX11_ABI}>,1,0> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set the cxx11 abi to same value as the Maya we are compiling with. The two must match.
# MAYA_LINUX_BUILT_WITH_CXX11_ABI Maya Linux was built with new cxx11 ABI. | ||
# MAYA_MACOSX_BUILT_WITH_UB2 Maya OSX was built with Universal Binary 2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added these two. Others were existing but missing the doc line here.
COMMAND | ||
nm "${MAYA_Foundation_LIBRARY}" | ||
COMMAND | ||
grep findVariableReplacement | ||
COMMAND | ||
grep " T " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something new I learned is that running multiple commands this way sends the output of one to the input of the next. Here running nm grepping for certain text. Then below on the string find look for the cxx11 version. If present it means Maya was compiled with the new ABI.
${MAYA_LIBRARY_DIR} | ||
OUTPUT_VARIABLE | ||
maya_lipo_output) | ||
string(REGEX MATCHALL "(x86_64|arm64)" maya_ub2_match ${maya_lipo_output}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use regular expression to see and check list output below to see if both these are present. If they are it means Maya was compiled with UB2 enabled.
…to new ABI * Fix logic mistake for previous versions of Maya.
MAYA-125649 - Build MayaUsd on RHEL8 with new ABI when Maya switches to new ABI
MAYA-125320 - Enable UB2 on MacOSX