-
Notifications
You must be signed in to change notification settings - Fork 753
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
Feature/compile osx #171
Feature/compile osx #171
Conversation
|
No it won't break nuget support on Windows if you add a call to |
Hey, @AndreyAkinshin do you have an idea why linux loading doesn't work? |
|
Hey, @haf. Where is |
It's not my computer; it's the dockerfile that is contained in this PR. Run However, answering your question's jest: it's right where it's failing to load it; |
Ok, I've modded your code a bit and there's a bug in your code that doesn't check for errors loading the lib... Let me push the changes. |
@haf, ok. |
There. |
So the current error is this:
...Fixing. |
@AndreyAkinshin I like your loader btw. It makes it easy to distribute cross-platform libraries which are automatically switched depending on architecture. Did you consider just using |
Next error:
|
@haf,
If you have found any miskakes in InteropDotNet, PR are welcome! |
Either it's in the bin folder of the currently executing dll or it will find the native leptonica from whereever If we also avoided compiling the respective versions of each library into their names, we could load them globally instead; and have only a single version on the operating system -- given that your deployment supports this (e.g. having a cheap VM). |
Yes, it would be cool, but I just wanted to do a standalone solution. |
Could you possibly provide an OS X implementation, too? |
@haf, unfortunately, I don't have an OS X. So I can't build binary and check it in a real environment. If you can help me with it, it would be great! |
@AndreyAkinshin This haf@ee35892#diff-f926a5fb754ac9357f66aee8cbca99bdL22 is the change I think you should make to your library |
@haf, geat! Can you make the PR in the main repo: https://github.com/AndreyAkinshin/InteropDotNet ? |
Not really my focus right now... Sorry. Here's another problem:
When running on OSX. |
Here's the proper check for OS X. |
@AndreyAkinshin This is a commit that allows OS X to work: haf@1aadbe4 but hell awaits me, for sure. I can't work with C# without ReSharper and that doesn't exist for OS X; so this code is a copy-paste-mess. The problem with the pre-compiled .so files is that they are dynamically linked to specific versions of .so files when they were compiled -- and this is also a show-stopper for OS X. To solve it we'd need a way to either provide multiple names for the library, or to let InteropDotNet first check global names. But since I need to change the names to match homebrew in this case; we're back at having to allow multiple library names depending on platform. |
Good work guys. As an alternative solution it might be easiest to just build a copy of leptonica from source that statically links in all dependant libs such as libpng and use that for standalone installs for Mono and OS X. If using Global libraries, where native tesseract and leptonica is installed using a package manager, is required I think this could be achieved by adding a fallback to LibraryLoader to just load the dll/so with no path specified. I believe that will mean that os will look in its normal search path. I think this was the behaviour in version 1. Any thoughts? |
P.S. haf .Net 2,. Net 4, and .Net 4 Client Profile is required as some users cannot upgrade to .Net 4 due to company policies and wanting to aim for lowest denominators. I've based the project structure on Reactive Extentions' project structure which uses a different project configuration per target which seems to work ok on windows at least however it does make for an unconventional project configuration as the project configurations are declared in a seperate file and imported into the project which could cause issues for other tools I guess. |
Added issue #174 to cover setting up a docker container for Mono. |
Continuation of discussion in #170