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

Generate GTSAM_UNSTABLE CMake exports #906

Merged
merged 2 commits into from
Oct 25, 2021
Merged

Conversation

varunagrawal
Copy link
Collaborator

@varunagrawal varunagrawal commented Oct 23, 2021

Fixes #881

This will require a user to now do find_package(GTSAM_UNSTABLE) if they wish to use GTSAM_UNSTABLE features.

@varunagrawal
Copy link
Collaborator Author

@berndpfrommer any news on this?

@berndpfrommer
Copy link
Collaborator

Funny, I was just typing as I just completed the following test:

  • Merge Generate GTSAM_UNSTABLE CMake exports #906 with the packaging branch and build the package, works.
  • Packages install just gtsam-dev + libgtsam (no unstable), and compile my code (tagslam) against it, works. This would have been a failure mode before, I just never discovered the failure since I always installed both libraries (stable and unstable).
    Let me also test that I can use and compile against the unstable API. I was just working on that.

@varunagrawal
Copy link
Collaborator Author

Amazing!!

@berndpfrommer
Copy link
Collaborator

Almost, almost. Here's a gotcha.
The cmake config files are all in the libgtsam-dev package, including the ones for libgtsam-unstable.

dpkg -c ./libgtsam-dev_4.1.0-1ubuntu2~389.gbpb9908d_amd64.deb | grep -i cmake
drwxr-xr-x root/root         0 2021-10-08 23:09 ./usr/lib/cmake/
drwxr-xr-x root/root         0 2021-10-08 23:09 ./usr/lib/cmake/GTSAM/
-rw-r--r-- root/root       859 2021-10-08 23:09 ./usr/lib/cmake/GTSAM/GTSAM-exports-relwithdebinfo.cmake
-rw-r--r-- root/root      4451 2021-10-08 23:09 ./usr/lib/cmake/GTSAM/GTSAM-exports.cmake
-rw-r--r-- root/root      1203 2021-10-08 23:09 ./usr/lib/cmake/GTSAM/GTSAMConfig.cmake
-rw-r--r-- root/root      1722 2021-10-08 23:09 ./usr/lib/cmake/GTSAM/GTSAMConfigVersion.cmake
-rw-r--r-- root/root       309 2021-10-08 23:09 ./usr/lib/cmake/GTSAM/gtsam_extra.cmake
drwxr-xr-x root/root         0 2021-10-08 23:09 ./usr/lib/cmake/GTSAMCMakeTools/
-rw-r--r-- root/root      1235 2021-10-08 23:09 ./usr/lib/cmake/GTSAMCMakeTools/Config.cmake.in
-rw-r--r-- root/root      4306 2021-10-08 23:09 ./usr/lib/cmake/GTSAMCMakeTools/FindNumPy.cmake
-rw-r--r-- root/root       212 2021-10-08 23:09 ./usr/lib/cmake/GTSAMCMakeTools/GTSAMCMakeToolsConfig.cmake
-rw-r--r-- root/root     15511 2021-10-08 23:09 ./usr/lib/cmake/GTSAMCMakeTools/GtsamBuildTypes.cmake
-rw-r--r-- root/root      2240 2021-10-08 23:09 ./usr/lib/cmake/GTSAMCMakeTools/GtsamMakeConfigFile.cmake
-rw-r--r-- root/root      2452 2021-10-08 23:09 ./usr/lib/cmake/GTSAMCMakeTools/GtsamPrinting.cmake
-rw-r--r-- root/root     12246 2021-10-08 23:09 ./usr/lib/cmake/GTSAMCMakeTools/GtsamTesting.cmake
-rw-r--r-- root/root      5704 2021-10-08 23:09 ./usr/lib/cmake/GTSAMCMakeTools/README.html
-rw-r--r-- root/root      1856 2021-10-08 23:09 ./usr/lib/cmake/GTSAMCMakeTools/dllexport.h.in
drwxr-xr-x root/root         0 2021-10-08 23:09 ./usr/lib/cmake/GTSAM_UNSTABLE/
-rw-r--r-- root/root       931 2021-10-08 23:09 ./usr/lib/cmake/GTSAM_UNSTABLE/GTSAM_UNSTABLE-exports-relwithdebinfo.cmake
-rw-r--r-- root/root      4562 2021-10-08 23:09 ./usr/lib/cmake/GTSAM_UNSTABLE/GTSAM_UNSTABLE-exports.cmake
-rw-r--r-- root/root      1257 2021-10-08 23:09 ./usr/lib/cmake/GTSAM_UNSTABLE/GTSAM_UNSTABLEConfig.cmake
-rw-r--r-- root/root      1722 2021-10-08 23:09 ./usr/lib/cmake/GTSAM_UNSTABLE/GTSAM_UNSTABLEConfigVersion.cmake
-rw-r--r-- root/root       309 2021-10-08 23:09 ./usr/lib/cmake/GTSAM_UNSTABLE/gtsam_extra.cmake

But libgtsam-unstable-dev does not have any cmake config files:

dpkg -c ./libgtsam-unstable-dev_4.1.0-1ubuntu2~389.gbpb9908d_amd64.deb | grep -i cmake                                                                                              

I suspect that the problem is with the CMakeLists.txt files: the libgtsam-dev target installs also the cmake config files for the libgtsam-unstable-dev target.
Need to look into this some more.

@berndpfrommer
Copy link
Collaborator

nope, not a CMakeLists.txt error, but actually a bug in my packaging files

@berndpfrommer
Copy link
Collaborator

Fixed the packaging and everything is working. Without a find_package(GTSAM_UNSTABLE), the old-style INCLUDE_DIR variable is empty:

GTSAM_INCLUDE_DIR: /usr/lib/cmake/GTSAM/../../../include
GTSAM_UNSTABLE_INCLUDE_DIR: 

And the target include properties also don't have "unstable" in them. The build of the user executable fails as it should because it can't find the unstable library.

Adding the find_package(UNSTABLE) leads to successful compilation.

OK, from my end this commit is good to go. Once this has been merged into devel I will fix the packaging bug as well.

Copy link
Collaborator

@ProfFan ProfFan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :) Thanks Varun!

@varunagrawal varunagrawal merged commit e586679 into develop Oct 25, 2021
@varunagrawal varunagrawal deleted the fix/unstable-dependency branch October 25, 2021 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Related to CMake and build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not installing the libgtsam-unstable-dev package causes build failures
3 participants