| Issue |
52963
|
| Summary |
[OpenMP] Linking error when creating exe with the objects not compiled with OpenMP flags : Could not open input file '/tmp/foo-0b9a1a.cubin'
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
pramodk
|
Hello All,
This is a simple reproducer from our application build:
* I have object file file compiled without OpenMP flags
* I try to create exe with the above object file and **with** OpenMP flags. This results into link error.
i.e.
```console
$ echo "int main() { return 0; } " > foo.cpp
$ clang++ -c foo.cpp # adding openmp flags here doesn't cause below error
$ clang++ foo.o -o foo -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda
nvlink fatal : Could not open input file '/tmp/foo-ad52ec.cubin'
clang-13: error: nvlink command failed with exit code 1 (use -v to see invocation)
```
Adding `-v` gives:
```console
$ clang++ foo.o -o foo -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -v
clang version 13.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /gpfs/bbp.cscs.ch/ssd/apps/bsd/2021-11/stage_externals/install_gcc-11.2.0-skylake/llvm-13.0.0-klsplt/bin
Found candidate GCC installation: /gpfs/bbp.cscs.ch/ssd/apps/bsd/2021-11/stage_compilers/install_gcc-4.8.5-haswell/gcc-11.2.0-vjzwth/lib/gcc/x86_64-pc-linux-gnu/11.2.0
Selected GCC installation: /gpfs/bbp.cscs.ch/ssd/apps/bsd/2021-11/stage_compilers/install_gcc-4.8.5-haswell/gcc-11.2.0-vjzwth/lib/gcc/x86_64-pc-linux-gnu/11.2.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /gpfs/bbp.cscs.ch/ssd/apps/bsd/2021-11/stage_externals/install_gcc-11.2.0-skylake/cuda-11.4.2-yopegt, version 11.2
clang-13: warning: Unknown CUDA version. cuda.h: CUDA_VERSION=11040. Assuming the latest supported version 10.1 [-Wunknown-cuda-version]
"/gpfs/bbp.cscs.ch/ssd/apps/bsd/2021-11/stage_externals/install_gcc-11.2.0-skylake/llvm-13.0.0-klsplt/bin/clang-offload-bundler" -type=o -targets=host-x86_64-unknown-linux-gnu,openmp-nvptx64-nvidia-cuda -inputs=foo.o -outputs=/tmp/foo-f5a3fe.o,/tmp/foo-29e202.cubin -unbundle -allow-missing-bundles
"/gpfs/bbp.cscs.ch/ssd/apps/bsd/2021-11/stage_externals/install_gcc-11.2.0-skylake/cuda-11.4.2-yopegt/bin/nvlink" -o /tmp/foo-e81118.out -v -arch sm_70 -L/gpfs/bbp.cscs.ch/ssd/apps/bsd/2021-11/stage_externals/install_gcc-11.2.0-skylake/llvm-13.0.0-klsplt/lib /tmp/foo-29e202.cubin
nvlink fatal : Could not open input file '/tmp/foo-29e202.cubin'
clang-13: error: nvlink command failed with exit code 1 (use -v to see invocation)
```
Obviously I can get rid of unnecessary linker flags in this case. But I am not sure if this is intended behaviour. At least the error could be improved here?
Thank you!
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs