Menu

#1 Support for Mac

1.0
closed
nobody
None
2015-11-09
2015-09-23
No

Hello, is there currently support for Macs? I did not find a mexmaci64 version in the build, and I was unable to build it myself. Sorry, I have no experience with mex files previous to this so I may be missing something simple. I am running Matlab 2014b on Mac Yosemite.

Thanks,
Ricardo

Discussion

  • Martin Kortmann

    Martin Kortmann - 2015-09-23

    Hi Ricardo,
    I have no access to MATLAB for Mac currently, sorry.
    But it should compile on a MAC also, where are the problems?
    Martin

     
  • Ricardo Piedrahita

    Hi Martin,

    I get a large amount of output, and I have pasted it below, sorry if there is bad formatting!
    I added the second line there, by writing disp(buildargs) to see if there was something obvious I could change...

    Edit: It appears the formatting is quite bad, let me know if you would rather I upload the file separately. And thanks again!

    compiling release version of mksqlite...
    -output mksqlite -DNDEBUG#1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_THREADSAFE=2 -DHAVE_LZ4 -O mksqlite.cpp sqlite/sqlite3.c blosc/blosc.c blosc/blosclz.c blosc/shuffle.c blosc/lz4.c blosc/lz4hc.c md5/md5.c -ldl -maci64
    Building with 'Xcode Clang++'.
    Error using mex
    In file included from <built-in>:175:
    :1:15: warning: whitespace recommended after macro name

    define NDEBUG#1 1

              ^
    

    :7:9: warning: 'NDEBUG' macro redefined

    define NDEBUG 1

        ^
    

    :1:9: note: previous definition is here

    define NDEBUG#1 1

        ^
    

    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/mksqlite.cpp:28:
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/sql_interface.hpp:23:
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/sql_user_functions.hpp:26:
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/number_compressor.hpp:35:
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/locale.hpp:304:28: warning: illegal character encoding in string literal
    [-Winvalid-source-encoding]
    "mksqlite verwendet dar<FC>ber hinaus:\n"
    ^~~~
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/locale.hpp:332:21: warning: illegal character encoding in string literal
    [-Winvalid-source-encoding]
    "BLOB ist zu gro<DF>",
    ^~~~
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/mksqlite.cpp:28:
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/sql_interface.hpp:23:
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/sql_user_functions.hpp:27:
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/serialize.hpp:24:
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/value.hpp:101:25: warning: rvalue references are a C++11 extension
    [-Wc++11-extensions]
    ValueBase( ValueBase&& other )
    ^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/value.hpp:136:36: warning: rvalue references are a C++11 extension
    [-Wc++11-extensions]
    ValueBase& operator=( ValueBase&& other )
    ^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/value.hpp:103:32: error: no member named 'move' in namespace 'std'
    this = std::move(other);
    ~~~~~^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/value.hpp:200:23: warning: rvalue references are a C++11 extension
    [-Wc++11-extensions]
    ValueMex( ValueMex&& other ) : ValueBase( std::move(other) )
    ^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/value.hpp:219:34: warning: rvalue references are a C++11 extension
    [-Wc++11-extensions]
    ValueMex& operator=( ValueMex&& other )
    ^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/value.hpp:200:52: error: no member named 'move' in namespace 'std'
    ValueMex( ValueMex&& other ) : ValueBase( std::move(other) )
    ~~~~~^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/value.hpp:221:36: error: no member named 'move' in namespace 'std'
    ValueBase::operator=( std::move(other) );
    ~~~~~^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/value.hpp:640:23: warning: rvalue references are a C++11 extension
    [-Wc++11-extensions]
    ValueSQL( ValueSQL&& other ) : ValueBase( std::move(other) )
    ^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/value.hpp:662:34: warning: rvalue references are a C++11 extension
    [-Wc++11-extensions]
    ValueSQL& operator=( ValueSQL&& other )
    ^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/value.hpp:640:52: error: no member named 'move' in namespace 'std'
    ValueSQL( ValueSQL&& other ) : ValueBase( std::move(other) )
    ~~~~~^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/value.hpp:664:35: error: no member named 'move' in namespace 'std'
    ValueBase::operator=(std::move(other));
    ~~~~~^
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/mksqlite.cpp:28:
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/sql_interface.hpp:23:
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/sql_user_functions.hpp:28:
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/deelx/deelx.h:3962:29: warning: cast to 'const char
    ' from smaller
    integer type 'int' [-Wint-to-pointer-cast]
    buffer.Push((const CHART )distance);
    ^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/deelx/deelx.h:3814:12: note: in instantiation of member function
    'CRegexpT<char>::Replace' requested here
    return Replace(tstring, CBufferRefT<CHART>(tstring).GetSize(), replaceto, CBufferRefT<CHART>(replaceto).GetSize(),
    result_length, start, ntimes, result, pContext);
    ^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/sql_user_functions.hpp:291:35: note: in instantiation of member function
    'CRegexpT<char>::Replace' requested here
    char
    result = regexp.Replace( str, replace );
    ^
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/mksqlite.cpp:28:
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/sql_interface.hpp:23:
    In file included from /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/sql_user_functions.hpp:28:
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/deelx/deelx.h:3974:29: warning: cast to 'const char ' from smaller
    integer type 'int' [-Wint-to-pointer-cast]
    buffer.Push((const CHART
    )distance);
    ^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/deelx/deelx.h:4032:25: warning: cast to 'const char ' from smaller
    integer type 'int' [-Wint-to-pointer-cast]
    buffer.Push((const CHART
    )len);
    ^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/deelx/deelx.h:4044:25: warning: cast to 'const char ' from smaller
    integer type 'int' [-Wint-to-pointer-cast]
    buffer.Push((const CHART
    )(lastIndex - endpos));
    ^
    /Users/ricardopiedrahita/Downloads/mksqlite-2.1-src/deelx/deelx.h:4052:25: warning: cast to 'const char ' from smaller
    integer type 'int' [-Wint-to-pointer-cast]
    buffer.Push((const CHART
    )(endpos - lastIndex));
    ^
    15 warnings and 5 errors generated.

    Error in buildit>buildmksqlite (line 155)
    eval (['mex ' buildargs]);

    Error in buildit (line 16)
    buildmksqlite('release');

     

    Last edit: Ricardo Piedrahita 2015-09-23
    • Vic Jang

      Vic Jang - 2016-02-05

      Hi Recardo,

      Here's a solution for you.

      Find -DNDEBUG#1 in the code.
      It will be somewhere close to the actual build command
      eval (['mex ' buildargs]);

      Replace -DNDEBUG#1 with -DNDEBUG=1
      and try running again.

      I ran into this problem while building another MATLAB library with mex.
      I was able to build correctly after a similar modification.

      I am not sure why some code uses -D_NAME_#_VALUE_ as opposed to -D_NAME_=_VALUE_
      but anyway this was how I solved it.

      Andreas,

      Would you be able to explain why? That will solve this mystery which took me 2 hours to resolve.
      Thank you.

       
  • Andreas Martin

    Andreas Martin - 2015-09-24

    Hello Ricardo,

    there are several users, appreciate to use mksqlite on mac. Is seems, that apple ships their system with a very old library version, which you have to update manually, but that's kind tricky.
    It would be nice, if someone is able to compile this code on mac and would post a small "how to". I also have no access to a mac, with MATLAB installed...
    As far as I know you have to manually update the libraries and force the compiler to use them (-std=c++11 -stdlib=libc++).
    Tried "mex -setup CPP" on MATLAB console?

    Regards, Andreas

     
  • Andreas Martin

    Andreas Martin - 2015-11-09
    • status: open --> closed
     

Log in to post a comment.