ros2 / tinyxml_vendor

Vendor package for providing tinyxml within a cmake package
Apache License 2.0
2 stars 14 forks source link

compling urdfdom on ARM64 fails with tinyxml codepack error #7

Closed BrannonKing closed 6 years ago

BrannonKing commented 7 years ago

I had to add set(CMAKE_POSITION_INDEPENDENT_CODE ON) to tinyxml_cmakelists.txt in order to get urdfdom to compile on ARM64 (aarch64, ARM Cortext-53). Without it you get this error:

libtinyxml.a: relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17' can not be used when making a shared object; recompile with -fPIC
dirk-thomas commented 7 years ago

Can you please create a PR for this use case.

mattions commented 6 years ago

I had the same problem on when try to compile urdfdom on an AMD64

# Topological order
 - urdfdom

Process package 'urdfdom' with context:
--------------------------------------------------------------------------------
 source_space => /home/mattions/ros2_ws/src/ros2/urdfdom
  build_space => /home/mattions/ros2_ws/build/urdfdom
install_space => /home/mattions/ros2_ws/install
   make_flags => -j4, -l4
  build_tests => True
--------------------------------------------------------------------------------
+++ Building 'urdfdom'
==> '. /home/mattions/ros2_ws/build/urdfdom/cmake__build.sh && /usr/bin/make cmake_check_build_system' in '/home/mattions/ros2_ws/build/urdfdom'
==> '. /home/mattions/ros2_ws/build/urdfdom/cmake__build.sh && /usr/bin/make -j4 -l4' in '/home/mattions/ros2_ws/build/urdfdom'
[  7%] Built target gtest
[ 10%] Linking CXX shared library ../lib/liburdfdom_world.so
[ 17%] Linking CXX shared library ../lib/liburdfdom_model_state.so
[ 17%] Linking CXX shared library ../lib/liburdfdom_model.so
[ 25%] Built target gtest_main
/usr/bin/ld: /home/mattions/ros2_ws/install/lib/libtinyxml.a(tinyxml.o): relocation R_X86_64_PC32 against symbol `_ZN9TiXmlBase6entityE' cannot be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
urdf_parser/CMakeFiles/urdfdom_model_state.dir/build.make:122: recipe for target 'lib/liburdfdom_model_state.so.1.0' failed
make[2]: *** [lib/liburdfdom_model_state.so.1.0] Error 1

@BrannonKing could you provide an example of the atched tinyxml_cmakelists.txt, and how you compile it with ament? When I've added the sinstruction you suggested on the file, the MAKE FLAG fPIC was not picked up and it is still ignored.

BrannonKing commented 6 years ago

@mattions , what version of GCC are you using?

mattions commented 6 years ago

@BrannonKing I have gcc 7.2 (ubuntu 17.10)

mattions@apollo:ros2_ws$ gcc --version
gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I've patched the tinyxml_cmakelists.txt as in #9:

mattions@apollo:ros2_ws$ cat /home/mattions/ros2_ws/src/ros2/tinyxml_vendor/tinyxml_cmakelists.txt 
cmake_minimum_required(VERSION 2.4.6)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_definitions(-DTIXML_USE_STL)
add_library(tinyxml tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp)

set_target_properties(tinyxml PROPERTIES
                      INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)

install(TARGETS tinyxml
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib
        RUNTIME DESTINATION lib)
install(FILES tinyxml.h tinystr.h
        DESTINATION include)

However the fPIC flag seems not be picked up by ament:

mattions@apollo:ros2_ws$ src/ament/ament_tools/scripts/ament.py build --build-tests --symlink-install /home/mattions/ros2_ws/src/ros2/tinyxml_vendor/
# Topological order
 - tinyxml_vendor

Process package 'tinyxml_vendor' with context:
--------------------------------------------------------------------------------
 source_space => /home/mattions/ros2_ws/src/ros2/tinyxml_vendor
  build_space => /home/mattions/ros2_ws/build/tinyxml_vendor
install_space => /home/mattions/ros2_ws/install
   make_flags => -j4, -l4
  build_tests => True
--------------------------------------------------------------------------------
+++ Building 'tinyxml_vendor'
==> '. /home/mattions/ros2_ws/build/tinyxml_vendor/cmake__build.sh && /usr/bin/make cmake_check_build_system' in '/home/mattions/ros2_ws/build/tinyxml_vendor'
==> '. /home/mattions/ros2_ws/build/tinyxml_vendor/cmake__build.sh && /usr/bin/make -j4 -l4' in '/home/mattions/ros2_ws/build/tinyxml_vendor'
+++ Installing 'tinyxml_vendor'
==> '. /home/mattions/ros2_ws/build/tinyxml_vendor/cmake__install.sh && /usr/bin/make install' in '/home/mattions/ros2_ws/build/tinyxml_vendor'
Install the project...
-- Install configuration: ""
-- Up-to-date: /home/mattions/ros2_ws/install/share/tinyxml_vendor/cmake
-- Up-to-date: /home/mattions/ros2_ws/install/share/tinyxml_vendor/cmake/Modules
-- Up-to-date: /home/mattions/ros2_ws/install/share/tinyxml_vendor/cmake/Modules/FindTinyXML.cmake
-- Up-to-date: /home/mattions/ros2_ws/install/share/tinyxml_vendor/cmake/tinyxml_vendorConfig.cmake
-- Up-to-date: /home/mattions/ros2_ws/install/share/tinyxml_vendor/cmake/tinyxml_vendorConfig-version.cmake
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/environment/ament_prefix_path.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/environment/path.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/environment/library_path.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/environment/pkg_config_path.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/local_setup.bash
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/local_setup.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/local_setup.zsh
-- [ament] Deploying: /home/mattions/ros2_ws/install/local_setup.bash
-- [ament] Deploying: /home/mattions/ros2_ws/install/local_setup.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/local_setup.zsh
-- [ament] Deploying: /home/mattions/ros2_ws/install/setup.bash
-- [ament] Deploying: /home/mattions/ros2_ws/install/setup.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/setup.zsh
-- [ament] Deploying: /home/mattions/ros2_ws/install/_order_packages.py
dirk-thomas commented 6 years ago

@mattions Why do you think fPIC is not being used when using the referenced patch? Did you check the invocation with VERBOSE=1?

mattions commented 6 years ago

@dirk-thomas because urdfdom compilation gives the same error.

This is run in Verbose mode:

mattions@apollo:ros2_ws$ export VERBOSE=1 && src/ament/ament_tools/scripts/ament.py build --build-tests --symlink-install /home/mattions/ros2_ws/src/ros2/tinyxml_vendor/
# Topological order
 - tinyxml_vendor

Process package 'tinyxml_vendor' with context:
--------------------------------------------------------------------------------
 source_space => /home/mattions/ros2_ws/src/ros2/tinyxml_vendor
  build_space => /home/mattions/ros2_ws/build/tinyxml_vendor
install_space => /home/mattions/ros2_ws/install
   make_flags => -j4, -l4
  build_tests => True
--------------------------------------------------------------------------------
+++ Building 'tinyxml_vendor'
==> '. /home/mattions/ros2_ws/build/tinyxml_vendor/cmake__build.sh && /usr/bin/make cmake_check_build_system' in '/home/mattions/ros2_ws/build/tinyxml_vendor'
/usr/bin/cmake -H/home/mattions/ros2_ws/src/ros2/tinyxml_vendor -B/home/mattions/ros2_ws/build/tinyxml_vendor --check-build-system CMakeFiles/Makefile.cmake 0
==> '. /home/mattions/ros2_ws/build/tinyxml_vendor/cmake__build.sh && /usr/bin/make -j4 -l4' in '/home/mattions/ros2_ws/build/tinyxml_vendor'
/usr/bin/cmake -H/home/mattions/ros2_ws/src/ros2/tinyxml_vendor -B/home/mattions/ros2_ws/build/tinyxml_vendor --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/mattions/ros2_ws/build/tinyxml_vendor/CMakeFiles /home/mattions/ros2_ws/build/tinyxml_vendor/CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/mattions/ros2_ws/build/tinyxml_vendor'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/mattions/ros2_ws/build/tinyxml_vendor'
/usr/bin/cmake -E cmake_progress_start /home/mattions/ros2_ws/build/tinyxml_vendor/CMakeFiles 0
+++ Installing 'tinyxml_vendor'
==> '. /home/mattions/ros2_ws/build/tinyxml_vendor/cmake__install.sh && /usr/bin/make install' in '/home/mattions/ros2_ws/build/tinyxml_vendor'
/usr/bin/cmake -H/home/mattions/ros2_ws/src/ros2/tinyxml_vendor -B/home/mattions/ros2_ws/build/tinyxml_vendor --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/mattions/ros2_ws/build/tinyxml_vendor/CMakeFiles /home/mattions/ros2_ws/build/tinyxml_vendor/CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/mattions/ros2_ws/build/tinyxml_vendor'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/mattions/ros2_ws/build/tinyxml_vendor'
/usr/bin/cmake -E cmake_progress_start /home/mattions/ros2_ws/build/tinyxml_vendor/CMakeFiles 0
/usr/bin/make -f CMakeFiles/Makefile2 preinstall
make[1]: Entering directory '/home/mattions/ros2_ws/build/tinyxml_vendor'
make[1]: Nothing to be done for 'preinstall'.
make[1]: Leaving directory '/home/mattions/ros2_ws/build/tinyxml_vendor'
Install the project...
/usr/bin/cmake -P cmake_install.cmake
-- Install configuration: ""
-- Up-to-date: /home/mattions/ros2_ws/install/share/tinyxml_vendor/cmake
-- Up-to-date: /home/mattions/ros2_ws/install/share/tinyxml_vendor/cmake/Modules
-- Up-to-date: /home/mattions/ros2_ws/install/share/tinyxml_vendor/cmake/Modules/FindTinyXML.cmake
-- Up-to-date: /home/mattions/ros2_ws/install/share/tinyxml_vendor/cmake/tinyxml_vendorConfig.cmake
-- Up-to-date: /home/mattions/ros2_ws/install/share/tinyxml_vendor/cmake/tinyxml_vendorConfig-version.cmake
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/environment/ament_prefix_path.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/environment/path.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/environment/library_path.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/environment/pkg_config_path.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/local_setup.bash
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/local_setup.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/share/tinyxml_vendor/local_setup.zsh
-- [ament] Deploying: /home/mattions/ros2_ws/install/local_setup.bash
-- [ament] Deploying: /home/mattions/ros2_ws/install/local_setup.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/local_setup.zsh
-- [ament] Deploying: /home/mattions/ros2_ws/install/setup.bash
-- [ament] Deploying: /home/mattions/ros2_ws/install/setup.sh
-- [ament] Deploying: /home/mattions/ros2_ws/install/setup.zsh
-- [ament] Deploying: /home/mattions/ros2_ws/install/_order_packages.py

and this is the urdfdom error compilation:

mattions@apollo:ros2_ws$ export VERBOSE=1 && src/ament/ament_tools/scripts/ament.py build --build-tests --symlink-install /home/mattions/ros2_ws/src/ros2/urdfdom
# Topological order
 - urdfdom

Process package 'urdfdom' with context:
--------------------------------------------------------------------------------
 source_space => /home/mattions/ros2_ws/src/ros2/urdfdom
  build_space => /home/mattions/ros2_ws/build/urdfdom
install_space => /home/mattions/ros2_ws/install
   make_flags => -j4, -l4
  build_tests => True
--------------------------------------------------------------------------------
+++ Building 'urdfdom'
==> '. /home/mattions/ros2_ws/build/urdfdom/cmake__build.sh && /usr/bin/make cmake_check_build_system' in '/home/mattions/ros2_ws/build/urdfdom'
/usr/bin/cmake -H/home/mattions/ros2_ws/src/ros2/urdfdom -B/home/mattions/ros2_ws/build/urdfdom --check-build-system CMakeFiles/Makefile.cmake 0
==> '. /home/mattions/ros2_ws/build/urdfdom/cmake__build.sh && /usr/bin/make -j4 -l4' in '/home/mattions/ros2_ws/build/urdfdom'
/usr/bin/cmake -H/home/mattions/ros2_ws/src/ros2/urdfdom -B/home/mattions/ros2_ws/build/urdfdom --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/mattions/ros2_ws/build/urdfdom/CMakeFiles /home/mattions/ros2_ws/build/urdfdom/CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/mattions/ros2_ws/build/urdfdom'
/usr/bin/make -f urdf_parser/CMakeFiles/urdfdom_model.dir/build.make urdf_parser/CMakeFiles/urdfdom_model.dir/depend
/usr/bin/make -f urdf_parser/CMakeFiles/urdfdom_world.dir/build.make urdf_parser/CMakeFiles/urdfdom_world.dir/depend
/usr/bin/make -f urdf_parser/CMakeFiles/urdfdom_model_state.dir/build.make urdf_parser/CMakeFiles/urdfdom_model_state.dir/depend
/usr/bin/make -f urdf_parser/test/CMakeFiles/gtest.dir/build.make urdf_parser/test/CMakeFiles/gtest.dir/depend
make[2]: Entering directory '/home/mattions/ros2_ws/build/urdfdom'
cd /home/mattions/ros2_ws/build/urdfdom && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/mattions/ros2_ws/src/ros2/urdfdom /home/mattions/ros2_ws/src/ros2/urdfdom/urdf_parser /home/mattions/ros2_ws/build/urdfdom /home/mattions/ros2_ws/build/urdfdom/urdf_parser /home/mattions/ros2_ws/build/urdfdom/urdf_parser/CMakeFiles/urdfdom_model_state.dir/DependInfo.cmake --color=
make[2]: Entering directory '/home/mattions/ros2_ws/build/urdfdom'
cd /home/mattions/ros2_ws/build/urdfdom && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/mattions/ros2_ws/src/ros2/urdfdom /home/mattions/ros2_ws/src/ros2/urdfdom/urdf_parser/test /home/mattions/ros2_ws/build/urdfdom /home/mattions/ros2_ws/build/urdfdom/urdf_parser/test /home/mattions/ros2_ws/build/urdfdom/urdf_parser/test/CMakeFiles/gtest.dir/DependInfo.cmake --color=
make[2]: Entering directory '/home/mattions/ros2_ws/build/urdfdom'
cd /home/mattions/ros2_ws/build/urdfdom && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/mattions/ros2_ws/src/ros2/urdfdom /home/mattions/ros2_ws/src/ros2/urdfdom/urdf_parser /home/mattions/ros2_ws/build/urdfdom /home/mattions/ros2_ws/build/urdfdom/urdf_parser /home/mattions/ros2_ws/build/urdfdom/urdf_parser/CMakeFiles/urdfdom_model.dir/DependInfo.cmake --color=
make[2]: Entering directory '/home/mattions/ros2_ws/build/urdfdom'
cd /home/mattions/ros2_ws/build/urdfdom && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/mattions/ros2_ws/src/ros2/urdfdom /home/mattions/ros2_ws/src/ros2/urdfdom/urdf_parser /home/mattions/ros2_ws/build/urdfdom /home/mattions/ros2_ws/build/urdfdom/urdf_parser /home/mattions/ros2_ws/build/urdfdom/urdf_parser/CMakeFiles/urdfdom_world.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/mattions/ros2_ws/build/urdfdom'
/usr/bin/make -f urdf_parser/CMakeFiles/urdfdom_model_state.dir/build.make urdf_parser/CMakeFiles/urdfdom_model_state.dir/build
make[2]: Leaving directory '/home/mattions/ros2_ws/build/urdfdom'
/usr/bin/make -f urdf_parser/CMakeFiles/urdfdom_model.dir/build.make urdf_parser/CMakeFiles/urdfdom_model.dir/build
make[2]: Leaving directory '/home/mattions/ros2_ws/build/urdfdom'
/usr/bin/make -f urdf_parser/test/CMakeFiles/gtest.dir/build.make urdf_parser/test/CMakeFiles/gtest.dir/build
make[2]: Entering directory '/home/mattions/ros2_ws/build/urdfdom'
make[2]: Leaving directory '/home/mattions/ros2_ws/build/urdfdom'
/usr/bin/make -f urdf_parser/CMakeFiles/urdfdom_world.dir/build.make urdf_parser/CMakeFiles/urdfdom_world.dir/build
make[2]: Entering directory '/home/mattions/ros2_ws/build/urdfdom'
make[2]: Entering directory '/home/mattions/ros2_ws/build/urdfdom'
make[2]: Nothing to be done for 'urdf_parser/test/CMakeFiles/gtest.dir/build'.
make[2]: Leaving directory '/home/mattions/ros2_ws/build/urdfdom'
make[2]: Entering directory '/home/mattions/ros2_ws/build/urdfdom'
[  3%] Linking CXX shared library ../lib/liburdfdom_model_state.so
cd /home/mattions/ros2_ws/build/urdfdom/urdf_parser && /usr/bin/cmake -E cmake_link_script CMakeFiles/urdfdom_model_state.dir/link.txt --verbose=1
[  7%] Linking CXX shared library ../lib/liburdfdom_model.so
cd /home/mattions/ros2_ws/build/urdfdom/urdf_parser && /usr/bin/cmake -E cmake_link_script CMakeFiles/urdfdom_model.dir/link.txt --verbose=1
[ 14%] Built target gtest
/usr/bin/make -f urdf_parser/test/CMakeFiles/gtest_main.dir/build.make urdf_parser/test/CMakeFiles/gtest_main.dir/depend
[ 17%] Linking CXX shared library ../lib/liburdfdom_world.so
make[2]: Entering directory '/home/mattions/ros2_ws/build/urdfdom'
cd /home/mattions/ros2_ws/build/urdfdom && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/mattions/ros2_ws/src/ros2/urdfdom /home/mattions/ros2_ws/src/ros2/urdfdom/urdf_parser/test /home/mattions/ros2_ws/build/urdfdom /home/mattions/ros2_ws/build/urdfdom/urdf_parser/test /home/mattions/ros2_ws/build/urdfdom/urdf_parser/test/CMakeFiles/gtest_main.dir/DependInfo.cmake --color=
cd /home/mattions/ros2_ws/build/urdfdom/urdf_parser && /usr/bin/cmake -E cmake_link_script CMakeFiles/urdfdom_world.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC  -fvisibility=hidden -O3 -DNDEBUG  -shared -Wl,-soname,liburdfdom_model_state.so.1.0 -o ../lib/liburdfdom_model_state.so.1.0 CMakeFiles/urdfdom_model_state.dir/src/urdf_model_state.cpp.o CMakeFiles/urdfdom_model_state.dir/src/twist.cpp.o -Wl,-rpath,/home/mattions/ros2_ws/install/lib: /home/mattions/ros2_ws/install/lib/libtinyxml.a /home/mattions/ros2_ws/install/lib/libconsole_bridge.so.0.4 
/usr/bin/c++ -fPIC  -fvisibility=hidden -O3 -DNDEBUG  -shared -Wl,-soname,liburdfdom_model.so.1.0 -o ../lib/liburdfdom_model.so.1.0 CMakeFiles/urdfdom_model.dir/src/pose.cpp.o CMakeFiles/urdfdom_model.dir/src/model.cpp.o CMakeFiles/urdfdom_model.dir/src/link.cpp.o CMakeFiles/urdfdom_model.dir/src/joint.cpp.o -Wl,-rpath,/home/mattions/ros2_ws/install/lib: /home/mattions/ros2_ws/install/lib/libtinyxml.a /home/mattions/ros2_ws/install/lib/libconsole_bridge.so.0.4 
/usr/bin/c++ -fPIC  -fvisibility=hidden -O3 -DNDEBUG  -shared -Wl,-soname,liburdfdom_world.so.1.0 -o ../lib/liburdfdom_world.so.1.0 CMakeFiles/urdfdom_world.dir/src/pose.cpp.o CMakeFiles/urdfdom_world.dir/src/model.cpp.o CMakeFiles/urdfdom_world.dir/src/link.cpp.o CMakeFiles/urdfdom_world.dir/src/joint.cpp.o CMakeFiles/urdfdom_world.dir/src/world.cpp.o -Wl,-rpath,/home/mattions/ros2_ws/install/lib: /home/mattions/ros2_ws/install/lib/libtinyxml.a /home/mattions/ros2_ws/install/lib/libconsole_bridge.so.0.4 
make[2]: Leaving directory '/home/mattions/ros2_ws/build/urdfdom'
/usr/bin/make -f urdf_parser/test/CMakeFiles/gtest_main.dir/build.make urdf_parser/test/CMakeFiles/gtest_main.dir/build
make[2]: Entering directory '/home/mattions/ros2_ws/build/urdfdom'
make[2]: Nothing to be done for 'urdf_parser/test/CMakeFiles/gtest_main.dir/build'.
make[2]: Leaving directory '/home/mattions/ros2_ws/build/urdfdom'
[ 25%] Built target gtest_main
/usr/bin/ld: /home/mattions/ros2_ws/install/lib/libtinyxml.a(tinyxml.o): relocation R_X86_64_PC32 against symbol `_ZN9TiXmlBase6entityE' cannot be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
urdf_parser/CMakeFiles/urdfdom_model.dir/build.make:174: recipe for target 'lib/liburdfdom_model.so.1.0' failed
make[2]: *** [lib/liburdfdom_model.so.1.0] Error 1
make[2]: Leaving directory '/home/mattions/ros2_ws/build/urdfdom'
CMakeFiles/Makefile2:136: recipe for target 'urdf_parser/CMakeFiles/urdfdom_model.dir/all' failed
make[1]: *** [urdf_parser/CMakeFiles/urdfdom_model.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: /home/mattions/ros2_ws/install/lib/libtinyxml.a(tinyxml.o): relocation R_X86_64_PC32 against symbol `_ZN9TiXmlBase6entityE' cannot be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
urdf_parser/CMakeFiles/urdfdom_model_state.dir/build.make:122: recipe for target 'lib/liburdfdom_model_state.so.1.0' failed
make[2]: *** [lib/liburdfdom_model_state.so.1.0] Error 1
make[2]: Leaving directory '/home/mattions/ros2_ws/build/urdfdom'
CMakeFiles/Makefile2:284: recipe for target 'urdf_parser/CMakeFiles/urdfdom_model_state.dir/all' failed
make[1]: *** [urdf_parser/CMakeFiles/urdfdom_model_state.dir/all] Error 2
/usr/bin/ld: /home/mattions/ros2_ws/install/lib/libtinyxml.a(tinyxml.o): relocation R_X86_64_PC32 against symbol `_ZN9TiXmlBase6entityE' cannot be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
urdf_parser/CMakeFiles/urdfdom_world.dir/build.make:200: recipe for target 'lib/liburdfdom_world.so.1.0' failed
make[2]: *** [lib/liburdfdom_world.so.1.0] Error 1
make[2]: Leaving directory '/home/mattions/ros2_ws/build/urdfdom'
CMakeFiles/Makefile2:210: recipe for target 'urdf_parser/CMakeFiles/urdfdom_world.dir/all' failed
make[1]: *** [urdf_parser/CMakeFiles/urdfdom_world.dir/all] Error 2
make[1]: Leaving directory '/home/mattions/ros2_ws/build/urdfdom'
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

<== Command '. /home/mattions/ros2_ws/build/urdfdom/cmake__build.sh && /usr/bin/make -j4 -l4' failed in '/home/mattions/ros2_ws/build/urdfdom' with exit code '2'
<== Command '. /home/mattions/ros2_ws/build/urdfdom/cmake__build.sh && /usr/bin/make -j4 -l4' failed in '/home/mattions/ros2_ws/build/urdfdom' with exit code '2'

Do I have something special to clean the directory and make ament re-compile, or does it do it automatically?

BrannonKing commented 6 years ago

Do I have something special to clean the directory and make ament re-compile, or does it do it automatically?

It does it automatically if the source files have changed. It will rerun CMake if the CMakeLists.txt file has changed. However, it appears that the addition was insufficient to cause a rebuild. You can force it to rebuild by deleting this folder first: /home/mattions/ros2_ws/build/tinyxml_vendor

mattions commented 6 years ago

@BrannonKing I forced the rebuild, and I've also commented out the system library, so the one compiled with the project will be used, and now I'm able to compile urdfdom successfully.

Thanks for the help.