Issue 62 - Building with pthreads in Digital Unix 4.0
Summary: Building with pthreads in Digital Unix 4.0
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1999-02-01 20:57 UTC by afrost@williams.edu
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description afrost@williams.edu 1999-02-01 20:57:46 UTC
Full_Name: Ashley Frost
Version: 1.1.4
OS: Digital Unix 4.0d
URL: 
Submission from: (NULL) (137.165.10.21)


I couldn't find this information anywhere in the FAQ or mailing list archives,
so I'm offering it to anyone who is having trouble with ./configure and pthread
support for Digital Unix.  It would be especially helpful under the Platform 
Hints in a section for Digital Unix.

If configure stops with the error:

       checking if pthread_create() works... no
       configure: error: pthread.h and pthread_create are not compatible

then do this to resolve the problem:

CC="cc"; export CC
LIBS="-lpthread -lexc"; export LIBS
CFLAGS="-pthread"; export CFLAGS

./configure

Comment 1 Kurt Zeilenga 1999-02-01 21:15:58 UTC
At 08:57 PM 2/1/99 GMT, Ashley.W.Frost@williams.edu wrote:
>Full_Name: Ashley Frost
>Version: 1.1.4
>OS: Digital Unix 4.0d
>URL: 
>Submission from: (NULL) (137.165.10.21)
>
>
>I couldn't find this information anywhere in the FAQ or mailing list archives,
>so I'm offering it to anyone who is having trouble with ./configure and pthread
>support for Digital Unix.  It would be especially helpful under the Platform 
>Hints in a section for Digital Unix.

You are, of course, welcomed to add a subcategory for Digital UNIX in the
platform hints section of the faq-o-matic and then add your 'new answer.'

>If configure stops with the error:
>
>       checking if pthread_create() works... no
>       configure: error: pthread.h and pthread_create are not compatible

Where did it find the incompatible pthread_create() ?

Kurt
Comment 2 afrost@williams.edu 1999-02-01 21:40:16 UTC
BTW, thank you for your work on this project.  Its exciting and a
wonderful service to the community.

Further information regarding Kurt's email follows.

Regards,

-Ashley


On Mon, 1 Feb 1999, Kurt D. Zeilenga wrote:

> At 08:57 PM 2/1/99 GMT, Ashley.W.Frost@williams.edu wrote:
> >Full_Name: Ashley Frost
> >Version: 1.1.4
> >OS: Digital Unix 4.0d
> >URL: 
> >Submission from: (NULL) (137.165.10.21)
> >
> >
> >I couldn't find this information anywhere in the FAQ or mailing list archives,
> >so I'm offering it to anyone who is having trouble with ./configure and pthread
> >support for Digital Unix.  It would be especially helpful under the Platform 
> >Hints in a section for Digital Unix.
> 
> You are, of course, welcomed to add a subcategory for Digital UNIX in the
> platform hints section of the faq-o-matic and then add your 'new answer.'

I didn't realize you allowed offsite people to modify the faq-o-matic,
although a second look shows this to be true.  

I also realize that this answer looks a lot like some of the other answers
for other OS's regarding pthreads, however it is slightly different and
took a little digging through the man pages on DU.  If this had been in
there, it would have saved me some trouble right off the bat.

> >If configure stops with the error:
> >
> >       checking if pthread_create() works... no
> >       configure: error: pthread.h and pthread_create are not compatible
> 
> Where did it find the incompatible pthread_create() ?


Here is the tail of the config.log:

configure:4333: checking if pthread_create() works
configure:4365: cc -o conftest -g   conftest.c  -lpthreads -lmach -lexc
-lc_r  1>&5
ld:
Unresolved:
__pthread_create
configure: failed program was:
#line 4342 "configure"
#include "confdefs.h"

#include <pthread.h>
#ifndef NULL
#define NULL (void*)0
#endif

static void *task(p)
        void *p;
{
        return (void *) (p == NULL);
}

int main(argc, argv)
        int argc;
        char **argv;
{
        pthread_t t;
        exit(pthread_create(&t, NULL, task, NULL));
}


-Ashley

Comment 3 Rodney McDuff 1999-02-02 00:18:26 UTC
Hi Ashley
Here are my config setting for DU 4.0D for openldap-1.1.3

setenv CC cc
setenv CFLAGS "-O4 -std"
setenv CPPFLAGS "-I/usr/local/include"
setenv LDFLAGS "-L/usr/local/lib"
setenv LIBS "-lpthread -lpthreads"

./configure --prefix=/usr/local/ldap --enable-slurpd --enable-shared\
    --enable-wrappers --with-threads \
    --with-ldbm-api=gdbm


-- 

  +-----------------+------------------------------------------+
  |    _   ^   _    | Dr. Rodney McDuff                        |
  |   |\  /|\  /|   | Network Development, Prentice Centre     |
  |     \  |  /     | The University of Queensland             |
  |      \ | /      | St. Lucia, Brisbane                      |
  |       \|/       | Queensland, Australia. 4072.             |
  |<-------+------->| TELEPHONE: +61 7 3365 8220               |
  |       /|\       | FACSIMILE: +61 7 3365 4477               |
  |      / | \      | EMAIL: mcduff@prentice.uq.edu.au         |
  |     /  |  \     |                                          |
  |   |/  \|/  \|   |        Ex ignorantia ad sapientiam       |
  |    -   v   -    |            Ex luce ad tenebras           |
  +-----------------+------------------------------------------+


Comment 4 Kurt Zeilenga 1999-02-02 02:54:24 UTC
moved from Incoming to Software Bugs
Comment 5 Kurt Zeilenga 1999-02-02 03:24:35 UTC
I've made some changes that should resolve pthread detections issues
on Digital Unix 4.0.

In the meantime, I suggest (if using the vendor supplied compiler)
	CFLAGS=-pthread; export CFLAGS
	./configure --with-threads=posix

If using something else (like gcc):
	CFLAGS=; export CFLAGS
	CPPFLAGS=-D_REENTRANT; export CPPFLAGS
	LIBS="-lpthread -lmach -lexc"; export LIBS
	./configure --with-threads=posix

If this doesn't work, try without the -lmach library.

I do NOT recommend using "-threads" nor "-lpthreads" as this will cause
older posix routines to be included.  (In fact, this is why the test
failed).

Note: this will build the complete system with threads (instead of just
the threaded components).

See Also: 
http://www.unix.digital.com/faqs/publications/base_doc/DOCUMENTATION/V40E_HTML/AQ2DPDTK/DOCU_020.HTM#heading_a.2.2


If you are using the vendor supplied compiler.  
At 09:39 PM 2/1/99 GMT, Ashley.W.Frost@williams.edu wrote:
>
>BTW, thank you for your work on this project.  Its exciting and a
>wonderful service to the community.
>
>Further information regarding Kurt's email follows.
>
>Regards,
>
>-Ashley
>
>
>On Mon, 1 Feb 1999, Kurt D. Zeilenga wrote:
>
>> At 08:57 PM 2/1/99 GMT, Ashley.W.Frost@williams.edu wrote:
>> >Full_Name: Ashley Frost
>> >Version: 1.1.4
>> >OS: Digital Unix 4.0d
>> >URL: 
>> >Submission from: (NULL) (137.165.10.21)
>> >
>> >
>> >I couldn't find this information anywhere in the FAQ or mailing list archives,
>> >so I'm offering it to anyone who is having trouble with ./configure and pthread
>> >support for Digital Unix.  It would be especially helpful under the Platform 
>> >Hints in a section for Digital Unix.
>> 
>> You are, of course, welcomed to add a subcategory for Digital UNIX in the
>> platform hints section of the faq-o-matic and then add your 'new answer.'
>
>I didn't realize you allowed offsite people to modify the faq-o-matic,
>although a second look shows this to be true.  
>
>I also realize that this answer looks a lot like some of the other answers
>for other OS's regarding pthreads, however it is slightly different and
>took a little digging through the man pages on DU.  If this had been in
>there, it would have saved me some trouble right off the bat.
>
>> >If configure stops with the error:
>> >
>> >       checking if pthread_create() works... no
>> >       configure: error: pthread.h and pthread_create are not compatible
>> 
>> Where did it find the incompatible pthread_create() ?
>
>
>Here is the tail of the config.log:
>
>configure:4333: checking if pthread_create() works
>configure:4365: cc -o conftest -g   conftest.c  -lpthreads -lmach -lexc
>-lc_r  1>&5
>ld:
>Unresolved:
>__pthread_create
>configure: failed program was:
>#line 4342 "configure"
>#include "confdefs.h"
>
>#include <pthread.h>
>#ifndef NULL
>#define NULL (void*)0
>#endif
>
>static void *task(p)
>        void *p;
>{
>        return (void *) (p == NULL);
>}
>
>int main(argc, argv)
>        int argc;
>        char **argv;
>{
>        pthread_t t;
>        exit(pthread_create(&t, NULL, task, NULL));
>}
>
>
>-Ashley
>
>
>
>
Comment 6 Kurt Zeilenga 1999-02-03 23:31:39 UTC
changed notes
changed state Open to Release
Comment 7 Kurt Zeilenga 1999-02-11 23:11:34 UTC
changed notes
changed state Release to Closed
Comment 8 OpenLDAP project 2014-08-01 21:06:51 UTC
Provided workaround.
Updated pthread detection for release with 1.2