问题
I'm trying to compile an example mex file in Octave and get the following error that I don't understand and can't find where to go for more information:
octave:8> mkoctfile -v --mex hello_oct.cpp
/usr/local/octave/3.8.0/bin/mkoctfile-3.8.0: line 512: 15840 Segmentation fault: 11 /usr/local/octave/3.8.0/bin/g++-mp-4.7 -c -fPIC -I/usr/local/octave/3.8.0/include/octave-3.8.0/octave/.. -I/usr/local/octave/3.8.0/include/octave-3.8.0/octave -I/usr/local/octave/3.8.0/include -pipe -Os -m64 -D_THREAD_SAFE -pthread -I. hello_oct.cpp -o hello_oct.o
/usr/local/octave/3.8.0/bin/g++-mp-4.7 -c -fPIC -I/usr/local/octave/3.8.0/include/octave-3.8.0/octave/.. -I/usr/local/octave/3.8.0/include/octave-3.8.0/octave -I/usr/local/octave/3.8.0/include -pipe -Os -m64 -D_THREAD_SAFE -pthread -I. hello_oct.cpp -o hello_oct.o
warning: mkoctfile exited with failure status
The same error occurs without the --mex option and across different source files. I'm running Octave 3.8.0 on OS X Yosemite. I don't believe I need to install any packages in Octave to create .mex or .oct files, but let me know if I do. I'd appreciate any explanation behind the error or suggestions of where to look for solutions.
This is a related question but appears in a different context it seems.
回答1:
There is a problem with the 3.8.0 binary. Reinstalling with homebrew fixed the issue.
来源:https://stackoverflow.com/questions/29358350/mkoctfile-segmentation-fault