MPI version of the CAF library: undefined references.

Jorge D'ELIA jdelia@intec.unl.edu.ar
Fri Nov 18 19:42:00 GMT 2011


Dear Gfortran developers,

I try to make the MPI version of the GNU Fortran coarray 
communication library following the instructions given at 
the page: 

http://gcc.gnu.org/wiki/CoarrayLib

However, there is an error in the link step, as follows,

$ gfortran-beta --version
GNU Fortran (GCC) 4.7.0 20111116 (experimental)
Copyright (C) 2011 Free Software Foundation, Inc.

$ mpif90 --version
GNU Fortran (GCC) 4.7.0 20111116 (experimental)
Copyright (C) 2011 Free Software Foundation, Inc.

$ cd /usr/local/fabrica/gcc_2011-11-16/gcc/libgfortran/caf

$ ls -all *.c 
-rwxrwxr-x 1 root users 8684 Nov 16 11:40 mpi.c
-rwxrwxr-x 1 root users 4540 Nov 16 11:40 single.c

$ ls -all *.h
-rwxrwxr-x 1 root users 2848 Nov 16 11:40 libcaf.h

...

$ cd /usr/local/gfortran-beta/lib/gcc/i686-pc-linux-gnu/4.7.0 

$ ls -all libcaf*
-rw-r--r-- 1 root root  6274 Nov 18 15:29 libcaf_mpi.a
-rwxr-xr-x 1 root root  9375 Nov 18 15:29 libcaf_mpi.so.1.0.0
-rw-r--r-- 1 root root 14032 Nov 16 13:53 libcaf_single.a
-rwxr-xr-x 1 root root   944 Nov 16 13:53 libcaf_single.la

$ cd /u/test

$ cat test01.f90
program test01
  implicit none
  integer :: mr, np
  mr = this_image ()
  np = num_images ()
  write (*,*) "Hola  desde la imagen ; mr = ", mr
  write (*,*) "Total de imagenes     ; np = ", np
end program

$ gfortran-beta -Wall -std=f2008 -fcoarray=lib -c test01.f90

However:

$ mpif90 -lcaf_mpi -o test01.exe test01.o
test01.o: In function `main':
test01.f90:(.text+0x140): undefined reference to `_gfortran_caf_init'
test01.f90:(.text+0x170): undefined reference to `_gfortran_caf_finalize'
collect2: error: ld returned 1 exit status



Please, someone could give me any suggestions to solve it?

Regards,

Jorge.
--



More information about the Fortran mailing list