make install fails !?

Issue #103 resolved
Frank Dellaert created an issue

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)

  1. Frank Dellaert 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.

  2. Chris Beall

    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()
    
  3. Frank Dellaert 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....

  4. Frank Dellaert 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
    
  5. Log in to comment