Skip to content

[Bug]: 编译k230_canmv_lckfb_defconfig,出现cmake版本过高的报错 #91

@Hyrsoft

Description

@Hyrsoft

What happened

在sdk提供的dockerfile生成的docker中首次执行make CONF=k230_canmv_lckfb_defconfig,出现cmake版本过高的错误。

/opt/toolchain/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/bin/../lib/gcc/riscv64-unknown-linux-musl/12.0.1/../../../../riscv64-unknown-linux-musl/bin/ld: warning: /home/hao/k230_sdk/src/big/mpp/userapps/sample/elf/sample_face_detect.elf has a LOAD segment with RWX permissions
cp /home/hao/k230_sdk/src/big/mpp/../kmodel/mobile_retinaface/test.kmodel /home/hao/k230_sdk/src/big/mpp/userapps/sample/elf/
/home/hao/k230_sdk/src/big/mpp/userapps/sample/sample_face_detect/Makefile all
make[2]: Leaving directory '/home/hao/k230_sdk/src/big/mpp/userapps/sample/sample_face_detect'
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.


-- Configuring incomplete, errors occurred!
make[2]: Entering directory '/home/hao/k230_sdk/output/k230_canmv_lckfb_defconfig/big/mpp/userapps/sample/fastboot_app'
make[2]: *** No targets specified and no makefile found.  Stop.
make[2]: Leaving directory '/home/hao/k230_sdk/output/k230_canmv_lckfb_defconfig/big/mpp/userapps/sample/fastboot_app'
make[1]: *** [Makefile:44: all] Error 2
make[1]: Leaving directory '/home/hao/k230_sdk/src/big/mpp/userapps/sample'
/bin/bash: line 6: exit: check_src: numeric argument required
make: *** [Makefile:229: mpp-apps] Error 2

查看docker中的cmake版本:

$ cmake --version
cmake version 4.0.2

无法通过apt的方式卸载和重装低版本的cmake

在报错信息中找到对应目录/home/hao/k230_sdk/src/big/mpp/userapps/sample/sample_face_detect,但是没有发现cmakelists.txt,无从改起

$ cd /home/hao/k230_sdk/src/big/mpp/userapps/sample/sample_face_detect
$ ls

anchors_320.cc  main.cc  Makefile  mobile_retinaface.cc  mobile_retinaface.h  model.cc  model.h  util.cc  util.h

Reproduction steps

配置docker容器

用sdk带的dockerfile配置docker容器

docker build -f tools/docker/Dockerfile -t k230_docker tools/docker
docker run -u root -it -v $(pwd):$(pwd) -v $(pwd)/toolchain:/opt/toolchain -w $(pwd) k230_docker /bin/bash

编译

make CONF=k230_canmv_lckfb_defconfig

Hardware board

k230_canmv_lckfb 立创开发板

Software version

v1.9

Bug frequency

初次编译不通过

Anything else

No response

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions