"You need pthreads" error but can't find a pthreads package

I’m trying to build SheepShaver on Fedora 31 x86_64 but “configure” spits out the error:

configure: error: You need pthreads to run SheepShaver.

Some Googling reveals that I should install a package named something along the lines of pthread-dev but this package does not exist in Fedora.

Searching the package database for pthread/pthreads doesn’t reveal anything that helps.

What do I need to do?

dnf install glib2-devel
# See a next comment

See also: “Build-essentials” package for Fedora (Unix StackExchange).

POSIX threads (or pthreads) is part of glibc (not glib2), and if you want to build things against installed libraries, you need to install the development packages:

sudo dnf install glibc-devel
2 Likes

Some additional information:

By convention, shared objects for libraries are named lib.... So the pthread library will be called libpthread.so. You can query the repositories to see which package (if any) provides the library as a capability:

$ sudo dnf repoquery --whatprovides 'libpthread.so*'
glibc-0:2.30-10.fc31.i686
glibc-0:2.30-10.fc31.x86_64
glibc-0:2.30-5.fc31.i686
glibc-0:2.30-5.fc31.x86_64

So you need to develop with glibc, and install the glibc-devel package.

More information on libraries/shared objects:

https://www.ibm.com/developerworks/library/l-shobj/index.html

1 Like

Thank you for the replies. Sadly, glibc-devel was already installed, presumably because I already installed the entire “C Development Tools and Libraries” group.

# are you did this that way?
git clone https://github.com/cebix/macemu.git
cd macemu/SheepShaver
make links
cd macemu/SheepShaver/src/Unix
./autogen.sh
make

# Is this produce any output?
find / -type f -name *pthread.h 2>/dev/null

Then maybe this is a bug?

“… These days it is normally better to use AC_SEARCH_LIBS…”
autoconf, Libraries (gnu.org)

While:  “… AC_CHECK_LIB(pthread, pthread_create, …”
in SheepShaver, Unix, configure.ac (GuiHub).

Then it’s about the build system (autotools here?) not being able to find it. This is often because it isn’t looking in the right place. Check where the various compiler and linker flags are being set. You may have to tweak those bits.