-
Notifications
You must be signed in to change notification settings - Fork 7
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
[BodyYarp] devices should be shared libraries #51
Comments
Working on this in teo-main first: https://github.com/roboticslab-uc3m/teo-main/issues/60 |
Essentially https://github.com/jgvictores/example-yarp-plugin-gtest is a good example of a repository containing a YARP plugin compiled as a shared library. Important:
|
Just in case, I would also recommend having YARP installed with |
PS: From https://github.com/asrob-uc3m/robotDevastation-robots I've just seen that https://github.com/jgvictores/example-yarp-plugin-gtest is not updated to the latest of YARP. Here are the two relevant fixes: |
@jgvictores |
I tried to do the first shared library with CanBusControlboard. Here is the commit but, when I've tried to do cmake .., it shows this: -- The C compiler identification is GNU 5.2.1
-- The CXX compiler identification is GNU 5.2.1
-- 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
-- Detecting C compile features
-- Detecting C compile features - 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Libraries go to /home/teo/repos/rsantos88/teo-body/build/lib
-- Executables go to /home/teo/repos/rsantos88/teo-body/build/bin
-- Setting up installation of teo-body.ini to /usr/local/share/yarp/config/path.d folder.
-- +++ plugin CuiAbsolute, SKIP_CuiAbsolute is set
-- +++ plugin TechnosoftIpos, SKIP_TechnosoftIpos is set
-- +++ plugin LacqueyFetch, SKIP_LacqueyFetch is set
-- +++ plugin TextilesHand, SKIP_TextilesHand is set
-- +++ plugin FakeJoint, SKIP_FakeJoint is set
-- +++ plugin CanBusHico, SKIP_CanBusHico is set
-- +++ plugin CanBusControlboard, SKIP_CanBusControlboard is set
CMake Error at libraries/BodyYarp/CMakeLists.txt:32 (install):
install TARGETS given target "BodyYarp" which does not exist in this
directory.
CMake Error: Could not open file for write in copy operation /BodyYarp_yarpdev.cpp.tmp
CMake Error: : System Error: Permission denied
CMake Error at /usr/local/share/yarp/cmake/YarpPlugin.cmake:357 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
libraries/BodyYarp/CMakeLists.txt:36 (YARP_ADD_PLUGIN_YARPDEV_EXECUTABLE)
CMake Error at libraries/BodyYarp/CMakeLists.txt:37 (install):
install TARGETS given target "launchBodyYarp" which does not exist in this
directory.
-- Found PythonInterp: /usr/bin/python (found version "2.7.10")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring incomplete, errors occurred!
See also "/home/teo/repos/rsantos88/teo-body/build/CMakeFiles/CMakeOutput.log".
See also "/home/teo/repos/rsantos88/teo-body/build/CMakeFiles/CMakeError.log". |
Now, with this commit, the last problem was solved, but when I try to compile, it shows this error: [ 46%] Building CXX object programs/recordLocomotion/CMakeFiles/recordLocomotion.dir/RecordRateThread.cpp.o
[ 50%] /usr/local/lib/libBodyYarp.a(add_BodyYarp_plugins.cpp.o): En la función `add_BodyYarp_plugins':
add_BodyYarp_plugins.cpp:(.text+0x1f): referencia a `add_owned_CuiAbsolute(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x29): referencia a `add_owned_TechnosoftIpos(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x33): referencia a `add_owned_LacqueyFetch(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x3d): referencia a `add_owned_TextilesHand(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x47): referencia a `add_owned_FakeJoint(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x51): referencia a `add_owned_CanBusHico(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x5b): referencia a `add_owned_CanBusControlboard(char const*)' sin definir
collect2: error: ld returned 1 exit status
programs/recordManipulation/CMakeFiles/recordManipulation.dir/build.make:166: recipe for target 'bin/recordManipulation' failed
make[2]: *** [bin/recordManipulation] Error 1
CMakeFiles/Makefile2:869: recipe for target 'programs/recordManipulation/CMakeFiles/recordManipulation.dir/all' failed
make[1]: *** [programs/recordManipulation/CMakeFiles/recordManipulation.dir/all] Error 2
Building CXX object programs/playbackLocomotion/CMakeFiles/playbackLocomotion.dir/PlaybackThread.cpp.o
[ 53%] Building CXX object programs/playbackLocomotion/CMakeFiles/playbackLocomotion.dir/main.cpp.o
Linking CXX executable ../../bin/recordLocomotion
Linking CXX executable ../../bin/playbackLocomotion
/usr/local/lib/libBodyYarp.a(add_BodyYarp_plugins.cpp.o): En la función `add_BodyYarp_plugins':
add_BodyYarp_plugins.cpp:(.text+0x1f): referencia a `add_owned_CuiAbsolute(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x29): referencia a `add_owned_TechnosoftIpos(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x33): referencia a `add_owned_LacqueyFetch(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x3d): referencia a `add_owned_TextilesHand(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x47): referencia a `add_owned_FakeJoint(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x51): referencia a `add_owned_CanBusHico(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x5b): referencia a `add_owned_CanBusControlboard(char const*)' sin definir
collect2: error: ld returned 1 exit status
programs/recordLocomotion/CMakeFiles/recordLocomotion.dir/build.make:141: recipe for target 'bin/recordLocomotion' failed
make[2]: *** [bin/recordLocomotion] Error 1
CMakeFiles/Makefile2:969: recipe for target 'programs/recordLocomotion/CMakeFiles/recordLocomotion.dir/all' failed
make[1]: *** [programs/recordLocomotion/CMakeFiles/recordLocomotion.dir/all] Error 2
/usr/local/lib/libBodyYarp.a(add_BodyYarp_plugins.cpp.o): En la función `add_BodyYarp_plugins':
add_BodyYarp_plugins.cpp:(.text+0x1f): referencia a `add_owned_CuiAbsolute(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x29): referencia a `add_owned_TechnosoftIpos(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x33): referencia a `add_owned_LacqueyFetch(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x3d): referencia a `add_owned_TextilesHand(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x47): referencia a `add_owned_FakeJoint(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x51): referencia a `add_owned_CanBusHico(char const*)' sin definir
add_BodyYarp_plugins.cpp:(.text+0x5b): referencia a `add_owned_CanBusControlboard(char const*)' sin definir
collect2: error: ld returned 1 exit status
programs/playbackLocomotion/CMakeFiles/playbackLocomotion.dir/build.make:141: recipe for target 'bin/playbackLocomotion' failed
make[2]: *** [bin/playbackLocomotion] Error 1
CMakeFiles/Makefile2:1019: recipe for target 'programs/playbackLocomotion/CMakeFiles/playbackLocomotion.dir/all' failed
make[1]: *** [programs/playbackLocomotion/CMakeFiles/playbackLocomotion.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make: *** [all] Error 2
|
You are still linking to |
I'd keep them as long as the Just as a side note: if the |
In fact, the consequences are quite brutal regarding code and cmake (take a look at the current SharedLibraries branch at https://github.com/roboticslab-uc3m/teo-body/network). I'm extremely inclined to force shared libraries, keeping static libraries seems like a giant effort (possibly requiring ugly hacks or at least ugly code) with no visible benefits. PS: |
I believe some of those changes would be necessary even for static libraries in terms of a major cleanup, I just recently found that instructions like this do not make much sense (apart from populating a public interface, which may or may not be intended): target_link_libraries(TEO_BODY_STATIC_PLUGIN ${YARP_LIBRARIES} ${TEO_BODY_LIBRARIES}) It might not be that hard nor hackish to provide support for static libraries. Having that said, I'm not against forcing shared YARP plugins/TEO libraries/both, but in that case, I'd stress that |
@jgvictores you might also want to add b342044 to the list at #51 (comment). |
Done at 92a3cf7. |
[BodyYarp] devices should be shared libraries (currently static).
The text was updated successfully, but these errors were encountered: