Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building middleware fails on Ubuntu 22.04 amd64 Docker container #20

Open
cryptic-quasar opened this issue Jan 5, 2025 · 1 comment

Comments

@cryptic-quasar
Copy link

Hi, for building the SDK, I follow the steps provided in https://milkv.io/docs/duo/getting-started/buildroot-sdk. I am building for milkv-duos-glibc-arm64-emmc using the Ubuntu 22.04.5 Docker container. Therefore upon running ./build.sh lunch, I choose the 4th option.

The following error happens no matter if I run the build in the one-click mode or manually. I appreciate any input.

Run build_middleware() function
make: '/opt/duo-buildroot-sdk-v2/install/soc_sg2000_milkv_duos_glibc_arm64_emmc/rootfs' is up to date.
/opt/duo-buildroot-sdk-v2/cvi_mpi /opt/duo-buildroot-sdk-v2/build
make[1]: Entering directory '/opt/duo-buildroot-sdk-v2/cvi_mpi'
make[1]: Entering directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/3rdparty'
make[1]: Entering directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp'
#################################################
#                                               #
#   Compiling '3rdparty libs' Configs as below  #
#                                               #
#################################################
make[2]: Entering directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/common'
make[2]: Entering directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/3rdparty/inih'
make[1]: Leaving directory '/opt/duo-buildroot-sdk-v2/cvi_mpi'
[aarch64-linux-gnu-gcc] sensor_list.o
make[2]: Leaving directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/common'
pushd sensor/cv181x && \
make all && \
popd;
/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv181x /opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp
make[2]: Entering directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv182x'
pushd  gcore_gc2083 && make all && popd
pushd  gcore_gc4653 && make all && popd
pushd  ov_ov5647 && make all && popd
#################################################
/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv181x/gcore_gc2083 /opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv181x
/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv181x/gcore_gc4653 /opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv181x
/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv181x/ov_ov5647 /opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv181x
#
make[3]: Entering directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv182x/gcore_gc2083'
make[3]: Entering directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv182x/gcore_gc4653'
make[3]: Entering directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv182x'
make[3]: Entering directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp/sensor/cv182x/ov_ov5647'
# Compiling 'component libs' Configs as below...
# SENSOR_LIST=gcore_gc2083 gcore_gc4653 ov_ov5647
#
#################################################
make[2]: *** write jobserver: Bad file descriptor.  Stop.
make[2]: *** Waiting for unfinished jobs....
[aarch64-linux-gnu-gcc] ini.o
aarch64-linux-gnu-gcc -O3 -std=gnu11 -g -Wall -Wextra -Werror -fPIC -ffunction-sections -fdata-sections -D__CV181X__ -DOS_IS_LINUX   -c -o gcore_gc2083/gc2083_cmos.o gcore_gc2083/gc2083_cmos.c
aarch64-linux-gnu-gcc -O3 -std=gnu11 -g -Wall -Wextra -Werror -fPIC -ffunction-sections -fdata-sections -D__CV181X__ -DOS_IS_LINUX   -c -o gcore_gc2083/gc2083_sensor_ctl.o gcore_gc2083/gc2083_sensor_ctl.c
aarch64-linux-gnu-gcc -O3 -std=gnu11 -g -Wall -Wextra -Werror -fPIC -ffunction-sections -fdata-sections -D__CV181X__ -DOS_IS_LINUX   -c -o gcore_gc4653/gc4653_sensor_ctl.o gcore_gc4653/gc4653_sensor_ctl.c
aarch64-linux-gnu-gcc -O3 -std=gnu11 -g -Wall -Wextra -Werror -fPIC -ffunction-sections -fdata-sections -D__CV181X__ -DOS_IS_LINUX   -c -o gcore_gc4653/gc4653_cmos.o gcore_gc4653/gc4653_cmos.c
aarch64-linux-gnu-gcc -O3 -std=gnu11 -g -Wall -Wextra -Werror -fPIC -ffunction-sections -fdata-sections -D__CV181X__ -DOS_IS_LINUX   -c -o ov_ov5647/ov5647_sensor_ctl.o ov_ov5647/ov5647_sensor_ctl.c
aarch64-linux-gnu-gcc -O3 -std=gnu11 -g -Wall -Wextra -Werror -fPIC -ffunction-sections -fdata-sections -D__CV181X__ -DOS_IS_LINUX   -c -o ov_ov5647/ov5647_cmos.o ov_ov5647/ov5647_cmos.c
[LINK][aarch64-linux-gnu-ar] libini.a
make[2]: *** write jobserver: Bad file descriptor.  Stop.
make[2]: *** Waiting for unfinished jobs....
[LINK][aarch64-linux-gnu-ld] libini.so
make[2]: *** write jobserver: Bad file descriptor.  Stop.
make[1]: *** [Makefile:8: all] Error 1
make[1]: Leaving directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/3rdparty'
make: *** [Makefile:20: 3rdparty] Error 2
make: *** Waiting for unfinished jobs....
aarch64-linux-gnu-ld: cannot find gcore_gc2083/gc2083_cmos.o: No such file or directory
aarch64-linux-gnu-ld: cannot find gcore_gc2083/gc2083_sensor_ctl.o: No such file or directory
aarch64-linux-gnu-ld: cannot find gcore_gc4653/gc4653_sensor_ctl.o: No such file or directory
aarch64-linux-gnu-ld: cannot find gcore_gc4653/gc4653_cmos.o: No such file or directory
aarch64-linux-gnu-ld: cannot find ov_ov5647/ov5647_sensor_ctl.o: No such file or directory
aarch64-linux-gnu-ld: cannot find ov_ov5647/ov5647_cmos.o: No such file or directory
gcore_gc2083/gc2083_sensor_ctl.c:10:10: fatal error: linux/cvi_comm_video.h: No such file or directory
 #include <linux/cvi_comm_video.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
ov_ov5647/ov5647_cmos.c:8:10: fatal error: linux/cvi_type.h: No such file or directory
 #include <linux/cvi_type.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [Makefile_full:28: /opt/duo-buildroot-sdk-v2/cvi_mpi/lib/libsns_full.so] Error 1
make[3]: *** write jobserver: Bad file descriptor.  Stop.
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [<builtin>: gcore_gc2083/gc2083_sensor_ctl.o] Error 1
make[3]: *** write jobserver: Bad file descriptor.  Stop.
make[2]: *** [Makefile:335: all_sensor] Error 1
make[2]: *** write jobserver: Bad file descriptor.  Stop.
ov_ov5647/ov5647_sensor_ctl.c:11:10: fatal error: linux/cvi_comm_video.h: No such file or directory
 #include <linux/cvi_comm_video.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gcore_gc4653/gc4653_sensor_ctl.c:10:10: fatal error: linux/cvi_comm_video.h: No such file or directory
 #include <linux/cvi_comm_video.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:11: all] Error 2
make[1]: Leaving directory '/opt/duo-buildroot-sdk-v2/cvi_mpi/component/isp'
gcore_gc2083/gc2083_cmos.c:7:10: fatal error: linux/cvi_type.h: No such file or directory
 #include <linux/cvi_type.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:35: component] Error 2
 build middleware failed !!
/opt/duo-buildroot-sdk-v2/build
Error: Build board milkv-duos-glibc-arm64-emmc failed!
root@74017d9151ee:/opt/duo-buildroot-sdk-v2# gcore_gc4653/gc4653_cmos.c:7:10: fatal error: linux/cvi_type.h: No such file or directory
 #include <linux/cvi_type.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
[aarch64-linux-gnu-gcc] ov5647_sensor_ctl.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
make[3]: *** Waiting for unfinished jobs....
[aarch64-linux-gnu-gcc] gc4653_sensor_ctl.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
make[3]: *** Waiting for unfinished jobs....
[aarch64-linux-gnu-gcc] gc2083_sensor_ctl.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
make[3]: *** Waiting for unfinished jobs....
[aarch64-linux-gnu-gcc] ov5647_cmos.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
[aarch64-linux-gnu-gcc] gc2083_cmos.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
[aarch64-linux-gnu-gcc] gc4653_cmos.o
make[3]: *** write jobserver: Bad file descriptor.  Stop.
@itssead
Copy link

itssead commented Jan 25, 2025

Hi, here is a quick fix for that problem. In the file build/envsetup_milkv.sh you have to change the make all '-j [jobs]' parameter to -j1. The parallel makefile processing might be selectively disabled using the .NOTPARALLEL feature, but I am not a expert in complex/parallel makefiles :)

build/envsetup_milkv.sh:
234  # make all -j$(nproc)
235  make all -j1

I also had to modify fatbuffers/CMakeLists.txt:219 (CMAKE_CXX_FLAGS). I replaced '-std=c++0x' with '-std=c++20' and got the build process finish successfully ('gnimage for milkv-duo256m-musl-riscv64-sd success!') . My building host OS is arch linux. Generated output image was not tested yet.

flatbuffers/CMakeLists.txt:
219  # "${CMAKE_CXX_FLAGS} -std=c++0x")
220  ${CMAKE_CXX_FLAGS} -std=c++20")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants