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

Use @loader_path instead of $ORIGIN on MacOS #403

Merged
merged 7 commits into from
May 30, 2023

Conversation

manopapad
Copy link
Contributor

@manopapad manopapad commented Apr 20, 2023

Description

The dynamic libraries currently produced by rapids-cmake on MacOS for cython modules don't work, because the wrong "ORIGIN" marker is used. The typical suggestion appears to be to use @loader_path in place of $ORIGIN on MacOS, although there is one more option that I can't currently recall.

Please excuse my ignorance around your processes. Please feel free to make/request changes.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.
  • The cmake-format.json is up to date with these changes.
  • I have added new files under rapids-cmake/
    • I have added include guards (include_guard(GLOBAL))
    • I have added the associated docs/ rst file and update the api.rst

@manopapad manopapad requested a review from a team as a code owner April 20, 2023 22:03
@vyasr
Copy link
Contributor

vyasr commented Apr 20, 2023

That solution is consistent with what I've seen used on Mac before, but I'll defer to @robertmaynard since he has far more experience than I do.

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like @vyasr, I think this looks generally right but I would defer to @robertmaynard.

@@ -72,14 +72,19 @@ function(rapids_cython_add_rpath_entries)
list(APPEND cleaned_paths "${path}")
endforeach()

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(platform_rpath_origin "\$ORIGIN")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be escaped? ($ORIGIN vs. \$ORIGIN) It isn't escaped here in the original code, but it is escaped in the install_rpath in the other file. I'm not 100% sure how variable interpolation works in CMake so escaping may be needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to escape $ORIGIN with CMake 3.16+

@@ -72,14 +72,19 @@ function(rapids_cython_add_rpath_entries)
list(APPEND cleaned_paths "${path}")
endforeach()

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make this @loader_path behavior specific to Darwin and use $ORIGIN in an "else"? I'd like to avoid the string check for "Linux" as a defensive behavior.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we should explicit check for Darwin and otherwise use $ORIGIN

Copy link
Contributor

@robertmaynard robertmaynard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@loader_path is the closest mapping to $ORIGIN on OSX. Approving based on the other comments being resolved.

@manopapad
Copy link
Contributor Author

Comments addressed, PTAL

@manopapad
Copy link
Contributor Author

@bdice is there anything else to do on this one? I updated against latest 23.06, but I am unable to set labels, as required by the "Label Checker" action.

@robertmaynard robertmaynard added bug Something isn't working non-breaking Introduces a non-breaking change 3 - Ready for Review Ready for review by team labels May 17, 2023
@robertmaynard
Copy link
Contributor

@bdice is there anything else to do on this one? I updated against latest 23.06, but I am unable to set labels, as required by the "Label Checker" action.

Added labels

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks fine to me. Are we good to merge @robertmaynard @vyasr ?

@trxcllnt trxcllnt added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels May 24, 2023
@bdice bdice changed the base branch from branch-23.06 to branch-23.08 May 30, 2023 20:02
@bdice
Copy link
Contributor

bdice commented May 30, 2023

I bumped this to 23.08 since 23.06 is in code freeze.

@robertmaynard
Copy link
Contributor

Happy to merge this into 23.8

@robertmaynard
Copy link
Contributor

/merge

@rapids-bot rapids-bot bot merged commit a63aa0e into rapidsai:branch-23.08 May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants