error while compiling

When I am compiling with I get following error:

copy.o(.text+0x91): In function copy_': ./copy.cuf:8: undefined reference to pgf90_alloc’
copy.o(.text+0xef):./copy.cuf:8: undefined reference to pgf90_alloc' copy.o(.text+0x14d):./copy.cuf:8: undefined reference to pgf90_alloc’
copy.o(.text+0x1ce):./copy.cuf:8: undefined reference to pgf90_alloc' copy.o(.text+0x243):./copy.cuf:8: undefined reference to pgf90_alloc’
copy.o(.text+0x2b2):./copy.cuf:8: more undefined references to pgf90_alloc' follow copy.o(.text+0x4e2): In function copy_’:
./copy.cuf:16: undefined reference to pgf90_dev_configure_call' copy.o(.text+0x50a):./copy.cuf:16: undefined reference to pgf90_allocated’
copy.o(.text+0x51e):./copy.cuf:16: undefined reference to pgf90_dealloc' copy.o(.text+0x531):./copy.cuf:20: undefined reference to pgf90_allocated’
copy.o(.text+0x545):./copy.cuf:20: undefined reference to pgf90_dealloc' copy.o(.text+0x558):./copy.cuf:20: undefined reference to pgf90_allocated’
copy.o(.text+0x56c):./copy.cuf:20: undefined reference to pgf90_dealloc' copy.o(.text+0x57f):./copy.cuf:20: undefined reference to pgf90_allocated’
copy.o(.text+0x593):./copy.cuf:20: undefined reference to pgf90_dealloc' copy.o(.text+0x5a7):./copy.cuf:20: undefined reference to pgf90_allocated’
copy.o(.text+0x5bb):./copy.cuf:20: undefined reference to pgf90_dealloc' copy.o(.text+0x5ce):./copy.cuf:20: undefined reference to pgf90_allocated’
copy.o(.text+0x5e2):./copy.cuf:20: undefined reference to pgf90_dealloc' copy.o(.text+0x61e): In function kernel_copy_’:
./copy.cuf:26: undefined reference to pgf90io_src_info' copy.o(.text+0x636):./copy.cuf:26: undefined reference to pgf90io_ldw_init’
copy.o(.text+0x659):./copy.cuf:26: undefined reference to pgf90io_ldw' copy.o(.text+0x662):./copy.cuf:26: undefined reference to pgf90io_ldw_end’
copy.o(.data+0x30): In function .C2_283': : undefined reference to pgf90_compiled’

My makefile looks like this:
COP = mpif90 -O3 -axW
CC = pgf90
#MPI_INCLUDES := /usr/mpi/intel/mvapich2-1.2p1/include
#MPI_LIBS := /usr/mpi/intel/mvapich2-1.2p1/lib
#FC =g95

DOTO = mod.o
create.o
displace.o
coulomb.o
lj.o
ee.o
erf.o
erfc.o
fourier.o
lrc.o
main.o
newmaxima.o
outfold.o
ran2.o
read.o
real.o
self.o
size.o
store.o
cuda_ptee:$(DOTO) copy.o
$(COP) copy.o $(DOTO) -o cuda_ptee


copy.o: copy.cuf
$(CC) -c copy.cuf -o copy.o

mod.o: mod.f90
$(COP) -c mod.f90

coulomb.o: coulomb.f90
$(COP) -c coulomb.f90

create.o: create.f90
$(COP) -c create.f90

displace.o: displace.f90
$(COP) -c displace.f90

ee.o: ee.f90
$(COP) -c ee.f90

… and so on…

I have no clue about this error,Can you please suggest me a way out

Hi Vaibhaw Kumar,

This error means that you’re missing an object or library on the link line. In this case, these symbols are found in the PGI runtime libraries. I’m guessing that your mpif90 is configured to use Intel’s Fortran compiler, which doesn’t know that it should add these libraries.

While you could add the PGI runtime libraries to your link, if you use F90 features such as modules, most F90 compilers are not compatible with each other. Hence, I would suggest you rebuild your MVAPICH so that it’s configured for use with PGI or use the MPICH installation provided with your PGI compilers.

Hope this helps,
Mat