Can not build PX4 firmware on ubuntu

Hi,

I have followed the steps as mentioned here: https://dev.px4.io/en/setup/dev_env_linux_ubuntu.html

I get this output:
root@px4test-ubuntu:/home/oaasadmin/src/Firmware# arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160609 (release) [ARM/embedded-5-branch revision 237715]
Copyright © 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I got the source and trying to build px4 firmware using the cmd: make px4fmu-v2_default

failed with the following error:

Scanning dependencies of target nuttx_patch_px4io-v2
[ 13%] Built target px4fmu-v2-nuttx_patch_00028-BACKPORT-mtd-FLASH-corruption.patch
[ 13%] Built target nuttx_patch_px4io-v2
Scanning dependencies of target px4fmu-v2-nuttx_patch_00029-BACKPORT-stm32-serial-upstream-sans-IRQ.patch
[ 14%] px4fmu-v2: nuttx-patches/00029-BACKPORT-stm32-serial-upstream-sans-IRQ.patch applied
Scanning dependencies of target nuttx_configure_px4io-v2
[ 15%] Configuring NuttX for px4io-v2 with nsh
[ 15%] Built target px4fmu-v2-nuttx_patch_00029-BACKPORT-stm32-serial-upstream-sans-IRQ.patch
Scanning dependencies of target px4fmu-v2-nuttx_patch_00030-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-nuttx.patch
[ 15%] px4fmu-v2: nuttx-patches/00030-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-nuttx.patch applied
[ 15%] Built target px4fmu-v2-nuttx_patch_00030-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-nuttx.patch
[ 15%] Built target nuttx_configure_px4io-v2
Scanning dependencies of target px4fmu-v2-nuttx_patch_00031-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-apps.patch
Scanning dependencies of target nuttx_export_px4io-v2
[ 15%] px4fmu-v2: nuttx-patches/00031-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-apps.patch applied
[ 15%] Building NuttX for px4io-v2 with nsh
make[4]: warning: jobserver unavailable: using -j1. Add ‘+’ to parent make rule.
[ 15%] Built target px4fmu-v2-nuttx_patch_00031-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-apps.patch
make[5]: gcc: Command not found
make[5]: *** [mkconfig] Error 127
make[4]: *** [tools/mkconfig] Error 2
src/modules/px4iofirmware/CMakeFiles/nuttx_export_px4io-v2.dir/build.make:60: recipe for target ‘px4io-v2/nuttx_export.stamp’ failed
make[3]: *** [px4io-v2/nuttx_export.stamp] Error 2
CMakeFiles/Makefile2:8590: recipe for target ‘src/modules/px4iofirmware/CMakeFiles/nuttx_export_px4io-v2.dir/all’ failed
make[2]: *** [src/modules/px4iofirmware/CMakeFiles/nuttx_export_px4io-v2.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs…
Scanning dependencies of target px4fmu-v2-nuttx_patch_00032-BACKPORT-stm32f7-pinmap-FMC-I2C4-fixes.patch
[ 15%] px4fmu-v2: nuttx-patches/00032-BACKPORT-stm32f7-pinmap-FMC-I2C4-fixes.patch applied
[ 15%] Built target px4fmu-v2-nuttx_patch_00032-BACKPORT-stm32f7-pinmap-FMC-I2C4-fixes.patch
Makefile:160: recipe for target ‘all’ failed
make[1]: *** [all] Error 2
Makefile:165: recipe for target ‘px4fmu-v2_default’ failed
make: *** [px4fmu-v2_default] Error 2

As you can see, arm-gcc is available in the system but getting gcc not found. Can you please help me here?

Are you sure you have gcc installed? Running “gcc -v” at the command line should tell you if you do and what version you have (mine is v5.4, it works).

Thank you for quick response. bin path seems to be not set properly. After setting the path, I can verify gcc version.

root@px4test-ubuntu:/home/oaasadmin/src/Firmware# gcc -v
Using built-in specs.
COLLECT_GCC=gcc-4.6
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: …/src/configure -v --with-pkgversion=‘Ubuntu/Linaro 4.6.4-6ubuntu2’ --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-gnu-unique-object --disable-libmudflap --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.4 (Ubuntu/Linaro 4.6.4-6ubuntu2)

And then, I ran the same cmd: make px4fmu-v2_default

it is failing at this point

13%] Built target px4io-v2-nuttx_patch_90000-PENDING-wip-inflight-to-upstream.patch
[ 13%] Built target px4fmu-v2-nuttx_patch_00028-BACKPORT-mtd-FLASH-corruption.patch
[ 13%] Built target nuttx_patch_px4io-v2
[ 14%] Built target px4fmu-v2-nuttx_patch_00029-BACKPORT-stm32-serial-upstream-sans-IRQ.patch
[ 15%] Built target nuttx_configure_px4io-v2
[ 15%] Built target px4fmu-v2-nuttx_patch_00030-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-nuttx.patch
[ 15%] Building NuttX for px4io-v2 with nsh
make[4]: warning: jobserver unavailable: using -j1. Add ‘+’ to parent make rule.
make[5]: execvp: gcc: Not a directory
make[5]: *** [mkconfig] Error 127
make[4]: *** [tools/mkconfig] Error 2
src/modules/px4iofirmware/CMakeFiles/nuttx_export_px4io-v2.dir/build.make:60: recipe for target ‘px4io-v2/nuttx_export.stamp’ failed
make[3]: *** [px4io-v2/nuttx_export.stamp] Error 2
CMakeFiles/Makefile2:8590: recipe for target ‘src/modules/px4iofirmware/CMakeFiles/nuttx_export_px4io-v2.dir/all’ failed
make[2]: *** [src/modules/px4iofirmware/CMakeFiles/nuttx_export_px4io-v2.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs…
[ 15%] Built target px4fmu-v2-nuttx_patch_00031-BACKPORT-fix-arm-none-eabi-gcc-7-warnings-apps.patch
Makefile:160: recipe for target ‘all’ failed
make[1]: *** [all] Error 2
Makefile:165: recipe for target ‘px4fmu-v2_default’ failed
make: *** [px4fmu-v2_default] Error 2

do you think any other bin paths are missing from $path variable?

root@px4test-ubuntu:/home/oaasadmin/src/Firmware# $PATH
bash: /opt/ros/kinetic/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/oaasadmin/gcc-arm-none-eabi-5_4-2016q2/bin:/usr/bin/gcc-4.6: No such file or directory

can anyone help me here? did you get into the same situation?