llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

undefined reference to __kmpc_push_target_tripcount

Open jdenny-ornl opened this issue 7 years ago • 2 comments

Bugzilla Link 40536
Resolution FIXED
Resolved on Jan 30, 2019 14:03
Version unspecified
OS Linux
Fixed by commit(s) r352669

Extended Description

At r352640 and since r350571, some directives cause an undefined reference to __kmpc_push_target_tripcount. For example:

$ cat test.c
int main() {
  #pragma omp target teams
  #pragma omp distribute
  for (int i = 0; i < 8; ++i)
    ;
  return 0;
}
$ clang -fopenmp test.c
/tmp/test-b61bc4.o: In function `main':
test.c:(.text+0x1c): undefined reference to `__kmpc_push_target_tripcount'
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
$ clang -fopenmp -lomptarget test.c
$ ./a.out 
Libomptarget fatal error 1: default offloading policy must switched to mandatory or disabled
$ clang -fopenmp -fopenmp-targets=nvptx64 test.c
$ ./a.out
$ echo $?
0

jdenny-ornl avatar Jan 30 '19 19:01 jdenny-ornl

Alexey: Thanks for the quick fix. Seems to work.

jdenny-ornl avatar Jan 30 '19 22:01 jdenny-ornl

assigned to @alexey-bataev

jdenny-ornl avatar Jan 30 '19 19:01 jdenny-ornl