PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Error linking CUDA Fortran code

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
styc



Joined: 21 Jan 2009
Posts: 1

PostPosted: Thu Sep 01, 2011 6:41 pm    Post subject: Error linking CUDA Fortran code Reply with quote

I have a small test program:
Code:
program test

    type t
        integer n
        double precision, allocatable, device :: a(:), b(:), c(:)
    end type

    type(t) x

    read *, x%n
    allocate(x%a(x%n), x%b(x%n), x%c(x%n))
    call f(x%a, x%b, x%c)
    print *, sum(x%c)

    contains

    subroutine f(a, b, c)

        double precision, device :: a(:), b(:), c(:)
        integer i

        !$cuf kernel do 〈〈〈*, 256〉〉〉
        do i = 1, size(a)
            a(i) = 1
            b(i) = 1
            c(i) = a(i) + b(i)
        end do

    end subroutine

end program


When I compile it
Code:
pgfortran 11.8-0 64-bit target on x86-64 Linux -tp gh
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2011, STMicroelectronics, Inc.  All Rights Reserved.
using
Code:
pgfortran test.f90 -otest -Mcuda

the linker complains:
Code:
/tmp/pgfortran8iWe0Up28Yol.o: In function `..cuda_fortran_constructor_1':
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.STATICS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.STATICS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
/tmp/pgfortran8iWe0Up28Yol.o:./test.f90:29: more undefined references to `.BSS3' follow
/tmp/pgfortran8iWe0Up28Yol.o: In function `..cuda_fortran_constructor_1':
./test.f90:29: undefined reference to `.STATICS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.STATICS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.STATICS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.STATICS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
/tmp/pgfortran8iWe0Up28Yol.o:./test.f90:29: more undefined references to `.BSS3' follow
/tmp/pgfortran8iWe0Up28Yol.o: In function `..cuda_fortran_constructor_1':
./test.f90:29: undefined reference to `.STATICS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.STATICS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.STATICS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
./test.f90:29: undefined reference to `.BSS3'
/tmp/pgfortran8iWe0Up28Yol.o:./test.f90:29: more undefined references to `.BSS3' follow
/tmp/pgfortran8iWe0Up28Yol.o: In function `..cuda_fortran_constructor_1':
./test.f90:29: undefined reference to `f_'
./test.f90:29: undefined reference to `.STATICS3'
./test.f90:29: undefined reference to `.STATICS3'
./test.f90:29: undefined reference to `.BSS3'


Any idea why this is happening and how it can be resolved?
Back to top
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 438

PostPosted: Fri Sep 02, 2011 3:55 pm    Post subject: Problem linking with -Mcuda Reply with quote

Thanks for the submission. We logged this as TPR 18153.

regards,
dave
Back to top
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 438

PostPosted: Mon Jul 01, 2013 11:36 am    Post subject: TPR 18153 was fixed in 12.9 Reply with quote

A late message - we are closing TPR 18153 because it was fixed as of 12.9 release at least.

thanks,
dave
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group