LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cannot find pthread in ubuntu 14.04 (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-find-pthread-in-ubuntu-14-04-a-4175510166/)

Imani1 07-04-2014 08:32 PM

Cannot find pthread in ubuntu 14.04
 
I am trying to install a program TRIQS in a 32-bit Pentium 4 Ubuntu14.04 system;
In course of the compilation I ran into the error "lpthreads not found"
I then copied "liblpthread.a" and "libpthread.so" from /usr/libx32 into usr/bin still the program doe not compile as it cannot find pthread(see error log below).

Please help as I am in dire need.
Thanks in anticipation


/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2882036904.dir/link.txt --verbose=1
/usr/bin/gcc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec2882036904.dir/CheckFunctionExists.c.o -o cmTryCompileExec2882036904 -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: Leaving directory `/home/enukpere/src/triqs/build/src/CMakeFiles/CMakeTmp'
make[1]: *** [cmTryCompileExec2882036904] Error 1
make: *** [cmTryCompileExec2882036904/fast] Error 2

zunke 07-04-2014 08:46 PM

Note that error : "cannot find -lpthreads" not "cannot find -lpthread"

Imani1 07-05-2014 07:25 AM

ZUNKE, ThanKs for the correction but I am yet to receive a solution. Do you have a solution to the problem "-lpthreads" not found?

btmiller 07-05-2014 10:14 AM

Libraries belong in a lib directory, not in a bin directory (the system is configured to look for them there), so moving a library into /usr/bin is rather pointless.

I can't find any reference to a "libpthreads" anywhere except asa component to libevent. I wonder if this isn't just a typo in the Makefile of the program you're trying to compile. I wonder if you edit the makefile and change "-lpthreads" to "-lpthread" it will suddenly work. I note the argument "-DCHECK_FUNCTION_EXISTS=pthread_create", and pthread_create is a part of libpthread.

Does the TRIQS software have any documentation regarding necessary prerequisites? Sometimes library names change over the years, so if it was written on an older Linux OS it's possible that this could be a source of confusion,

Imani1 07-15-2014 09:53 PM

In connection wth the issue of not finding pthread I read somewhere that I should export libpthread.a from the directory libx32 to where it can be seen by usr/bin/ld.
The question is how do I perform the export?
Please help I need to install the proyram for my thesis.


All times are GMT -5. The time now is 10:56 PM.