-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
cc_library with .dylibs #407
Comments
I can't reproduce, this seems to work for me:
And:
Can you give more details about what's in your BUILD file and the error you're getting? |
I just put it in an example repo. If you clone that and run |
Thanks, I'll give it a try. |
This change should have allowed .dylib in srcs; are you at a more recent On Tue, Sep 1, 2015 at 8:44 PM, Kristina [email protected] wrote:
|
I've found one issue (https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java#L910 needs to be |
Great, thanks Kristina. When I was running it, it wasn't complaining in the bazel analyze phase, it was failing when trying to do |
Fixes some of #407. -- MOS_MIGRATED_REVID=102148776
Okay, the other problem is that osx_gcc_wrapper.sh isn't fixing the install name correctly. I think I have a fix for that. |
I've got a change to make osx_gcc_wrapper fix the shared library paths:
However, this doesn't help, because the dylib inputs use system paths to refer to each other:
I could go through recursively and change all inputs to refer to each other if possible, but I'm not sure if that's the right solution. Anyone have any thoughts? |
Symbolic linking everything to /usr/local/lib looks to be working but that seems crazy and maybe related to SIPs. Who knows but hopefully the libraries are also included in the pip. Referencing the cc_library of .so files worked perfect on linux. I guess I wonder is the a Bazel problem or a pure OSX problem that clang would have without Bazel being involved. We seem to have this same issue in TensorFlow trying to link to the MKL. It works fine in Linux but trying to build with the dylib files fails. We will open a bug internally and ask for help as the MKL adds a large performance boost to our community and especially on Macs where the video card is normally not well supported for ML. We expected this file to work just like it does for .so files. It also makes it hard for partners to contribute and thus the integration falls to us to deal with. :-( I get similar errors to others I see on the internet:
|
Ping! |
Quick update, I think the problem is that https://github.com/bazelbuild/bazel/blob/master/tools/cpp/osx_cc_wrapper.sh.tpl only assumes .so extension when updating the install. Also mentioned in #1576. It didn't work for precompiled libraries before, but that was fixed in f426544. IIUC, changing osx_cc_wrapper.sh and osx_cc_wrapper.sh.tpl to fix .dylibs in addition to .sos will resolve this issue. |
Hi - gentle ping from Mac Tensorflow user wanting to have MKL support out of the box, and this issue appears to be a blocker. Im unfamiliar with the tooling here, otherwise id be happy to help. Thank you in advance for any work towards a solution to this. |
Thanks for letting me know, I will try to fix it this week. |
*** Reason for rollback *** I broke http://ci.bazel.io/view/Dashboard/job/bazel-tests/1079/testReport/junit/(root)/(empty)/test_osx_cc_wrapper_rpaths_handling/ *** Original change description *** Fix osx_cc_wrapper to also update dylibs In f426544 I updated osx_cc_wrapper to work correctly in case both precompiled .so and cc_library-made .so are linked into a single binary. This cl makes osx_cc_wrapper work also when a precompiled .dylib is provided. Fixes #3450 again for dylibs Fixes #407 One step closer to finishing #1576 RELNOTES: None. PiperOrigin-RevId: 171806769
Can this be re-opened - was rolled back above ^^ still blocking Tensorflow activity - apologies for appearing pushy in advance! Very appreciated! |
No problem thank's for reminding me. The fix is trivial, just need to find time to resubmit. |
Hi,
I'm trying to include ffmpeg in my project. To build it I use their configure/make compilation system which builds
lib[name].[version].dylib
files for Mac OS X.cc_library apparently doesn't allow .dylib files in srcs. My initial workaround was to manually add the dylibs to
data
and use-L
and-l
commands inlinkopts
. However, this doesn't work when depending on thecc_library
from another package (the-L
command cannot find the directory).How do I use
.dylib
s in cc_libraries?Thanks
Indigo
The text was updated successfully, but these errors were encountered: