YOLO: -bash: ./darknet: No such file or directory - makefile

When I try to train my yolov4 on my vm with command
./darknet detector train build/darknet/x64/data/obj.data cfg/yolov4-my_gray.cfg backup/yolov4-my_gray_1200.weights -gpus 0,1,2,3 -dont_show
I received
-bash: ./darknet: No such file or directory
Of course I do this in darknet directory. When I try to make i received
When i check open cv
pkg-config --cflags opencv
I received
"-I/usr/include/opencv"
Maybe somebody can help.

Seems compiler is not able to find the file in the includes path you mentioned.
First check if cuda_runtime.h file is available on your machine and get that location. If the file is available then just give the path of the file to the compiler using -I option.
If the file is available at the path /usr/include/opencv, then you would need to provide it with -I option to the compiler
g++ -std=c++11 -I/usr/local/cuda/include ...

Related

mingw5.4 : cannot open output file /home/user1/test.o: No such file or directory

I am building my test.c using mingw5.4 using command:
/software/mingw5.4/bin//x86_64-w64-mingw32-gcc test.cxx -o /home/user1/test.o
But I am getting following error:
c:/cygwin64_new/home/admin/software/mingw5.4/bin/../lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
cannot open output file /home/user1/test.o: No such file or directory
If I use version mingw4.8.3 the same file is compiling fine.
/usr/bin/x86_64-w64-mingw32-gcc test.cxx -o /home/user1/test.o
If anybody know reason of error in case of version mingw5.4 please let me know.
LOL. I've done that. There is a command called test on *nix systems. Some shells have it built in (for speed). Try running ./test or text.exe or call the executable something else.

Error fatal - No such file or directory

I have installed the cds library with command ./build.sh -b 64 -z '-std=c++0x' -l '-L /usr/lib/x86_64-linux-gnu' --with-boost /usr/include/boost --amd64-use-128bit at build folder.
After I tried to compile the example init.cpp of src folder, I typed this in terminal: g++ init.cpp -o init, and terminal showed: fatal error: cds/init.h: No such file or directory.
What should I do for compilation command in this case?
Thanks.
For general troubleshooting in cases like this, i would recommend finding where on the system the file got installed (if your build.sh actually installed the file). You would be able to find the missing header file using
find / -path '*/cds/init.h' 2>/dev/null
Then you need to supply two parameters to g++:
First one gets the compiler to know about the include files from the install directory
-I path_to_folder_one_step_above_cds_folder
Second one gets the linker to know about the librarys location. If the library file is called libcds.so, you can find it by running
find / -name libcds.so 2>/dev/null
So for linking, you supply the flag
-L path_to_folder_one_step_above_libcds.so
In your case you might not need the -L flag, since most of your library supposedly is header only.
UPDATE: the build.sh script is printing out important information at the top, starting with "Building with the following options:". The important bits will be "Compile options:" and "Link options:". Those should be enough to solve your specific option.
UPDATE2: build.sh also exports some flags which might include more options. You can print them out directly after running build.sh by running
echo LDFLAGS=$LDFLAGS
echo CFLAGS=$CFLAGS
echo CXXFLAGS=$CXXFLAGS
you are likely to need to pass all these options to g++ when compiling and linking against that library. LDFLAGS are specific to the linker only. Both the other ones are needed for compiling c++ files.

How to get NDK toolchain utilities to list symbols (function names) of NDK-built library on Mac OS X?

I have a couple of libraries built by the NDK for which I am trying to view the exported symbols, the available function names to be precise. One is a .so file and the other a .a file. I was helped in this question (How to obtain readelf and objdump binaries for OS X?) to find the utilities that I think I need. They are specific to the NDK installation. I am on OS X fyi.
In my NDK installation I found nm and objdump in prebuilt/darwin-x86_64/arm-linux-androideabi/bin. Their file type is "Alias". When I ran nm -g libMylib.so nothing happened -- at all. When I ran objdump -TC libMylib.so I got: "objdump: command not found". Then I found the arm-linux-androideabi-nm and arm-linux-androideabi-objdump files (file type listed as "Unix Executable File" in Finder) in the prebuilt/darwin-x86_64/bin dir. The attempt to use both of them resulted in "command not found". In all these attempts I placed libMylib.so right in the very folder with the utility I'm trying to run.
I think this is basically a general issue about how to call binaries in unix; even if you are in the same directory when you run nm -g libMylib.so, since . normally isn't part of your $PATH. To run the right one, do ./nm -g libMylib.so, or without using cd to enter this directory first, just do path/to/your/NDK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-nm -g libMylib.so, or add this directory to your path first:
export PATH=path/to/your/NDK/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin:$PATH
arm-linux-androideabi-nm -g libMylib.so
(It's preferrable to add this directory to the path instead of the arm-linux-androideabi directory, since it is clear which tool you want to invoke when you call when you do arm-linux-androideabi-nm, while if you add the other directory and call nm, it is up to the order of the directories in $PATH.)
See e.g. Why do you need ./ (dot-slash) before script name to run it in bash? for more explanations about $PATH.

How to add directories to Cygwin gcc default search path

I'm a bit of a noob at working with compilers. I want to add an arbitrary directory on my win 8 C:\ drive to the Cygwin gcc default search path.
Here is what I have tried so far. Using gcc --help I found the commands -print-search-dirs and -B <directory> ("add directory to the compiler's search path").
Using the former command output this:
install: /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/
programs: =/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/:/usr/lib/gcc/x86_64-pc-cygwin/4.
9.2/:/usr/lib/gcc/x86_64-pc-cygwin/:/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/:/usr/li
b/gcc/x86_64-pc-cygwin/:/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../../x86_64-p
c-cygwin/bin/x86_64-pc-cygwin/4.9.2/:/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../.
./../x86_64-pc-cygwin/bin/
libraries: =/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/:/usr/lib/gcc/x86_64-pc-cygwin/4
.9.2/../../../../x86_64-pc-cygwin/lib/x86_64-pc-cygwin/4.9.2/:/usr/lib/gcc/x86_6
4-pc-cygwin/4.9.2/../../../../x86_64-pc-cygwin/lib/../lib/:/usr/lib/gcc/x86_64-p
c-cygwin/4.9.2/../../../x86_64-pc-cygwin/4.9.2/:/usr/lib/gcc/x86_64-pc-cygwin/4.
9.2/../../../../lib/:/lib/x86_64-pc-cygwin/4.9.2/:/lib/../lib/:/usr/lib/x86_64-p
c-cygwin/4.9.2/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../..
/x86_64-pc-cygwin/lib/:/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/../../../:/lib/:/usr/
lib/
The full path to /usr is C:\cygwin64\usr. The directory I want to add is c:\directory So I tried gcc -B /../directory and other variations, but I get error
gcc: fatal error: no input files
compilation terminated
Seems like it thinks I'm trying to compile something. I want to permanently add a directory to the list of default search paths.
There are two issues at play here.
The first problem has to do with the fact that Cygwin views the top of its directory tree / to be within the Windows directory C:\cygwin64. As a result, you are unable to move above that point in the filesystem. The solution is to go through Cygwin's directory /cygdrive, which is the access point where all Windows disk drives are mounted. You can access the top-level Windows directory C:\ from Cygwin as /cygdrive/c. So for the problem above, instead of using gcc -B /../directory, try using gcc -B /cygdrive/c/directory.
The second issue is that of adding directories to the search path, versus telling it to compile a specific source file. Given the date of this question, I assume you've solved that part of the problem at this point?

gcc -c option not giving execute file permission to the output file

i am using ubuntu 10.10
i am trying to compile simple helloworld file using
gcc -c option
the output file is created but it does not have execute permission
if i dont use -c option the output file has execute permission ..
Please help
The command gcc -c generates a non-executable object file. If you want the output to be executable, do not use the -c option.
I am not sure what you hoped -c was for, but it is exactly for not generating an executable, and your GCC is working as designed.
From the man gcc:
-c Compile or assemble the source files, but do not link. The linking
stage simply is not done. The ultimate output is in the form of an
object file for each source file.
It is not executable. It needs to undergo linking process to become an execution file.

Resources