ShaoqingRen / faster_rcnn

Faster R-CNN
Other
2.7k stars 1.22k forks source link

Errors running faster_rcnn_build.m #92

Open klroth opened 8 years ago

klroth commented 8 years ago

When I run the file, I get the following error:

faster_rcnn_build Compiling nms_mex Building with 'MinGW64 Compiler (C++)'. Error using mex g++: error: -fexceptions: No such file or directory

Error in faster_rcnn_build (line 13) mex -O -outdir bin ...

If I run with the -v option enabled, here is the output:

faster_rcnn_build Compiling nms_mex Building with 'MinGW64 Compiler (C++)'. Error using mex g++: error: -fexceptions: No such file or directory Using built-in specs. COLLECT_GCC=C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\bin\g++ Target: x86_64-w64-mingw32 Configured with: ../../../src/gcc-4.9.2/configure --build=x86_64-w64-mingw32 --enable-targets=all --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-graphite --enable-cxx-flags=-DWINPTHREAD_STATIC --disable-build-with-cxx --disable-build-poststage1-with-cxx --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --prefix=/mingw64tdm --with-local-prefix=/mingw64tdm --with-pkgversion=tdm64-1 --with-bugurl=http://tdm-gcc.tdragon.net/bugs Thread model: posix gcc version 4.9.2 (tdm64-1)

Error in faster_rcnn_build (line 13) mex -O -outdir bin ...

I have made sure that all the folders and subfolders are properly added to the path. I am running MATLAB 2016a on a Windows 7 64 bit OS. I've set up the MinGW64 compiler for C++:

MEX configured to use 'MinGW64 Compiler (C++)' for C++ language compilation.

Any help would be greatly appreciated! I am stuck at this point...

klroth commented 8 years ago

Another set of output if I move the -v flag:

mex -O -outdir bin ... CXXFLAGS="\$CXXFLAGS -std=c++11" ... -largeArrayDims ... functions/nms/nms_mex.cpp ... -v -output nms_mex; Verbose mode is on. ... Looking for compiler 'MinGW64 Compiler (C++)' ... ... Looking for environment variable 'MW_MINGW64_LOC' ...Yes ('C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9'). ... Looking for file 'C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\bin\g++.exe' ...Yes. ... Looking for folder 'C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9' ...Yes. Found installed compiler 'MinGW64 Compiler (C++)'. Set PATH = C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\bin;C:\Program Files\MATLAB\R2016a\extern\include\win64;C:\Program Files\MATLAB\R2016a\extern\include;C:\Program Files\MATLAB\R2016a\simulink\include;C:\Program Files\MATLAB\R2016a\lib\win64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\MATLAB\R2016a\bin Set INCLUDE = C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\include;C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\include; Set LIB = C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\lib;;C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\lib;; Set MW_TARGET_ARCH = win64;win64; Set LIBPATH = C:\Program Files\MATLAB\R2016a\extern\lib\win64;C:\Program Files\MATLAB\R2016a\extern\lib\win64;

Options file details

Compiler location: C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9
Options file: C:\Users\SDAV\AppData\Roaming\MathWorks\MATLAB\R2016a\mex_C++_win64.xml
CMDLINE1 : C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\bin\g++ -c -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2016a/extern/include" -I"C:\Program Files\MATLAB\R2016a/simulink/include" \-fexceptions -fno-omit-frame-pointer -std=c++11 -O -DNDEBUG C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\functions\nms\nms_mex.cpp -o C:\Users\SDAV\AppData\Local\Temp\mex_1345346736136139_10340\nms_mex.obj
CMDLINE2 : C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\bin\g++ -m64 -Wl,--no-undefined -shared -s -Wl,"C:\Program Files\MATLAB\R2016a/extern/lib/win64/mingw64/mexFunction.def" C:\Users\SDAV\AppData\Local\Temp\mex_1345346736136139_10340\nms_mex.obj   -L"C:\Program Files\MATLAB\R2016a\extern\lib\win64\mingw64" -llibmx -llibmex -llibmat -lm -llibmwlapack -llibmwblas -o C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\bin\nms_mex.mexw64
CXX : C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\bin\g++
COMPILER : C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\bin\g++
DEFINES : -m64 -DMATLAB_MEX_FILE 
MATLABMEX : -DMATLAB_MEX_FILE 
CXXFLAGS : \-fexceptions -fno-omit-frame-pointer -std=c++11
INCLUDE : -I"C:\Program Files\MATLAB\R2016a/extern/include" -I"C:\Program Files\MATLAB\R2016a/simulink/include"
CXXOPTIMFLAGS : -O -DNDEBUG
CXXDEBUGFLAGS : -g
LDXX : C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\bin\g++
LINKER : C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\bin\g++
LDFLAGS : -m64 -Wl,--no-undefined
LDTYPE : -shared
LINKEXPORT : -Wl,"C:\Program Files\MATLAB\R2016a/extern/lib/win64/mingw64/mexFunction.def"
LIBLOC : C:\Program Files\MATLAB\R2016a\extern\lib\win64\mingw64
LINKLIBS : -L"C:\Program Files\MATLAB\R2016a\extern\lib\win64\mingw64" -llibmx -llibmex -llibmat -lm -llibmwlapack -llibmwblas
LDOPTIMFLAGS : -s
LDDEBUGFLAGS : -g
OBJEXT : .obj
LDEXT : .mexw64
SETENV : set COMPILER=g++ 
            set COMPFLAGS=-c \-fexceptions -fno-omit-frame-pointer -std=c++11 -m64 -DMATLAB_MEX_FILE  -DMATLAB_MEX_FILE  
            set OPTIMFLAGS=-O -DNDEBUG 
            set DEBUGFLAGS=-g 
            set LINKER=g++ 
            set LINKFLAGS=-m64 -Wl,--no-undefined -shared -L"C:\Program Files\MATLAB\R2016a\extern\lib\win64\mingw64" -llibmx -llibmex -llibmat -lm -llibmwlapack -llibmwblas -Wl,"C:\Program Files\MATLAB\R2016a/extern/lib/win64/mingw64/mexFunction.def" 
            set LINKDEBUGFLAGS=-g
            set NAME_OUTPUT= -o "%OUTDIR%%MEX_NAME%%MEX_EXT%"
MINGWROOT : C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9
MATLABROOT : C:\Program Files\MATLAB\R2016a
ARCH : win64
SRC : C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\functions\nms\nms_mex.cpp
OBJ : C:\Users\SDAV\AppData\Local\Temp\mex_1345346736136139_10340\nms_mex.obj
OBJS : C:\Users\SDAV\AppData\Local\Temp\mex_1345346736136139_10340\nms_mex.obj 
SRCROOT : C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\functions\nms\nms_mex
DEF : C:\Users\SDAV\AppData\Local\Temp\mex_1345346736136139_10340\nms_mex.def
EXP : C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\bin\nms_mex.exp
LIB : C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\bin\nms_mex.lib
EXE : C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\bin\nms_mex.mexw64
ILK : C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\bin\nms_mex.ilk
MANIFEST : C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\bin\nms_mex.mexw64.manifest
TEMPNAME : C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\bin\nms_mex
EXEDIR : C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\bin\
EXENAME : nms_mex
OPTIM : -O -DNDEBUG
LINKOPTIM : -s

Building with 'MinGW64 Compiler (C++)'. C:\MATLAB\SupportPackages\R2016a\MW_MinGW_4_9\bin\g++ -c -m64 -DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2016a/extern/include" -I"C:\Program Files\MATLAB\R2016a/simulink/include" -fexceptions -fno-omit-frame-pointer -std=c++11 -O -DNDEBUG C:\Users\SDAV\Desktop\K_Roth\DeepLearn\Methods\FasterRCNN\faster_rcnn-master\functions\nms\nms_mex.cpp -o C:\Users\SDAV\AppData\Local\Temp\mex_1345346736136139_10340\nms_mex.obj Error using mex g++: error: -fexceptions: No such file or directory

klroth commented 8 years ago

After checking each dir listed in the output above, I found the following non-existent:

C:\Program Files\MATLAB\R2016a\extern\include\win64

The rest seem to exist. Not sure why this one doesn't, or if this is even the cause of the issue. Any help would be greatly appreciated!

aabdelfattah commented 7 years ago

Hello I think you need to remove the \ from

 mex -O -v -outdir bin ...
      CXXFLAGS="\$CXXFLAGS -std=c++11"  ...
      -largeArrayDims ...
      functions/nms/nms_mex.cpp ...
      -output nms_mex;

to be

mex -O -v -outdir bin ...
      CXXFLAGS="$CXXFLAGS -std=c++11"  ...
      -largeArrayDims ...
      functions/nms/nms_mex.cpp ...
      -output nms_mex;
ROliveira-lab commented 7 years ago

@klroth Are you already solved it?