Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] undefined reference to `pthread_atfork' (Lahey Fujitsu compiler AMD64)
From: Alex Pletzer (pletzer_at_[hidden])
Date: 2007-12-12 14:02:55


Hi,

I'm on a AMD64 box (Linux quartic.txcorp.com 2.6.19-1.2288.fc5 #1 SMP
Sat Feb 10 14:59:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux) and
compiled openmpi-1.2.4 using the Lahey-Fujitsu compiler (lfc). The
compilation of openmpi went fine.

  $ ../configure --enable-mpi-f90 --enable-mpi-f77 --enable-mpi-cxx
--prefix=/home/research/pletzer/local/x86_64/openmpi-1.2.4/ FC=lfc
F77=lfc FCFLAGS=-O2 FFLAGS=-O2 --disable-shared --enable-static

However, when compiling a test code with mpif90, I get the following error:

[pletzer_at_quartic test]$ cat t.f90
program test
  implicit none
  include 'mpif.h'
  integer :: rank, size, ier
  call mpi_init(ier)
  call mpi_comm_rank(MPI_COMM_WORLD, rank, ier)
  call mpi_comm_size(MPI_COMM_WORLD, size, ier)
  print *,'rank ', rank, ' size ', size
  call mpi_finalize(ier)
end program test

[pletzer_at_quartic test]$ mpif90 t.f90
Encountered 0 errors, 0 warnings in file t.f90.
/home/research/pletzer/local/x86_64/openmpi-1.2.4//lib/libopen-pal.a(lt1-malloc.o):
In function `ptmalloc_init':
malloc.c:(.text+0x4b71): undefined reference to `pthread_atfork'
[pletzer_at_quartic test]$

I know this symbol is defined in

[pletzer_at_quartic test]$ nm /usr/lib64/libpthread.a | grep pthread_atfork
..
0000000000000000 T pthread_atfork

However linking with this library does not resolve the problem:

[pletzer_at_quartic test]$ mpif90 t.f90 /usr/lib64/libpthread.a
Encountered 0 errors, 0 warnings in file t.f90.
/home/research/pletzer/local/x86_64/openmpi-1.2.4//lib/libopen-pal.a(lt1-malloc.o):
In function `ptmalloc_init':
malloc.c:(.text+0x4b71): undefined reference to `pthread_atfork'

Thanks for your help.

--Alex

-- 
Alexander Pletzer
Tech-X (p) 303 - 996 2031 (c) 609 235 6022 (f) 303 448 7756