Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake error when building with MATLAB flag ON #82

Closed
izzys opened this issue Jul 10, 2019 · 9 comments · Fixed by #85
Closed

cmake error when building with MATLAB flag ON #82

izzys opened this issue Jul 10, 2019 · 9 comments · Fixed by #85
Labels
bug Bug report

Comments

@izzys
Copy link

izzys commented Jul 10, 2019

CMake Error at cmake/GtsamMatlabWrap.cmake:106 (message):
You must call find_package(GTSAM) before using wrap
Call Stack (most recent call first):
cmake/GtsamMatlabWrap.cmake:59 (wrap_library_internal)
gtsam/CMakeLists.txt:214 (wrap_and_install_library)

@varunagrawal
Copy link
Collaborator

varunagrawal commented Jul 10, 2019

This seems like GTSAM was either not built first or is installed somewhere which is not on your PATH.

Which OS are you on?

@izzys
Copy link
Author

izzys commented Jul 10, 2019

Linux 16.04

I had a gtsam installation without MATLAB that went fine. Then I tried to build again with the MATLAB flag ON, and the build failed.

So I cleaned the previous installation, removed all files from usr/local and started all over again.

I still get the error above.

Now I am building again without the MATLAB flag, and it is going fine.

@varunagrawal varunagrawal added the bug Bug report label Jul 10, 2019
@varunagrawal
Copy link
Collaborator

Okay I can reproduce this. I'll see what the issue is.

@jlblancoc
Copy link
Member

@varunagrawal Let me know if you suspect it's related to any of the recent changes to cmake.

I don't have any Linux partition with MATLAB installed (for some reason, always preferred Windows for matlab), but if needed to debug this, could give it a try.

@varunagrawal
Copy link
Collaborator

@jlblancoc seems like this commit broke something. I am able to build the MATLAB wrapper on commits before this.

I'm looking into it some more to try and isolate the issue.

@varunagrawal
Copy link
Collaborator

varunagrawal commented Jul 11, 2019

I found the problem.

In gtsam/CMakeLists.txt you are setting the project name again with project(gtsam LANGUAGES CXX). The project name should be GTSAM aka uppercase, which is why the check at L102 of GtsamMatlabWrap.cmake is failing (it is checking for GTSAM but the project name has been set to gtsam aka lowercase), and hence it goes to the else condition and fails because GTSAM_INCLUDE_DIR is never set explicitly in the cmake files.

The fix should be super simple: Update gtsam/CMakeLists.txt to set the project to GTSAM so that we are consistent, and then update GtsamMatlabWrap.cmake to check for lowercase or uppercase always.

@izzys thanks again for submitting the issue. We should have this resolved by tomorrow.

@varunagrawal
Copy link
Collaborator

@dellaert you should take a look at this issue. This is why we really need to figure out CI for Matlab. Maybe contact Mathworks about this?

@jlblancoc
Copy link
Member

Thanks for investigating it!

But please, don't change it to GTSAM, it's like that for a reason (undoing it will break Windows builds).

Why not updating GtsamMatlabWrap to check for lowercase only? Can you try it? Thanks

@cntaylor
Copy link
Contributor

I had this same problem. I fixed this (see github cntaylor/gtsam, about to submit a pull request...) by modifying line 102 in GtsamMatlabWrap to check for "gtsam" rather than "GTSAM"

gchenfc added a commit that referenced this issue Apr 12, 2021
bae34fac8 Merge pull request #82 from borglab/feature/templated-base-class
6fd4053dd Merge pull request #84 from borglab/feature/print_redirectstdout
349784a38 comment about redirecting stdout
dc4fd9371 updated docs
b43f7c6d7 Merge pull request #80 from borglab/feature/multiple_interface_files
7d8c3faa7 redirect std::out for print_()
a812a6110 print redirect stdout unit test
97f3b6994 support for templated base class
3e16564e3 test cases for templated base class
7b9d080f5 Revert "unit test for printing with keyformatter"
45e203195 Revert "funcitonal print passes unit test"
8b5d66f03 Revert "include functional and iostream"
34bfbec21 Revert "delete debug statement"
dbe661c93 Revert "add includes to the example tpl file."
f47e23f1a Revert "Revert "function to concatenate multiple header files together""
e667e2095 Revert "function to concatenate multiple header files together"
600c77bf4 add includes to the example tpl file.
d5caca20e delete debug statement
4a554edb8 include functional and iostream
e8ad2c26f funcitonal print passes unit test
077d5c4e7 unit test for printing with keyformatter
d5a1e6dff function to concatenate multiple header files together

git-subtree-dir: wrap
git-subtree-split: bae34fac828acb6b17bfe37ebe78f7c9a156ed5a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants