undefined reference to 'dlerror' when using Intel ITTAPI

Hello everyone… I feel this is a straightforward problem, but I have been a bit stuck on fixing this problem.

I am following this link to profile performance anomaly:

https://software.intel.com/content/www/us/en/develop/documentation/vtune-cookbook/top/configuration-recipes/profiling-performance-anomalies.html

But having a bit of a hard time getting the program to compile.

Code is straightforward, just simply trying to create PT region by following the above tutorial:

However, upon trying to compile it using the below command:

Looking like I am having some issue with the linking/loading phase that is not related to installation?

I have also tried manually installing the API library from GitHub - intel/ittapi: Intel® Instrumentation and Tracing Technology (ITT) and Just-In-Time (JIT) APIs · GitHub and do things manually, but no luck, so I am asking for help…

VTune Profiler itself works properly; I have run the vtune-self-checker.sh and used vtune-gui to see whether I could do a simple analysis such as a hotspot.

Thank you in advance, and I would appreciate any suggestions.

Hi,

Thanks for posting in Intel forums.

Try the below command to compile your itt code.

icpc -g <cpp file> -I/opt/intel/oneapi/vtune/latest/sdk/include /opt/intel/oneapi/vtune/latest/sdk/lib64/libittnotify.a -lpthread -o <executable_name>

The above command is for cpp code.You can replace icpc with icc for c language code and these icc and icpc are classic compilers which are included in Intel HPC toolkit.

You can also refer the below itt documentation for other configurations.

https://software.intel.com/content/www/us/en/develop/documentation/vtune-help/top/api-support/instrumentation-and-tracing-technology-apis/basic-usage-and-configuration/attaching-itt-apis-to-a-launched-application.html

Regards,

Janani Chandran

Hi,

Is your issue resolved? Do you have any update?

Regards,

Janani Chandran

Dear JananiC,

I sincerely apologize for the late response; your suggestion of using the HPC toolkit compiler worked! I didn’t know such a compiler existed, so I’m glad I asked for help, or otherwise, I wouldn’t have been able to solve it.

Thank you for your help,

Kind regards.

Hi,

Thanks for accepting our solution.

If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.

Regards,

Janani Chandran