Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

support building static libraries#21

Open
csukuangfj wants to merge 6 commits into
rhasspy:masterfrom
csukuangfj:fix-cmake
Open

support building static libraries#21
csukuangfj wants to merge 6 commits into
rhasspy:masterfrom
csukuangfj:fix-cmake

Conversation

@csukuangfj
Copy link
Copy Markdown

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

Comment thread CMakeLists.txt
onnxruntime
)

if(NOT BUILD_SHARED_LIBS)
Copy link
Copy Markdown
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)

Comment thread CMakeLists.txt
src/shared.cpp
)

set_target_properties(piper_phonemize PROPERTIES
Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants