sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Error building Flite for Arch on Pi

Sun May 19, 2013 8:04 pm

I decided I was tired of futzing around, having trouble getting festival to work, and decided to see if I could build flite (festival lite) for the Pi, but have never built a package before. I see the package is in other repositories, but not ArchLinuxArm for the pi. I would guess people knowing how to work with basic c code build errors can help debug, whatever OS they are running.

http://www.speech.cs.cmu.edu/flite/index.html

Source is here:

http://www.speech.cs.cmu.edu/flite/pack ... se.tar.bz2

Arch Linux build files are here:

https://aur.archlinux.org/packages/fl/f ... ite.tar.gz

https://aur.archlinux.org/packages/fl/flite/PKGBUILD

Here is output. first, distribution running on my Pi:

[ alarmpi ~] cat /proc/version
Linux version 3.6.11-9-ARCH+ (nobody@panda3) (gcc version 4.7.2 (GCC) ) #1 PREEMPT Sat Mar 30 02:38:20 UTC 2013

Next, last 6 lines of the output, showing two lines before the "undefined reference":

[ alarmpi ~] tail -n6 /mnt/part3/makeflite2.txt
gcc -march=armv6 -mfloat-abi=hard -mfpu=vfp -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wall -I../include -c -o flite_voice_list.o flite_voice_list.c
gcc -march=armv6 -mfloat-abi=hard -mfpu=vfp -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wall -o ../bin/flite flite_main.o flite_voice_list.o -L../build/armv6l-linux-gnu/lib -lflite_cmu_us_kal -lflite_cmu_time_awb -lflite_cmu_us_kal16 -lflite_cmu_us_awb -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite -lm -lasound -lm -lasound
../build/armv6l-linux-gnu/lib/libflite_cmu_us_kal16.a(cmu_us_kal16_diphone.o):(.data+0xc): undefined reference to `cmu_us_kal16_res'
collect2: error: ld returned 1 exit status
make[1]: *** [../bin/flite] Error 1
make: *** [build/armv6l-linux-gnu/obj//.make_build_dirs] Error 2
[ alarmpi ~]

Then I checked the output to see what other references there were to the missing item:

[ alarmpi ~] grep kal16_res /mnt/part3/makeflite2.txt
gcc -I../../lang/usenglish -I../../lang/cmulex -I../../include -march=armv6 -mfloat-abi=hard -mfpu=vfp -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wall
-c cmu_us_kal16_residx.c -o ../../build/armv6l-linux-gnu/obj/lang/cmu_us_kal16/cmu_us_kal16_residx.o
a - cmu_us_kal16_res.o
a - cmu_us_kal16_residx.o
../build/armv6l-linux-gnu/lib/libflite_cmu_us_kal16.a(cmu_us_kal16_diphone.o):(.data+0xc): undefined reference to `cmu_us_kal16_res'
[ alarmpi ~]

I could only find two webpages containing some of the error output, and the errors in the first debian one were for an earlier version of flite.

http://osdir.com/ml/debian-bugs-closed/ ... 00726.html

http://jira.freeswitch.org/secure/attachment/1103

Now what do I do? I do not know c, just bash and sed and a little awk.

Also, if I needed to make extra swap, would there be an error indicating that my pi had run out of space?

Thanks!
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Error building Flite for Arch on Pi

Mon May 20, 2013 10:10 pm

Okay, I now have put the full output from makepkg at pastebin. Maybe I should have posted in the new to linux forum as have no experience with this sort of thing. I found out there may be more wrong than just the error at the end. But still no idea what to do about it.

http://pastebin.com/GUmaUs58

Seems that there being no machine/soundcard.h could be a factor, as well as other stuff. Does this mean I cannot build flite if I do not have an audio input sound card?

The negative answers to checking output start on line 36.

EDIT: making progress, searching around, it seems that there being no maching subdirectory does not matter, some files used to be in machine, are now in sys subdirectories.

I also now understand that the files ending in .h are library sources, and am searching out mmsystem.h and audioio.h and will post more later, I may be on the road to solution.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

User avatar
scruss
Posts: 3212
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Error building Flite for Arch on Pi

Sun May 26, 2013 3:09 am

I managed to build it on a 512 MB Model B under Raspbian from the stock source using just './configure; make'
It did take a long time, though.

I've been running flite for years on a small ARM box as a robotic compère for a podcast. I remember I needed to add swap space to get the voice data to build, which is where your compilation failed.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Error building Flite for Arch on Pi

Sun May 26, 2013 4:47 am

Oh, how cool, thanks for the reply. How would I know that the failure was due to inadequate swap space? How much swap do you think would be needed? I don't have experience with making swap, when I tried it on my Embedded Linux PDA, making a separate swap partition on an SD card years ago, it did not work out.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

User avatar
scruss
Posts: 3212
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Error building Flite for Arch on Pi

Sun May 26, 2013 12:08 pm

I only needed the swap space on the older SheevaPlug. It built fine on a 512MB model B with no additional swap, total memory 448776 MB. The errors I'm seeing in your paste don't look like out of memory. What is your gpu_mem set to? What's the output of free? Are you trying to build it with X running?

Those are some weird compiler options your package manager is setting. What happens if you download the source package, extract it, cd to the flite-1.4-release folder, and as a regular user (not root; don't build stuff as root unless you have to), do:

Code: Select all

./configure
make

?

After a while, you should end up with a bin/flite executable, which you can test with:

Code: Select all

bin/flite -o hello.wav 'Hello, folks!'
That wav file should have something in it.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Error building Flite for Arch on Pi

Sun May 26, 2013 6:05 pm

scruss wrote:...The errors I'm seeing in your paste don't look like out of memory. What is your gpu_mem set to? What's the output of free? Are you trying to build it with X running?
X is definitely not running, I just confirmed with "ps ax" when trying again. Output of df and free and gpu mem info are:

Code: Select all

bash# free
             total       used       free     shared    buffers     cached
Mem:        472844     196160     276684
   0      59332      90624
-/+ buffers/cache:      46204     426640
Swap:            0          0          0
bash# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.1G  2.7G  271M  91% /
devtmpfs         83M     0   83M   0% /dev
tmpfs           231M     0  231M   0% /dev/shm
tmpfs           231M  336K  231M   1% /run
tmpfs           231M     0  231M   0% /sys/fs/cgroup
tmpfs           231M     0  231M   0% /tmp
/dev/mmcblk0p1   90M   30M   61M  33% /boot
/dev/mmcblk0p3  421M   39M  360M  10% /mnt/part3
bash# grep gpu /boot/config.txt
gpu_mem_512=316
gpu_mem_256=128
My understanding is that gpu.cpu memory split is dynamic, but maybe it is not working right? My Pi is Model B 512MB too. And reran fsck on it this morning, file system is clean.
scruss wrote:Those are some weird compiler options your package manager is setting. What happens if you download the source package, extract it, cd to the flite-1.4-release folder, and as a regular user (not root; don't build stuff as root unless you have to), do:

Code: Select all

./configure
make
Okay, skipped the makepkg wrapper, did not understand that I do not need it. But same identical errors when do configure and then make. Can post longer output, if you want, but looks the same to me. Ends with:

Code: Select all

../build/armv6l-linux-gnu/lib/libflite_cmu_us_kal16.a(cmu_us_kal16_diphone.o):(.data+0xc): undefined reference to `cmu_us_kal16_res'
collect2: error: ld returned 1 exit status
make[1]: *** [../bin/flite] Error 1
make: *** [build/armv6l-linux-gnu/obj//.make_build_dirs] Error 2
Thanks for how to test binary when and if I can get it compiled. I do know how to use flite, have used it before on my Zaurus PDA, which is why I knew about it. Although I usually just pipe a few words to that version of flite and it talks, no configuring needed. But it was prebuilt, just stuck the binary in my path to run it.

I do have a couple bash scripts running that sleep a lot, but they are not using that much memory or cpu. Biggest cpu and memory users are minimal:

Code: Select all

 %CPU COMMAND
  0.9 crond
  0.5 mmcqd/0
  0.1 sshd 
 
 %MEM COMMAND
  1.5 1 /usr/lib/systemd/systemd-journald
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Error building Flite for Arch on Pi

Sun May 26, 2013 7:01 pm

Just ran configure and make again, this time running strace on the make command.

Lots more debugging information in the output from strace of "make", posted at:

http://pastebin.com/40gVSpDb

I am not sure which things are key issues, a lot of time there will be output in strace when an executable cannot find something that it finds a line or two later.

I did remove audioio.h because it was not natively on my Pi, but was getting the same final error message with and without it available for the build. I can put it back if it really is needed.

However, it looks like a big issue is make is not finding a "make.mo" for my LOCALE, here is what is on my system:

Code: Select all

bash# find / -name make.mo
/usr/share/locale/es/LC_MESSAGES/make.mo
/usr/share/locale/ko/LC_MESSAGES/make.mo
/usr/share/locale/vi/LC_MESSAGES/make.mo
/usr/share/locale/gl/LC_MESSAGES/make.mo
/usr/share/locale/he/LC_MESSAGES/make.mo
/usr/share/locale/pl/LC_MESSAGES/make.mo
/usr/share/locale/lt/LC_MESSAGES/make.mo
/usr/share/locale/fi/LC_MESSAGES/make.mo
/usr/share/locale/ga/LC_MESSAGES/make.mo
/usr/share/locale/fr/LC_MESSAGES/make.mo
/usr/share/locale/hr/LC_MESSAGES/make.mo
/usr/share/locale/tr/LC_MESSAGES/make.mo
/usr/share/locale/pt_BR/LC_MESSAGES/make.mo
/usr/share/locale/nl/LC_MESSAGES/make.mo
/usr/share/locale/de/LC_MESSAGES/make.mo
/usr/share/locale/ru/LC_MESSAGES/make.mo
/usr/share/locale/zh_CN/LC_MESSAGES/make.mo
/usr/share/locale/id/LC_MESSAGES/make.mo
/usr/share/locale/uk/LC_MESSAGES/make.mo
/usr/share/locale/da/LC_MESSAGES/make.mo
/usr/share/locale/be/LC_MESSAGES/make.mo
/usr/share/locale/sv/LC_MESSAGES/make.mo
/usr/share/locale/ja/LC_MESSAGES/make.mo
/usr/share/locale/it/LC_MESSAGES/make.mo
bash#
My /etc/locale.gen has just the following uncommented lines:

Code: Select all

en_US.UTF-8 UTF-8
en_US ISO-8859-1 
What do I do, create a symlink to one of the other entries? I am not sure what make.mo does. It is strange there are no LC_MESSAGES entries for the western hemisphere! Is there a package I need to install to get them there?
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

User avatar
scruss
Posts: 3212
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Error building Flite for Arch on Pi

Mon May 27, 2013 12:31 am

I have no idea, sorry. Builds fine for me.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Error building Flite for Arch on Pi

Mon May 27, 2013 6:11 am

What tzone did you set your pi at? Did you leave it UK? That is where mine is bombing out, in addition to one other missing thing have not figure out.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

User avatar
scruss
Posts: 3212
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Error building Flite for Arch on Pi

Mon May 27, 2013 11:42 am

I have it at whatever the right one for EDT is.

Sounds like your installation is broken if the locale infrastructure isn't there. I've only ever run Raspbian, which has always just worked for me.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Error building Flite for Arch on Pi

Mon May 27, 2013 1:35 pm

Found this in README:

Code: Select all

 new byte order architectures may not work directly as there is some careful byte order constraints in some structures
Are you running Raspbian hard float or soft float? That could be the problem, if you succeeded on soft float and I am using hard float.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

User avatar
scruss
Posts: 3212
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Error building Flite for Arch on Pi

Mon May 27, 2013 6:12 pm

sdjf wrote:Are you running Raspbian hard float or soft float?
Hard float. Don't think there ever was a soft float one.

The Kirkwood-based SheevaPlug is soft float (a very old Ubuntu 9.04). It builds flite with no problem.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

hayderOICO
Posts: 49
Joined: Thu May 09, 2013 3:40 pm

Re: Error building Flite for Arch on Pi

Wed Mar 04, 2015 10:27 am

hello

sorry to bring back a zombie thread.

I'm trying to compile flite 2.0 and get the warnings when doing the configure. It does compile when I make, but throws a /dev/dsp missing when I try to run it.

I had faced a similar issue with /dev/dsp on the fully fledged festival... but at least there's a documented solution for that which works.

I'm looking at solutions now... (just installed libasound2-dev and recompiling).

User avatar
scruss
Posts: 3212
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Error building Flite for Arch on Pi

Fri Mar 06, 2015 12:59 pm

Debian/Raspbian does extensive patching of the flite source to make it talk to alsa, so maybe looking at their patches would help?
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

Return to “Advanced users”