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

support building static libraries #21

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

csukuangfj
Copy link

Requires rhasspy/espeak-ng#1
for building static libraries.

@@ -142,6 +144,10 @@ target_link_libraries(
onnxruntime
)

if(NOT BUILD_SHARED_LIBS)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is to fix the following link errors:

[ 45%] Built target piper_phonemize
[ 54%] Linking CXX executable piper_phonemize
Undefined symbols for architecture x86_64:
  "_ucd_isalnum", referenced from:
      _TranslateClauseWithTerminator in libespeak-ng.a(translate.c.o)
      _ReadClause in libespeak-ng.a(readclause.c.o)
  "_ucd_isalpha", referenced from:
      _TranslateChar in libespeak-ng.a(translate.c.o)
      _CombineFlag in libespeak-ng.a(translate.c.o)
      _GetTranslatedPhonemeString in libespeak-ng.a(dictionary.c.o)
      _TranslateRules in libespeak-ng.a(dictionary.c.o)
      _MatchRule in libespeak-ng.a(dictionary.c.o)
      _ReadClause in libespeak-ng.a(readclause.c.o)
      _IsAlpha in libespeak-ng.a(common.c.o)
      ...
  "_ucd_isdigit", referenced from:
      _TranslateClauseWithTerminator in libespeak-ng.a(translate.c.o)
      _ReadClause in libespeak-ng.a(readclause.c.o)

src/phonemize.cpp
src/phoneme_ids.cpp
src/tashkeel.cpp
src/shared.cpp
)

set_target_properties(piper_phonemize PROPERTIES
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

piper-phonemize is used as a subproject in sherpa-onnx and it is always compiled from source along with sherpa-onnx.

We don't need to manage the version of piper-phonemize via soname.

In addition, setting soname will produce two more symlink files. If I use cp /path/to/install/lib/lib*.so* /some/dest/dir, it will dereference the symlink files and copy the real file, which means there are two more copies of the lib.

I don't see the need to keep the soname. I cannot think of a use case where we only update the version of
piper-phonemize without updating the main project where piper-phonemize is used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other people have requested this, so I'd like to keep it. We could make it an option, though.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other people have requested this, so I'd like to keep it. We could make it an option, though.

Ok, I will create an option, defaulting to ON.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other people have requested this, so I'd like to keep it. We could make it an option, though.

Done.

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

Successfully merging this pull request may close these issues.

2 participants