where I can find pthreads for linux - linux

Ok. My last question will be downvoted for spell error. Ok. But I really have not pthreads in my system.
My system :
Linux vps-sohoportal.hspheredns.com 2.6.18-294.26.1.el5.lve0.8.18xen #1 SMP Thu Feb 24 12:15:18 EET 2011 x86_64 x86_64 x86_64 GNU/Linux
when I try to cinfigure sphinx have error:
configuring Sphinx
checking for CFLAGS needed for pthreads...
checking for LIBS needed for pthreads...
checking for pthreads... configure: error: no working pthreads library found
Please Help

Find the pthread-stubs package of your distribution. Check in your package manager.
If you can't find it, it should be shipped with your compiler.

Related

cannot execute binary file: Exec format error for a binary compiled in WSL environment

I have recently started working on WSL environment.
I have compiled one program in WSL environment which is of type "ELF 64-bit LSB shared object" but when I try to run it in the same environment, it throws an error "cannot execute binary file: Exec format error".
I am not sure about what I am missing here. How can I run the binary.
Kindly suggest.
kshitij#APL-5CD010D2WP:~/runtime/bin$ ioc_broker &
[1] 3579
kshitij#APL-5CD010D2WP:~/runtime/bin$ bash: /bin/ioc_broker: cannot execute binary file: Exec format error
^C
[1]+ Exit 126 ioc_broker
kshitij#APL-5CD010D2WP:~/runtime/bin$ file ioc_broker
ioc_broker: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=aa1e76d798d46d45f131cb53de8f947ddb4c8526, for GNU/Linux 3.2.0, not stripped
kshitij#APL-5CD010D2WP:~/runtime/bin$ uname -srv
Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022
kshitij#APL-5CD010D2WP:~/runtime/bin$
kshitij#APL-5CD010D2WP:/mnt/d/src/myproject/build$ uname -a
Linux APL-5CD010D2WP 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
I have compiled the binary using cmake in which I have specified nothing specific about comiler being used.
kshitij#APL-5CD010D2WP:/mnt/d/src/myproject/build$ cmake -DCMAKE_INSTALL_PREFIX=/home/kshitij/runtime ..
-- The CXX compiler identification is GNU 9.4.0
-- Check for working CXX compiler: /bin/c++
-- Check for working CXX compiler: /bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Line: 57 Using COMMON_API_VERSION 3.1.12
uname -srv
Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022
Try uname -a instead. It should identify the kernel as either i686 or x86_64.
I expect that your kernel says i686, in which case you've installed a 32-bit WSL2 and are trying to run a 64-bit binary on it. That doesn't work for obvious reason -- you need a 64-bit kernel to run 64-bit binaries.
Update:
I see x86_64
Ok, my guess was wrong. The other reason for Exec format error is that the file is corrupt in some way.
One possible source of corruption is if you run out of disk space and the file is truncated. Check df -h . output and if there is a lot of space, try rebuilding the binary again.
Also try eu-readelf -a ioc_broker -- eu-readelf is good at warning about corrupt ELF files.
Finally, look in /var/log/messages for any kernel warnings -- you may have a bad disk block or something else.

pyAlsaaudio install on openSUSE

I'm trying to install pyAlsaaudio on my openSUSE distro
Output of uname -a: Linux linux-0cd5 4.12.14-lp150.12.48-default #1 SMP Tue Feb 12 14:01:48 UTC 2019 (268f014) x86_64 x86_64 x86_64 GNU/Linux
I downloaded the source from this link,
http://larsimmisch.github.io/pyalsaaudio/pyalsaaudio.html
which includes a py setup file.
Initially I didn't have the gcc compiler installed, so I just installed it.
Snipped output of gcc -v: gcc version 7.3.1 20180323 [gcc-7-branch revision 258812] (SUSE Linux)
The setup.py file is still giving me issues, I think because I am missing the alsa/asoundlib.h file, similar to this thread:
https://ubuntuforums.org/showthread.php?t=1586707
However, the solution there doesn't work for openSUSE, there isn't a libasound2-dev available for openSUSE.
Any ideas?
I just found an answer for this here:
https://mailman.alsa-project.org/pipermail/alsa-devel/2013-December/069794.html
I used the following command:
sudo zypper install -C 'pkgconfig(alsa)'
which pointed me to a package I wasn't aware of - "alsa-devel". I wasn't able to find this package when I searched for things like "libasound"
Now I have the proper alsa/asoundlib.h file which is something that the creators of pyalsaaudio note could cause issues if it is absent.
setup.py compiles without issues now! Hope this helps someone else avoid losing 2 hours of googling!

make: can't find /usr/include/linux/ext3_fs.h

When I try to compile one of my old program which uses ext3 structure with new Fedora 16
I get the message
# make
Compile main.c In file included from main.c:8:0:
giis.h:18:28: fatal error: linux/ext3_fs.h: No such file or directory
compilation terminated.
I did yum install kernel-devel and kernel-headers - but still it gives above message.
# uname -a
Linux space 3.2.9-2.fc16.x86_64 #1 SMP Mon Mar 5 20:55:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
The linux kernel does not export a header called ext3_fs.h, or does not do so anymore. Edit your giis.h to do without it. See commit v2.6.25-rc8~52: “Neither of the headers actually compiles when included from userpsace nor should it be made available as userspace tools should be using the libraries or at least headers from e2fsprogs.”

Install TBB on Linux 11.04

I have been searching google and tbbs forums on how to install TBB.
I have downloaded both the linux and source from:
http://threadingbuildingblocks.org/ver.php?fid=175
Extracted them using tar -xvf, and then ran the make file.
Then I went to tbb/build/linux_intel64_gcc_cc4.5.2_libc,13_kernel2.6.38_debug/ and ran tbbvars.sh
I also tried running tbb/build/generate_tbbvars.sh, then tbbvars.sh and tbbvars.csh
No matter what I ty when I try to compile a program with -ltbb, i get
/usr/bin/ld: skipping incompatible /usr/lib/libtbb.so when searching for -ltbb
/usr/bin/ld: cannot find -ltbb
Any one know how to fix this?
Linux damian-HP-Z600-Workstation 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
This is another instance of the issue answered lucidly here. You have libraries of one bit width and are trying to link them into a compilation of a different bit width. If both your application compile process and your TBB build process were done on the same system, one of them must have done the wrong thing when deciding whether to output 32-bit code or 64-bit code.

libstdc++.so.6: cannot handle TLS data

I have an application compiled at:
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Linux debian 2.6.18-5-686 #1 SMP Fri Jun 1 00:47:00 UTC 2007 i686 GNU/Linux
and it runs well.
Now I want to run it at:
Linux 2.4.20_mvlcge31-tomas #7 Thu May 7 11:33:21 CEST 2009 i686 unknown
I got following errors:
libstdc++.so.6: cannot handle TLS data
From the web I saw someone suggested to do this: export LD_ASSUME_KERNEL=2.2.5
I tried but get even more errors:
ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
Who can help me with it? thanks
You had compiled the application against much newer libc and kernel version, You can't compile program on 2.6 with newest libc and expect it to run on old kernel.
Also where do you actually still use Linux 2.4?

Resources