Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OMP_OFFLOAD_LLVM] Undefined references to .omp_offloading symbols #1399

Open
dmikushin opened this issue Jun 28, 2023 · 3 comments
Open

[OMP_OFFLOAD_LLVM] Undefined references to .omp_offloading symbols #1399

dmikushin opened this issue Jun 28, 2023 · 3 comments

Comments

@dmikushin
Copy link
Contributor

dmikushin commented Jun 28, 2023

By testing

flang -O2 -fopenmp -fopenmp-targets=x86_64 /openmp-offload-example/src/example.f90 -o /openmp-offload-example/build/example

I get a linking error:

/usr/bin/ld: /tmp/example-49d1c7.o:(.rodata+0x0): undefined reference to `.omp_offloading.img_start.nvptx64-nvidia-cuda'
/usr/bin/ld: /tmp/example-49d1c7.o:(.rodata+0x8): undefined reference to `.omp_offloading.img_end.nvptx64-nvidia-cuda'
/usr/bin/ld: /tmp/example-49d1c7.o:(.rodata+0x10): undefined reference to `.omp_offloading.entries_begin'
/usr/bin/ld: /tmp/example-49d1c7.o:(.rodata+0x18): undefined reference to `.omp_offloading.entries_end'
/usr/bin/ld: /tmp/example-49d1c7.o:(.rodata+0x30): undefined reference to `.omp_offloading.entries_begin'
/usr/bin/ld: /tmp/example-49d1c7.o:(.rodata+0x38): undefined reference to `.omp_offloading.entries_end'

Instead of following my -fopenmp-targets=x86_64 command, Flang gives me offloading to NVIDIA. "I no longer have a motorcycle, but the habit remains" (c)

@dmikushin
Copy link
Contributor Author

dmikushin commented Jun 29, 2023

Today I grepped the whole LLVM repository history for img_start entries with

git rev-list --all | parallel --bar -P 16 git show | grep "img_start"

And found zero occurrences. If it existed, it should pop up at least in the tests. Perhaps, it means the OpenMP linking in Flang was done against PGI's internal fork of LLVM, which is not a part of this project anymore.

Does anyone have a clue? If not, I will match my Fortran example with C example side by side to find the proper naming of OpenMP symbols.

@bryanpkc
Copy link
Collaborator

@shivaramaarao Any clue?

@bryanpkc
Copy link
Collaborator

@sscalpone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants