diff --git a/.cproject b/.cproject index 9114e4159..57e3284f1 100644 --- a/.cproject +++ b/.cproject @@ -311,14 +311,6 @@ true true - - make - -j2 - testGaussianFactor.run - true - true - true - make -j2 @@ -345,6 +337,7 @@ make + tests/testBayesTree.run true false @@ -352,6 +345,7 @@ make + testBinaryBayesNet.run true false @@ -399,6 +393,7 @@ make + testSymbolicBayesNet.run true false @@ -406,6 +401,7 @@ make + tests/testSymbolicFactor.run true false @@ -413,6 +409,7 @@ make + testSymbolicFactorGraph.run true false @@ -428,11 +425,20 @@ make + tests/testBayesTree true false true + + make + -j2 + testGaussianFactor.run + true + true + true + make -j5 @@ -505,22 +511,6 @@ false true - - make - -j2 - all - true - true - true - - - make - -j2 - clean - true - true - true - make -j2 @@ -537,6 +527,22 @@ true true + + make + -j2 + all + true + true + true + + + make + -j2 + clean + true + true + true + make -j2 @@ -561,18 +567,26 @@ true true - + make - -j5 - testValues.run + -j2 + all true true true - + make - -j5 - testOrdering.run + -j2 + check + true + true + true + + + make + -j2 + clean true true true @@ -657,26 +671,18 @@ true true - + make - -j2 - all + -j5 + testValues.run true true true - + make - -j2 - check - true - true - true - - - make - -j2 - clean + -j5 + testOrdering.run true true true @@ -915,6 +921,7 @@ make + testGraph.run true false @@ -922,6 +929,7 @@ make + testJunctionTree.run true false @@ -929,6 +937,7 @@ make + testSymbolicBayesNetB.run true false @@ -1040,6 +1049,7 @@ make + testErrors.run true false @@ -1495,7 +1505,6 @@ make - testSimulated2DOriented.run true false @@ -1535,7 +1544,6 @@ make - testSimulated2D.run true false @@ -1543,7 +1551,6 @@ make - testSimulated3D.run true false @@ -1759,7 +1766,6 @@ make - tests/testGaussianISAM2 true false @@ -1781,102 +1787,6 @@ true true - - make - -j2 - testRot3.run - true - true - true - - - make - -j2 - testRot2.run - true - true - true - - - make - -j2 - testPose3.run - true - true - true - - - make - -j2 - timeRot3.run - true - true - true - - - make - -j2 - testPose2.run - true - true - true - - - make - -j2 - testCal3_S2.run - true - true - true - - - make - -j2 - testSimpleCamera.run - true - true - true - - - make - -j2 - testHomography2.run - true - true - true - - - make - -j2 - testCalibratedCamera.run - true - true - true - - - make - -j2 - check - true - true - true - - - make - -j2 - clean - true - true - true - - - make - -j2 - testPoint2.run - true - true - true - make -j2 @@ -2078,6 +1988,7 @@ cpack + -G DEB true false @@ -2085,6 +1996,7 @@ cpack + -G RPM true false @@ -2092,6 +2004,7 @@ cpack + -G TGZ true false @@ -2099,6 +2012,7 @@ cpack + --config CPackSourceConfig.cmake true false @@ -2176,39 +2090,7 @@ true true - - make - -j5 - wrap.testSpirit.run - true - true - true - - - make - -j5 - wrap.testWrap.run - true - true - true - - - make - -j5 - check.wrap - true - true - true - - - make - -j5 - wrap_gtsam - true - true - true - - + make -j5 wrap @@ -2216,6 +2098,102 @@ true true + + make + -j2 + testRot3.run + true + true + true + + + make + -j2 + testRot2.run + true + true + true + + + make + -j2 + testPose3.run + true + true + true + + + make + -j2 + timeRot3.run + true + true + true + + + make + -j2 + testPose2.run + true + true + true + + + make + -j2 + testCal3_S2.run + true + true + true + + + make + -j2 + testSimpleCamera.run + true + true + true + + + make + -j2 + testHomography2.run + true + true + true + + + make + -j2 + testCalibratedCamera.run + true + true + true + + + make + -j2 + check + true + true + true + + + make + -j2 + clean + true + true + true + + + make + -j2 + testPoint2.run + true + true + true + make -j2 @@ -2255,6 +2233,46 @@ false true + + make + -j5 + wrap.testSpirit.run + true + true + true + + + make + -j5 + wrap.testWrap.run + true + true + true + + + make + -j5 + check.wrap + true + true + true + + + make + -j5 + wrap_gtsam + true + true + true + + + make + -j5 + wrap + true + true + true + diff --git a/CMakeLists.txt b/CMakeLists.txt index c0f273030..ac8e7b0f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,7 @@ option(GTSAM_INSTALL_WRAP "Enable/Disable installation of wrap ut option(GTSAM_ENABLE_BUILD_MEX_BINARIES "Enable/Disable building of matlab mex files" OFF) option(GTSAM_ENABLE_BUILD_MEX_BINARIES_ALL "Enable/Disable adding building of mex files to ALL target" OFF) set(GTSAM_BUILD_MEX_BINARY_FLAGS "-j2" CACHE STRING "Flags for running make on toolbox MEX files") +set(MEX_COMMAND "mex" CACHE STRING "Command to use for executing mex (if on path, 'mex' will work)") # Flags for choosing default packaging tools set(CPACK_SOURCE_GENERATOR "TGZ" CACHE STRING "CPack Default Source Generator") diff --git a/wrap/CMakeLists.txt b/wrap/CMakeLists.txt index 6049b8a81..f0999a9eb 100644 --- a/wrap/CMakeLists.txt +++ b/wrap/CMakeLists.txt @@ -44,7 +44,13 @@ endif() # Code generation command add_custom_target(wrap_gtsam ALL COMMAND - ${EXECUTABLE_OUTPUT_PATH}/wrap ${GTSAM_MEX_BIN_EXTENSION} ${CMAKE_CURRENT_SOURCE_DIR}/../ ${moduleName} ${toolbox_path} "${mexFlags}" + ${EXECUTABLE_OUTPUT_PATH}/wrap + ${MEX_COMMAND} + ${GTSAM_MEX_BIN_EXTENSION} + ${CMAKE_CURRENT_SOURCE_DIR}/../ + ${moduleName} + ${toolbox_path} + "${mexFlags}" DEPENDS wrap) # Build command diff --git a/wrap/Module.cpp b/wrap/Module.cpp index dfd781016..d9d3c5b76 100644 --- a/wrap/Module.cpp +++ b/wrap/Module.cpp @@ -277,7 +277,7 @@ void verifyReturnTypes(const vector& validtypes, const vector& vt) { } /* ************************************************************************* */ -void Module::matlab_code(const string& toolboxPath, +void Module::matlab_code(const string& mexCommand, const string& toolboxPath, const string& mexExt, const string& mexFlags) const { string installCmd = "install -d " + toolboxPath; system(installCmd.c_str()); @@ -297,7 +297,7 @@ void Module::matlab_code(const string& toolboxPath, makeModuleMfile.oss << "clear delims" << endl; makeModuleMfile.oss << "addpath(toolboxpath);" << endl << endl; - makeModuleMakefile.oss << "\nMEX = mex\n"; + makeModuleMakefile.oss << "\nMEX = " << mexCommand << "\n"; makeModuleMakefile.oss << "MEXENDING = " << mexExt << "\n"; makeModuleMakefile.oss << "mex_flags = " << mexFlags << "\n\n"; diff --git a/wrap/Module.h b/wrap/Module.h index 3e97d9ba2..4b650728d 100644 --- a/wrap/Module.h +++ b/wrap/Module.h @@ -40,7 +40,9 @@ struct Module { bool enable_verbose=true); /// MATLAB code generation: - void matlab_code(const std::string& path, + void matlab_code( + const std::string& mexCommand, + const std::string& path, const std::string& mexExt, const std::string& mexFlags) const; }; diff --git a/wrap/wrap.cpp b/wrap/wrap.cpp index f55927a5e..453eaa73a 100644 --- a/wrap/wrap.cpp +++ b/wrap/wrap.cpp @@ -31,7 +31,9 @@ using namespace std; * @param nameSpace e.g. gtsam * @param mexFlags extra arguments for mex script, i.e., include flags etc... */ -void generate_matlab_toolbox(const string& mexExt, +void generate_matlab_toolbox( + const string& mexCommand, + const string& mexExt, const string& interfacePath, const string& moduleName, const string& toolboxPath, @@ -42,13 +44,14 @@ void generate_matlab_toolbox(const string& mexExt, wrap::Module module(interfacePath, moduleName, true); // Then emit MATLAB code - module.matlab_code(toolboxPath,mexExt,mexFlags); + module.matlab_code(mexCommand,toolboxPath,mexExt,mexFlags); } /** Displays usage information */ void usage() { cerr << "wrap parses an interface file and produces a MATLAB toolbox" << endl; cerr << "usage: wrap mexExtension interfacePath moduleName toolboxPath [mexFlags]" << endl; + cerr << " mexExecutable : command to execute mex if on path, use 'mex'" << endl; cerr << " mexExtension : OS/CPU-dependent extension for MEX binaries" << endl; cerr << " interfacePath : *absolute* path to directory of module interface file" << endl; cerr << " moduleName : the name of the module, interface file must be called moduleName.h" << endl; @@ -61,7 +64,7 @@ void usage() { * Typically called from "make all" using appropriate arguments */ int main(int argc, const char* argv[]) { - if (argc<6 || argc>7) { + if (argc<7 || argc>8) { cerr << "Invalid arguments:\n"; for (int i=0; i