-
Notifications
You must be signed in to change notification settings - Fork 4k
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
macOS fix deps path and id name for C++ binary #1051
Comments
@JanX2 Thanks! We would be happy to review a PR for that. There is something that I am puzzled about, because we should already have something working properly: |
That is really odd @lissyx! The |
@JanX2 I just tested with a build from TC (we merged tensorflow-r1.4 this morning), and indeed, seems like we have wrong path for |
|
Yes @lissyx. That can’t work. I get the same.
|
So, @JanX2 don't hesitate to send a PR, I think we should not bundle |
I agree @lissyx. Not bundling sox is fine. But paths on the build machine like Thank you for responding so quickly by the way! |
@JanX2 True, except I'm far from being used to the OSX linker, and its documentation is not as good as I would hope for quickly discovering, so I don't really know which magic path should be used :), so if you do, I'd really like to see a PR. If not, then I'll work on that, but later :) |
@lissyx I don’t know about a “magic path”, but my use of I don’t have a clue about the build system this project is using for the native client, but there ought to be a way to integrate the above. If all else fails, the commands I have describe above are a solution of last resort. |
Magic path in my mind are stuff like |
@lissyx Ah. I get it. :) |
Sure, but should we really use |
@lissyx I’m pretty sure all the binaries should be using I just added that in my OP, but I am talking solely about the pre-build binaries here. Additionally, the Off the top of my hat, I blame the build system. I don’t know it at all so, to me, the white spots on my map are automatically the culprit. ;) |
I have just tried to build Deep Speech from source. This appears to instruct the build system to build the binaries:
This references the |
@JanX2 That's the part for TensorFlow, we don't really have a control on that. |
@lissyx Ok. Then I would recommend to do some post-processing similar to what I have done in my original post here. Rename the binaries and patch the paths used by the dynamic linker. I have also tried to build the binaries from source. Stuck now: |
@JanX2 I have to admit I don't really see how big of a deal it is that the shared object is named |
@lissyx The reason is that I want to build a macOS I finally managed to build Deep Speech from source. The last holdup was that
Fixing the linker paths may be as simple as copying/renaming the
I have never written a file for that build system. Do you know how to copy the dynamic library Then end result would be a directory will all necessary binaries that is moveable and largely independent of the way the system is set up. |
Thanks! I'm really puzzled how I can help: what you call "that build system" is just standard makefile, like on any simple Unix system. So you can just modify it and say add a target Regarding |
@lissyx I mostly use Xcode as my IDE and rarely have to touch any text-based part of the build infrastructure it uses. It can call on make as an external build system, but that usually makes things harder when you want to debug something. As of my last test, the binary distribution for Deep Speech had all the dependencies apart from libsox shipping with it, but they had paths to those dependencies would only work on the original build machine. That’s what I want to fix. The binary distribution should work OOTB. Without having to resort to shipping that And no, moving dynamic libraries around to get a working build product is not the usual way. At least you don’t do it manually. Xcode usually does this for you to bundle everything together for packaging or distribution. Just have a look an app on macOS. It’s actually a directory called a “package” you can open via the contextual menu in the Finder. Having all non-system-provided dependencies in there bundled up makes things relatively neat. I believe you were right before when you suggested using For my framework things might get a bit more complicated, because it might be bundled within another framework and |
@JanX2 You are mixing things together, and this is getting confusing now: I was referring to "moving dynamic libraries" when you mentionned the I think |
So mostly:
|
@lissyx I find time and time again that I have no idea what I’m doing. :) Your suggestion would assume that the
The other line as well, but with the complication that the user has to provide
My approach was the latter so I could move the set of binaries around. Even to another machine, if necessary. |
Now, we are on good grounds. It is supposed that |
We don’t need to fix the Additionally, the dependencies may have broken paths as per my example in the OP. |
@JanX2 |
@lissyx Sorry for the misunderstanding. I read “
What I meant there was that the dependencies may/do have broken paths to their dependencies and so on recursively. |
Yet,
Assuming
|
Thanks! LGTM so far! Apparently it doesn’t list subdependencies. These might still have dependencies that are build-machine specific:
|
@JanX2 No, we don't need to worry about those, we already set proper RPATH for And fixing the use of RPATH is likely to be a two lines patch on |
We might need to fix the IDs, though we build
|
Okay, just |
@JanX2 With that PR:
|
I think that’s a good start. There still are two issues I can see:
|
For (1), I either disagree or don't understand. Everything is bundled together as For (2), there is nothing to fix, as you point out and as you can see with |
@lissyx Yes. It does work. But you might prevent libsox from working correctly on the build machine. For example, I might be puzzled afterwards, if something linking against lib sox doesn’t work on my build machine. This might be fine for the tensorflow libraries, but for libsox, which my be outside of our directory hierarchy it may not. |
That code isn't changing libsox, it's changing the deepspeech binary. |
My bad. You are right of course! :D |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
On macOS 10.12.6, I tried to follow “Using the command-line client” and the native client README. I had a couple of issues getting the pre-build binaries to work. The following notes are what I did about them.
Initial Python dependencies
Download via
The native_client requires AVX2. It will crash with an “Illegal Instruction: 4” error otherwise.
Check your CPU capabilities:
The latter should contain “AVX2”.
All dependencies that are not supplied by the system are still hard-wired to the build system’s paths.
This is how to check the dependencies of a binary:
This is how to fix/patch the binaries and complete the set of required dependencies:
The following assumes this directory list within the DeepSpeech root:
native_client
smoke_test
models
Finally we can test the native_client.
The release process should be amended to check for non-system provided dependencies and fix them like above.
The text was updated successfully, but these errors were encountered: