llvm-project
llvm-project copied to clipboard
undefined reference to __kmpc_push_target_tripcount
| 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
Alexey: Thanks for the quick fix. Seems to work.
assigned to @alexey-bataev