/usr/bin/ld: cannot find -lpthreads












0















I am trying to compile the code provided here, but I am stuck when trying to run the command cmake ..



When running this command a lot of stuff is output to the screen and one of those things are those lines:



CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
G2O_EXT_CSPARSE


and also



-- Configuring incomplete, errors occurred!
See also "/home/yalishanda/Downloads/lsd_slam_noros-master/build/CMakeFiles/CMakeOutput.log".
See also "/home/yalishanda/Downloads/lsd_slam_noros-master/build/CMakeFiles/CMakeError.log".


So when doing cat of CMakeError.log I can see among many other things this:



/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_792f7.dir/build.make:97: recipe for target 'cmTC_792f7' failed


I already installed pthreads using:



 sudo apt-get install libpthread-stubs0-dev


which even returned:



Reading package lists... Done
Building dependency tree
Reading state information... Done
libpthread-stubs0-dev is already the newest version (0.3-4).
The following package was automatically installed and is no longer required:
snap-confine
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.


So this shouldn't be the issue I think, yet the error output file complains about this.



I also already read 2 other posts on SE related to this kind of errors, but they didn't solve my issue.



Could someobody explain what I am doing incorrectly?










share|improve this question























  • Did you build and install the G2O General Graph Optimization library as indicated in the instructions? I think that's a far bigger part of your issue than pthreads

    – steeldriver
    Jul 15 '17 at 12:10











  • @steeldriver yes I did, by following this tutorial: sayantanfoto.blogspot.be/2015/06/installing-g2o-on-ubuntu.html What do you think may be the issue?

    – LandonZeKepitelOfGreytBritn
    Jul 15 '17 at 12:51











  • I'm not sure - what version of Ubuntu are you running?

    – steeldriver
    Jul 15 '17 at 13:04











  • @steeldriver I am running ubuntu 16.04 LTS

    – LandonZeKepitelOfGreytBritn
    Jul 15 '17 at 15:27











  • It looks like you may need to configure g2o to build the local sparse matrix support as well (regardless of whether you installed libsuitesparse-dev) i.e. cmake -DBUILD_CSPARSE=ON ..

    – steeldriver
    Jul 15 '17 at 15:35
















0















I am trying to compile the code provided here, but I am stuck when trying to run the command cmake ..



When running this command a lot of stuff is output to the screen and one of those things are those lines:



CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
G2O_EXT_CSPARSE


and also



-- Configuring incomplete, errors occurred!
See also "/home/yalishanda/Downloads/lsd_slam_noros-master/build/CMakeFiles/CMakeOutput.log".
See also "/home/yalishanda/Downloads/lsd_slam_noros-master/build/CMakeFiles/CMakeError.log".


So when doing cat of CMakeError.log I can see among many other things this:



/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_792f7.dir/build.make:97: recipe for target 'cmTC_792f7' failed


I already installed pthreads using:



 sudo apt-get install libpthread-stubs0-dev


which even returned:



Reading package lists... Done
Building dependency tree
Reading state information... Done
libpthread-stubs0-dev is already the newest version (0.3-4).
The following package was automatically installed and is no longer required:
snap-confine
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.


So this shouldn't be the issue I think, yet the error output file complains about this.



I also already read 2 other posts on SE related to this kind of errors, but they didn't solve my issue.



Could someobody explain what I am doing incorrectly?










share|improve this question























  • Did you build and install the G2O General Graph Optimization library as indicated in the instructions? I think that's a far bigger part of your issue than pthreads

    – steeldriver
    Jul 15 '17 at 12:10











  • @steeldriver yes I did, by following this tutorial: sayantanfoto.blogspot.be/2015/06/installing-g2o-on-ubuntu.html What do you think may be the issue?

    – LandonZeKepitelOfGreytBritn
    Jul 15 '17 at 12:51











  • I'm not sure - what version of Ubuntu are you running?

    – steeldriver
    Jul 15 '17 at 13:04











  • @steeldriver I am running ubuntu 16.04 LTS

    – LandonZeKepitelOfGreytBritn
    Jul 15 '17 at 15:27











  • It looks like you may need to configure g2o to build the local sparse matrix support as well (regardless of whether you installed libsuitesparse-dev) i.e. cmake -DBUILD_CSPARSE=ON ..

    – steeldriver
    Jul 15 '17 at 15:35














0












0








0








I am trying to compile the code provided here, but I am stuck when trying to run the command cmake ..



When running this command a lot of stuff is output to the screen and one of those things are those lines:



CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
G2O_EXT_CSPARSE


and also



-- Configuring incomplete, errors occurred!
See also "/home/yalishanda/Downloads/lsd_slam_noros-master/build/CMakeFiles/CMakeOutput.log".
See also "/home/yalishanda/Downloads/lsd_slam_noros-master/build/CMakeFiles/CMakeError.log".


So when doing cat of CMakeError.log I can see among many other things this:



/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_792f7.dir/build.make:97: recipe for target 'cmTC_792f7' failed


I already installed pthreads using:



 sudo apt-get install libpthread-stubs0-dev


which even returned:



Reading package lists... Done
Building dependency tree
Reading state information... Done
libpthread-stubs0-dev is already the newest version (0.3-4).
The following package was automatically installed and is no longer required:
snap-confine
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.


So this shouldn't be the issue I think, yet the error output file complains about this.



I also already read 2 other posts on SE related to this kind of errors, but they didn't solve my issue.



Could someobody explain what I am doing incorrectly?










share|improve this question














I am trying to compile the code provided here, but I am stuck when trying to run the command cmake ..



When running this command a lot of stuff is output to the screen and one of those things are those lines:



CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
G2O_EXT_CSPARSE


and also



-- Configuring incomplete, errors occurred!
See also "/home/yalishanda/Downloads/lsd_slam_noros-master/build/CMakeFiles/CMakeOutput.log".
See also "/home/yalishanda/Downloads/lsd_slam_noros-master/build/CMakeFiles/CMakeError.log".


So when doing cat of CMakeError.log I can see among many other things this:



/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_792f7.dir/build.make:97: recipe for target 'cmTC_792f7' failed


I already installed pthreads using:



 sudo apt-get install libpthread-stubs0-dev


which even returned:



Reading package lists... Done
Building dependency tree
Reading state information... Done
libpthread-stubs0-dev is already the newest version (0.3-4).
The following package was automatically installed and is no longer required:
snap-confine
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.


So this shouldn't be the issue I think, yet the error output file complains about this.



I also already read 2 other posts on SE related to this kind of errors, but they didn't solve my issue.



Could someobody explain what I am doing incorrectly?







compiling cmake






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 15 '17 at 11:30









LandonZeKepitelOfGreytBritnLandonZeKepitelOfGreytBritn

1631112




1631112













  • Did you build and install the G2O General Graph Optimization library as indicated in the instructions? I think that's a far bigger part of your issue than pthreads

    – steeldriver
    Jul 15 '17 at 12:10











  • @steeldriver yes I did, by following this tutorial: sayantanfoto.blogspot.be/2015/06/installing-g2o-on-ubuntu.html What do you think may be the issue?

    – LandonZeKepitelOfGreytBritn
    Jul 15 '17 at 12:51











  • I'm not sure - what version of Ubuntu are you running?

    – steeldriver
    Jul 15 '17 at 13:04











  • @steeldriver I am running ubuntu 16.04 LTS

    – LandonZeKepitelOfGreytBritn
    Jul 15 '17 at 15:27











  • It looks like you may need to configure g2o to build the local sparse matrix support as well (regardless of whether you installed libsuitesparse-dev) i.e. cmake -DBUILD_CSPARSE=ON ..

    – steeldriver
    Jul 15 '17 at 15:35



















  • Did you build and install the G2O General Graph Optimization library as indicated in the instructions? I think that's a far bigger part of your issue than pthreads

    – steeldriver
    Jul 15 '17 at 12:10











  • @steeldriver yes I did, by following this tutorial: sayantanfoto.blogspot.be/2015/06/installing-g2o-on-ubuntu.html What do you think may be the issue?

    – LandonZeKepitelOfGreytBritn
    Jul 15 '17 at 12:51











  • I'm not sure - what version of Ubuntu are you running?

    – steeldriver
    Jul 15 '17 at 13:04











  • @steeldriver I am running ubuntu 16.04 LTS

    – LandonZeKepitelOfGreytBritn
    Jul 15 '17 at 15:27











  • It looks like you may need to configure g2o to build the local sparse matrix support as well (regardless of whether you installed libsuitesparse-dev) i.e. cmake -DBUILD_CSPARSE=ON ..

    – steeldriver
    Jul 15 '17 at 15:35

















Did you build and install the G2O General Graph Optimization library as indicated in the instructions? I think that's a far bigger part of your issue than pthreads

– steeldriver
Jul 15 '17 at 12:10





Did you build and install the G2O General Graph Optimization library as indicated in the instructions? I think that's a far bigger part of your issue than pthreads

– steeldriver
Jul 15 '17 at 12:10













@steeldriver yes I did, by following this tutorial: sayantanfoto.blogspot.be/2015/06/installing-g2o-on-ubuntu.html What do you think may be the issue?

– LandonZeKepitelOfGreytBritn
Jul 15 '17 at 12:51





@steeldriver yes I did, by following this tutorial: sayantanfoto.blogspot.be/2015/06/installing-g2o-on-ubuntu.html What do you think may be the issue?

– LandonZeKepitelOfGreytBritn
Jul 15 '17 at 12:51













I'm not sure - what version of Ubuntu are you running?

– steeldriver
Jul 15 '17 at 13:04





I'm not sure - what version of Ubuntu are you running?

– steeldriver
Jul 15 '17 at 13:04













@steeldriver I am running ubuntu 16.04 LTS

– LandonZeKepitelOfGreytBritn
Jul 15 '17 at 15:27





@steeldriver I am running ubuntu 16.04 LTS

– LandonZeKepitelOfGreytBritn
Jul 15 '17 at 15:27













It looks like you may need to configure g2o to build the local sparse matrix support as well (regardless of whether you installed libsuitesparse-dev) i.e. cmake -DBUILD_CSPARSE=ON ..

– steeldriver
Jul 15 '17 at 15:35





It looks like you may need to configure g2o to build the local sparse matrix support as well (regardless of whether you installed libsuitesparse-dev) i.e. cmake -DBUILD_CSPARSE=ON ..

– steeldriver
Jul 15 '17 at 15:35










2 Answers
2






active

oldest

votes


















0














This error may related with linking of library. I was facing the same issue but installing build-essential package solved the problem.
Try apt-get install build-essential






share|improve this answer

































    0














    This appears to be a long-standing CMake bug. Something else is going wrong, CMake gets confused, and reports this spurious problem instead of the real error.



    Look for "thread" in your CMakeLists.txt file and temporarily remove that.






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f936402%2fusr-bin-ld-cannot-find-lpthreads%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      This error may related with linking of library. I was facing the same issue but installing build-essential package solved the problem.
      Try apt-get install build-essential






      share|improve this answer






























        0














        This error may related with linking of library. I was facing the same issue but installing build-essential package solved the problem.
        Try apt-get install build-essential






        share|improve this answer




























          0












          0








          0







          This error may related with linking of library. I was facing the same issue but installing build-essential package solved the problem.
          Try apt-get install build-essential






          share|improve this answer















          This error may related with linking of library. I was facing the same issue but installing build-essential package solved the problem.
          Try apt-get install build-essential







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 29 '18 at 4:15

























          answered Aug 29 '18 at 4:05









          AdityaAditya

          51447




          51447

























              0














              This appears to be a long-standing CMake bug. Something else is going wrong, CMake gets confused, and reports this spurious problem instead of the real error.



              Look for "thread" in your CMakeLists.txt file and temporarily remove that.






              share|improve this answer




























                0














                This appears to be a long-standing CMake bug. Something else is going wrong, CMake gets confused, and reports this spurious problem instead of the real error.



                Look for "thread" in your CMakeLists.txt file and temporarily remove that.






                share|improve this answer


























                  0












                  0








                  0







                  This appears to be a long-standing CMake bug. Something else is going wrong, CMake gets confused, and reports this spurious problem instead of the real error.



                  Look for "thread" in your CMakeLists.txt file and temporarily remove that.






                  share|improve this answer













                  This appears to be a long-standing CMake bug. Something else is going wrong, CMake gets confused, and reports this spurious problem instead of the real error.



                  Look for "thread" in your CMakeLists.txt file and temporarily remove that.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 5 at 10:20









                  Matthias UrlichsMatthias Urlichs

                  1034




                  1034






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f936402%2fusr-bin-ld-cannot-find-lpthreads%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Questions related to Moebius Transform of Characteristic Function of the Primes

                      List of scandals in India

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?