/usr/bin/ld: cannot find -lpthreads
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
add a comment |
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
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 installedlibsuitesparse-dev) i.e.cmake -DBUILD_CSPARSE=ON ..
– steeldriver
Jul 15 '17 at 15:35
add a comment |
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
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
compiling cmake
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 installedlibsuitesparse-dev) i.e.cmake -DBUILD_CSPARSE=ON ..
– steeldriver
Jul 15 '17 at 15:35
add a comment |
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 installedlibsuitesparse-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
add a comment |
2 Answers
2
active
oldest
votes
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
add a comment |
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.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
edited Aug 29 '18 at 4:15
answered Aug 29 '18 at 4:05
AdityaAditya
51447
51447
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Feb 5 at 10:20
Matthias UrlichsMatthias Urlichs
1034
1034
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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