Skip to content

Commit

Permalink
drake_debug_mex fails with a useful error when mex file tries a mexCa…
Browse files Browse the repository at this point in the history
…llMATLAB.
  • Loading branch information
RussTedrake committed Feb 1, 2014
1 parent 4368251 commit 18c8b0d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ solvers/test/regenSummary
solvers/test/singular_solutions
solvers/test/startRegen_0
solvers/test/startRegen_1
.#*
1 change: 1 addition & 0 deletions util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ add_mex(drakeUtil SHARED drakeUtil.cpp)
pods_install_libraries(drakeUtil)

add_mex(debugMex SHARED debugMexLib.cpp)
#set_property( SOURCE debugMexLib.cpp PROPERTY COMPILE_FLAGS -DMX_COMPAT_32 )
add_mex(drake_debug_mex EXECUTABLE drakeDebugMex.cpp)

if (eigen3_FOUND)
Expand Down
18 changes: 17 additions & 1 deletion util/debugMexLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,29 @@
* Author: russt
*/

#include <iostream>
#include <matrix.h>
#include <mat.h>

using namespace std;

mxArray *mxGetProperty(const mxArray *pa, mwIndex index, const char *propname)
{
return mxGetField(pa,index,propname);
return mxGetField(pa,index,propname);
}

extern "C" {
int mexCallMATLAB(int nlhs, mxArray *plhs[], int nrhs,
mxArray *prhs[], const char *functionName)
{
cerr << "Invalid mex file: Calls to mexCallMATLAB are not supported by drake_debug_mex" << endl;
return 0;;
}

mxArray *mexCallMATLABWithTrap(int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[], const char *functionName)
{
cerr << "Invalid mex file: Calls to mexCallMATLAB are not supported by drake_debug_mex" << endl;
return NULL;
}

}

0 comments on commit 18c8b0d

Please sign in to comment.