Hi list,
trying to compile and load the espeak external from https://github.com/kronihias/espeak on Debian/GNU Linux. Have the apt packages espeak libespeak-dev installed and the makefile modifiet to point to PDROOT=/usr/include/pd
Running 'make' yields an error: cc -export-dynamic -shared -lc -lm -lespeak -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC -Wall -W -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch -I/usr/include/pd/src -o espeak.pd_linux espeak.c espeak.c: In function ‘espeak_setup’: espeak.c:406:6: error: cast between incompatible function types from ‘void * (*)(t_symbol *)’ {aka ‘void * (*)(struct _symbol *)’} to ‘void * (*)(void)’ [-Werror=cast-function-type] 406 | (t_newmethod)espeak_new, // newmethod | ^ cc1: all warnings being treated as errors make[1]: *** [Makefile:79: espeak.pd_linux] Error 1 make[1]: Leaving directory '/tmp/espeak-master' make: *** [Makefile:46: auto] Error 2
which I can circumnavigate disabling the -Werror flag in the makefile. Compilation somewhat succeeds then, posting: espeak.c: In function ‘espeak_setup’: espeak.c:406:6: warning: cast between incompatible function types from ‘void * (*)(t_symbol *)’ {aka ‘void * (*)(struct _symbol *)’} to ‘void * (*)(void)’ [-Wcast-function-type] 406 | (t_newmethod)espeak_new, // newmethod | ^
Loading the external in Pd then throws: ./espeak.pd_linux: ./espeak.pd_linux: undefined symbol: espeak_SetParameter espeak: can't load library
Can anyone point me into a good direction what to try next here? Anyone having had success on OS X with this external so far?
appreciated, as always, yours, P
Hi,
"cast-function-type" has been introduced in GCC 8 and it affects lots of existing Pd code. Usually, it is just a warning and can be ignored, but the makefile for espeak sets "-Werror", which means that every warning is treated as an error. The quickest fix is to either remove "-Werror" or add "-Wno-cast-function-type".
Christof
On 13.03.2021 10:06, Peter P. wrote:
Hi list,
trying to compile and load the espeak external from https://github.com/kronihias/espeak on Debian/GNU Linux. Have the apt packages espeak libespeak-dev installed and the makefile modifiet to point to PDROOT=/usr/include/pd
Running 'make' yields an error: cc -export-dynamic -shared -lc -lm -lespeak -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC -Wall -W -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch -I/usr/include/pd/src -o espeak.pd_linux espeak.c espeak.c: In function ‘espeak_setup’: espeak.c:406:6: error: cast between incompatible function types from ‘void * (*)(t_symbol *)’ {aka ‘void * (*)(struct _symbol *)’} to ‘void * (*)(void)’ [-Werror=cast-function-type] 406 | (t_newmethod)espeak_new, // newmethod | ^ cc1: all warnings being treated as errors make[1]: *** [Makefile:79: espeak.pd_linux] Error 1 make[1]: Leaving directory '/tmp/espeak-master' make: *** [Makefile:46: auto] Error 2
which I can circumnavigate disabling the -Werror flag in the makefile. Compilation somewhat succeeds then, posting: espeak.c: In function ‘espeak_setup’: espeak.c:406:6: warning: cast between incompatible function types from ‘void * (*)(t_symbol *)’ {aka ‘void * (*)(struct _symbol *)’} to ‘void * (*)(void)’ [-Wcast-function-type] 406 | (t_newmethod)espeak_new, // newmethod | ^
Loading the external in Pd then throws: ./espeak.pd_linux: ./espeak.pd_linux: undefined symbol: espeak_SetParameter espeak: can't load library
Can anyone point me into a good direction what to try next here? Anyone having had success on OS X with this external so far?
appreciated, as always, yours, P
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Hi,
"cast-function-type" has been introduced in GCC 8 and it affects lots of existing Pd code. Usually, it is just a warning and can be ignored, but the makefile for espeak sets "-Werror", which means that every warning is treated as an error. The quickest fix is to either remove "-Werror" or add "-Wno-cast-function-type".
Which is what I did, described below in my last email, no?
Thanks , P
Christof
On 13.03.2021 10:06, Peter P. wrote:
Hi list,
trying to compile and load the espeak external from https://github.com/kronihias/espeak on Debian/GNU Linux. Have the apt packages espeak libespeak-dev installed and the makefile modifiet to point to PDROOT=/usr/include/pd
Running 'make' yields an error: cc -export-dynamic -shared -lc -lm -lespeak -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC -Wall -W -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch -I/usr/include/pd/src -o espeak.pd_linux espeak.c espeak.c: In function ‘espeak_setup’: espeak.c:406:6: error: cast between incompatible function types from ‘void * (*)(t_symbol *)’ {aka ‘void * (*)(struct _symbol *)’} to ‘void * (*)(void)’ [-Werror=cast-function-type] 406 | (t_newmethod)espeak_new, // newmethod | ^ cc1: all warnings being treated as errors make[1]: *** [Makefile:79: espeak.pd_linux] Error 1 make[1]: Leaving directory '/tmp/espeak-master' make: *** [Makefile:46: auto] Error 2
which I can circumnavigate disabling the -Werror flag in the makefile. Compilation somewhat succeeds then, posting: espeak.c: In function ‘espeak_setup’: espeak.c:406:6: warning: cast between incompatible function types from ‘void * (*)(t_symbol *)’ {aka ‘void * (*)(struct _symbol *)’} to ‘void * (*)(void)’ [-Wcast-function-type] 406 | (t_newmethod)espeak_new, // newmethod | ^
Loading the external in Pd then throws: ./espeak.pd_linux: ./espeak.pd_linux: undefined symbol: espeak_SetParameter espeak: can't load library
Can anyone point me into a good direction what to try next here? Anyone having had success on OS X with this external so far?
appreciated, as always, yours, P
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Which is what I did, described below in my last email, no?
sorry, I accientally skipped the last part of your message...
Loading the external in Pd then throws: ./espeak.pd_linux: ./espeak.pd_linux: undefined symbol: espeak_SetParameter espeak: can't load library
So the actual problem is that Pd can't find the 'espeak' library at runtime. You obviously have it installed, at least gcc can find the header files during compilation.
Where does "libespeak.so" live?
Christof
On 13.03.2021 20:47, Peter P. wrote:
- Christof Ressi info@christofressi.com [2021-03-13 15:54]:
Hi,
"cast-function-type" has been introduced in GCC 8 and it affects lots of existing Pd code. Usually, it is just a warning and can be ignored, but the makefile for espeak sets "-Werror", which means that every warning is treated as an error. The quickest fix is to either remove "-Werror" or add "-Wno-cast-function-type".
Which is what I did, described below in my last email, no?
Thanks , P
Christof
On 13.03.2021 10:06, Peter P. wrote:
Hi list,
trying to compile and load the espeak external from https://github.com/kronihias/espeak on Debian/GNU Linux. Have the apt packages espeak libespeak-dev installed and the makefile modifiet to point to PDROOT=/usr/include/pd
Running 'make' yields an error: cc -export-dynamic -shared -lc -lm -lespeak -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC -Wall -W -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch -I/usr/include/pd/src -o espeak.pd_linux espeak.c espeak.c: In function ‘espeak_setup’: espeak.c:406:6: error: cast between incompatible function types from ‘void * (*)(t_symbol *)’ {aka ‘void * (*)(struct _symbol *)’} to ‘void * (*)(void)’ [-Werror=cast-function-type] 406 | (t_newmethod)espeak_new, // newmethod | ^ cc1: all warnings being treated as errors make[1]: *** [Makefile:79: espeak.pd_linux] Error 1 make[1]: Leaving directory '/tmp/espeak-master' make: *** [Makefile:46: auto] Error 2
which I can circumnavigate disabling the -Werror flag in the makefile. Compilation somewhat succeeds then, posting: espeak.c: In function ‘espeak_setup’: espeak.c:406:6: warning: cast between incompatible function types from ‘void * (*)(t_symbol *)’ {aka ‘void * (*)(struct _symbol *)’} to ‘void * (*)(void)’ [-Wcast-function-type] 406 | (t_newmethod)espeak_new, // newmethod | ^
Loading the external in Pd then throws: ./espeak.pd_linux: ./espeak.pd_linux: undefined symbol: espeak_SetParameter espeak: can't load library
Can anyone point me into a good direction what to try next here? Anyone having had success on OS X with this external so far?
appreciated, as always, yours, P
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 3/13/21 10:45 PM, Christof Ressi wrote:
So the actual problem is that Pd can't find the 'espeak' library at runtime. You obviously have it installed, at least gcc can find the header files during compilation.
the *actual* problem is, that one (or more) symbol(s) that are supposed to be provided by the libespeak library cannot be resolved. there's no error indicating that any library cannot be found at runtime.
i just checked the project and after a successfull compilation, it seems that the espeak.pd_linux is not linked at all against the libespeak library.
this basically indicates a broken build system. whenever you happen to meet the author of the makefile, please deliver a good slapping from my side.
what is going wrong here, is that modern linkers try aggressively to remove unneeded dependencies. and because libespeak is added to the linker when nothing yet uses any of its symbols, it is discarded.
putting the linker-flags to pull in the libraries after the object-files that require these libraries, fixes the problem:
$ git diff Makefile
diff --git a/Makefile b/Makefile
index b3528b2..cd5b0ce 100644
--- a/Makefile
+++ b/Makefile
@@ -63,7 +63,7 @@ TARGETS=$(SOURCES:.c=.$(EXTENSION))
pd_linux: $(TARGETS)
LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \
- -Wall -W -Wshadow -Wstrict-prototypes -Werror \
+ -Wall -W -Wshadow -Wstrict-prototypes \
-Wno-unused -Wno-parentheses -Wno-switch
LINUXLDFLAGS = -export-dynamic -shared -lc -lm -lespeak
@@ -71,7 +71,7 @@ LINUXLDFLAGS = -export-dynamic -shared -lc -lm -lespeak
LINUXINCLUDE = -I$(PDSRCDIR)
%.pd_linux: %.c
- $(CC) $(LINUXLDFLAGS) $(LINUXCFLAGS) $(LINUXINCLUDE) -o
$*.pd_linux $*.c
+ $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.pd_linux $*.c
$(LINUXLDFLAGS)
strip --strip-unneeded $*.pd_linux
it seems that the espeak.pd_linux is not linked at all against the libespeak library.
Ha, good catch!
As a side note for other people:
By default, ld doesn't complain about missing symbols during linkage when building a shared library, instead you get an error at load time (which is what has happened here). You would have to pass "-Wl,--no-undefined" to get the error already at link time. However, you can't really do that with Pd externals, because they don't actually link back to Pd (instead they rely on "-export-dynamic" to get the symbols from the host executable itself) and "-Wl,--no-undefined" would give you errors for all Pd symbols.
On Windows, however, the linker always tries to resolve all symbols, generally by using so called import libraries (although MinGW can also directly link against DLLs). If a symbol is not found, you get a linker error. That's also why on Windows we need a pd.dll + pd.lib, otherwise externals wouldn't have anything they can actually link back to.
Christof
On 13.03.2021 23:04, IOhannes m zmölnig wrote:
On 3/13/21 10:45 PM, Christof Ressi wrote:
So the actual problem is that Pd can't find the 'espeak' library at runtime. You obviously have it installed, at least gcc can find the header files during compilation.
the *actual* problem is, that one (or more) symbol(s) that are supposed to be provided by the libespeak library cannot be resolved. there's no error indicating that any library cannot be found at runtime.
i just checked the project and after a successfull compilation, it seems that the espeak.pd_linux is not linked at all against the libespeak library.
this basically indicates a broken build system. whenever you happen to meet the author of the makefile, please deliver a good slapping from my side.
what is going wrong here, is that modern linkers try aggressively to remove unneeded dependencies. and because libespeak is added to the linker when nothing yet uses any of its symbols, it is discarded.
putting the linker-flags to pull in the libraries after the object-files that require these libraries, fixes the problem:
$ git diff Makefile diff --git a/Makefile b/Makefile index b3528b2..cd5b0ce 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ TARGETS=$(SOURCES:.c=.$(EXTENSION)) pd_linux: $(TARGETS) LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \ - -Wall -W -Wshadow -Wstrict-prototypes -Werror \ + -Wall -W -Wshadow -Wstrict-prototypes \ -Wno-unused -Wno-parentheses -Wno-switch LINUXLDFLAGS = -export-dynamic -shared -lc -lm -lespeak @@ -71,7 +71,7 @@ LINUXLDFLAGS = -export-dynamic -shared -lc -lm -lespeak LINUXINCLUDE = -I$(PDSRCDIR) %.pd_linux: %.c - $(CC) $(LINUXLDFLAGS) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.pd_linux $*.c + $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.pd_linux $*.c $(LINUXLDFLAGS) strip --strip-unneeded $*.pd_linux
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
Hi, list,
the modified Makefile works great, thanks IOhannes and Matthias! There still seems some hickups with the object itself. Asking it to set a texbuffer and synthesize from its help-patch, it posts a longer red message to the pd console:
"an operation on the array 'array1' in the patch 'espeak-help.pd' failed since it uses garray_getfloatarray while running 64-bit (Tcl) INVALID COMMAND NAME: invalid command name "Âcdk Ãithin "uplevel #0 $docmds"an operation on the array 'array1' in the patch 'espeak-help.pd' failed since it uses garray_getfloatarray while running 64-bit"
Furthermore the object reports to synthesize at 22050Hz sampling rate, but its playback in the help patch is still at double speed, unless I divide by four instead of two next to the "resampling" comment. The associated array is also only filled up to one half when synthesizing the textbuffer, perhaps this gives a hint?
Oh and in the [pd properties] subpatch both the "pitch" and the "pitch range" seem to be set with the same prefixed message?
Thanks/best, P
On 3/13/21 10:45 PM, Christof Ressi wrote:
So the actual problem is that Pd can't find the 'espeak' library at runtime. You obviously have it installed, at least gcc can find the header files during compilation.
the *actual* problem is, that one (or more) symbol(s) that are supposed to be provided by the libespeak library cannot be resolved. there's no error indicating that any library cannot be found at runtime.
i just checked the project and after a successfull compilation, it seems that the espeak.pd_linux is not linked at all against the libespeak library.
this basically indicates a broken build system. whenever you happen to meet the author of the makefile, please deliver a good slapping from my side.
what is going wrong here, is that modern linkers try aggressively to remove unneeded dependencies. and because libespeak is added to the linker when nothing yet uses any of its symbols, it is discarded.
putting the linker-flags to pull in the libraries after the object-files that require these libraries, fixes the problem:
$ git diff Makefile diff --git a/Makefile b/Makefile index b3528b2..cd5b0ce 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ TARGETS=$(SOURCES:.c=.$(EXTENSION)) pd_linux: $(TARGETS) LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \ - -Wall -W -Wshadow -Wstrict-prototypes -Werror \ + -Wall -W -Wshadow -Wstrict-prototypes \ -Wno-unused -Wno-parentheses -Wno-switch LINUXLDFLAGS = -export-dynamic -shared -lc -lm -lespeak @@ -71,7 +71,7 @@ LINUXLDFLAGS = -export-dynamic -shared -lc -lm -lespeak LINUXINCLUDE = -I$(PDSRCDIR) %.pd_linux: %.c - $(CC) $(LINUXLDFLAGS) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.pd_linux $*.c + $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.pd_linux $*.c $(LINUXLDFLAGS) strip --strip-unneeded $*.pd_linux
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On 3/15/21 6:38 PM, Peter P. wrote:
Furthermore the object reports to synthesize at 22050Hz sampling rate, but its playback in the help patch is still at double speed, unless I divide by four instead of two next to the "resampling" comment. The associated array is also only filled up to one half when synthesizing the textbuffer, perhaps this gives a hint?
that's all because of the invalid use of garray_getfloatarray() on a 64bit system.
Oh and in the [pd properties] subpatch both the "pitch" and the "pitch range" seem to be set with the same prefixed message?
i'm sure i don't understand the question.
gfmsard IOhannes
PS: could you ask matthias whether he is ok to transfer the repository into the https://github.com/pd-externals/ namespace? (or even into https//git.iem.at/pd/ where I could try to have the CI build proper deken packages)
you can also try speech.flite from ceammc https://github.com/uliss/pure-data
Em sáb., 13 de mar. de 2021 às 06:07, Peter P. peterparker@fastmail.com escreveu:
Hi list,
trying to compile and load the espeak external from https://github.com/kronihias/espeak on Debian/GNU Linux. Have the apt packages espeak libespeak-dev installed and the makefile modifiet to point to PDROOT=/usr/include/pd
Running 'make' yields an error: cc -export-dynamic -shared -lc -lm -lespeak -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC -Wall -W -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch -I/usr/include/pd/src -o espeak.pd_linux espeak.c espeak.c: In function ‘espeak_setup’: espeak.c:406:6: error: cast between incompatible function types from ‘void * (*)(t_symbol *)’ {aka ‘void * (*)(struct _symbol *)’} to ‘void * (*)(void)’ [-Werror=cast-function-type] 406 | (t_newmethod)espeak_new, // newmethod | ^ cc1: all warnings being treated as errors make[1]: *** [Makefile:79: espeak.pd_linux] Error 1 make[1]: Leaving directory '/tmp/espeak-master' make: *** [Makefile:46: auto] Error 2
which I can circumnavigate disabling the -Werror flag in the makefile. Compilation somewhat succeeds then, posting: espeak.c: In function ‘espeak_setup’: espeak.c:406:6: warning: cast between incompatible function types from ‘void * (*)(t_symbol *)’ {aka ‘void * (*)(struct _symbol *)’} to ‘void * (*)(void)’ [-Wcast-function-type] 406 | (t_newmethod)espeak_new, // newmethod | ^
Loading the external in Pd then throws: ./espeak.pd_linux: ./espeak.pd_linux: undefined symbol: espeak_SetParameter espeak: can't load library
Can anyone point me into a good direction what to try next here? Anyone having had success on OS X with this external so far?
appreciated, as always, yours, P
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list