How to make Fedora4 build threadsafe?

Поиск
Список
Период
Сортировка
Искать

How to make Fedora4 build threadsafe?

От:
Matt England <mengland@mengland.net>
Дата:
I experienced this error while running this ./configure:

./configure --enable-thread-safety --prefix=/cgrid/local/postgresql

on FedoraCore4:

checking thread safety of required library functions... no
configure: error:
*** Thread test program failed.  Your platform is not thread-safe.
*** Check the file 'config.log'for the exact reason.
***
*** You can use the configure option --enable-thread-safety-force
*** to force threads to be enabled.  However, you must then run
*** the program in src/tools/thread and add locking function calls
*** to your applications to guarantee thread safety.

[mengland@localhost postgresql-8.1.3]$


Is there anything I can do to fix this?  Install some extra/different 
libraries?  (I'm trying a ./configure run after installing 
"linuxthreads-devel" right now.)

I didn't have this problem building 8.1.0/8.1.1 with the same procedure on 
Centos4.1 and Debian3.1 (sarge) systems, for whatever that's worth.

-Matt

Re: How to make Fedora4 build threadsafe?

От:
Matt England <mengland@mengland.net>
Дата:
At 2/28/2006 11:34 PM, Matt England wrote:
>checking thread safety of required library functions... no
>configure: error:
>*** Thread test program failed.  Your platform is not thread-safe.
>*** Check the file 'config.log'for the exact reason.

For what it's worth, this seems to be pertinent part of config.log:

[...]
configure:16424: checking for the pthreads library -lpthreads
configure:16462: gcc -o conftest -O2 -Wall -Wmissing-prototypes 
-Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels 
-fno-strict-aliasing   -D_GNU_SOURCE    conftest.c -lpthreads  -lz 
-lreadline -ltermcap -lcrypt -lresolv -lnsl -ldl -lm -lbsd  >&5
conftest.c: In function 'main':
conftest.c:125: warning: 'th' is used uninitialized in this function
/usr/bin/ld: cannot find -lpthreads
collect2: ld returned 1 exit status
configure:16468: $? = 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME "PostgreSQL"
[...]


...although the thing is so long that it's hard to tell.

I couldn't find a pthreads library/package/thing anywhere, or at least not 
yet.  My system *does* have a /usr/lib/libpthread.so (singular), but no 
libpthreads (plural).  Installing linuxpthreads-devel didn't solve anything.

Any thoughts?

-Matt 

Re: How to make Fedora4 build threadsafe?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Matt England  writes:
> I experienced this error while running this ./configure:
> ./configure --enable-thread-safety --prefix=/cgrid/local/postgresql
> on FedoraCore4:
> checking thread safety of required library functions... no

Hmm, it works fine for me on FC4.  I wonder if you are missing the
glibc-devel RPM?

The part of config.log that matters is the part after "checking thread
safety of required library functions", not the part that is checking
to see which thread library you've got.  FWIW, the thread library
check goes like this for me:

checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking whether pthreads work with -pthreads... no
checking whether pthreads work with -mthreads... no
checking for the pthreads library -lpthread... yes
checking whether pthreads work with --thread-safe... no
checking whether pthreads work with -mt... no
checking for the pthreads library -lpthreadGC2... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes

			regards, tom lane

Re: How to make Fedora4 build threadsafe?

От:
Matt England <mengland@mengland.net>
Дата:

At 3/1/2006 09:34 AM, Tom Lane wrote:
>Matt England  writes:
> > I experienced this error while running this ./configure:
> > ./configure --enable-thread-safety --prefix=/cgrid/local/postgresql
> > on FedoraCore4:
> > checking thread safety of required library functions... no
>
>Hmm, it works fine for me on FC4.  I wonder if you are missing the
>glibc-devel RPM?

I checked, and said rpm was already on my system.

However, I did build successfully.  Here's how:

As per:

http://www.redhat.com/archives/rhl-list/2006-March/msg00023.html

I built from the source rpm at:

http://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/postgresql-8.1.3-1.src.rpm

...and everything built ok with

./configure --enable-thread-safety
make

-Matt 

FAQ