-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[TF] Set default RPATH to toolchain stdlib instead of /usr/lib/swift
on macOS.
#27206
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously, the default RPATH was set to `/usr/lib/swift`. This caused linker issues on macOS, as tensorflow-branch-specific modules like TensorFlow and Python do not exist in `/usr/lib/swift`. This patch defaults the `-toolchain-stdlib-rpath` flag to be true, so the default RPATH is the toolchain standard library instead of `/usr/lib/swift`. With this default, the linker issues are fixed. A `-no-toolchain-stdlib-path` flag is added to opt out of this default, making `/usr/lib/swift` the RPATH. Add positive/negative tests. `swift test` works on macOS for packages that import/use TensorFlow again. Partially reverts swiftlang#24787. Resolves TF-797.
bgogul
approved these changes
Sep 16, 2019
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.
Thanks, Dan!
@swift-ci Please test tensorflow |
/usr/lib/swift
./usr/lib/swift
on macOS.
Suggestion: Do most of this in master and just flip the default from |
dan-zheng
added a commit
to dan-zheng/swift
that referenced
this pull request
Sep 17, 2019
Add `-no-toolchain-stdlib-rpath` flag: the negative version of `-toolchain-stdlib-rpath`. Make `-no-toolchain-stdlib-rpath` be the default: use `/usr/lib/swift` as default RPATH on Darwin platforms instead of toolchain standard library. Adapted from swiftlang#27206. tensorflow branch requires the opposite default (use toolchain standard library as RPATH) because some stdlib modules like TensorFlow do not exist in `/usr/lib/swift`.
rxwei
approved these changes
Sep 17, 2019
…rpath`. - Change existing driver invocations in Driver/linker-rpath to use explicit `-no-toolchain-stdlib-rpath` flag. - Add tests for implicit `-toolchain-stdlib-rpath` flag.
@swift-ci Please test tensorflow |
@swift-ci Please test tensorflow linux CPU |
dan-zheng
added a commit
that referenced
this pull request
Sep 17, 2019
…` on macOS. (#27206) Previously, the default RPATH was set to `/usr/lib/swift`. This caused linker issues on macOS, as tensorflow-branch-specific modules like TensorFlow and Python do not exist in `/usr/lib/swift`. This patch defaults the `-toolchain-stdlib-rpath` flag to be true, so the default RPATH is the toolchain standard library instead of `/usr/lib/swift`. With this default, the linker issues are fixed. A `-no-toolchain-stdlib-path` flag is added to opt out of this default, making `/usr/lib/swift` the RPATH. Add positive/negative tests. `swift test` works on macOS for packages that import/use TensorFlow again. Partially reverts #24787. Resolves TF-797.
Awesome! |
dan-zheng
added a commit
that referenced
this pull request
Sep 21, 2019
Add `-no-toolchain-stdlib-rpath` flag: the negative version of `-toolchain-stdlib-rpath`. Make `-no-toolchain-stdlib-rpath` be the default: use `/usr/lib/swift` as default RPATH on Darwin platforms instead of toolchain standard library. Adapted from #27206. tensorflow branch requires the opposite default (use toolchain standard library as RPATH) because some stdlib modules like TensorFlow do not exist in `/usr/lib/swift`.
This was referenced Dec 20, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the default RPATH was set to
/usr/lib/swift
.This caused linker issues on macOS, as tensorflow-branch-specific modules like
TensorFlow and Python do not exist in
/usr/lib/swift
.This patch defaults the
-toolchain-stdlib-rpath
flag to be true, so thedefault RPATH is the toolchain standard library instead of
/usr/lib/swift
.With this default, the linker issues are fixed. A
-no-toolchain-stdlib-path
flag is added to opt out of this default, making
/usr/lib/swift
the RPATH.Add positive/negative tests.
swift test
works on macOS for packages that import/use TensorFlow again (namely https://github.com/tensorflow/swift-apis).Partially reverts #24787. Resolves TF-797.