Reputation: 13
I am getting the error while compiling Darknet via MSYS2.
cl : Command line error D8021 : invalid numeric argument '/Wfatal-errors'
make: *** [Makefile:211: obj/convolutional_kernels.o] Error 2
A few snippets from Makefile:
ifeq ($(OS),Windows_NT)
ifeq ($(findstring MSVC,$(CC)),MSVC)
CC=cl
CFLAGS=/W3 /EHsc /nologo /D_CRT_SECURE_NO_WARNINGS
else
CC=gcc
CFLAGS=-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC
endif
else
ifeq ($(USE_CPP), 1)
CC=g++
else
CC=gcc
endif
CFLAGS=-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC
endif
LDFLAGS= -lm -pthread -L/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.2/lib/x64 -L/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.2/cudnn/lib/x64
COMMON= -Iinclude/ -I3rdparty/stb/include -I/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.2/include
ifeq ($(OPENCV), 1)
COMMON+= -DOPENCV
CFLAGS+= -DOPENCV
LDFLAGS+= $(shell pkg-config --libs opencv4 2> /dev/null || pkg-config --libs opencv)
COMMON+= $(shell pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv)
endif
Environment details: Win 10, YOLOv3, CUDA 11.2, CUDNN 8.1, PyCharm 2024.1.4, GPU NVIDIA 1660 series
Any help is appreciated.
Upvotes: 1
Views: 35
Reputation: 20340
Please make sure you are building the correct version of Darknet.
From what you provided in the question, it looks like you are on one of the abandoned repos, most likely the old AlexeyAB one. Note that AlexeyAB abandoned that repo in July 2021.
The new Darknet repo is this one, where hopefully you won't get that build error: https://github.com/hank-ai/darknet#table-of-contents
You may also want to read through the Darknet/YOLO FAQ: https://www.ccoderun.ca/programming/yolo_faq/#which_repos_to_use_and_avoid
Disclaimer: I maintain the new Darknet/YOLO repo.
Upvotes: 0