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

Fix pkg-config boost entries for Ubuntu Focal (gazebo9) #2751

Merged
merged 5 commits into from
Jul 15, 2020

Conversation

j-rivero
Copy link
Contributor

@j-rivero j-rivero commented Jun 8, 2020

Partial fix for #2735 . Need another PR for Gazebo11

@chapulina chapulina requested a review from scpeters July 13, 2020 18:24
Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

I've noticed this issue for a while on homebrew since it has had a newer boost version for a while. Unfortunately, this doesn't fix the issue on homebrew because those libraries have an extra -mt (for multithreaded I believe).

$ ls /usr/local/opt/boost/lib | grep thread
libboost_thread-mt.a
libboost_thread-mt.dylib

The homebrew CI build is gone now, but I saw the following in an email about it:

399: ld: library not found for -lboost_thread

In my previous debugging, I tried to use a generator expression to extract the boost library names from cmake targets. For example, the following patch is able to write the absolute path of the library for each target:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8659ff1707..e90e868a23 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -383,6 +383,7 @@ else (build_errors)
   string (REPLACE ";" " -L" Boost_PKGCONFIG_LIBS "${Boost_PKGCONFIG_LIBS}")
 
   foreach (b ${Boost_LIBRARIES})
+    file(GENERATE OUTPUT generated_${b}.txt CONTENT $<TARGET_LINKER_FILE:${b}>\n)
     get_filename_component(bname ${b} NAME_WE)
     # Prefix -l if not already prefixed
     string(FIND ${bname} "-l" lprefix)
$ cat generated_Boost\:\:thread.txt 
/usr/local/lib/libboost_thread-mt.dylib

cmake has a different generator expression that seems like it would be perfect for this case: TARGET_LINKER_FILE_BASE_NAME, but that been reported as a known issue for these boost targets (boostorg/boost_install#41, and cmake issue 20611)

so I'll approve this because it seems to work for ubuntu 20.04, but it doesn't fix homebrew

CMakeLists.txt Outdated Show resolved Hide resolved
@scpeters scpeters added the 9 Gazebo 9 label Jul 15, 2020
scpeters added 4 commits July 15, 2020 14:08
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters
Copy link
Member

I've updated the changelog and also bumped the version to 9.13.2 in anticipation of an upcoming release

@scpeters scpeters merged commit 01a89a5 into gazebo9 Jul 15, 2020
@scpeters scpeters deleted the gazebo9_fix_boost_pkgconfig branch July 15, 2020 21:19
@scpeters
Copy link
Member

I filed #2790 to capture the issues with homebrew that I discussed in that comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9 Gazebo 9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants