diff --git a/matlab/CMakeLists.txt b/matlab/CMakeLists.txt index 45d56e41d..e38d7cb6f 100644 --- a/matlab/CMakeLists.txt +++ b/matlab/CMakeLists.txt @@ -64,6 +64,10 @@ set(ignore gtsam::Point3 gtsam::CustomFactor) +if (APPLE OR WIN32) + list(APPEND ignore gtsam::Symbol) +endif() + set(interface_files ${GTSAM_SOURCE_DIR}/gtsam/gtsam.i ${GTSAM_SOURCE_DIR}/gtsam/base/base.i diff --git a/matlab/README.md b/matlab/README.md index 25628b633..ac0956cb7 100644 --- a/matlab/README.md +++ b/matlab/README.md @@ -10,6 +10,14 @@ The interface generated by the wrap tool also redirects the standard output stre For instructions on updating the version of the [wrap library](https://github.com/borglab/wrap) included in GTSAM to the latest version, please refer to the [wrap README](https://github.com/borglab/wrap/blob/master/README.md#git-subtree-and-contributing) +### Filename Case Sensitivity + +Due to the file name syntax requirements of Matlab, having the files `Symbol.m` (for the class) and `symbol.m` (for the function) together on an OS with a case-insensitive filesystem is impossible. + +To put it simply, for an OS like Windows or MacOS where the filesystem is case-insensitive, we cannot have two files `symbol.m` and `Symbol.m` in the same folder. When trying to write one file after another, they will end up overwriting each other. We cannot specify 2 different filenames, since Matlab's syntax prevents that. + +For this reason, on Windows and MacOS, we ignore the `Symbol` class and request users to use the `symbol` function exclusively for key creation. + ## Ubuntu If you have a newer Ubuntu system (later than 10.04), you must make a small modification to your MATLAB installation, due to MATLAB being distributed with an old version of the C++ standard library. Delete or rename all files starting with `libstdc++` in your MATLAB installation directory, in paths: