linker errors

Dear all,

I have a Fortran program (not my own code) that I want to modify so that it uses a GPU. I can compile and run it ok on the host CPU but then I try to compile for GPU I get linker errors:

pgfortran -m64 -ta=nvidia -Mcuda=4.0,cc20 -o evolve evolve.f90

/tmp/pgfortransh6f23izZ3Nk.o: In function ..cuda_fortran_constructor_1': /home/avoss/./evolve.f90:410: undefined reference to step_’
/tmp/pgfortransh6f23izZ3Nk.o: In function filter': /home/avoss/./evolve.f90:664: undefined reference to .BSS14’
/home/avoss/./evolve.f90:665: undefined reference to .BSS14' /home/avoss/./evolve.f90:666: undefined reference to .BSS14’
/home/avoss/./evolve.f90:666: undefined reference to .BSS14' /home/avoss/./evolve.f90:667: undefined reference to .BSS14’
/tmp/pgfortransh6f23izZ3Nk.o:/home/avoss/./evolve.f90:667: more undefined references to `.BSS14’ follow

Can anyone give me a hint as to what is going on? I had some problems earlier with the -mcmodel=medium option leading to libcublas not being linked ok, so I introduced allocatable arrays into the code so I can change to the normal memory model. Not sure what is going on now though.

When I comment out the !$acc directives the code compiles, links and runs ok with the same invocation of pgfortran.



Hi Alex,

This looks like a compiler issue. .BSSnn is a reference to a static variable. In the past, this type of error means that the compiler got the symbol name wrong or due to optimization removed some variable in one spot but missed others. Can you please send an example of the code to PGI Customer Service ( We’ll need a compiler engineer to look at the code and tell us what’s happening. We’ll also try to find a work around.

Note that we’re in the process of adding -mcmodel=medium support to CUDA Fortran.


This has been fixed in the current 13.10 release.