MPTK 0.6.1 Installation on Mac OS X 10.7.5

Wait no longer! In 2010, I chronicled my installation of MPTK 0.5.3 on Mac OS X 10.6.4. Now, I do so for MPTK 0.6.1 on OS X 10.7.5.

First, download the sources from here. While unpacking, I get some ice tea and think about the good old days. Now, let’s say I just want to build and install the package from the command line.

  1. I create a directory “mkdir MPTK061”; and “cd MPTK061”.
  2. Then I “cmake PATH_TO_SOURCE/MPTK-Source-0.6.1/”.
  3. We might need to adjust some things, but we need to generate the make script. So, I type “ccmake .” If you don’t have MATLAB installed, turn off “BUILD_MATLAB_MEX_FILES”. I leave mine on. Then I hit “c” for configuring, and “g” for generating.
  4. Then I type “make”.
  5. Then I get errors:
    In file included from /usr/local/include/mptk.h:295,
    from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/classes/mptk4matlab.h:32,
    from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/bookread.cpp:45:
    /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/mp_system.h:101:1: warning: "ULONG_MAX" redefined
    In file included from /usr/include/machine/limits.h:6,
    from /usr/include/limits.h:64,
    from /Applications/MATLAB_R2010b.app/extern/include/tmwtypes.h:43,
    from /Applications/MATLAB_R2010b.app/extern/include/matrix.h:293,
    from /Applications/MATLAB_R2010b.app/extern/include/mex.h:59,
    from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/classes/mptk4matlab.h:31,
    from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/bookread.cpp:45:
    /usr/include/i386/limits.h:75:1: warning: this is the location of the previous definition
    In file included from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/classes/mptk4matlab.h:32,
    from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/bookread.cpp:45:
    /usr/local/include/mptk.h:3204: error: 'GP_Pos_Book_c' has not been declared
    /usr/local/include/mptk.h:3212: error: 'GP_Param_Book_c' has not been declared
    /usr/local/include/mptk.h:3231: error: 'GP_Book_c' has not been declared
    /usr/local/include/mptk.h:3232: error: 'GP_Book_c' has not been declared
    /usr/local/include/mptk.h:3238: error: 'GP_Param_Book_c' has not been declared
    /usr/local/include/mptk.h:3239: error: 'GP_Param_Book_c' has not been declared
    In file included from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/classes/mptk4matlab.h:32,
    from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/bookread.cpp:45:
    /usr/local/include/mptk.h:4272: error: 'GP_Block_Book_c' has not been declared
    In file included from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/classes/mptk4matlab.h:32,
    from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/bookread.cpp:45:
    /usr/local/include/mptk.h:4914: error: 'GP_Pos_Book_c' has not been declared
    /usr/local/include/mptk.h:5109: error: 'GP_Pos_Book_c' has not been declared
    /usr/local/include/mptk.h:5244: error: 'GP_Pos_Book_c' has not been declared
    /usr/local/include/mptk.h:5680: error: 'GP_Pos_Book_c' has not been declared
    In file included from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/classes/mptk4matlab.h:32,
    from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/bookread.cpp:45:
    /usr/local/include/mptk.h:7731: error: ISO C++ forbids declaration of 'GP_Pos_Range_Sub_Book_c' with no type
    /usr/local/include/mptk.h:7731: error: 'GP_Pos_Range_Sub_Book_c' declared as a 'virtual' field
    /usr/local/include/mptk.h:7731: error: expected ';' before '*' token
    In file included from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/classes/mptk4matlab.h:32,
    from /Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/bookread.cpp:45:
    /usr/local/include/mptk.h:7990: error: ISO C++ forbids declaration of 'GP_Pos_Range_Sub_Book_c' with no type
    /usr/local/include/mptk.h:7990: error: 'GP_Pos_Range_Sub_Book_c' declared as a 'virtual' field
    /usr/local/include/mptk.h:7990: error: expected ';' before '*' token
    /usr/local/include/mptk.h:7997: error: ISO C++ forbids declaration of 'GP_Pos_Range_Sub_Book_c' with no type
    /usr/local/include/mptk.h:7997: error: 'GP_Pos_Range_Sub_Book_c' declared as a 'virtual' field
    /usr/local/include/mptk.h:7997: error: expected ';' before '*' token
    /usr/local/include/mptk.h:8005: error: ISO C++ forbids declaration of 'GP_Pos_Range_Sub_Book_c' with no type
    /usr/local/include/mptk.h:8005: error: 'GP_Pos_Range_Sub_Book_c' declared as a 'virtual' field
    /usr/local/include/mptk.h:8005: error: expected ';' before '*' token
    mex: compile of ' "/Users/bobs/Aalborg/research/201303/MPTK-Source-0.6.1/src/matlab/bookread.cpp"' failed.
    make[2]: *** [mptk/matlab/bookread.mexmaci64] Error 1
    make[1]: *** [src/matlab/CMakeFiles/matlab_bookread.dir/all] Error 2
    make: *** [all] Error 2
  6. WHAT IS GOING ON?!???
  7. Ten minutes later, calmly note that my path still has the old version of MPTK.
  8. So I delete /usr/local/include/mptk.h: “sudo rm /usr/local/include/mptk.h”. Password: “*********”
  9. Then I type “make” again; and to install it “sudo make”. Password: “****”

Now, let’s say I want to create an XCode project.

  1. I create a directory “mkdir MPTK061”; and “cd MPTK061”.
  2. Then I “cmake -G Xcode PATH_TO_SOURCE/MPTK-Source-0.6.1/”.
  3. Now, I “ccmake .”, adjust any settings, configure and generate as above.
  4. This creates in the path, “MPTK.xcodeproj”, which I open in XCode.
  5. I select the ALL BUILD, hit run, and get errors:
    -> gcc -O -Wl,-twolevel_namespace -undefined error -arch x86_64 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2010b.app/extern/lib/maci64/mexFunction.map -o  "/Users/bobs/Aalborg/research/201303/MPTK061/mptk/matlab/dictread.mexmaci64"  /Users/bobs/Aalborg/research/201303/MPTK061/mptk/matlab/dictread.o  -L/Users/bobs/Aalborg/research/201303/MPTK061/lib -lmptk -lmptk4matlab -L/Applications/MATLAB_R2010b.app/bin/maci64 -lmx -lmex -lmat -lstdc++
    ld: library not found for -lmptk
    collect2: ld returned 1 exit status
    mex: link of ' "/Users/bobs/Aalborg/research/201303/MPTK061/mptk/matlab/dictread.mexmaci64"' failed.
    make: *** [/Users/bobs/Aalborg/research/201303/MPTK061/mptk/matlab/dictread.mexmaci64] Error 1
    Command /bin/sh failed with exit code 2
    
  6. This looks to be a linking error, and I currently don’t know how to solve it.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s