-
Notifications
You must be signed in to change notification settings - Fork 518
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
hipcc compiler doesn't accept arguments to LLVM plugin for .cpp files, but it does for .c files #2561
Comments
Thank you for reporting this issue; we are looking into it. Mark |
Hi @sameershende I'm having difficulty reproducing this error with ROCm 5.0.2. I was able to get a copy of your TAU plugin .so, but when I call hipcc (with either a C or C++ file) clang cannot load the plugin because there is an undefined LLVM symbol in the .so. I attribute this kind of error to there being a mismatch between levels of LLVM in clang and the plugin .so. Are you still encountering this issue with ROCm 5.0.2 ? |
Hi @david-salinas, how do you compile the TAU plugin? Which symbol is undefined? |
This is my compile command: /opt/rocm-5.0.2/bin/hipcc -c matmult.c -g -DPROFILING_ON -DTAU_DOT_H_LESS_HEADERS -fPIC -DTAU_MPI -DTAU_UNIFY -DTAU_MPI_THREADED -DTAU_LINUX_TIMERS -DTAU_MPIGREQUEST -DTAU_MPIDATAREP -DTAU_MPIERRHANDLER -DTAU_CRAYCNL -DTAU_AT_FORK -DTAU_MPICONSTCHAR -DTAU_MPIATTRFUNCTION -DTAU_MPITYPEEX -DTAU_MPIADDERROR -DTAU_LARGEFILE -D_LARGEFILE64_SOURCE -DTAU_BFD -DTAU_MPIFILE -DHAVE_GNU_DEMANGLE -DHAVE_TR1_HASH_MAP -DTAU_SS_ALLOC_SUPPORT -DEBS_CLOCK_RES=1 -DTAU_STRSIGNAL_OK -DTAU_TRACK_LD_LOADER -DTAU_MPICH3 -DTAU_MPI_EXTENSIONS -DTAU_SUPPRESS_PTHREAD_CREATE_WRAPPER -DTAU_ELF_BFD -I/ccs/home/sameer/tau2/include -I/opt/cray/pe/mpich/8.1.12/ofi/amd/4.4/include -g -flegacy-pass-manager -fplugin=/home/dsalinas/work/swdev-328441/submit/TAU_Profiling_CXX.so -mllvm -tau-input-file=s.tau -o matmult.o -v And this is the error: error: unable to load plugin '/home/dsalinas/work/swdev-328441/submit/TAU_Profiling_CXX.so': '/home/dsalinas/work/swdev-328441/submit/TAU_Profiling_CXX.so: undefined symbol: _ZN4llvm2cl15GeneralCategoryE' Though maybe the issue is I'm missing some of your headers? I noticed in the description of this ticket that you're calling /opt/rocm-5.0.2/bin/hipcc, but in the output from -v I see "/opt/rocm-4.5.0". I'm wondering if you may have an issue with how you installed ROCm 5.0.2. |
Hi David, Yes, it looks like an incompatibility between the LLVM framework used as a base layer for hipcc and the one expected by the plugin. I have never seen this specific symbol causing trouble, but one thing we need to be careful about is that the compiler used to compile the plugin needs to be more or less the same as used to compile the compiler. So if your hipcc framework and compiler has been compiled with LLVM, then you need to compile the plugin using clang++, otherwise if it was compiled with gcc, then you need to compile the plugin using a "close enough" version of gcc. |
@sameershende I think there are two issues here: 1) hipcc does not behave the same with C source versus C++ source, and 2) hipcc is not handling the -fplugin arguments as expected (for C++ source). For issue 1) this behaviour is inherent in that HIP is a C++ API and Kernel language, and C source files are not HIP source files. The hipcc command/script invokes Clang specially for C++/HIP source files, but not for C source files. For issue 2), I think this is a duplicate of the other issue you opened: #2453 , where hipcc is not handling the plugin arguments as expected. I'd like to close this issue as a duplicate of #2543 . |
Sounds good. Please close it. |
closing as a duplicate of #2543 |
In ROCm 5.0.2 (and earlier versions), the hipcc script gives an error while passing an argument to an LLVM plugin (loaded using the legacy pass manger) to a C++ file. The exact same command works for C files. Here is an example with the TAU Performance System passing a selective instrumentation file with exclude/include list of functions to a compiler-based instrumentation plugin for LLVM using the -flegacy-pass-manager compiler option:
The text was updated successfully, but these errors were encountered: