Giter Site home page Giter Site logo

Comments (20)

rhr avatar rhr commented on September 6, 2024 2

cmake creates a file CMakeFiles/bamm.dir/link.txt in the build directory that contains the final linking command. Change '-lpthread' to '-pthread' in this file and re-run the command to build a working binary. This worked for me on Ubuntu 14.04.

from bamm.

redcurry avatar redcurry commented on September 6, 2024

Hello,

We found this problem as well yesterday and I'm working on a solution. C++11 threads requires that the pthread library also be linked. The following will solve the problem, but I'm working on a more permanent solution:

SET(CMAKE_EXE_LINKER_FLAGS "-pthread")

from bamm.

tony-travis avatar tony-travis commented on September 6, 2024

Hi,

Just tried that too, and rebuilt "bamm" from scratch, but didn't WFM:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f27da2..ed40faa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@ IF(NOT WIN32)
   IF(APPLE AND (${CMAKE_CXX_COMPILER_ID} MATCHES Clang))
       SET(CXX_LANGUAGE_FLAGS "-std=c++11 -stdlib=libc++")
       SET(CXX_ARCHITECTURE_FLAGS "-arch x86_64")
-      SET(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++")
+      SET(CMAKE_EXE_LINKER_FLAGS "-pthread")
   ENDIF(APPLE AND (${CMAKE_CXX_COMPILER_ID} MATCHES Clang))
 ELSE(NOT WIN32)
   SET(CXX_WARNING_FLAGS "/W4")

from bamm.

tony-travis avatar tony-travis commented on September 6, 2024

Sorry, closed by accident(!)

from bamm.

redcurry avatar redcurry commented on September 6, 2024

Hello,

I've updated the CMake configuration file to find pthreads and link it. Please pull again from GitHub and let me know if it works now. Let me know which compiler you're using if it doesn't work. I tested it on g++ version 4.8.0. Thanks!

from bamm.

tony-travis avatar tony-travis commented on September 6, 2024

Hi,

Just re-cloned "bamm" from GitHub and rebuilt, but the same error as before - Not surprising, really, because I already tried the same edit manually ;-)

I'm using:
root@wildcat:/usr/local/src/bioinformatics/BAMM/bamm/build# g++ --version
g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2

Thanks for looking into the problem,

Tony.

from bamm.

redcurry avatar redcurry commented on September 6, 2024

Let's see if it's a CMake problem or something else... In an empty "build" directory, compile bamm manually (without CMake):

g++ -DBAMM_VERSION=\"1.0\" -DBAMM_VERSION_DATE=\"1\" -DGIT_COMMIT_ID=\"0\" -pthread -std=c++11 -o bamm ../src/*.cpp

It should take less than a minute to compile and produce a single executable program named bamm. Try running it with data and let me know if that works.

Thanks.

from bamm.

tony-travis avatar tony-travis commented on September 6, 2024

OK, that works :-)

Thanks,

Tony.

from bamm.

redcurry avatar redcurry commented on September 6, 2024

That's great. I'm not entirely sure, yet, why running CMake didn't work. I've made some changes to the CMakeLists.txt file. Do you mind pulling again, compiling using CMake, then running bamm?

Thanks.

from bamm.

tony-travis avatar tony-travis commented on September 6, 2024

Hi,

I did a new "git clone", but I got the same problem running "bamm" as before:

terminate called after throwing an instance of 'std::system_error'
  what():  Enable multithreading to use std::thread: Operation not permitted
Aborted

Bye,

Tony.

from bamm.

redcurry avatar redcurry commented on September 6, 2024

I'm still not sure what the problem is, and I cannot replicate this error on my computer (also running GCC 4.8.2), but this link may provide an answer: http://stackoverflow.com/questions/20568235/using-c11-multithreading-in-shared-library-loaded-by-programm-without-thread-s (look at checked answer).

from bamm.

blackrim avatar blackrim commented on September 6, 2024

I am getting the same problem here. Clean everything and same error
terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted
Aborted (core dumped)
Tried manual pthread linking and all that. No luck
This does work on the recent debian so this is an ubuntu problem.

from bamm.

tony-travis avatar tony-travis commented on September 6, 2024

On 02/10/14 01:09, Stephen Smith wrote:

I am getting the same problem here. Clean everything and same error
terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted
Aborted (core dumped)
Tried manual pthread linking and all that. No luck
This does work on the recent debian so this is an ubuntu problem.

Hi, Stephen.

Looks like a "cmake" problem, really, because the program compiles and
runs properly without using "cmake". We are running the binary OK now.

Bye,

Tony.

Minke Informatics Limited, Registered in Scotland - Company No. SC419028
Registered Office: 3 Donview, Bridge of Alford AB33 8QJ, Scotland (UK)
tel. +44(0)19755 63548 http://minke-informatics.co.uk
mob. +44(0)7985 078324 mailto:[email protected]

from bamm.

blackrim avatar blackrim commented on September 6, 2024

Thanks Tony, you are correct that worked fine.

from bamm.

paternogbc avatar paternogbc commented on September 6, 2024

Hi I am running bamm in Ubuntu 14 LTS and I am facing the same problem.
I tried the solution proposed: "
g++ -DBAMM_VERSION="1.0" -DBAMM_VERSION_DATE="1" -DGIT_COMMIT_ID="0" -pthread -std=c++11 -o bamm ../src/*.cpp"

and it works, however it seems to take much longer when compared with an similar windows computer. Any suggestion?

Thanks in advance,
Gustavo

from bamm.

mkandziora avatar mkandziora commented on September 6, 2024

I just compiled the version 2.5 on ubuntu 14.04 and run into this issue:
terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted

the above mentioned solution of rhr solved the issue.

from bamm.

loloNC avatar loloNC commented on September 6, 2024

Hi everyone,

I am very novice with the use of linux. I work since a week on ubuntu 14.04.
I installed bamm and had the same problem when running an analysis (with the same error message as above :
terminate called after throwing an instance of 'std::system_error', what(): Enable multithreading to use std::thread: Operation not permitted, Aborted)

I attempted to use the solution proposed by rhr. But apparently I haven't done properly the manipulation under the shell, because :

  1. bamm still doesn't work (I get the same error message when running analyses)
  2. when I re-open the file CMakeFiles/bamm.dir/link.txt
    the '-lpthread' reappeared even if I changed it previously by '-pthread' (just before running the cmake .. command)

Could you explain me step by step what I have to do in the shell to solve this problem.

Thank you in advances

from bamm.

Bisaloo avatar Bisaloo commented on September 6, 2024

The solution proposed by rhr works for me as well.

@loloNC : you are not supposed to re-run cmake ... Edit the file, then run cmake -j and it should work.

from bamm.

paternogbc avatar paternogbc commented on September 6, 2024

Just instaled BAMM v2.5 and it is working very nice on Ubuntu 16.04.

Instaled from source with the following commands:

git clone https://github.com/macroevolution/bamm.git
mkdir build
cd build
cmake ..
make -j
sudo make install

from bamm.

sjackman avatar sjackman commented on September 6, 2024

@tmozgach resolved this issue with Linuxbrew and Homebrew/science in PR https://github.com/Homebrew/homebrew-science/pull/5832
If you're encountering this issue, you may wish to consider installing bamm using Linuxbrew
See http://linuxbrew.sh for Linuxbrew installation instructions then run

brew install homebrew/science/bamm

from bamm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.