Skip to content

Remove libTensorFlow forced linking. #25222

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
merged 1 commit into from
Jun 3, 2019
Merged

Conversation

pschuh
Copy link
Contributor

@pschuh pschuh commented Jun 3, 2019

I seem to be able to run swift test.swift without these linked in, so I think that they're unnecessary. Also, fixed the "-ltensorflow" problem in a different way. This may break some things I'm not able to test on mac, but I think we should fix-forward that.

@pschuh pschuh requested review from bgogul and dan-zheng June 3, 2019 19:34
@pschuh
Copy link
Contributor Author

pschuh commented Jun 3, 2019

For reference, this is the test I ran (along with the normal tests)

import TensorFlow
import Python

print(Tensor<Float>(3.0))

print(Python.import("numpy"))

@pschuh
Copy link
Contributor Author

pschuh commented Jun 3, 2019

@swift-ci please test tensorflow

Copy link
Contributor

@dan-zheng dan-zheng left a comment

Choose a reason for hiding this comment

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

LGTM!

This may break some things I'm not able to test on mac, but I think we should fix-forward that.

I wonder what breakages do you anticipate on macOS? I believe changes in lib/Driver/UnixToolChains.cpp don't affect macOS, which uses the related lib/Driver/DarwinToolChains.cpp file.

@pschuh
Copy link
Contributor Author

pschuh commented Jun 3, 2019

Hi Dan,
The comment suggests that this was added to solve some xcode problem on mac. I expect that this might be somehow automatically solved by time, but the original issues might pop up again.

llvm::sys::path::append(swiftTensorFlowLibPath, "libswiftTensorFlow.so");
if (llvm::sys::fs::exists(swiftTensorFlowLibPath)) {
Arguments.push_back("-lswiftTensorFlow");
Arguments.push_back("-ltensorflow");
Copy link
Contributor

Choose a reason for hiding this comment

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

Notes from @pschuh for reference:

  • The link "tensorflow" added to stdlib/public/CTensorFlow/module.modulemap should eliminate the need for Arguments.push_back("-ltensorflow"); here.
  • -lswiftPython and -lswiftTensorFlow may be fixed by specifying the -module-link-name flag.

@pschuh
Copy link
Contributor Author

pschuh commented Jun 3, 2019

@swift-ci please test tensorflow gpu

Copy link
Contributor

@bgogul bgogul left a comment

Choose a reason for hiding this comment

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

Thanks, @pschuh !

@pschuh pschuh merged commit f537a92 into swiftlang:tensorflow Jun 3, 2019
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

Successfully merging this pull request may close these issues.

3 participants