首页 > 解决方案 > 如何运行 YoloV3 Darknet 的“make”命令(适用于 Windows)?

问题描述

运行 ./make.exe 命令(通过使用 GNUWin32)后,我收到以下错误:

mkdir -p obj   
mkdir -p backup   
A subdirectory or file -p already exists.  
Error occurred while processing: -p. make: *** [backup] Error 1

重新运行命令后,我得到一个不同的错误:

mkdir -p results
A subdirectory or file -p already exists.
Error occurred while processing: -p.
make: *** [results] Error 1

然后,无论我重复 make 命令多少次,我都会得到相同的错误:

gcc -Iinclude/ -Isrc/ -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -c ./src/gemm.c -o obj/gemm.o
process_begin: CreateProcess(NULL, gcc -Iinclude/ -Isrc/ -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -c ./src/gemm.c -o obj/gemm.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [obj/gemm.o] Error 2

由于我是初学者,您能否提供有关如何解决问题的详细说明?

标签: windowsmakefiledarknetgnuwin32

解决方案


这些问题:

mkdir -p obj   
mkdir -p backup   
A subdirectory or file -p already exists.  
Error occurred while processing: -p. make: *** [backup] Error 1

是因为您要求 Make 在 Windows 上执行一个为在 Linux 或其他类似 Unix 操作系统上工作而编写的 makefile。

在类 Unix 操作系统中,命令:

mkdir -p obj

意思是:如果它已经存在,则创建一个 obj 没有错误的目录。在 Windows 中,这意味着:创建一个名为的目录 -p ,然后创建一个名为 obj.

因此,当mkdir -p obj创建了目录-pobj命令时:

mkdir -p backup

失败是因为:

A subdirectory or file -p already exists.

Unix/Linux makefile 无意创建一个名为 的目录-p,但在 Windows 上它就是这样做的。

您尝试修复此特定错误毫无意义。这只是尝试在 Windows 上执行 Unix/Linux makefile 导致的无数错误中的第一个。您需要一个为在 Windows 上运行而编写的 makefile,或者自己编写一个,或者找到一种在不使用 Make 的 Windows 上构建软件的方法。

这个问题:

gcc -Iinclude/ -Isrc/ -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -c ./src/gemm.c -o obj/gemm.o
process_begin: CreateProcess(NULL, gcc -Iinclude/ -Isrc/ -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -c ./src/gemm.c -o obj/gemm.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [obj/gemm.o] Error 2

是因为您的计算机上没有安装GCC C 编译器 gcc,或者如果您有,它所在的目录不在您的PATH. 所以 Make 找不到它来执行编译和链接软件的基本业务。

这是GCC 的一个流行的 Windows 端口


推荐阅读