添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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 I'm trying to build geogram in Ami Linux but I'm getting error. Below you will fin the error:

============= Checking for CMake ============

cmake version 3.10.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).
Found CMake

============= Creating makefiles for Linux64-gcc-dynamic-Release ============

-- The C compiler identification is GNU 7.2.1
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring build for standalone Geogram (without Vorpaline)
-- GCC version >= 4.3, activating sign conversion warnings
-- GCC version >= 4.6, activating double promotion warnings
-- Did not find GLFW3 in the system, using built-in GLFW3.
-- Looking for pthread.h
-- Looking for pthread.h - not found
CMake Error at /usr/local/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/usr/local/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.10/Modules/FindThreads.cmake:205 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/lib/third_party/glfw/CMakeLists.txt:70 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/ec2-user/libraries/geogram/build/Linux64-gcc-dynamic-Release/CMakeFiles/CMakeOutput.log".
See also "/home/ec2-user/libraries/geogram/build/Linux64-gcc-dynamic-Release/CMakeFiles/CMakeError.log".

============= Creating makefiles for Linux64-gcc-dynamic-Debug ============

-- The C compiler identification is GNU 7.2.1
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring build for standalone Geogram (without Vorpaline)
-- GCC version >= 4.3, activating sign conversion warnings
-- GCC version >= 4.6, activating double promotion warnings
-- Did not find GLFW3 in the system, using built-in GLFW3.
-- Looking for pthread.h
-- Looking for pthread.h - not found
CMake Error at /usr/local/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
/usr/local/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.10/Modules/FindThreads.cmake:205 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/lib/third_party/glfw/CMakeLists.txt:70 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/ec2-user/libraries/geogram/build/Linux64-gcc-dynamic-Debug/CMakeFiles/CMakeOutput.log".
See also "/home/ec2-user/libraries/geogram/build/Linux64-gcc-dynamic-Debug/CMakeFiles/CMakeError.log".

============== Geogram build configured ==================

To build geogram:

  • go to build/Linux64-gcc-dynamic-Release or build/Linux64-gcc-dynamic-Debug
  • run 'make' or 'cmake --build .'
  • Note: local configuration can be specified in CMakeOptions.txt
    (see CMakeOptions.txt.sample for an example)
    You'll need to re-run configure.sh if you create or modify CMakeOptions.txt

    I think you need to install libpthread (it should be sudo apt-get install libpthread-stubs0-dev )
    Also pay attention to this line

    -- The C compiler identification is GNU 7.2.1
    -- The CXX compiler identification is GNU 4.8.5
    

    It seems like you have different versions installed for the c and c++ compiler. You may need to install g++7 to use the same version for c and c++

    I updated c++ and I can confirm that libpthread-stubs is installed. I'm using Ami Linux for this.
    If you see this line:
    Did not find GLFW3 in the system, using built-in GLFW3
    It says that it can't find GLFW3, I can confirm that GLFW3 is installed without any error.

    ============= Checking for CMake ============
    cmake version 3.11.0
    CMake suite maintained and supported by Kitware (kitware.com/cmake).
    Found CMake
    ============= Creating makefiles for Linux64-gcc-dynamic-Release ============
    -- Configuring build for standalone Geogram (without Vorpaline)
    -- GCC version >= 4.3, activating sign conversion warnings
    -- GCC version >= 4.6, activating double promotion warnings
    -- Did not find GLFW3 in the system, using built-in GLFW3.
    CMake Error at /usr/local/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
      Could NOT find Threads (missing: Threads_FOUND)
    Call Stack (most recent call first):
      /usr/local/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
      /usr/local/share/cmake-3.11/Modules/FindThreads.cmake:205 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
      src/lib/third_party/glfw/CMakeLists.txt:70 (find_package)
    -- Configuring incomplete, errors occurred!
    See also "/home/ec2-user/libraries/geogram/CMakeFiles/CMakeOutput.log".
    See also "/home/ec2-user/libraries/geogram/CMakeFiles/CMakeError.log".
    ============= Creating makefiles for Linux64-gcc-dynamic-Debug ============
    -- Configuring build for standalone Geogram (without Vorpaline)
    -- GCC version >= 4.3, activating sign conversion warnings
    -- GCC version >= 4.6, activating double promotion warnings
    -- Did not find GLFW3 in the system, using built-in GLFW3.
    CMake Error at /usr/local/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
      Could NOT find Threads (missing: Threads_FOUND)
    Call Stack (most recent call first):
      /usr/local/share/cmake-3.11/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
      /usr/local/share/cmake-3.11/Modules/FindThreads.cmake:205 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
      src/lib/third_party/glfw/CMakeLists.txt:70 (find_package)
    -- Configuring incomplete, errors occurred!
    See also "/home/ec2-user/libraries/geogram/CMakeFiles/CMakeOutput.log".
    See also "/home/ec2-user/libraries/geogram/CMakeFiles/CMakeError.log".
    ============== Geogram build configured ==================
    To build geogram:
      - go to build/Linux64-gcc-dynamic-Release or build/Linux64-gcc-dynamic-Debug
      - run 'make' or 'cmake --build .'
    Note: local configuration can be specified in CMakeOptions.txt
    (see CMakeOptions.txt.sample for an example)
    You'll need to re-run configure.sh if you create or modify CMakeOptions.txt
              

    libpthread.so :

    /var/lib/docker/overlay2/c2a718a936105a3f3adfbd51fe6121df428cb6216e088aa215153a92dfffd393/diff/usr/lib/x86_64-linux-gnu/libpthread.so
    /var/lib/docker/overlay2/e49b8aebcd3e79a3b3655ae86303e4b5cc34257581d439263f6217ec8d07a4c2/merged/usr/lib/x86_64-linux-gnu/libpthread.so
    /var/lib/docker/overlay2/c2734637d0a5954b594b92f02854a21eb50707a40da798997e8047130530e900/diff/usr/libx32/libpthread.so
    /var/lib/docker/overlay2/c2734637d0a5954b594b92f02854a21eb50707a40da798997e8047130530e900/diff/usr/lib/x86_64-linux-gnu/libpthread.so
    /var/lib/docker/overlay2/c2734637d0a5954b594b92f02854a21eb50707a40da798997e8047130530e900/diff/usr/lib32/libpthread.so
    /usr/lib64/libpthread.so
    

    pthread.h :

    /var/lib/docker/overlay2/c2a718a936105a3f3adfbd51fe6121df428cb6216e088aa215153a92dfffd393/diff/usr/include/pthread.h
    /var/lib/docker/overlay2/e49b8aebcd3e79a3b3655ae86303e4b5cc34257581d439263f6217ec8d07a4c2/merged/usr/include/pthread.h
    /var/lib/docker/overlay2/c2734637d0a5954b594b92f02854a21eb50707a40da798997e8047130530e900/diff/usr/include/pthread.h
    /usr/include/pthread.h
    /usr/x86_64-w64-mingw32/sys-root/mingw/include/pthread.h
      simonrp84, mojovski, siquike, orenyomtov, Gigahawk, mkhairy, marinerain, tomilov, lwesiers, rAm1n, and 14 more reacted with thumbs up emoji
      YusufSuleman reacted with thumbs down emoji
          All reactions
              

    I'm having this issue too. Edit: Solved it by including this in the top-level CMakeLists.txt:

    set(CMAKE_THREAD_LIBS_INIT "-lpthread")
    set(CMAKE_HAVE_THREADS_LIBRARY 1)
    set(CMAKE_USE_WIN32_THREADS_INIT 0)
    set(CMAKE_USE_PTHREADS_INIT 1)
    set(THREADS_PREFER_PTHREAD_FLAG ON)

    Found this suggestion in another forum somewhere.

    jayanshu-gundaniya, AaronChan906, JellyBrick, afernandezody, Chanchanhan, one-and-only, mr-sobol, MiguelBtt, s-ansa, hacker1024, and 71 more reacted with thumbs up emoji maykulkarni, sujit-dn, iguqur, VanHoevenTR, OwlOfFortune, deansmile, HansBambel, bjajoh, hammersmith-xie, marcogmaia, and 17 more reacted with heart emoji quocnhat, OwlOfFortune, bjajoh, deansmile, jingpengw, Oxymore-coder, shrihanDev, tdrps, hujimei, and gagankonana reacted with rocket emoji Newbytee, Oxymore-coder, shrihanDev, and hujimei reacted with eyes emoji All reactions

    I'm having this issue too. Edit: Solved it by including this in the top-level CMakeLists.txt:

    set(CMAKE_THREAD_LIBS_INIT "-lpthread")
    set(CMAKE_HAVE_THREADS_LIBRARY 1)
    set(CMAKE_USE_WIN32_THREADS_INIT 0)
    set(CMAKE_USE_PTHREADS_INIT 1)
    set(THREADS_PREFER_PTHREAD_FLAG ON)

    Found this suggestion in another forum somewhere.

    that is cool, fix for me. Thank you

    I'm having this issue too. Edit: Solved it by including this in the top-level CMakeLists.txt:

    set(CMAKE_THREAD_LIBS_INIT "-lpthread")
    set(CMAKE_HAVE_THREADS_LIBRARY 1)
    set(CMAKE_USE_WIN32_THREADS_INIT 0)
    set(CMAKE_USE_PTHREADS_INIT 1)
    set(THREADS_PREFER_PTHREAD_FLAG ON)

    Found this suggestion in another forum somewhere.

    Unfortunately this trick is not applicable to every environment. I do not build geogram, but I encountered the missing pthread functions during linking. It worked while building with CMake cross compilation an armhf target in Debian 10 and same sources fail in Arch Linux. So the trick is nice, but there are corner cases which fails. It seems that compilers or CMake have trouble with -pthreads flag. It seems that pthread shared objects are symlinked differently in every system, breaking builds. Unfortunatelly the only fix I managed to see working everywhere is linking straight to the SO file with absolute path. Something like this in CMake:

    TARGET_LINK_LIBRARIES(my_target
    #	${CMAKE_THREAD_LIBS_INIT} # FAILS
    #	/opt/cross-toolchains/arm-linux-gnueabihf/lib/libpthread.so # FAILS
    	/opt/cross-toolchains/arm-linux-gnueabihf/lib/libpthread-2.28.so # WORKS
    #	/opt/cross-toolchains/arm-linux-gnueabihf/lib/libpthread.so.0 # FAILS
    

    Where libpthread-2.28.so is the SO and libpthread.so is symlink to libpthread.so.0 which in turns is symlink to libpthread-2.28.so:

    /opt/cross-toolchains/arm-linux-gnueabihf/lib/libpthread-2.28.so
    /opt/cross-toolchains/arm-linux-gnueabihf/lib/libpthread.so -> libpthread.so.0
    /opt/cross-toolchains/arm-linux-gnueabihf/lib/libpthread.so.0 -> libpthread-2.28.so
              

    @tkircher, I'm installing the librealsense package from source using HomeBrew and got the below error.

    CMake Error at /opt/homebrew/Cellar/cmake/3.20.5/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
    Could NOT find Threads (missing: Threads_FOUND)
    Call Stack (most recent call first):
    /opt/homebrew/Cellar/cmake/3.20.5/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
    /opt/homebrew/Cellar/cmake/3.20.5/share/cmake/Modules/FindThreads.cmake:238 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
    examples/measure/CMakeLists.txt:9 (find_package)

    I tried updating the config in the CMakeLists.txt like you mentioned above but see that there are multiple CMakeLists.txt files in the package hierarchy. Which file do I make the changes to?

    Also, I installed using 'brew install --build-from-source librealsense' as I was getting the following error with 'brew install'

    'Error: librealsense: no bottle available!'

    Update: The issue is fixed