Skip to content
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

Merged

Conversation

seando-adsk
Copy link
Collaborator

MAYA-125649 - Build MayaUsd on RHEL8 with new ABI when Maya switches 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.

@seando-adsk seando-adsk requested a review from boudrey October 25, 2022 13:08
…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.
@seando-adsk seando-adsk force-pushed the donnels/MAYA-125649/build_latest_maya_with_rhel8_new_abi branch from a83ec3c to 4782bc2 Compare October 25, 2022 13:14
Comment on lines +88 to +90
if(APPLE AND BUILD_UB2 AND NOT MAYA_MACOSX_BUILT_WITH_UB2)
message(WARNING "Maya was NOT built with Universal Binary 2")
endif()
Copy link
Collaborator Author

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>
Copy link
Collaborator Author

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.

Comment on lines +32 to +33
# 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.
Copy link
Collaborator Author

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.

Comment on lines +490 to +495
COMMAND
nm "${MAYA_Foundation_LIBRARY}"
COMMAND
grep findVariableReplacement
COMMAND
grep " T "
Copy link
Collaborator Author

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})
Copy link
Collaborator Author

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.

@seando-adsk seando-adsk added the build Related to building maya-usd repository label Oct 25, 2022
boudrey
boudrey previously approved these changes Oct 25, 2022
…to new ABI

* Fix logic mistake for previous versions of Maya.
@seando-adsk seando-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Oct 25, 2022
@seando-adsk seando-adsk merged commit fa21059 into dev Oct 25, 2022
@seando-adsk seando-adsk deleted the donnels/MAYA-125649/build_latest_maya_with_rhel8_new_abi branch October 25, 2022 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to building maya-usd repository ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants