starfive-tech / VisionFive2

445 stars 79 forks source link

error when running make #47

Closed csukuangfj closed 1 year ago

csukuangfj commented 1 year ago

I am following the build instructions in README.md.

However, I am getting the following error

(py38) kuangfangjun:VisionFive2$ rm -rf work/
(py38) kuangfangjun:VisionFive2$ make -j 3
mkdir -p /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/
cp /star-fj/fangjun/open-source/VisionFive2/conf/buildroot_initramfs_config /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/.config
make -C /star-fj/fangjun/open-source/VisionFive2/buildroot RISCV=/star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/host O=/star-fj/fan
gjun/open-source/VisionFive2/work/buildroot_initramfs olddefconfig
make[1]: Entering directory '/star-fj/fangjun/open-source/VisionFive2/buildroot'
mkdir -p /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config/lxdialog
PKG_CONFIG_PATH="" make CC="/usr/bin/gcc" HOSTCC="/usr/bin/gcc" \
    obj=/star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config -C support/kconfig -f Makefile.br conf
make[2]: Entering directory '/star-fj/fangjun/open-source/VisionFive2/buildroot/support/kconfig'
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/star-fj/fangjun/open
-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config -DCONFIG_=\"\"  -MM *.c > /star-fj/fangjun/open-source/VisionFive2/work/buildroot_
initramfs/build/buildroot-config/.depend 2>/dev/null || :
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/star-fj/fangjun/open
-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config -DCONFIG_=\"\"   -c conf.c -o /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config/conf.o
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config -DCONFIG_=\"\"  -I. -c /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config/zconf.tab.c -o /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config/zconf.tab.o
/usr/bin/gcc -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE  -I/star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config -DCONFIG_=\"\"   /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config/conf.o /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config/zconf.tab.o  -o /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config/conf
rm /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/build/buildroot-config/zconf.tab.c
make[2]: Leaving directory '/star-fj/fangjun/open-source/VisionFive2/buildroot/support/kconfig'
  GEN     /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/Makefile
package/starfive/img-gpu-powervr/Config.in:77:warning: config symbol defined without type
#
# configuration written to /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/.config
#
make[1]: Leaving directory '/star-fj/fangjun/open-source/VisionFive2/buildroot'
make -C /star-fj/fangjun/open-source/VisionFive2/buildroot RISCV=/star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/host O=/star-fj/fan
gjun/open-source/VisionFive2/work/buildroot_initramfs
make[1]: Entering directory '/star-fj/fangjun/open-source/VisionFive2/buildroot'
/usr/bin/make -j1 O=/star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" syncconfig
make[2]: Entering directory '/star-fj/fangjun/open-source/VisionFive2/buildroot'
make[2]: warning: -jN forced in submake: disabling jobserver mode.
  GEN     /star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/Makefile
package/starfive/img-gpu-powervr/Config.in:77:warning: config symbol defined without type
make[2]: Leaving directory '/star-fj/fangjun/open-source/VisionFive2/buildroot'

You seem to have the current working directory in your
LD_LIBRARY_PATH environment variable. This doesn't work.
support/dependencies/dependencies.mk:27: recipe for target 'dependencies' failed
make[1]: *** [dependencies] Error 1
make[1]: Leaving directory '/star-fj/fangjun/open-source/VisionFive2/buildroot'
make: *** No rule to make target '/star-fj/fangjun/open-source/VisionFive2/work/buildroot_initramfs/host/bin/riscv64-buildroot-linux-gnu-gcc', needed
by '/star-fj/fangjun/open-source/VisionFive2/work/u-boot/u-boot.bin'.  Stop.
(py38) kuangfangjun:VisionFive2$ echo $LD_LIBRARY_PATH
/star-fj/fangjun/software/protobuf-3.20.1-cmake/lib:/star-fj/fangjun/software/cuda-10.2.89/lib:/star-fj/fangjun/software/cuda-10.2.89/lib64:
(py38) kuangfangjun:VisionFive2$

The error log is not informative and I have no idea where to start debugging.

andyhu-stf commented 1 year ago

It seems it is your build environment problem. You can unset LD_LIBRARY_PATH and try again.

csukuangfj commented 1 year ago

I was using Ubuntu 18.04.

After switching to Ubuntu 22.04, everything works as expected.

andyhu-stf commented 1 year ago

The SDK support the ubuntu18.04, I think it is still your build environment problem