Issue #2059 new
Pei JIA
created an issue

Environment:

OS: Ubuntu 16.04.1 GCC/G++: 5.4.0 CMakeError.log under CMakeFiles gave me the following error message:

Determining if the pthread_create exist failed with the following output:

Change Dir: ....../gazebo/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_7c4e6/fast"
/usr/bin/make -f CMakeFiles/cmTC_7c4e6.dir/build.make CMakeFiles/cmTC_7c4e6.dir/build
make[1]: Entering directory '....../gazebo/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_7c4e6.dir/CheckSymbolExists.c.o
/usr/bin/cc     -o CMakeFiles/cmTC_7c4e6.dir/CheckSymbolExists.c.o   -c ....../gazebo/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_7c4e6
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7c4e6.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTC_7c4e6.dir/CheckSymbolExists.c.o  -o cmTC_7c4e6 -rdynamic 
CMakeFiles/cmTC_7c4e6.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_7c4e6.dir/build.make:97: recipe for target 'cmTC_7c4e6' failed
make[1]: *** [cmTC_7c4e6] Error 1
make[1]: Leaving directory '....../gazebo/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_7c4e6/fast' failed
make: *** [cmTC_7c4e6/fast] Error 2

File ....../gazebo/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: ....../gazebo/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_0da70/fast"
/usr/bin/make -f CMakeFiles/cmTC_0da70.dir/build.make CMakeFiles/cmTC_0da70.dir/build
make[1]: Entering directory '....../gazebo/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_0da70.dir/CheckFunctionExists.c.o
/usr/bin/cc    -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_0da70.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_0da70
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0da70.dir/link.txt --verbose=1
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTC_0da70.dir/CheckFunctionExists.c.o  -o cmTC_0da70 -rdynamic -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_0da70.dir/build.make:97: recipe for target 'cmTC_0da70' failed
make[1]: *** [cmTC_0da70] Error 1
make[1]: Leaving directory '....../gazebo/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_0da70/fast' failed
make: *** [cmTC_0da70/fast] Error 2


Performing C++ SOURCE FILE Test HAVE_ISNAN failed with the following output:
Change Dir: ....../gazebo/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_38373/fast"
/usr/bin/make -f CMakeFiles/cmTC_38373.dir/build.make CMakeFiles/cmTC_38373.dir/build
make[1]: Entering directory '....../gazebo/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_38373.dir/src.cxx.o
/usr/bin/c++     -Wall -Wextra -Wno-long-long -Wno-unused-value -Wfloat-equal -Wshadow -Winit-self -Wswitch-default -Wmissing-include-dirs -pedantic -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -DHAVE_ISNAN   -o CMakeFiles/cmTC_38373.dir/src.cxx.o -c ....../gazebo/build/CMakeFiles/CMakeTmp/src.cxx
In file included from ....../gazebo/build/CMakeFiles/CMakeTmp/src.cxx:1:0:
....../gazebo/build/CMakeFiles/CMakeTmp/src.cxx: In function int main():
....../gazebo/build/CMakeFiles/CMakeTmp/src.cxx:2:13: error: non-floating-point argument in call to function __builtin_isnan
 int main() {isnan(0); return 1;}
             ^
CMakeFiles/cmTC_38373.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_38373.dir/src.cxx.o' failed
make[1]: *** [CMakeFiles/cmTC_38373.dir/src.cxx.o] Error 1
make[1]: Leaving directory '....../gazebo/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_38373/fast' failed
make: *** [cmTC_38373/fast] Error 2

Source file was:
#include <math.h> 
int main() {isnan(0); return 1;}

Comments (4)

  1. Lennon Woo

    Is there any solution related to this issue. I meet almost the same problem. The CMake output seem only hint to check CMakeError.log file

    My CMake then make output as follow:

    -- Gazebo version 9.0.0
    -- High memory tests: enabled
    -- 
    
    ====== Finding 3rd Party Packages ======
    -- Operating system is Linux
    -- Checking for module 'freeimage>=3.9.0'
    --   No package 'freeimage' found
    --   freeimage.pc not found, trying freeimage_include_dir and freeimage_library_dir flags.
    --   Found /usr/include/FreeImage.h
    --   Looking for FreeImage.h - found
    --   Looking for libfreeimage - found
    -- Found Protobuf: /usr/lib/libprotobuf.so;-lpthread (found version "3.5.1") 
    -- HDF5: Using hdf5 compiler wrapper to determine C configuration
    -- HDF5: Using hdf5 compiler wrapper to determine CXX configuration
    -- HDF5 Found
    CMake Warning at cmake/SearchForStuff.cmake:152 (find_package):
      By not providing "FindSimbody.cmake" in CMAKE_MODULE_PATH this project has
      asked CMake to find a package configuration file provided by "Simbody", but
      CMake did not find one.
    
      Could not find a package configuration file provided by "Simbody" with any
      of the following names:
    
        SimbodyConfig.cmake
        simbody-config.cmake
    
      Add the installation prefix of "Simbody" to CMAKE_PREFIX_PATH or set
      "Simbody_DIR" to a directory containing one of the above files.  If
      "Simbody" provides a separate development package or SDK, be sure it has
      been installed.
    Call Stack (most recent call first):
      CMakeLists.txt:147 (include)
    
    
    -- Looking for Simbody - not found
    --  Simbody not found, for simbody physics engine option, please install libsimbody-dev.
    -- Could NOT find DART (missing: DART_DIR)
    -- Looking for DART - not found
    --  DART 6 not found, for dart physics engine option, please install libdart6-dev.
    -- Using system tinyxml.
    -- Using system tinyxml2.
    -- Looking for libtar.h - found
    -- Looking for libtar.so - found
    -- Checking for module 'tbb'
    --   No package 'tbb' found
    -- TBB not found, attempting to detect manually
    -- Checking for modules 'playercore>=3.0;playerc++;playerwkb'
    --   No package 'playercore' found
    --   No package 'playerc++' found
    --   No package 'playerwkb' found
    --  Player not found, gazebo plugin for player will not be built.
    -- Looking for GTS - found
    -- Checking for module 'bullet>=2.82'
    --   No package 'bullet' found
    -- Checking for module 'bullet2.82>=2.82'
    --   No package 'bullet2.82' found
    --  Bullet > 2.82 not found, for bullet physics engine option, please install libbullet2.82-dev.
    -- Looking for libusb-1.0 - found. USB peripherals support enabled.
    -- Checking for module 'OculusVR'
    --   No package 'OculusVR' found
    --  Oculus Rift support will be disabled.
    -- Boost version: 1.66.0
    -- Looking for SDFormat 6 - found
    -- Boost version: 1.66.0
    -- Boost version: 1.66.0
    -- Found the following Boost libraries:
    --   thread
    --   signals
    --   system
    --   filesystem
    --   program_options
    --   regex
    --   iostreams
    --   date_time
    --   chrono
    --   atomic
    -- Looking for dlfcn.h - found
    -- Looking for libdl - found
    -- Could NOT find GDAL (missing: GDAL_LIBRARY GDAL_INCLUDE_DIR) 
    -- Looking for libgdal - not found
    --  GDAL not found, Digital elevation terrains support will be disabled.
    -- Looking for ronn to generate manpages - found
    -- Looking for gzip to generate manpages - found
    -- Looking for libspnav and spnav.h - not found
    -- Looking for uuid - found
    -- Looking for libgraphviz-dev - found
    -- Found Protobuf: /usr/lib/libprotobuf.so;-lpthread;-lpthread (found suitable version "3.5.1", minimum required is "2.3.0") 
    -- Looking for ignition-msgs1-config.cmake - found
    -- Looking for ignition-math4-config.cmake - found
    -- Checking for module 'libzmq >= 4'
    --   Found libzmq , version 4.2.2
    -- Checking for module 'uuid'
    --   Found uuid, version 2.31.1
    -- Looking for ignition-transport4-config.cmake - found
    -- Checking for module 'jsoncpp'
    --   Found jsoncpp, version 1.8.4
    -- Checking for module 'yaml-0.1'
    --   Found yaml-0.1, version 0.1.7
    -- Checking for module 'libzip'
    --   Found libzip, version 1.3.2
    -- Checking for module 'tinyxml2'
    --   Found tinyxml2, version 6.0.0
    -- Looking for dlfcn.h - found
    -- Looking for libdl - found
    -- FreeImage.pc not found, we will search for FreeImage_INCLUDE_DIRS and FreeImage_LIBRARIES
    -- Checking for module 'gts'
    --   Found gts, version 0.7.6
    -- Checking for module 'libswscale'
    --   Found libswscale, version 4.8.100
    -- Checking for module 'libavdevice >= 56.4.100'
    --   Found libavdevice , version 57.10.100
    -- Checking for module 'libavformat'
    --   Found libavformat, version 57.83.100
    -- Checking for module 'libavcodec'
    --   Found libavcodec, version 57.107.100
    -- Checking for module 'libavutil'
    --   Found libavutil, version 55.78.100
    -- Looking for libignition-fuel_tools1 - found
    -- Found Ignition Common
    -- Looking for libosvrClientKit and ClientKit.h - not found
    --  OpenSource Virtual Reality (OSVR) support will be disabled.
    -- Looking for qwt - found: version 6.1.3
    -- ----------------------------------------
    
    -- Looking for display capabilities
    --  + found a display available ($DISPLAY is set)
    --  ! valid dri display not found using pyopengl
    -- Checking gazebo build type
    -- Enable host CFlags
    -- 
    SSE4 disabled.
    
    -- Enable upstream CFlags
    -- Performing Test R-fvisibility=hidden
    -- Performing Test R-fvisibility=hidden - Success
    -- 
    
    ====== Configuring 3rd Party Packages ======
    -- ----------------------------------------
    
    -- BUILD WARNINGS
    --  Simbody not found, for simbody physics engine option, please install libsimbody-dev.
    --  DART 6 not found, for dart physics engine option, please install libdart6-dev.
    --  Player not found, gazebo plugin for player will not be built.
    --  Bullet > 2.82 not found, for bullet physics engine option, please install libbullet2.82-dev.
    --  Oculus Rift support will be disabled.
    --  GDAL not found, Digital elevation terrains support will be disabled.
    --  OpenSource Virtual Reality (OSVR) support will be disabled.
    -- END BUILD WARNINGS
    
    -- Custom CFlags:-pthread     -Wall -Wextra -Wno-long-long -Wno-unused-value -Wfloat-equal -Wshadow -Wswitch-default -Wmissing-include-dirs -pedantic -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11
    -- Build Type: Release
    -- Install path: /usr
    -- tinyxml2_VERSION 6.0.0 >= 6.0.0
    -- Configuration successful. Type make to compile gazebo
    -- Configuring incomplete, errors occurred!
    See also "/tmp/yaourt-tmp-lennon/aur-gazebo/src/gazebo-9.0.0/build/CMakeFiles/CMakeOutput.log".
    See also "/tmp/yaourt-tmp-lennon/aur-gazebo/src/gazebo-9.0.0/build/CMakeFiles/CMakeError.log".
    make: *** [Makefile:8146: cmake_check_build_system] Error 1
    
  2. Lennon Woo

    Hello, Louise.

    My system is Archlinux up-to-date, and I use AUR to install the gazebo.

    Thanks for your hint, after I install the glxinfo and python3-opengl,

    I have installed the package on my machine successful.

  3. Log in to comment