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

pxrConfig.cmake generated on Linux not usable between distros due to absolute path of libm.so #2798

Closed
pmolodo opened this issue Nov 8, 2023 · 3 comments

Comments

@pmolodo
Copy link
Contributor

pmolodo commented Nov 8, 2023

Description of Issue

On Linux, the generated pxrTargets.cmake will set an absolute path to libm.so inside of arch's INTERFACE_LINK_LIBRARIES.

This means that when compiling a plugin using the pxrConfig.cmake, if the path to libm.so differs from that used on the machine where USD was compiled, a linking error will be generated, because it can't find that exact absolute path.

In practice, this often makes the generated pxrConfig.cmake specific to the Linux distro used to generate it - for instance, if you compile on CentOS 7 (which uses /usr/lib64/libm.so), you can't use that pxrConfig.cmake on Ubuntu 20.04 (/lib/x86_64-linux-gnu/libm.so)

Steps to Reproduce

  1. Compile USD on CentOS 7 (or, likely, any CentOS version)
  2. Copy the resulting install to an Ubuntu 20.04 machine (or, likely, any Ubuntu version)
  3. Try to build a cmake project, using the default Makefile generator, that uses the generated pxrConfig.cmake, and links against pretty much any USD lib (ie, anything that transitively requires the arch lib
  4. CMake configuring will work successfully, but you will see an error like this from make when building:
make[2]: *** No rule to make target '/usr/lib64/libm.so', needed by 'my_usd_plugin.so'.  Stop.

System Information (OS, Hardware)

Linux

Package Versions

USD 24.02 (dcbc1ca)

@pmolodo pmolodo changed the title gererated pxrConfig.cmake on Linux not usable between distros due to absolute path of libm.so pxrConfig.cmake generated on Linux not usable between distros due to absolute path of libm.so Nov 8, 2023
@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-8924

@nvmkuruc
Copy link
Collaborator

@pmolodo Do you think this issue has been addressed now that #2796 has been merged?

@pmolodo
Copy link
Contributor Author

pmolodo commented Feb 10, 2025

Yes - fixed via #2796

@pmolodo pmolodo closed this as completed Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants