-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Libonx 2024 win private #113
base: main
Are you sure you want to change the base?
Conversation
…nda-forge-pinning 2024.03.09.12.07.17
…nda-forge-pinning 2024.03.09.12.07.17
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
if(ONNX_USE_LITE_PROTO) | ||
if(TARGET protobuf::libprotobuf-lite) | ||
- target_link_libraries(onnx_proto PUBLIC protobuf::libprotobuf-lite PRIVATE ${protobuf_ABSL_USED_TARGETS}) | ||
+ target_link_libraries(onnx_proto PRIVATE protobuf::libprotobuf-lite PRIVATE ${protobuf_ABSL_USED_TARGETS}) |
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.
@h-vetinari do you understand why the error:
ld: illegal thread local variable reference to regular symbol __ZN6google8protobuf8internal15ThreadSafeArena13thread_cache_E for architecture x86_64
might appear on OSX after I added this patch linking with PRIVATE
instead of PUBLIC
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.
First guess is that the symbol appears somewhere in the ABI of onnx (or even the API); plus making protobuf private hides the symbol from the linker so it fails when it's forced to search for it.
In other words, if the protobuf usage were truly private to onnx_proto
, this should work. Either it explicitly isn't private, or it's a bug in the privateness.
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.
Ah so maybe link onnx to proton if as well.
TODO: create patches for updated cmake file and summary file that use the new find_python stuff |
- message(STATUS " Python includes : ${PYTHON_INCLUDE_DIR}") | ||
+ message(STATUS " Python version : ${Python_VERSION}") | ||
+ message(STATUS " Python executable : ${Python_EXECUTABLE}") | ||
+ message(STATUS " Python includes : ${Python_INCLUDE_DIR}") |
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.
+ message(STATUS " Python includes : ${Python_INCLUDE_DIR}") | |
+ message(STATUS " Python includes : ${Python_INCLUDE_DIRS}") |
So close and yet so far on windows…. |
You get
if a symbol cannot be found by the linker - unfortunately without much context. Based on
it seems you're getting static builds. I wouldn't be surprised if that doesn't work somehow; normally missing symbols should show up during the build phase already, but with the switch to private (why?) and using protobuf-lite (why?)1, you have two steps that are reducing the amount of exposed symbols, and thus increasing the surface for the kind of import error you're seeing. Footnotes
|
Don't you want to link privately so that you don't export protobuf's symbols onto
mistake, or hold over. I'll look at this again next weekend. |
Sure, private is cleaner, but if a consumer of |
OK so I see now that this is about protobuf symbols in onnx_proto, and not If that's the case you won't ever be able to get around linking protobuf. Also, since we're now forced to do full rebuilds for every libprotobuf version anyway (down to the patch level...), there's no real distinction here anyway. Everything gets built on a consistent libprotobuf version anyway, so who cares if an onnx-consumer links it too... 🤷 |
linking to protobuf is one thing. But having the symbols exposed through two dlls is problematic. |
at least it is on linux. |
PUBLIC linkage is not the same as exposing the symbols. AFAIU it just means anything in the library linkage surface needs to be available when linking said library. |
8d433f4
to
d3f8929
Compare
So this is equvalent for linux, but not for windows? |
I can't comment as confidently on the linux side, but even there I'd be surprised if - for libA linking to libB - B's symbols get re-exported (which usually takes explicit steps). But the publicly-linked libB will of course be necessary on the linker (and include) paths for consuming libA, and libB's symbols will be searched if used (and if they weren't, why link to A to B in the first place...). But I don't see why they should be duplicated in libA. In any case, I recommend rereading this |
outputs: | ||
- name: libonnx |
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.
Can't remember ever seeing you voluntarily turn something into a multi-output recipe 😜
But looks like a nice improvement to me in general 💪
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.
oh troubleshooting is terrible. don't get me wrong.....
…nda-forge-pinning 2024.03.10.12.43.11
I'm trying a slightly different patch for linking to windows. I think it might actually also be useful for linux maybe..
This patch might be upstreamable
Checklist
0
(if the version changed)conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)