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 find Poco to return full lib path #8

Merged
merged 2 commits into from
Jul 2, 2013
Merged

Conversation

wjwwood
Copy link
Member

@wjwwood wjwwood commented Jun 17, 2013

On OS X, when building dependencies (Poco) into a location which is not on the lib path, I can get this:

==> Processing catkin package: 'class_loader'
==> Creating build directory: 'build_isolated/class_loader'
==> Building with env: '/opt/ros/groovy/env.sh'
==> cmake /Users/william/catkin_ws/src/class_loader -DCATKIN_DEVEL_PREFIX=/Users/william/catkin_ws/devel_isolated/class_loader -DCMAKE_INSTALL_PREFIX=/opt/ros/groovy in '/Users/william/catkin_ws/build_isolated/class_loader'
-- The C compiler identification is Clang 4.2.0
-- The CXX compiler identification is Clang 4.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Searching for Poco library...
--   Found Poco!
-- components found: Foundation.
-- Boost version: 1.53.0
-- Found the following Boost libraries:
--   thread
-- Using CATKIN_DEVEL_PREFIX: /Users/william/catkin_ws/devel_isolated/class_loader
-- Using CMAKE_PREFIX_PATH: /opt/ros/groovy
-- This workspace overlays: /opt/ros/groovy
-- Found PythonInterp: /usr/bin/python (found version "2.7.2")
-- Found PY_em: /opt/ros/groovy/lib/python2.7/site-packages/em.pyc
-- Found gtest: gtests will be built
-- Using CATKIN_TEST_RESULTS_DIR: /Users/william/catkin_ws/build_isolated/class_loader/test_results
-- catkin 0.5.66
-- Boost version: 1.53.0
-- Found the following Boost libraries:
--   thread
-- Checking to see if CXX compiler accepts flag -Wl,--version-script,"/Users/william/catkin_ws/build_isolated/class_loader/test/class_loader_hide_library_symbols__class_loader_TestPlugins1.script"
-- Checking to see if CXX compiler accepts flag -Wl,--version-script,"/Users/william/catkin_ws/build_isolated/class_loader/test/class_loader_hide_library_symbols__class_loader_TestPlugins1.script" - no
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/william/catkin_ws/build_isolated/class_loader
==> make -j4 -l4 in '/Users/william/catkin_ws/build_isolated/class_loader'
Scanning dependencies of target class_loader
[ 25%] [ 50%] [ 75%] Building CXX object CMakeFiles/class_loader.dir/src/meta_object.cpp.o
Building CXX object CMakeFiles/class_loader.dir/src/class_loader_core.cpp.o
[100%] Building CXX object CMakeFiles/class_loader.dir/src/class_loader.cpp.o
Building CXX object CMakeFiles/class_loader.dir/src/multi_library_class_loader.cpp.o
Linking CXX shared library /Users/william/catkin_ws/devel_isolated/class_loader/lib/libclass_loader.dylib
ld: library not found for -lPocoFoundation
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/william/catkin_ws/devel_isolated/class_loader/lib/libclass_loader.dylib] Error 1
make[1]: *** [CMakeFiles/class_loader.dir/all] Error 2
make: *** [all] Error 2

It is passing -LPocoFoundation, to the linker, so in that case you would also need to pass the -L/path/containing/that/lib, OR you can do what this pull request does and just pass the full path to the library, which is better form I think.

@@ -169,7 +169,8 @@ IF(Poco_INCLUDE_DIR)
FOREACH(COMPONENT ${Poco_FIND_COMPONENTS})
FIND_LIBRARY(LIB${COMPONENT} "Poco${COMPONENT}" Poco_LIBRARY_DIR)
IF (LIB${COMPONENT})
LIST(APPEND Poco_LIBRARIES "Poco${COMPONENT}${DBG}")
# LIST(APPEND Poco_LIBRARIES "Poco${COMPONENT}${DBG}")
Copy link
Member

Choose a reason for hiding this comment

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

Should go away. We have the git history for that.

@wjwwood
Copy link
Member Author

wjwwood commented Jun 25, 2013

I updated the pull request.

@wjwwood
Copy link
Member Author

wjwwood commented Jun 25, 2013

It builds on OS X, I haven't tested Linux.

@wjwwood
Copy link
Member Author

wjwwood commented Jul 1, 2013

@dirk-thomas @mirzashah Can I get a review/merge on this?

@dirk-thomas
Copy link
Member

With the debug suffix being readded +1

@mirzashah
Copy link
Member

It builds on linux with for me and passes all unit tests

mirzashah pushed a commit that referenced this pull request Jul 2, 2013
Fix find Poco to return full lib path
@mirzashah mirzashah merged commit 8753615 into groovy-devel Jul 2, 2013
@wjwwood
Copy link
Member Author

wjwwood commented Jul 9, 2013

This needs to get merged into hydro-devel! I probably opened against the wrong branch, or the hydro-devel branch get created during after I opened it.

@mirzashah
Copy link
Member

@wjwwood This is what happens when I'm not there to calm your mind with soothing camel sounds...

@dirk-thomas dirk-thomas deleted the fix_find_poco branch July 14, 2013 07:18
severin-lemaignan referenced this pull request in severin-lemaignan/robotpkg Aug 18, 2014
Changes since 0.1.29:
0.3.0 (2014-06-25)
------------------
* Use system-provided console-bridge
* Contributors: Esteve Fernandez

0.2.5 (2014-03-04)
------------------
* Changed format of debug messages so that rosconsole_bridge can correctly
parse the prefix
* Improved debug output

0.2.4 (2014-02-12)
------------------
* fix race condition with multi threaded library loading (`#16
<https://github.com/ros/class_loader/issues/16>`_)

0.2.3 (2013-08-21)
------------------
* fix missing class name in logWarn output

0.2.2 (2013-07-14)
------------------
* check for CATKIN_ENABLE_TESTING (`#10
<https://github.com/ros/class_loader/issues/10>`_)
* fix find Poco to return full lib path (`#8
<https://github.com/ros/class_loader/issues/8>`_)
* add missing runtime destination for library under Windows
* add Boosst component system

0.2.1 (2013-06-06)
------------------
* improve check for Poco foundation and headers (`#7
<https://github.com/ros/class_loader/issues/7>`_)

0.2.0 (2013-03-13)
------------------
* use find_package for Poco/dl instead to make it work on other platforms
* update Poco cmake file to include libdl on non-windows systems
* No longer CATKIN_DEPEND on console_bridge

Remove useless patches that have been fixed upstream
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants