where-is-paul / matrix-factor

Code for providing incomplete factorizations of symmetric indefinite matrices.
MIT License
10 stars 8 forks source link

Building on OSX #6

Open dpo opened 8 years ago

dpo commented 8 years ago

I finally successfully built SYM-iLDL on OSX with Matlab R2013b using the following steps:

In file included from ildl.cpp:1:
In file included from /Applications/Matlab/MATLAB_R2013b.app/extern/include/mex.h:58:
In file included from /Applications/Matlab/MATLAB_R2013b.app/extern/include/matrix.h:252:
/Applications/Matlab/MATLAB_R2013b.app/extern/include/tmwtypes.h:831:9: error: 
      unknown type name 'char16_t'
typedef char16_t CHAR16_T;
        ^

The solution consists in adding -std=c++11 to the CXXFLAGS in the mexmaci64 section of mexopts.sh so it looks like this:

CXXFLAGS="-fno-common -fexceptions -arch $ARCHS -isysroot $MW_SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -std=c++11" 

This might have been fixed in more recent versions of Matlab.

I'll upgrade Matlab soon to the latest release and I'll report here if the same steps are necessary. In the mean time, I hope this is useful to somebody. Thanks for iLDL!

where-is-paul commented 8 years ago

Thanks Dominique!

dpo commented 8 years ago

In R2015b, I had to make the same changes in makefile and matlab_files/makefile, but the MEX files compiled without trouble without generating a mexopts.sh (which now appears to be called mex_XXX_maci64.xml). After the fact, I generated the mex_C++_maci64.xml and noted that the C++ flags do include -std=c++11 by default.