cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

kenobrien
Journeyman III

AMDTPowerProfileAPI on Linux has unknown external dependencies

I have created an application using the AMDTPowerProfileAPI api in AMD_CodeXL_Linux_x86_64_1.8.9654/SDK/AMDTPowerProfile/bin/x86_64/

When I attempt to link with libAMDTPowerProfileAPI.so, I get linker errors:

./lib/libAMDTPowerProfileAPI.so: undefined reference to `osCriticalSectionLocker::osCriticalSectionLocker(osCriticalSection&)'

./lib/libAMDTPowerProfileAPI.so: undefined reference to `osCriticalSectionLocker::leaveCriticalSection()'

./lib/libAMDTPowerProfileAPI.so: undefined reference to `osCriticalSectionLocker::~osCriticalSectionLocker()'

./lib/libAMDTPowerProfileAPI.so: undefined reference to `osCriticalSection::osCriticalSection()'

./lib/libAMDTPowerProfileAPI.so: undefined reference to `osCriticalSection::~osCriticalSection()'

collect2: error: ld returned 1 exit status

I would call this a bug. Please may I have the correct linker flags to use this library. It is not given in the documentation.

Thanks.

0 Likes
1 Solution
rajeebbarman
Staff

Hi,

Since AMDTPowerProfileAPI.so has depenedencies on
AMDTOSWrappers and AMDTBaseTools shared libraries we are getting this errors.
These shared library is located in AMD_CodeXL_Linux_x86_64_1.8.9654 directory.

Assuming test program is located in
AMD_CodeXL_Linux_x86_64_1.8.XX/SDK/AMDTPowerProfile/bin/x86_64 directory as
test.cpp and we are also executing from the same directory, we can perform the
following steps to execute the test code.

  1. Set the LD_LIBRARY_PATH.

              
export LD_LIBRARY_PATH=export LD_LIBRARY_PATH=../../../../

  1. Set the linker flags

              
g++ test.cpp -I../../inc/ -L. -lAMDTPowerProfileAPI -L../../../../
-lAMDTOSWrappers -lAMDTBaseTools -o test

  1. Execute

              
./test

              

Regards

Aalok

View solution in original post

0 Likes
1 Reply
rajeebbarman
Staff

Hi,

Since AMDTPowerProfileAPI.so has depenedencies on
AMDTOSWrappers and AMDTBaseTools shared libraries we are getting this errors.
These shared library is located in AMD_CodeXL_Linux_x86_64_1.8.9654 directory.

Assuming test program is located in
AMD_CodeXL_Linux_x86_64_1.8.XX/SDK/AMDTPowerProfile/bin/x86_64 directory as
test.cpp and we are also executing from the same directory, we can perform the
following steps to execute the test code.

  1. Set the LD_LIBRARY_PATH.

              
export LD_LIBRARY_PATH=export LD_LIBRARY_PATH=../../../../

  1. Set the linker flags

              
g++ test.cpp -I../../inc/ -L. -lAMDTPowerProfileAPI -L../../../../
-lAMDTOSWrappers -lAMDTBaseTools -o test

  1. Execute

              
./test

              

Regards

Aalok

0 Likes