lagadic / vrep_ros_bridge

The main application of the plugin is to provide a communication interface between V-Rep and (ROS). The aim is to control the V-Rep simulation externally using ROS messages and ROS services.
Other
64 stars 45 forks source link

catkin_make error when install plugin #49

Closed onlytailei closed 7 years ago

onlytailei commented 8 years ago

Hi, I use Ubuntu 12.04 and Hydro-ros

After the installing of vrep and downloading the vre_ros_pkg, when I catkin_make the catkin_ws, I got this:

In terminal:

CMake Warning (dev) at /opt/ros/hydro/share/roslib/cmake/roslibConfig.cmake:165 (find_package):
  Policy CMP0054 is not set: Only interpret if() arguments as variables or
  keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  Quoted variables like "include" will no longer be dereferenced when the
  policy is set to NEW.  Since the policy is not set the OLD behavior will be
  used.
Call Stack (most recent call first):
  /opt/ros/hydro/share/pluginlib/cmake/pluginlibConfig.cmake:165 (find_package)
  /home/tyler/catkin_ws/devel/share/vrep_ros_plugin/cmake/vrep_ros_pluginConfig.cmake:165 (find_package)
  /opt/ros/hydro/share/catkin/cmake/catkinConfig.cmake:75 (find_package)
  vrep_ros_bridge/rigid_body_handler/CMakeLists.txt:7 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Eigen found (include: /usr/include/eigen3)
-- Configuring incomplete, errors occurred!
See also "/home/tyler/catkin_ws/src/CMakeFiles/CMakeOutput.log".
See also "/home/tyler/catkin_ws/src/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

CMakeError.log:

  1 Determining if the pthread_create exist failed with the following output:
  2 Change Dir: /home/tyler/catkin_ws/src/CMakeFiles/CMakeTmp
  3 
  4 Run Build Command:"/usr/bin/make" "cmTC_186d2/fast"
  5 /usr/bin/make -f CMakeFiles/cmTC_186d2.dir/build.make CMakeFiles/cmTC_186d2.dir/build
  6 make[1]: Entering directory `/home/tyler/catkin_ws/src/CMakeFiles/CMakeTmp'
  7 Building C object CMakeFiles/cmTC_186d2.dir/CheckSymbolExists.c.o
  8 /usr/bin/cc     -o CMakeFiles/cmTC_186d2.dir/CheckSymbolExists.c.o   -c /home/tyler/catkin_ws/src/CMakeFiles/CMakeTmp/CheckSymbolExists.c
  9 Linking C executable cmTC_186d2
 10 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_186d2.dir/link.txt --verbose=1
 11 /usr/bin/cc       CMakeFiles/cmTC_186d2.dir/CheckSymbolExists.c.o  -o cmTC_186d2 -rdynamic
 12 CMakeFiles/cmTC_186d2.dir/CheckSymbolExists.c.o: In function `main':
 13 CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
 14 collect2: ld returned 1 exit status
 15 make[1]: *** [cmTC_186d2] Error 1
 16 make[1]: Leaving directory `/home/tyler/catkin_ws/src/CMakeFiles/CMakeTmp'
 17 make: *** [cmTC_186d2/fast] Error 2
 18 
 19 File /home/tyler/catkin_ws/src/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
 20 /* */
 21 #include <pthread.h>
 22 
 23 int main(int argc, char** argv)
 24 {
 25   (void)argv;
 26 #ifndef pthread_create
 27   return ((int*)(&pthread_create))[argc];
 28 #else
 29   (void)argc;
 30   return 0;
 31 #endif
 32 }
 33 
 34 Determining if the function pthread_create exists in the pthreads failed with the following output:
 35 Change Dir: /home/tyler/catkin_ws/src/CMakeFiles/CMakeTmp
 36 
 37 Run Build Command:"/usr/bin/make" "cmTC_77e8c/fast"
 38 /usr/bin/make -f CMakeFiles/cmTC_77e8c.dir/build.make CMakeFiles/cmTC_77e8c.dir/build
 39 make[1]: Entering directory `/home/tyler/catkin_ws/src/CMakeFiles/CMakeTmp'
 40 Building C object CMakeFiles/cmTC_77e8c.dir/CheckFunctionExists.c.o
 41 /usr/bin/cc    -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_77e8c.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.3/Modules/CheckFunctionExists.c
 42 Linking C executable cmTC_77e8c
 43 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_77e8c.dir/link.txt --verbose=1
 44 /usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTC_77e8c.dir/CheckFunctionExists.c.o  -o cmTC_77e8c -rdynamic -lpthreads
 45 /usr/bin/ld: cannot find -lpthreads
 46 collect2: ld returned 1 exit status
 47 make[1]: *** [cmTC_77e8c] Error 1
 48 make[1]: Leaving directory `/home/tyler/catkin_ws/src/CMakeFiles/CMakeTmp'
 49 make: *** [cmTC_77e8c/fast] Error 2
fspindle commented 8 years ago

As explained in https://github.com/lagadic/vrep_ros_bridge/blob/master/README.md it seems to me that you forgot to:

export VREP_ROOT_DIR=/ChangeWithyourPathToVrep/

in the terminal where you run catkin_make

fabrizioschiano commented 8 years ago

I wanted just to add that you can avoid entering always the export command mentioned by fspindle by putting that command in your bashrc file. In this way the command will be run every time you open a terminal.

To do that, in a terminal you can do: cd gedit .bashrc

Then you can paste in your bashrc file: export VREP_ROOT_DIR=/ChangeWithyourPathToVrep/

For me is something like that: export VREP_ROOT_DIR=/home/fschiano/V-REP_PRO_EDU_V3_2_1_64_Linux

Of course you need to change the previous command according to your path.

onlytailei commented 8 years ago

fabrizioschiano and fsindle, thanks for you replies. I'm sure I have done that. And when I echo $VREP_ROOT_DIR in that terminal, I got the right path. So what should I do?

fspindle commented 8 years ago

In the same terminal run the following commands and give us the full output:

$ ls $VREP_ROOT_DIR/vrep.sh
/home/fspindle/soft/vrep/V-REP_PRO_EDU_V3_2_2_64_Linux/vrep.sh

$ cd ~/catkin_ws/src/vrep_ros_bridge
$ git checkout hydro-devel

$ cd ~/catkin_ws
$ catkin_make --pkg vrep_ros_bridge --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo
onlytailei commented 8 years ago
$ ls $VREP_ROOT_DIR/vrep.sh
/home/tyler/Software/V-REP_PRO_EDU_V3_2_2_64_Linux/vrep.sh

$ cd ~/catkin_ws/src/vrep_ros_bridge
$ git checkout hydro-devel
Already on 'hydro-devel'

$ cd ~/catkin_ws
$ catkin_make --pkg vrep_ros_bridge --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo

still the same error

fspindle commented 8 years ago

Yesterday we introduced changes in hydro-devel branch. Do a git pull, remove build an devel folders and try a new build

jokla commented 8 years ago

Also try to build the first time just with a simple catkin_make cd ~/catkin_ws $ catkin_make