rPi3 compilation issue

120 views
Skip to first unread message

Brian Gilbert

unread,
Sep 19, 2016, 12:03:06 AM9/19/16
to Connected Community HackerSpace
Anyone able to help me nut out what's required to get the g729 compilation steps to work on a rPi3?
The 6th code block of the Compiling the G.729 codec steps (running make) is where I get stuck

make output
make  all-am
make[1]: Entering directory '/tmp/tmpfs/bcg729-1.0.0/asterisk-g72x-1.3'
/bin/bash ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.   -I/usr/local/include -DG72X_ASTERISK=130 -I"/usr/include" -DG72X_BCG729 -Wall -D_GNU_SOURCE -DG72X_9 -O3 -fomit-frame-pointer -march= -flto  -MT codec_g729_la-codec_g72x.lo -MD -MP -MF .deps/codec_g729_la-codec_g72x.Tpo -c -o codec_g729_la-codec_g72x.lo `test -f 'codec_g72x.c' || echo './'`codec_g72x.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/usr/local/include -DG72X_ASTERISK=130 -I/usr/include -DG72X_BCG729 -Wall -D_GNU_SOURCE -DG72X_9 -O3 -fomit-frame-pointer -march= -flto -MT codec_g729_la-codec_g72x.lo -MD -MP -MF .deps/codec_g729_la-codec_g72x.Tpo -c codec_g72x.c  -fPIC -DPIC -o .libs/codec_g729_la-codec_g72x.o
gcc: error: missing argument to '-march='
Makefile:641: recipe for target 'codec_g729_la-codec_g72x.lo' failed
make[1]: *** [codec_g729_la-codec_g72x.lo] Error 1
make[1]: Leaving directory '/tmp/tmpfs/bcg729-1.0.0/asterisk-g72x-1.3'
Makefile:416: recipe for target 'all' failed
make: *** [all] Error 2

I found the following but not having a lot of luck with it:

Output of lscpu
Architecture:          armv7l
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
Model name:            ARMv7 Processor rev 4 (v7l)
CPU max MHz:           1200.0000
CPU min MHz:           600.0000


Output of cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 1
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 2
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 3
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

Hardware : BCM2709
Revision : a02082


Cheers
Brian

AJ

unread,
Sep 19, 2016, 12:50:29 AM9/19/16
to connected-commu...@googlegroups.com

gcc: error: missing argument to '-march='

seems to be the problem....

https://gcc.gnu.org/onlinedocs/gcc-6.2.0/gcc/ARM-Options.html#ARM-Options
look at the -march=name section...





On 19/09/2016 2:03 PM, Brian Gilbert wrote:
> Anyone able to help me nut out what's required to get the g729
> compilation steps to work on a rPi3?
> http://bobbyromeo.com/diy/incrediblepbx-asteriskfreepbx-raspberry-pi-residential-use-part-1/
> The 6th code block of the Compiling the G.729 codec steps (running
> make) is where I get stuck
>
> *make output*
> make all-am
> make[1]: Entering directory '/tmp/tmpfs/bcg729-1.0.0/asterisk-g72x-1.3'
> /bin/bash ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
> -I/usr/local/include -DG72X_ASTERISK=130 -I"/usr/include"
> -DG72X_BCG729 -Wall -D_GNU_SOURCE -DG72X_9 -O3 -fomit-frame-pointer
> -march= -flto -MT codec_g729_la-codec_g72x.lo -MD -MP -MF
> .deps/codec_g729_la-codec_g72x.Tpo -c -o codec_g729_la-codec_g72x.lo
> `test -f 'codec_g72x.c' || echo './'`codec_g72x.c
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/usr/local/include
> -DG72X_ASTERISK=130 -I/usr/include -DG72X_BCG729 -Wall -D_GNU_SOURCE
> -DG72X_9 -O3 -fomit-frame-pointer -march= -flto -MT
> codec_g729_la-codec_g72x.lo -MD -MP -MF
> .deps/codec_g729_la-codec_g72x.Tpo -c codec_g72x.c -fPIC -DPIC -o
> .libs/codec_g729_la-codec_g72x.o
> gcc: error: missing argument to '-march='
> Makefile:641: recipe for target 'codec_g729_la-codec_g72x.lo' failed
> make[1]: *** [codec_g729_la-codec_g72x.lo] Error 1
> make[1]: Leaving directory '/tmp/tmpfs/bcg729-1.0.0/asterisk-g72x-1.3'
> Makefile:416: recipe for target 'all' failed
> make: *** [all] Error 2
>
> I found the following but not having a lot of luck with it:
> https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=144115
>
> *Output of lscpu*
> Architecture: armv7l
> Byte Order: Little Endian
> CPU(s): 4
> On-line CPU(s) list: 0-3
> Thread(s) per core: 1
> Core(s) per socket: 4
> Socket(s): 1
> Model name: ARMv7 Processor rev 4 (v7l)
> CPU max MHz: 1200.0000
> CPU min MHz: 600.0000
>
>
> *Output of cat /proc/cpuinfo*
> --
> You received this message because you are subscribed to the Google
> Groups "Connected Community HackerSpace" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
> connected-community-h...@googlegroups.com
> <mailto:connected-community-h...@googlegroups.com>.
> To post to this group, send email to
> connected-commu...@googlegroups.com
> <mailto:connected-commu...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/connected-community-hackerspace/1320aaa3-e979-4dc5-b8d3-fb000a73458b%40googlegroups.com
> <https://groups.google.com/d/msgid/connected-community-hackerspace/1320aaa3-e979-4dc5-b8d3-fb000a73458b%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


Brian Gilbert

unread,
Sep 19, 2016, 6:04:36 PM9/19/16
to Connected Community HackerSpace
I do have that declared in configure.ac though

default excerpt:

# tested on raspberry Pi, may be not valid for other ARM devices
case "${host}" in
  armv6l-*-linux-gnueabihf*)
    cflags="-mcpu=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -O3 -Wall"
    march="armv6zk"
    ;;
esac

Changes I've tried:

# tested on raspberry Pi, may be not valid for other ARM devices
case "${host}" in
  armv6l-*-linux-gnueabihf*)
    cflags="-mcpu=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -O3 -Wall"
    march="armv7a"
    ;;
esac



# tested on raspberry Pi, may be not valid for other ARM devices
case "${host}" in
  armv7-*-linux-gnueabihf*)
    cflags="-mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -O3 -Wall"
    march="armv7-a"
    ;;
esac



# tested on raspberry Pi, may be not valid for other ARM devices
case "${host}" in
  armv8-*-linux-gnueabihf*)
    cflags="-mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -O3 -Wall"
    march="armv8-a"
    ;;
esac
> To post to this group, send email to

AJ

unread,
Sep 19, 2016, 8:09:04 PM9/19/16
to connected-commu...@googlegroups.com

http://raspberrypi.stackexchange.com/questions/2046/which-cpu-flags-are-suitable-for-gcc-on-raspberry-pi



On 20/09/2016 8:04 AM, Brian Gilbert wrote:
> I do have that declared in configure.ac though
>
> *default excerpt:*
>
> # tested on raspberry Pi, may be not valid for other ARM devices
> case "${host}" in
> armv6l-*-linux-gnueabihf*)
> cflags="-mcpu=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -O3 -Wall"
> march="armv6zk"
> ;;
> esac
>
> *Changes I've tried:*
> *
> *
> > connected-community-h...@googlegroups.com
> <javascript:>
> >
> <mailto:connected-community-h...@googlegroups.com
> <javascript:>>.
> > To post to this group, send email to
> > connected-commu...@googlegroups.com <javascript:>
> > <mailto:connected-commu...@googlegroups.com
> <javascript:>>.
> <https://groups.google.com/d/msgid/connected-community-hackerspace/1320aaa3-e979-4dc5-b8d3-fb000a73458b%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Connected Community HackerSpace" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
> connected-community-h...@googlegroups.com
> <mailto:connected-community-h...@googlegroups.com>.
> To post to this group, send email to
> connected-commu...@googlegroups.com
> <mailto:connected-commu...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/connected-community-hackerspace/90bb41b6-1834-44e4-8d93-11806e2c0073%40googlegroups.com
> <https://groups.google.com/d/msgid/connected-community-hackerspace/90bb41b6-1834-44e4-8d93-11806e2c0073%40googlegroups.com?utm_medium=email&utm_source=footer>.

Angus Gratton

unread,
Sep 19, 2016, 9:55:12 PM9/19/16
to connected-commu...@googlegroups.com
Hi Brian,

There's a tiny typo with march=armv7a vs march=armv7-a (only the second one is accepted by gcc.) However I don't think that's the problem because the -march argument is empty on the gcc command line.

I don't have a Pi 3 handy to test, but I'd check the Pi 3 compiler's identifying triplet (in the configure.ac snippet this in the 'host' variable). You can find this by running 'gcc -v' and looking for a Target: line in the output it prints.

For example, on my intel laptop the line is:

Target: x86_64-pc-linux-gnu

On old Pis this triplet matched the case armv6l-*-linux-gnueabihf*. I think the new triplet might just be arm-linux-gnueabihf, but it's worth checking its not armv7-something-linux-something (Raspbian used to do it differently compared to Debian on other ARM platforms, and they might still do it differently.)

Swap the line "armv6l-*-linux-gnueabihf*)" in configure.ac for one which matches your triplet (it can be exact or use wildcards), and it should hopefully then evaluate the line march="armv7-a" and pass that argument to gcc.

(Don't forget to rerun autogen.sh & configure each time you change configure.ac).

Yay autotools? :/


Angus

On Mon, Sep 19, 2016 at 03:04:36PM -0700, Brian Gilbert wrote:
> I do have that declared in configure.ac though
>
> *default excerpt:*
>
> # tested on raspberry Pi, may be not valid for other ARM devices
> case "${host}" in
> armv6l-*-linux-gnueabihf*)
> cflags="-mcpu=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -O3 -Wall"
> march="armv6zk"
> ;;
> esac
>
> *Changes I've tried:*
>
> > > connected-community-h...@googlegroups.com
> > <javascript:>
> > > <mailto:connected-community-h...@googlegroups.com
> > <javascript:>>.
> > > To post to this group, send email to
> > > connected-commu...@googlegroups.com <javascript:>
> > > <mailto:connected-commu...@googlegroups.com <javascript:>>.
> --
> You received this message because you are subscribed to the Google Groups "Connected Community HackerSpace" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to connected-community-h...@googlegroups.com.
> To post to this group, send an email to connected-commu...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/connected-community-hackerspace/90bb41b6-1834-44e4-8d93-11806e2c0073%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages