0
$\begingroup$

Rosanswers logo

On Fedora 32, ROS 10.1, following these instructions, running colcon build --symlink-install errors out with the below:

-- BUILD_SHARED_LIBS is on
/usr/local/bin/anaconda3/bin/python: can't find '__main__' module in '/usr/local/bin/anaconda3/lib/python3.7/site-packages/em'
CMake Error at cmake/safe_execute_process.cmake:11 (message):

  execute_process(/root/ros_catkin_ws/build/catkin/catkin_generated/env_cached.sh
  "/usr/local/bin/anaconda3/bin/python"
  "/usr/local/bin/anaconda3/lib/python3.7/site-packages/em" "--raw-errors"
  "-F"
  "/root/ros_catkin_ws/build/catkin/catkin_generated/pkg.develspace.context.pc.py"
  "-o" "/root/ros_catkin_ws/build/catkin/devel/lib/pkgconfig/catkin.pc"
  "/root/ros_catkin_ws/src/catkin/cmake/em/pkg.pc.em") returned error code 1
Call Stack (most recent call first):
  cmake/em_expand.cmake:25 (safe_execute_process)
  cmake/catkin_package.cmake:327 (em_expand)
  cmake/catkin_package.cmake:102 (_catkin_package)
  CMakeLists.txt:11 (catkin_package)

-- Configuring incomplete, errors occurred!
See also "/root/ros_catkin_ws/build/catkin/CMakeFiles/CMakeOutput.log".
See also "/root/ros_catkin_ws/build/catkin/CMakeFiles/CMakeError.log".
Failed   <<< catkin [0.82s, exited with code 1]

log file:

/usr/bin/ld: src.c:(.text+0x39): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x45): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x56): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_210d5.dir/build.make:107: cmTC_210d5] Error 1
gmake[1]: Leaving directory '/root/ros_catkin_ws/build/catkin/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:141: cmTC_210d5/fast] Error 2

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /root/ros_catkin_ws/build/catkin/CMakeFiles/CMakeTmp

Source file was:
#include <pthread.h>

void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_cancel(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}

Run Build Command(s):/usr/bin/gmake cmTC_d2cba/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_d2cba.dir/build.make CMakeFiles/cmTC_d2cba.dir/build
gmake[1]: Entering directory '/root/ros_catkin_ws/build/catkin/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_d2cba.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_d2cba.dir/CheckFunctionExists.c.o   -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_d2cba
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d2cba.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    -rdynamic CMakeFiles/cmTC_d2cba.dir/CheckFunctionExists.c.o  -o cmTC_d2cba  -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_d2cba.dir/build.make:107: cmTC_d2cba] Error 1
gmake[1]: Leaving directory '/root/ros_catkin_ws/build/catkin/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:141: cmTC_d2cba/fast] Error 2

Is this a known issue? Is there a work around for thepthreads? I also tried with -DBUILD_SHARED_LIBS=OFF no difference.

Edit: after adding setuptools and pytest-cov here are the errors:

Failed   <<< cyclonedds [0.56s, exited with code 1]


Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /root/ros2_dashing/build/cyclonedds/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_473c5/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_473c5.dir/build.make CMakeFiles/cmTC_473c5.dir/build
gmake[1]: Entering directory '/root/ros2_dashing/build/cyclonedds/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_473c5.dir/src.c.o
/usr/bin/cc   -DCMAKE_HAVE_LIBC_PTHREAD   -o CMakeFiles/cmTC_473c5.dir/src.c.o   -c /root/ros2_dashing/build/cyclonedds/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_473c5
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_473c5.dir/link.txt --verbose=1
/usr/bin/cc  -DCMAKE_HAVE_LIBC_PTHREAD    CMakeFiles/cmTC_473c5.dir/src.c.o  -o cmTC_473c5
/usr/bin/ld: CMakeFiles/cmTC_473c5.dir/src.c.o: in function `main':
src.c:(.text+0x2d): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x39): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x45): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x56): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_473c5.dir/build.make:107: cmTC_473c5] Error 1
gmake[1]: Leaving directory '/root/ros2_dashing/build/cyclonedds/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:141: cmTC_473c5/fast] Error 2


Source file was:
#include <pthread.h>

void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_cancel(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /root/ros2_dashing/build/cyclonedds/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_b1ea7/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_b1ea7.dir/build.make CMakeFiles/cmTC_b1ea7.dir/build
gmake[1]: Entering directory '/root/ros2_dashing/build/cyclonedds/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_b1ea7.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_b1ea7.dir/CheckFunctionExists.c.o   -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_b1ea7
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b1ea7.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTC_b1ea7.dir/CheckFunctionExists.c.o  -o cmTC_b1ea7  -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_b1ea7.dir/build.make:107: cmTC_b1ea7] Error 1
gmake[1]: Leaving directory '/root/ros2_dashing/build/cyclonedds/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:141: cmTC_b1ea7/fast] Error 2

Edit 3:

-- stderr: cyclonedds
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
  Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE) (found suitable version
  "1.8.0_265", minimum required is "1.8")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindJava.cmake:332 (find_package_handle_standard_args)
  src/idlc/cmake/IdlcGenerate.cmake:12 (find_package)
  src/idlc/CMakeLists.txt:44 (include)


---
Failed   <<< cyclonedds [3.19s, exited with code 1]
Aborted  <<< osrf_testing_tools_cpp [3.52s]
Aborted  <<< ament_flake8 [0.78s]
Aborted  <<< ament_pyflakes [0.74s]
Aborted  <<< ament_cmake_core [0.85s]
Aborted  <<< fastcdr [3.56s]

Summary: 8 packages finished [6.55s]
  1 package failed: cyclonedds
  5 packages aborted: ament_cmake_core ament_flake8 ament_pyflakes fastcdr osrf_testing_tools_cpp
  1 package had stderr output: cyclonedds
  289 packages not processed

Edit 4:

collect2: error: ld returned 1 exit status /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_ctrl@OPENSSL_1_1_1b' /usr/bin/ld: /usr/lib64/libcurl.so: undefined reference to 'SSLv3_client_method@OPENSSL_1_1_0' /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_derive@OPENSSL_1_1_1b' gmake[2]: *** [CMakeFiles/grid_test_target.dir/build.make:130: grid_test_target] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:451: CMakeFiles/grid_test_target.dir/all] Error 2 collect2: error: ld returned 1 exit status /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_CTX_free@OPENSSL_1_1_1b' gmake[2]: *** [CMakeFiles/movable_text_test_target.dir/build.make:131: movable_text_test_target] Error 1 collect2: error: ld returned 1 exit status gmake[1]: *** [CMakeFiles/Makefile2:481: CMakeFiles/movable_text_test_target.dir/all] Error 2 /usr/bin/ld: /usr/lib64/libSM.so: undefined reference to 'uuid_unparse_lower@UUID_1.0' gmake[2]: *** [CMakeFiles/billboard_line_test_target.dir/build.make:130: billboard_line_test_target] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:337: CMakeFiles/billboard_line_test_target.dir/all] Error 2 /usr/bin/ld: /usr/lib64/libcurl.so: undefined reference to 'SSLv3_client_method@OPENSSL_1_1_0' collect2: error: ld returned 1 exit status gmake[2]: *** [CMakeFiles/wrench_visual_test_target.dir/build.make:130: wrench_visual_test_target] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:194: CMakeFiles/wrench_visual_test_target.dir/all] Error 2 /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_CTX_new_id@OPENSSL_1_1_1b' /usr/bin/ld: /usr/lib64/libSM.so: undefined reference to 'uuid_generate@UUID_1.0' collect2: error: ld returned 1 exit status gmake[2]: *** [CMakeFiles/point_cloud_renderable_test_target.dir/build.make:130: point_cloud_renderable_test_target] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:280: CMakeFiles/point_cloud_renderable_test_target.dir/all] Error 2 /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_ctrl@OPENSSL_1_1_1b' /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_derive@OPENSSL_1_1_1b' /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_CTX_free@OPENSSL_1_1_1b' /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_ctrl@OPENSSL_1_1_1b' /usr/bin/ld: /usr/lib64/libSM.so: undefined reference to 'uuid_unparse_lower@UUID_1.0' /usr/bin/ld: /usr/lib64/libcurl.so: undefined reference to 'SSLv3_client_method@OPENSSL_1_1_0' /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_CTX_new_id@OPENSSL_1_1_1b' /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_CTX_free@OPENSSL_1_1_1b' /usr/bin/ld: /usr/lib64/libSM.so: undefined reference to 'uuid_generate@UUID_1.0' /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_CTX_new_id@OPENSSL_1_1_1b' /usr/bin/ld: /usr/lib64/libSM.so: undefined reference to 'uuid_generate@UUID_1.0' collect2: error: ld returned 1 exit status /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_derive@OPENSSL_1_1_1b' gmake[2]: *** [CMakeFiles/covariance_visual_test_target.dir/build.make:130: covariance_visual_test_target] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:394: CMakeFiles/covariance_visual_test_target.dir/all] Error 2 /usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to 'EVP_KDF_derive@OPENSSL_1_1_1b' /usr/bin/ld: /usr/lib64/libSM.so: undefined reference to 'uuid_unparse_lower@UUID_1.0' /usr/bin/ld: /usr/lib64/libcurl.so: undefined reference to 'SSLv3_client_method@OPENSSL_1_1_0' /usr/bin/ld: /usr/lib64/libSM.so: undefined reference to 'uuid_unparse_lower@UUID_1.0' /usr/bin/ld: /usr/lib64/libcurl.so: undefined reference to 'SSLv3_client_method@OPENSSL_1_1_0' collect2: error: ld returned 1 exit status gmake[2]: *** [CMakeFiles/line_test_target.dir/build.make:130: line_test_target] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:511: CMakeFiles/line_test_target.dir/all] Error 2 collect2: error: ld returned 1 exit status gmake[2]: *** [CMakeFiles/point_cloud_test_target.dir/build.make:130: point_cloud_test_target] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/point_cloud_test_target.dir/all] Error 2 gmake: *** [Makefile:161: all] Error 2

Failed <<< rviz_rendering [1.15s, exited with code 2] Aborted <<< rcutils [1.63s] Aborted <<< rosidl_typesupport_introspection_cpp [1.03s] Aborted <<< rosidl_generator_c [3.06s]

Summary: 117 packages finished [24.5s] 1 package failed: rviz_rendering 3 packages aborted: rcutils rosidl_generator_c rosidl_typesupport_introspection_cpp 1 package had stderr output: rviz_rendering 182 packages not processed


Originally posted by RobbieTheK on ROS Answers with karma: 43 on 2020-08-14

Post score: 0


Original comments

Comment by gvdhoorn on 2020-08-15:
The pthreads issue could be a red herring.

I'd first solve this:

/usr/local/bin/anaconda3/bin/python: can't find '__main__' module in '/usr/local/bin/anaconda3/lib/python3.7/site-packages/em'

you appear to have Anaconda installed.

Have you made sure pip (invoked via rosdep, but also manually) has installed the dependencies ROS needs for that specific interpreter, instead of your system provided one?

If it hasn't, you basically haven't installed the dependencies.

Comment by RobbieTheK on 2020-08-15:
Updated original post with similar errors even after installing setuptools and pytest-cov

Comment by marguedas on 2020-08-15:
I recently built ROS 2 Foxy on Fedora 32. It looks like you are trying to install ROS 2 Dashing that was released few years ago and was targeting Fedora 30 so maybe that's why you're facing more problems.

What I did to compile Foxy is:

Comment by RobbieTheK on 2020-08-15:
Thanks several packages installed now, but I get a different error updated in the original post. What is Failed <<< cyclonedds

Comment by RobbieTheK on 2020-08-15:
Thanks @marguedas, now getting different errors, I also tried setting -DBUILD_IDLC=OFF in cyclonedds/colcon.pkg per this suggestion, now getting ImportError: cannot import name 'Interpreter' from 'em' (/usr/local/lib/python3.8/site-packages/em/__init__.py)

Comment by RobbieTheK on 2020-08-15:
Any more suggestions?

collect2: error: ld returned 1 exit status
/usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to `EVP_KDF_ctrl@OPENSSL_1_1_1b'
/usr/bin/ld: /usr/lib64/libcurl.so: undefined reference to `SSLv3_client_method@OPENSSL_1_1_0'
/usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to `EVP_KDF_derive@OPENSSL_1_1_1b'
gmake[2]: *** [CMakeFiles/grid_test_target.dir/build.make:130: grid_test_target] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:451: CMakeFiles/grid_test_target.dir/all] Error 2
collect2: error: ld returned 1 exit status
/usr/bin/ld: /usr/lib64/libssh.so.4: undefined reference to `EVP_KDF_CTX_free@OPENSSL_1_1_1b'
gmake[2]: *** [CMakeFiles/movable_text_test_target.dir/build.make:131: movable_text_test_target] Error 1
Failed   <<< rviz_rendering

Comment by Dirk Thomas on 2020-08-17:\

ImportError: cannot import name 'Interpreter' from 'em'

You might have the Python package em installed which has the same namespace as empy which is the packages needed by colcon as well as ROS 2. You need to uninstall em and make sure empy is installed. See https://github.com/colcon/colcon-core/pull/370 for an improved error message in the future.

Comment by RobbieTheK on 2020-08-17:
Thanks @dirk-thomas, that was an issue but now it's all of these undefined reference errors, see the bottom of the original post (click 'more'). Since we have Anaconda Python and Fedora Python, I believe there could be a conflict. I tried upgrading Anaconda Python to 3.8, still same errors. I also tried using -DPYTHON_EXECUTABLE=/usr/local/bin/anaconda3/envs/python38/bin/python -DPYTHON_INCLUDE_DIR=/usr/local/bin/anaconda3/envs/python38/include/python3.8 as well as:

echo $PYTHON_INCLUDE_DIR
/usr/local/bin/anaconda3/envs/python38/include/python3.8
$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Finally I got it going. Here are the work-arounds needed:

-Add the stanza from this repo to ros2.repos.

-Change the option -DBUILD_IDLC=OFF in cyclonedds/colcon.pkg per this suggestion

-Updated $PATH so /usr/bin was first to ensure Fedora's Python 3.8 was used.

Now trying to determine how to install it so multiple users can use the ROS 2 commands. Do the binaries still need to be installed? Will that work on Fedora? They all seem customized for Debian/Ubuntu.


Originally posted by RobbieTheK with karma: 43 on 2020-08-18

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.