make install fails !?
An error in the file matrix.h that was never a problem suddenly stopped compiling on my mac. Does anyone have the same issue? This breaks matlab toolbox on Mac - major stumbling block.
[ 61%] Building C object gtsam/CMakeFiles/gtsam_wrapper.dir/3rdparty/CCOLAMD/Source/ccolamd.c.o
In file included from /Users/frank/borg/gtsam/gtsam/3rdparty/CCOLAMD/Source/ccolamd.c:625:
[ 62%] Built target Pose2SLAMExample
In file included from /Applications/MATLAB_R2013a.app/extern/include/mex.h:58:
In file included from /Applications/MATLAB_R2013a.app/extern/include/matrix.h:294:
/Applications/MATLAB_R2013a.app/extern/include/tmwtypes.h:819:9: error: unknown type name 'char16_t'
typedef char16_t CHAR16_T;
^
[ 62%] Built target PlanarSLAMExample
1 error generated.
make[2]: *** [gtsam/CMakeFiles/gtsam_wrapper.dir/3rdparty/CCOLAMD/Source/ccolamd.c.o] Error 1
make[1]: *** [gtsam/CMakeFiles/gtsam_wrapper.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 62%] Built target Pose2SLAMExample_g2o
[ 62%] Built target Pose2SLAMExample_graph
make: *** [all] Error 2
Comments (10)
-
-
reporter Yeah, was just reading this. How can I add this just for Clang 5.1? Thinking should add
-Dchar16_t=uint16_t
via CmakeLists.txt.
-
Maybe something like this:
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) add_definitions(…) endif() endif()
-
reporter Tried stuff in http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros, specifically
// Code snippet to fix Clang 5.1 break - May '14 #ifdef __is_identifier // Compatibility with non-clang compilers. #if !__is_identifier(char16_t) typedef uint16_t char16_t; #endif #endif
but that did not work out.
-
reporter Also,
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) message(STATUS "Adding -Dchar16_t=uint16_t") # set_target_properties(${moduleName}_wrapper PROPERTIES COMPILE_DEFINITIONS "char16_t=unsigned short") # add_definitions(-Dchar16_t=uint16_t) endif() endif()
with either line uncommented bombed....
-
reporter But just adding a typedef works, on Mac:
#ifdef MATLAB_MEX_FILE typedef uint16_t char16_t; #include "mex.h" #include "matrix.h" #endif
-
reporter I will check in as a branch so @cbeall3 can try on other platforms
-
reporter Seems to be resolved with merge of fix/wrapper
-
reporter - changed status to resolved
merged fix/wrapper, seems to be resolved
-
Can you please elaborate? I seem to have a similar problem and I couldn’t find a solution for it.
- Log in to comment
I can't reproduce this with Matlab 2014a, but here are some solutions you can try: http://stackoverflow.com/questions/22367516/mex-compile-error-unknown-type-name-char16-t