How to run the "make" command for YoloV3 Darknet (for Windows)? - windows

After running the ./make.exe command (By using GNUWin32), I get the following error:
mkdir -p obj
mkdir -p backup
A subdirectory or file -p already exists.
Error occurred while processing: -p. make: *** [backup] Error 1
After rerunning the command, I get a different error:
mkdir -p results
A subdirectory or file -p already exists.
Error occurred while processing: -p.
make: *** [results] Error 1
Then I get the same error no matter how many times I repeat the make command:
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
As I am a beginner, can you please provide detailed instructions on how I can fix the problem?

These problems:
mkdir -p obj
mkdir -p backup
A subdirectory or file -p already exists.
Error occurred while processing: -p. make: *** [backup] Error 1
are caused by the fact that you have asked Make to execute, on Windows,
a makefile that was written to work on Linux or some other Unix-like operating system.
In Unix-like operating systems, the command:
mkdir -p obj
means: Create a directory called obj with no error if it already exists. In
Windows it means: Create a directory called -p and then a directory called obj.
So when mkdir -p obj has created the directories -p and obj, the command:
mkdir -p backup
fails because:
A subdirectory or file -p already exists.
The Unix/Linux makefile has no intention of creating a directory called -p, but on Windows
that is what it does.
There is little point in your attempting to fix this specific error. It is just the
first of indefinitely many errors that will result from attempting to execute a Unix/Linux
makefile on Windows. You need a makefile that was written to run on
Windows, or to write one yourself, or to find a way of building the software on Windows that does not use Make.
This problem:
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
is caused by the fact that you have not installed the GCC C compiler
gcc on your computer, or if you have, the directory where it resides is not in your PATH. So Make cannot find
it to perform the essential business of compiling and linking your software.
Here is a popular Windows port of GCC

Your makefile has been written for Linux and is not directly portable to Windows.
The issue is that ‘mkdir’ is conflicting with CMD’s built-in function that doesn’t support the same command line options (as explained by Mike Kinghan).
A simple workaround is to replace any occurrence of mkdir in your makefile with $(MKDIR) and to add at the very beginning:
MKDIR := “$(shell which mkdir)”
Of course this requires that you install which and CoreUtils (that provides mkdir). Note the double quotes to avoid any issues with white space on the path to mkdir.
Last but not least you will also need gcc which you can get here or there for example.

Related

make: f90: command not found

I am trying to run some old Fortran code of my project team in ubuntu 16.04. I have not done any modifications to the existing code. All I have done is installed gfortran, opened a terminal, and gone to the file location using the cd command. Here I have many files, but just consider these two: a script file compile.sh, and a makefile remail.make.
In compile.sh:
make -f remail.make
In remail.make:
SOURCE_APPLI= ../SOURCES_COUNTERFLOW/
$(SOURCE_APPLI)grcom.f
TARGET = remail.e
OBJECTS = $(SOURCES_f77:.f=.o)
COMPILE = f90
.f90.o :
$(COMPILE) -o $*.o -c $*.f90
.f.o :
$(COMPILE) -o $*.o -c $*.f
$(TARGET) : $(OBJECTS)
$(COMPILE) $(OBJECTS) -o $#
del :
$(DELETE) $(OBJECTS)
When I run compile.sh, I get this error:
f90 ../SOURCES_COUNTERFLOW/grcom.o -o remail.e
make: f90: Command not found
make: *** [remail.e] Error 127
I have installed fort77 and gfortran-4.8 compilers.
What is the reason for this error?
The problem was that I was not using the correct executable.
For example, In my case, I installed fort77 and gfortran-4.8 and the executable was saved in the name as fort77 and gfortran-4.8.
The reason for my error was that I was calling these two executables as fort77 and gfortran instead of fort77 and gfortran-4.8.
When I called fort77 and gfortran-4.8 correctly in the terminal, it works!!

How does cygwin terminal work? (Makefile issue)

Here's my makefile:
assemblera: main.o parsingA.o parsingC.o symbolTable.o
gcc -o assemblera main.o parsingA.o parsingC.o symbolTable.o
main.o: main.c parsingA.h parsingC.h symbolTable.h
gcc -c main.c
parsingA.o: parsingA.c parsingA.h
gcc -c parsingA.c
parsingC.o: parsingC.c parsingC.h
gcc -c parsingC.c
symbolTable.o: symbolTable.c symbolTable.h
gcc -c symbolTable.c
clean:
rm *.o assemblera
Now for the problem: with Windows command prompt I can easily generate all the .o files and .exe file, and if I run the latter it works as intended. Now, if I use the cygwin terminal, I can give the instructions to generate the object files / the exe, but those do not appear nowhere in the folder and no error is returned. Also, if I use the make command, it returns this error:
gcc -c main.c
make: *** [Makefile:5: main.o] Error 1
(I did put tabs in front of every "gcc" and "rm"). I know next to nothing about makefiles and cygwin.

cgywin64: make -f Makefile

I'm trying to use mpi-ikl-simplemkl-1.0 (http://www.mloss.org/software/view/174/)
I'm using Windows 8.1 and I've installed cgywin64. When I type (on cgywin bash screen):
make -f Makefile
The result is:
gcc-4.2 -03 -ffast-math -fomit-frame-pointer -fPIC -c -o svm.o svm.cpp
gcc-4.2: error: spawn: No such file or directory
makefile:32: recipe for target 'svm.o' failed
make: *** [svm.o] Error 1
What should I do?
The internet wisdom seems to be that you should do one of:
Remove /bin from PATH
Remove /usr/bin from PATH
Reinstall gcc (possibly remove all versions of gcc first)

Gcc error only when using makefile (CreateProcess: No such file or directory)

I am having trouble compiling using make in windows 7 with gcc and the gsl library. It occurs only when using make (when I type the compilation commands manually into the cmd line, it compiles correctly). I found some posts where people had similar errors from gcc, but none where it worked when typing normally, but not when using make. The contents of my Makefile are shown below:
#Compiler
COMP=gcc
# Compiler Flags. -Wall turns on all warnings
FLAGS=-Wall
# GSL include file dir
INCLUDES=GnuWin32/include
# GSL Libraries directory
LIB=GnuWin32/lib
# Library Flags
LFLAGS=-lgsl -lgslcblas -lm
# Target Program
EXE=ex2.1.exe
# Dependencies needed for $(PROGRAM)
OBJ=ex2.1.o
# List of source files for objects
SRC=ex2.1.c
# List with types of files to be cleared by clean:
TRASH=*.exe *.o
# I/O files to be cleaned with 'very clean' target
#IOFILES= *.dat *.out *.csv *.mod
all: $(SRC) $(EXE)
$(EXE): $(OBJ)
$(COMP) -L/$(LIB) $(OBJ) $(LFLAGS) -o $(EXE)
$(OBJ): $(SRC)
$(COMP) -I/GnuWin32/include -c ex2.1.c
#$(COMP) -I/$(INCLUDES) -c $(SRC)
clean:
del $(TRASH)
If I type make with only the ex2.1.c present in the directory, I get the following output and error:
gcc -I/GnuWin32/include -c ex2.1.c
gcc: error: CreateProcess : No such file or directory
make: *** [ex2.1.o] Error 1
However, if I first type "gcc -I/GnuWiun32/include -c ex2.1.c", ex2.1.o is created successfully with no error. If then type 'make' I get the following output/error:
gcc -L/GnuWin32/lib ex2.1.o -lgsl -lgslcblas -lm -o ex2.1.exe
gcc: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not found
compilation terminated
make: *** [ex2.1.exe] Error 1
But if I manually enter "gcc -L/GnuWin32/lib ex2.1.o -lgsl -lgslcblas -lm -o ex2.1.exe" then the executable compiles and runs like it should, so the problem seems to be with how make is calling gcc? My PATH variable contains the paths to both make.exe as well as gcc.exe, so I am not sure what I do not set up correctly. Does anyone have an idea of what may be wrong? Thanks.

How to run "gmake install"?

I am now installing a code on my mac.
The code is from here. Look for "Benchmark and Boundary Detection Code" in this page.
In the readme file, it says:
(1) For the image and segmentation reading routines in the Dataset
directory to work, make sure you edit Dataset/bsdsRoot.m to point to
your local copy of the BSDS dataset.
(2) Run 'gmake install' from this directory to build everything. You
should then probably put the lib/matlab directory in your MATLAB path.
(3) Read the Benchmark/README file.
For the 1st step, I did as suggested.
For the 2nd step, I am pretty confused. I ran command gmake install in MATLAB, however, I got:
gmake
Undefined function or variable 'gmake'.
Actually, before running MATLAB, I installed gmake port through macports.
I just did it in terminal, however, this is what I got...
hou229:segbench yaozhongsong$ cd /Users/yaozhongsong/Documents/MATLAB/segbench
hou229:segbench yaozhongsong$ sudo gmake install
gmake[1]: execvp: ../Util/gethosttype: Permission denied
gmake[1]: Entering directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
GNUmakefile-library:26: *** mexSuffix not defined. Stop.
gmake[1]: Leaving directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
hou229:segbench yaozhongsong$
In MATLAB, I also did like this:
!gmake install
/bin/bash: gmake: command not found
How to do the 2nd step in readme file?
Thanks in advance!
#Amro
hou229:segbench yaozhongsong$ cd /Users/yaozhongsong/Documents/MATLAB/segbench
hou229:segbench yaozhongsong$ sudo gmake install
Password:
gmake[1]: execvp: ../Util/gethosttype: Permission denied
gmake[1]: Entering directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
mkdir -p ../lib/matlab
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Exception.cc -o build//Exception.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c String.cc -o build//String.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Random.cc -o build//Random.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Timer.cc -o build//Timer.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Matrix.cc -o build//Matrix.o
Matrix.cc:13:21: error: ieee754.h: No such file or directory
Matrix.cc: In function ‘double nextpow2(double)’:
Matrix.cc:86: error: ‘ieee754_double’ was not declared in this scope
Matrix.cc:86: error: expected `;' before ‘val’
Matrix.cc:87: error: ‘val’ was not declared in this scope
Matrix.cc:88: error: ‘IEEE754_DOUBLE_BIAS’ was not declared in this scope
Matrix.cc: At global scope:
Matrix.cc:48: warning: ‘snan’ defined but not used
Matrix.cc:49: warning: ‘inf’ defined but not used
gmake[1]: *** [build//Matrix.o] Error 1
gmake[1]: Leaving directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
For the "mexSuffix not defined" error, first run mexext inside MATLAB, take that output (I suspect it is mexmaci64), edit the file Util/GNUmakefile-library and add the following at line 24:
mexSuffix := mexmaci64
replace the value with the one you get from mexext
Note: I haven't tested any of this, I am on a Windows machine..
You need to run gmake from the Terminal (command line), not in MATLAB.

Resources