Looking at the svn logs it looks like you reported the problems with
these checks quite a while ago and we fixed them (in r13773
https://svn.open-mpi.org/trac/ompi/changeset/13773), but we never moved
them to the 1.2 branch.
I will ask for this to be moved to the 1.2 branch.
However, the changes made for ompi_config_pthreads.m4 are different than
you are suggesting now. Is this changeset good enough, or are there
other changes you think should be made?
Åke Sandgren wrote:
> There are a couple of bugs in the configure scripts regarding threads
> In ompi_check_pthread_pids.m4 the actual code for testing is wrong and
> is also missing a CFLAG save/add-THREAD_CFLAGS/restore resulting in the
> linking always failing for the -pthread test with gcc.
> config.log looks like this.
> configure:50353: checking if threads have different pids (pthreads on
> configure:50409: gcc -o conftest -DNDEBUG -march=k8 -O3 -msse -msse2
> -maccumulate-outgoing-args -finline-functions -fno-strict-aliasing
> -fexceptions conftest.c -lnsl -lutil -lm >&5
> conftest.c: In function 'checkpid':
> conftest.c:327: warning: cast to pointer from integer of different size
> /tmp/ccqUaAns.o: In function `main':conftest.c:(.text+0x1f): undefined
> reference to `pthread_create'
> :conftest.c:(.text+0x2e): undefined reference to `pthread_join'
> collect2: ld returned 1 exit status
> configure:50412: $? = 1
> configure: program exited with status 1
> Adding the CFLAGS save/add/restore make the code return the right answer
> both on systems with the old pthreads implementation and NPTL based
> systems. BUT, the code as it stands is technically incorrect.
> The patch have a corrected version.
> There is also two bugs in ompi_config_pthreads.m4.
> In OMPI_INTL_POSIX_THREADS_LIBS_CXX it is incorrectly setting
> PTHREAD_LIBS to $pl, in the then-part of the second if-statement, which
> at the time isn't set yet and forgetting to reset LIBS on failure in the
> bottom most if-else case in the for pl loop.
> In OMPI_INTL_POSIX_THREADS_LIBS_FC it is resetting LIBS whether
> succesfull or not resulting in -lpthread missing when checking for
> PTHREAD_MUTEX_ERRORCHECK_NP at least for some versions of pgi, (6.1 and
> older fails, 7.0 seems to always add -lpthread with pgf77 as linker)
> The output from configure in such a case looks like this:
> checking if C compiler and POSIX threads work with -lpthread... yes
> checking if C++ compiler and POSIX threads work with -lpthread... yes
> checking if F77 compiler and POSIX threads work with -lpthread... yes
> checking for PTHREAD_MUTEX_ERRORCHECK_NP... no
> checking for PTHREAD_MUTEX_ERRORCHECK... no
> (OS: Ubuntu Dapper, Compiler: pgi 6.1)
> There is also a problem in the F90 modules include flag search.
> The test currently does:
> $FC -c conftest-module.f90
> $FC conftest.f90
> This doesn't work if one has set FCFLAGS=-g in the environment.
> At least not with pgf90 since it needs the debug symbols from
> conftest-module.o to be able to link.
> You have to either add conftest-module.o to the compile line of conftest
> or make it a three-stager, $FC -c conftest-module.f90; $FC -c
> conftest.f90; $FC conftest.o conftest-module.o
> users mailing list