Menu

matlab mex build not working on linux

Anonymous
2013-06-25
2013-10-13
  • Anonymous

    Anonymous - 2013-06-25

    Hi,

    I'm having trouble building the matlab interface. I managed to get it building on linux, but only after removing the --mex option to the mex compiler from here

    http://sourceforge.net/p/geographiclib/code/ci/master/tree/matlab/CMakeLists.txt#l55

    As far as I can tell --mex is specific to octave's mkoctfile?

    The cmake command used was

    cmake $geographic_src -DMATLAB_COMPILER:STRING=mex -DGEOGRAPHICLIB_EXAMPLES:BOOL=OFF -DGEOGRAPHIC_SHARED_LIB:BOOL=OFF -DCMAKE_CXX_FLAGS=-fPIC
    

    (Side notes: -fPIC is required when building a geographiclib which can be linked into mex shared objects on linux and the -Wl,-rpath stuff in the matlab add_custom_command should be unnecessary in this case.)

    All in all, very nice bindings :)
    ~Chris F.

     
  • Charles Karney

    Charles Karney - 2013-06-26

    I believe this problem is already fixed in the devel branch. Please check out this branch and verify. Please suggest changes to include the -fPIC flag where appropriate. I anticipate making a release in about 2 weeks.

    --Charles

     
  • Anonymous

    Anonymous - 2013-06-26

    Ah very nice. Most projects I follow use master as the development branch, so I didn't realise you'd already fixed this.

    Attached is a patch to enable position independent code and remove the mex rpath when building GeographicLib statically.

    ~Chris

     
  • Charles Karney

    Charles Karney - 2013-10-13

    This is fixed in GeographicLib version 1.31.

     

Anonymous
Anonymous

Add attachments
Cancel