Skip to content
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

Static linking #73

Open
ayles opened this issue Apr 27, 2022 · 2 comments
Open

Static linking #73

ayles opened this issue Apr 27, 2022 · 2 comments

Comments

@ayles
Copy link

ayles commented Apr 27, 2022

Hi

I am trying to embed Phonetisaurus in my binary and just encountered an issue:

Static linking with OpenFST fails with duplicate symbol FLAGS_help.
Fix is simple https://github.com/ayles/Phonetisaurus/commit/4aba2c65666bdae76af362023d379c32dccfa518
But I am afraid it could not work with shared OpenFST and I currently have no time to test this.

Is there any plans to add static linkage support and [possibly] CMakeLists.txt?
(In my case there is a Kaldi with its own forked OpenFST and it was just pain to provide Phonetisaurus with OpenFST includes and libraries, so I just wrote simple CMakeLists.txt wrapper)

@no-execution
Copy link

Same problem, have you solve it?

@danijel3
Copy link
Contributor

danijel3 commented Oct 4, 2022

Just solved this issue. Both phonetisaurus and openfst binaries use this flag. To get around it, I simply changed:

DEFINE_bool (help, false, "show usage information");

To read:

DECLARE_bool   (help, false, "show usage information"); 

This may obviously crash the build of the original project, but works for me when I include it in my personal project.

Another solution would be to simply refactor the code and rename this flag to something else, eg. "help_phonetisaurus" or something like that...

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

No branches or pull requests

3 participants