mex with g++4.8 with Boost issues
Show older comments
I am trying to build a mex file on OS X with gnu++-4.8. But ending up with error msg. In the command line it links to libc++. I think libc++ is incompatible with gnu++-4.8. I thought this library will or should not get linked by this option nor should clang++ be used. I am confused by all the message below. Can some please help me wade through?
I have already posted two questions on similar topics but still struggling for a solution.
Thanks
mex -v CXX='/usr/local/bin/g++-4.8 ' CXXFLAGS='-std=gnu++11' gl_file.cpp /Users/slib/io/glFile.cpp -I/Users/boost_1_51_0 -I/Users/slib/include -I/Users/matutils -I/Users/eigen-eigen-5097c01bcdc4
Neither -compatibleArrayDims nor -largeArrayDims is selected.
Using -compatibleArrayDims. In the future, MATLAB will require the use of
-largeArrayDims and remove the -compatibleArrayDims option.
For more information:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
No MEX options file identified; looking for an implicit selection.
... Looking for compiler 'Xcode Clang++' ...
... Looking for environment variable 'DEVELOPER_DIR' ...No.
... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer').
... Looking for folder '/Applications/Xcode.app/Contents/Developer' ...Yes.
... Executing command 'which xcrun' ...Yes ('/usr/bin/xcrun').
... Looking for folder '/usr/bin' ...Yes.
... Executing command 'defaults read com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense' ...No.
... Executing command 'defaults read /Library/Preferences/com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense' ...Yes ('7.3.1').
... Executing command '
agreed=7.3.1
if echo $agreed | grep -E '[\.\"]' >/dev/null; then
lhs=`expr "$agreed" : '\([0-9]*\)[\.].*'`
rhs=`expr "$agreed" : '[0-9]*[\.]\(.*\)$'`
if echo $rhs | grep -E '[\."]' >/dev/null; then
rhs=`expr "$rhs" : '\([0-9]*\)[\.].*'`
fi
if [ $lhs -gt 4 ] || ( [ $lhs -eq 4 ] && [ $rhs -ge 3 ] ); then
echo $agreed
else
exit 1
fi
fi' ...Yes ('7.3.1').
... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer').
... Looking for folder
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk' ...Yes.
... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer').
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk' ...Yes.
... Executing command 'echo /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk | rev | cut -c1-10 | rev | egrep -oh '[0-9]+\.[0-9]+'' ...Yes ('10.11').
Found installed compiler 'Xcode Clang++'.
Options file details
-------------------------------------------------------------------
Compiler location: /Applications/Xcode.app/Contents/Developer
Options file: /Applications/MATLAB_R2016a.app/bin/maci64/mexopts/clang++_maci64.xml
Compiler location: /Applications/Xcode.app/Contents/Developer
Options file: /Applications/MATLAB_R2016a.app/bin/maci64/mexopts/clang++_maci64.xml
CMDLINE200 : /usr/local/bin/g++-4.8 -Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.11 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -framework Cocoa -bundle -Wl,-exported_symbols_list,"/Applications/MATLAB_R2016a.app/extern/lib/maci64/mexFunction.map" -stdlib=libc++ -O -Wl,-exported_symbols_list,"/Applications/MATLAB_R2016a.app/extern/lib/maci64/mexFunction.map" /var/folders/_j/0zxcvyh55jnggzgr3x9zxfk9_43znl/T/mex_3401169421544_7178/gl_file.o /var/folders/_j/0zxcvyh55jnggzgr3x9zxfk9_43znl/T/mex_3401169421544_7178/glFile.o -L"/Applications/MATLAB_R2016a.app/bin/maci64" -lmx -lmex -lmat -o ngl_file.mexmaci64
CXX : /usr/local/bin/g++-4.8
DEFINES : -DMX_COMPAT_32 -DMATLAB_MEX_FILE
MATLABMEX : -DMATLAB_MEX_FILE
CXXFLAGS : -std=gnu++11
INCLUDE : -I/Users/boost_1_51_0 -I/Users/slib/include -I/Users/matutils -I/Users/eigen-eigen-5097c01bcdc4 -I"/Applications/MATLAB_R2016a.app/extern/include" -I"/Applications/MATLAB_R2016a.app/simulink/include"
Accepted Answer
More Answers (0)
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!