ERROR: bad calibration on Raspi 3/navio2

Hi, I recently downloaded px4 repository and tried to build PX4 Firmware on raspi3.
native build for PX4 Firmware(make posix_rpi_native )
error as follow:
CMake Error at /usr/local/share/cmake-3.2/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler “/usr/bin/c++” is not able to compile a simple test
program.
It fails with the following output:
Change Dir: /home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" “cmTryCompileExec583486650/fast”
make[1]: Entering directory
‘/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp’
/usr/bin/make -f CMakeFiles/cmTryCompileExec583486650.dir/build.make
CMakeFiles/cmTryCompileExec583486650.dir/build
make[2]: Entering directory
‘/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp’
/usr/local/bin/cmake -E cmake_progress_report
/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp/CMakeFiles
1
Building CXX object
CMakeFiles/cmTryCompileExec583486650.dir/testCXXCompiler.cxx.o
/usr/bin/c++ -o
CMakeFiles/cmTryCompileExec583486650.dir/testCXXCompiler.cxx.o -c
/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTryCompileExec583486650
/usr/local/bin/cmake -E cmake_link_script
CMakeFiles/cmTryCompileExec583486650.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/cmTryCompileExec583486650.dir/testCXXCompiler.cxx.o
-o cmTryCompileExec583486650 -rdynamic
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec583486650.dir/build.make:88: recipe for target
‘cmTryCompileExec583486650’ failed
make[2]: Leaving directory
‘/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp’
make[2]: *** [cmTryCompileExec583486650] Error 1
Makefile:117: recipe for target ‘cmTryCompileExec583486650/fast’ failed
make[1]: *** [cmTryCompileExec583486650/fast] Error 2
make[1]: Leaving directory
‘/home/pi/px4src/Firmware/build_posix_rpi_native/CMakeFiles/CMakeTmp’
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:216 (project)
– Configuring incomplete, errors occurred!

I also check the cmake version as follow.
cmake version 3.2.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).

gcc version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.8/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: …/src/configure -v --with-pkgversion=‘Raspbian 4.8.2-21~rpi3rpi1’ --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.8.2 (Raspbian 4.8.2-21~rpi3rpi1)

I also try the sudo ldconfig. it is not work. plz help me T_T

never mind, it works after "sudo apt-get install "
but new error as follow:
[ 59%] Building CXX object src/modules/uORB/CMakeFiles/modules__uORB.dir/uORBUtils.cpp.o
[ 60%] Building CXX object src/modules/commander/CMakeFiles/modules__commander.dir/commander.cpp.o
[ 60%] Building CXX object src/modules/uORB/CMakeFiles/modules__uORB.dir/uORB.cpp.o
[ 60%] Building CXX object src/modules/uORB/CMakeFiles/modules__uORB.dir/uORBMain.cpp.o
Linking C static library libmodules__sdlog2.a
[ 61%] Building CXX object src/modules/uORB/CMakeFiles/modules__uORB.dir/Publication.cpp.o
[ 61%] Built target modules__sdlog2
[ 61%] Building CXX object src/modules/commander/CMakeFiles/modules__commander.dir/state_machine_helper.cpp.o
In file included from /home/pi/px4src/Firmware/src/modules/uORB/Publication.cpp:39:0:
/home/pi/px4src/Firmware/src/modules/uORB/Publication.hpp: In constructor ‘uORB::Publication::Publication(const orb_metadata*, int, ListuORB::PublicationNode**) [with T = vehicle_global_position_s]’:
/home/pi/px4src/Firmware/src/modules/uORB/Publication.hpp:154:2: internal compiler error: Segmentation fault
}
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
[ 62%] Building CXX object src/lib/ecl/CMakeFiles/lib__ecl.dir/EKF/ekf_helper.cpp.o
[ 62%] Generating px4_parameters.h, px4_parameters.c
Scanning dependencies of target modules__param
[ 62%] Building C object src/modules/param/CMakeFiles/modules__param.dir/px4_parameters.c.o
Linking C static library libmodules__param.a
[ 62%] Built target modules__param
[ 62%] Building CXX object src/modules/commander/CMakeFiles/modules__commander.dir/commander_helper.cpp.o
The bug is not reproducible, so it is likely a hardware or OS problem.
src/modules/uORB/CMakeFiles/modules__uORB.dir/build.make:123: recipe for target ‘src/modules/uORB/CMakeFiles/modules__uORB.dir/Publication.cpp.o’ failed
make[3]: *** [src/modules/uORB/CMakeFiles/modules__uORB.dir/Publication.cpp.o] Error 1
CMakeFiles/Makefile2:2423: recipe for target ‘src/modules/uORB/CMakeFiles/modules__uORB.dir/all’ failed
make[2]: *** [src/modules/uORB/CMakeFiles/modules__uORB.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs…

I run “make posix_rpi_native” again. It built complete.
BUT I run “sudo ./build_posix_rpi_native/src/firmware/posix/px4 ./posix-configs/rpi/px4.config” as nativebuild said.
I got the error as follow:

I add “-D__DF_RPI” in “/cmake/configs/posix_rpi_common.cmake” and problem was solved.

But when I calibrated the sensors, the calibration result was really bad…
Did any body meet same problem ? plz help me T_T