Hi! Attached is a patch that fixes some errors in the configure tests for pthreads on linux (both for gcc and pgi).
-- Ake Sandgren, HPC2N, Umea University, S-90187 Umea, Sweden Internet: a...@hpc2n.umu.se Phone: +46 90 7866134 Fax: +46 90 7866126 Mobile: +46 70 7716134 WWW: http://www.hpc2n.umu.se
diff -ru site/config/ompi_config_pthreads.m4 amd64_ubuntu606-pgi6.2/config/ompi_config_pthreads.m4 --- site/config/ompi_config_pthreads.m4 2006-06-02 21:51:39.000000000 +0200 +++ amd64_ubuntu606-pgi6.2/config/ompi_config_pthreads.m4 2006-10-06 10:54:22.000000000 +0200 @@ -480,7 +480,6 @@ ompi_pthread_cxx_success=0) AC_LANG_POP(C++) if test "$ompi_pthread_cxx_success" = "1"; then - PTHREAD_LIBS="$pl" AC_MSG_RESULT([yes]) else CXXCPPFLAGS="$orig_CXXCPPFLAGS" @@ -515,6 +514,7 @@ else PTHREAD_CXXCPPFLAGS= CXXCPPFLAGS="$orig_CXXCPPFLAGS" + LIBS="$orig_LIBS" AC_MSG_RESULT([no]) fi done @@ -535,7 +535,6 @@ OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1, ompi_pthread_f77_success=0) AC_LANG_POP(C) - LIBS="$orig_LIBS" if test "$ompi_pthread_f77_success" = "1"; then AC_MSG_RESULT([yes]) else @@ -550,12 +549,12 @@ OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1, ompi_pthread_f77_success=0) AC_LANG_POP(C) - LIBS="$orig_LIBS" if test "$ompi_pthread_f77_success" = "1"; then PTHREAD_LIBS="$pl" AC_MSG_RESULT([yes]) break else + LIBS="$orig_LIBS" AC_MSG_RESULT([no]) fi done diff -ru site/config/ompi_check_pthread_pids.m4 amd64_ubuntu606-pgi6.2/config/ompi_check_pthread_pids.m4 --- site/config/ompi_check_pthread_pids.m4 2006-04-12 18:12:28.000000000 +0200 +++ amd64_ubuntu606-pgi6.2/config/ompi_check_pthread_pids.m4 2006-10-06 11:30:28.000000000 +0200 @@ -46,20 +46,20 @@ void *checkpid(void *arg); int main(int argc, char* argv[]) { pthread_t thr; - int pid, retval; + int pid, *retval; pid = getpid(); pthread_create(&thr, NULL, checkpid, &pid); pthread_join(thr, (void **) &retval); - exit(retval); + exit(*retval); } +static int ret; void *checkpid(void *arg) { - int ret; int ppid = *((int *) arg); if (ppid == getpid()) ret = 0; else ret = 1; - pthread_exit((void *) ret); + pthread_exit((void *) &ret); }], [MSG=no OMPI_THREADS_HAVE_DIFFERENT_PIDS=0], [MSG=yes OMPI_THREADS_HAVE_DIFFERENT_PIDS=1],