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

Compilation fails on Ubuntu 20 with latest YARP master version #13

Closed
S-Dafarra opened this issue Jul 8, 2021 · 7 comments
Closed

Compilation fails on Ubuntu 20 with latest YARP master version #13

S-Dafarra opened this issue Jul 8, 2021 · 7 comments

Comments

@S-Dafarra
Copy link
Collaborator

S-Dafarra commented Jul 8, 2021

Here the error:

[ 93%] Building CXX object src/modules/idyntree-yarp-visualizer/CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o
[100%] Linking CXX executable ../../../bin/idyntree-yarp-visualizer
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o: in function `VisualizerCommands::setBasePosition(double, double, double)':
VisualizerCommands.cpp:(.text+0x41a0): undefined reference to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const'
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o: in function `VisualizerCommands::setBaseRotation(double, double, double)':
VisualizerCommands.cpp:(.text+0x4300): undefined reference to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const'
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o: in function `VisualizerCommands::setBasePose(double, double, double, double, double, double)':
VisualizerCommands.cpp:(.text+0x446c): undefined reference to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const'
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o: in function `VisualizerCommands::reconnectToRobot[abi:cxx11]()':
VisualizerCommands.cpp:(.text+0x45f7): undefined reference to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const'
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o: in function `VisualizerCommands::getCameraPosition()':
VisualizerCommands.cpp:(.text+0x49b6): undefined reference to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const'
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o:VisualizerCommands.cpp:(.text+0x4c96): more undefined references to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const' follow
/usr/bin/ld: ../../../lib/libreadonlyremotecontrolboard.a(jointData.cpp.o): in function `yarp::dev::impl::jointData::Editor::read(yarp::os::ConnectionReader&)':
jointData.cpp:(.text+0x507a): undefined reference to `yarp::os::idl::WireWriter::writeVocab32(int) const'
collect2: error: ld returned 1 exit status
make[2]: *** [src/modules/idyntree-yarp-visualizer/CMakeFiles/idyntree-yarp-visualizer.dir/build.make:151: bin/idyntree-yarp-visualizer] Error 1
make[1]: *** [CMakeFiles/Makefile2:303: src/modules/idyntree-yarp-visualizer/CMakeFiles/idyntree-yarp-visualizer.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I tried on Ubuntu 20.04 using yarp at robotology/yarp@e985634

@traversaro
Copy link
Member

traversaro commented Jul 8, 2021

Did you tested this after #11 ? The problem seems to be related to jointData.cpp. Could it be that the vendored jointData.cpp was not updated and so does not work with latest YARP? In that case #11 could fix the problem.

@S-Dafarra
Copy link
Collaborator Author

Did you tested this after #11 ? The problem seems to be related to jointData.cpp. Could it be that the vendored jointData.cpp was not updated and so does not work with latest YARP? In that case #11 could fix the problem.

Yes, I do have the same error

[100%] Linking CXX executable ../../../bin/idyntree-yarp-visualizer
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o: in function `VisualizerCommands::setBasePosition(double, double, double)':
/home/sdafarra/Software/idyntree-yarp-tools/build/src/modules/idyntree-yarp-visualizer/thrifts/VisualizerCommands.cpp:365: undefined reference to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const'
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o: in function `VisualizerCommands::setBaseRotation(double, double, double)':
/home/sdafarra/Software/idyntree-yarp-tools/build/src/modules/idyntree-yarp-visualizer/thrifts/VisualizerCommands.cpp:375: undefined reference to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const'
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o: in function `VisualizerCommands::setBasePose(double, double, double, double, double, double)':
/home/sdafarra/Software/idyntree-yarp-tools/build/src/modules/idyntree-yarp-visualizer/thrifts/VisualizerCommands.cpp:385: undefined reference to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const'
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o: in function `VisualizerCommands::reconnectToRobot[abi:cxx11]()':
/home/sdafarra/Software/idyntree-yarp-tools/build/src/modules/idyntree-yarp-visualizer/thrifts/VisualizerCommands.cpp:395: undefined reference to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const'
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o: in function `VisualizerCommands::getCameraPosition()':
/home/sdafarra/Software/idyntree-yarp-tools/build/src/modules/idyntree-yarp-visualizer/thrifts/VisualizerCommands.cpp:405: undefined reference to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const'
/usr/bin/ld: CMakeFiles/idyntree-yarp-visualizer.dir/thrifts/VisualizerCommands.cpp.o:/home/sdafarra/Software/idyntree-yarp-tools/build/src/modules/idyntree-yarp-visualizer/thrifts/VisualizerCommands.cpp:415: more undefined references to `yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const' follow
collect2: error: ld returned 1 exit status
make[2]: *** [src/modules/idyntree-yarp-visualizer/CMakeFiles/idyntree-yarp-visualizer.dir/build.make:151: bin/idyntree-yarp-visualizer] Error 1
make[1]: *** [CMakeFiles/Makefile2:303: src/modules/idyntree-yarp-visualizer/CMakeFiles/idyntree-yarp-visualizer.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

It seems related to the thrift generation 🤔

@traversaro
Copy link
Member

traversaro commented Jul 8, 2021

Seems to be related to this: robotology/yarp#2616 . Can you compile with make VERBOSE=1 so that we get the exact linker command for Linking CXX executable ../../../bin/idyntree-yarp-visualizer ? In this way we can get the YARP library that is being use to link, and via nm we can actually check if yarp::os::WireLink::write(yarp::os::PortWriter const&, yarp::os::PortReader&) const is there or not. It seems like if a YARP version different from the one used to generate the thrift is linked.

@S-Dafarra
Copy link
Collaborator Author

It seems like if a YARP version different from the one used to generate the thrift is linked.

That was indeed the problem. I switched back to the 3.4 version of yarp. Then it was compiling. I then uninstalled, changed branch to master, installed again. Then, with a clean build, running cmake for idyntree-yarp-tools fails with the message

-- The CXX compiler identification is GNU 9.3.0
-- The C compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/lib/ccache/c++
-- Check for working CXX compiler: /usr/lib/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/lib/ccache/cc
-- Check for working C compiler: /usr/lib/ccache/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found YCM: /home/sdafarra/Software/robotology-superbuild/build/install/share/cmake/YCM (found version "0.13.20210707.2-20210707.2+gite17e55a")
CMake Error at /home/sdafarra/Software/robotology-superbuild/build/install/lib/cmake/YARP_os/YARP_osTargets.cmake:87 (message):
  The imported target "YARP::YARP_os" references the file

     "/home/sdafarra/Software/robotology-superbuild/build/install/lib/libYARP_os.so.3.4.1"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/home/sdafarra/Software/robotology-superbuild/build/install/lib/cmake/YARP_os/YARP_osTargets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /home/sdafarra/Software/robotology-superbuild/build/install/lib/cmake/YARP_os/YARP_osConfig.cmake:20 (include)
  /home/sdafarra/Software/robotology-superbuild/build/install/lib/cmake/YARP/YARPConfig.cmake:162 (find_package)
  CMakeLists.txt:63 (find_package)


-- Configuring incomplete, errors occurred!

I will try to delete the superbuild install folder.

@S-Dafarra
Copy link
Collaborator Author

I will try to delete the superbuild install folder.

I ran into robotology/robotology-superbuild#819

@traversaro
Copy link
Member

@S-Dafarra compilation seems to be working more and less fine in this repo. I guess this was something related to your setup, could it make sense to close the issue unless it emerges again?

@S-Dafarra
Copy link
Collaborator Author

Yes, sounds good!

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

No branches or pull requests

2 participants