[espeak-ng:master] reported: Procedure not clear on how to remove/disable a language #github


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #922 Procedure not clear on how to remove/disable a language
By Nafihahmd:

Hi @jbowler , as you said I removed all compile*.c tried recompiling. But it is giving me errors. Let me elaborate the steps I followed.

  1. I moved compile*.c files out of the main folder

    mv src/libespeak-ng/compile*.c ../
    
  2. I recompiled the code using make -B

  3. Now in the middle of compiling I am getting the following error.

    CC       src/ucd-tools/src/src_libespeak_ng_la-tostring.lo
    make[1]: *** No rule to make target 'src/libespeak-ng/compiledata.c', needed by 'src/libespeak-ng/src_libespeak_ng_la-compiledata.lo'.  Stop.
    make[1]: Leaving directory '/home/melayil/Github/espeak-ng'
    Makefile:749: recipe for target 'all' failed
    make: *** [all] Error 2
    

N.B: I get similar error if I remove ssml.c file also (make[1]: *** No rule to make target 'src/libespeak-ng/ssml.c,...')

N.B 2: I think @jaacoppi was asking to removing only parts of .c file in his previous post. If that is the case, how should I remove functions inside the .c files without effecting other code that will be calling the former function. Should I leave a dummy function with no code inside?


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #922 Procedure not clear on how to remove/disable a language
By jaacoppi:

The build system (Gnu Make) expects those files to exist. You'll get an error if you remove them.

One way to do it is to delete everything, just leave an empty file. Then recompile and wait for the compiler to give error messages about missing functions. Then create dummy functions for those parts.

Another way is to look through the code and figure out where each function is called and why. Then delete everything you don't need.


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #922 Procedure not clear on how to remove/disable a language
By Nafihahmd:

@jaacoppi, Thanks. I will use the first method you said. Previously I was going by the second method and it felt very cumbersome.


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #922 Procedure not clear on how to remove/disable a language
By jbowler:

You don't remove the files, rather you modify Makefile.am not to include them in the build; i.e. delete the three lines:

        src/libespeak-ng/compiledata.c \
        src/libespeak-ng/compiledict.c \
        src/libespeak-ng/compilembrola.c \

from the definition of src_libespeak_ng_laSOURCES and whichever of the phsource/ph* lines and espeak-ng-data/*_dict lines that you don't need to build. Although, since espeak_ng won't be able to do the compile operations you probably don't even want to bother with the latter; just comment out the 'all-local' target at the top of Makefile.am

For tr_translate.c you have to comment out the languages. BTW this is for an experiment or a one-time unsupportable hack for a particular system. Actually doing it in the project would require some way of choosing the languages at 'configure' time, some support for the same in the Visual Studio solution and extra configure options such as --enable-ssml plus a somewhat tricky change to allow espeak-ng to be built twice, once with compile support once without, or maybe --enable-compile.


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #922 Procedure not clear on how to remove/disable a language
By jbowler:

Yes, that's expected. Now you need to track down the internal references in libespeak-ng; the print_dictionary_flags sounds innocent, but the fact that "DecodeRule" is trying to compile a dictionary seems really weird to me. Of course, I'm saying this on the basis of the function names...

Don't you have your own app? Ultimately if you are reducing code usage in a library that's what matters; the library compiles fine but it clearly has missing references that should be resolved internally. With your own app you can do a static link and remove whole functions from the library.


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #922 Procedure not clear on how to remove/disable a language
By Nafihahmd:

@jaacoppi I have removed unwanted languages from tr_languages.c and the result is :

All Languages*

file size (bytes) size after stripping**
libespeak-ng.a 2,584,008 454,842
libespeak-ng.so 1,557,248 498,486

English Only

file size (bytes) size after stripping
libespeak-ng.a 2,420,760 440,866
libespeak-ng.so 1,448,576 481,016

English + South Indian Languages

file size (bytes) size after stripping
libespeak-ng.a 2,427,696 441,954
libespeak-ng.so 1,456,096 485,240

* All languages describe size after the removal of SSML feature
** Strip means remove debug information from a library. It is done using Strip command.
eg., strip libespeak-ng.a


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #922 Procedure not clear on how to remove/disable a language
By Nafihahmd:

@jbowler Let me look into what you said.

And to the question whether I have an app, No I don't have. Espeak-ng has to stand on it's own, I think.