Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

including ipp libraries

Oleg_M_2
Beginner
1,483 Views

Hello!

I'm trying to use Intel IPP for signal processing. I began the work with the Add functions (ippsAdd_64f_A53 and ippsAdd_64f). I included ippvm.h, ippcore.h and ipps.h and wrote the CMakeLists.txt file as follows:

cmake_minimum_required(VERSION 3.7)
project(Test)
find_library(IPP_CORE libippcore.a PATHS /opt/intel/ipp/lib/intel64)
find_library(IPP_VM libippvm.a PATHS /opt/intel/ipp/lib/intel64)
find_library(IPP_S libipps.a PATHS /opt/intel/ipp/lib/intel64)
add_executable(Test main.cpp)
target_include_directories(Test PRIVATE /opt/intel/ipp/include)
target_link_libraries(Test ${IPP_CORE} ${IPP_VM} ${IPP_S})

The first of the function (_A53) works well, but while using the second one I get the following error:

/opt/intel/ipp/lib/intel64/libipps.a(jmp_ippsAdd_64f.o): In function 'in_ippsAdd_64f':
jmp_ippsAdd_64f.c:(.text+0x1): undefined reference to 'ippSafeInit'
/opt/intel/ipp/lib/intel64/libipps.a(jmp_ippsAdd_64f.o): In function 'ippsAdd_64f':
jmp_ippsAdd_64f.c:(.text+0x2a): undefined reference to 'ippJumpIndexForMergedLibs'

Tell me please, what is wrong? As I understand, I need to link some more libraries, but which of them?

Thanks in advance.

0 Kudos
8 Replies
Gennady_F_Intel
Moderator
1,483 Views

+ ipps.a

Oleg_M_2
Beginner
1,483 Views

Sorry, but as I understand you recomend including libipps.a. But I've already included it with:

find_library(IPP_S libipps.a PATHS /opt/intel/ipp/lib/intel64)
...
target_link_libraries(Test ${IPP_CORE} ${IPP_VM} ${IPP_S})

Could you, please explain my mistake?

Gennady_F_Intel
Moderator
1,483 Views

sorry, I missed that you added ipps.a lib, then at the first galnce everything looks correct.  Could you try to link this case explicitly w/o Cmake?

Sergey_K_Intel
Employee
1,483 Views

Hello,

Try to change the order of the libraries in "target_link_libraries" statement. First IPPS, then IPPVM and CORE at the end.
It's important for Linux linker.

Oleg_M_2
Beginner
1,483 Views

Sergey Khlystov (Intel) wrote:

Hello,

Try to change the order of the libraries in "target_link_libraries" statement. First IPPS, then IPPVM and CORE at the end.
It's important for Linux linker.

Thank you for the reply. I've tried - unfortunately it doesn't help.

Oleg_M_2
Beginner
1,483 Views

Gennady F. (Intel) wrote:

sorry, I missed that you added ipps.a lib, then at the first galnce everything looks correct.  Could you try to link this case explicitly w/o Cmake?

Yes, it works with both dynamic and static linking through using g++ command.

Now what could it be with cmake? I would be grateful for your help. Because g++ command is ok for test application, but not for the whole project))

Oleg_M_2
Beginner
1,483 Views

The answer appeared to be quite simple: cmake somehow links a static version of ipps and dynamic versions of other libs. As I understand, IPP needs to be whole static or whole dynamic. To do so I added

set(IPP_STATIC "ON")

to CMakeLists.txt

WoC
Beginner
814 Views

I see those names in several of the of the other ipp libs ... try adding more until the references are resolved.  e.g., try adding

find_library(IPP_I libippi.a PATHS /opt/intel/ipp/lib/intel64)
...
target_link_libraries(Test ${IPP_CORE} ${IPP_VM} ${IPP_S} ${IPP_I})

Also, I don't know if order matters (it matters to the linker), but it seems that the most

general library should be at the end :

target_link_libraries(Test  ${IPP_S} ${IPP_I}${IPP_VM}  ${IPP_CORE})

 

Reply