Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

broken cmake config for IPP

domin144
Beginner
1,174 Views

This is rather a bug report than a question, but I don't know where to put it.

Maybe at least this info will help others to workaround the problem.

 

After installing the IPP package from offline installer, cmake cannot properly find the libraries.

The package was installed on linux in used directory. The resulting cmake config is:

/home/domin144/intel/oneapi/ipp/2021.6.2/lib/cmake/ipp/ipp-config.cmake

The config advices to include following code in users cmake file:

find_package(IPP REQUIRED)
target_link_libraries(mytarget ${IPP_LIBRARIES})

 

This fails because the functions add_imported_library_target and add_components do not properly propagate the IPP_LIBRARIES variable to parent scope.

 

Example of failing CMakeLists.txt

cmake_minimum_required(VERSION 3.0)
project(intel_ipp_playground)

find_package(IPP REQUIRED)
message("IPP_FOUND = ${IPP_FOUND}")
message("IPP_LIBRARIES = ${IPP_LIBRARIES}")

add_executable(ipp-info)
target_sources(
    ipp-info
    PRIVATE
        ipp_info.cpp)
target_link_libraries(
    ipp-info
    PUBLIC
        ${IPP_LIBRARIES})
target_include_directories(
    ipp-info
    PUBLIC
        .)
set_property(TARGET ipp-info PROPERTY CXX_STANDARD 20)
set_property(TARGET ipp-info PROPERTY CXX_EXTENSIONS OFF)

cmake version is 3.18.4, but according to cmake documentation, the output should be same since at least cmake 3.0.0.

Build output:

[2/2 3.1/sec] Linking CXX executable ipp-info
FAILED: ipp-info 
: && /usr/bin/clang++-11 -g -rdynamic CMakeFiles/ipp-info.dir/ipp_info.cpp.o -o ipp-info   && :
/usr/bin/ld: CMakeFiles/ipp-info.dir/ipp_info.cpp.o: in function `main':
/home/domin144/sources/intel_ipp_playground/ipp_info.cpp:16: undefined reference to `ippInit'
/usr/bin/ld: /home/domin144/sources/intel_ipp_playground/ipp_info.cpp:17: undefined reference to `ippGetLibVersion'
/usr/bin/ld: /home/domin144/sources/intel_ipp_playground/ipp_info.cpp:20: undefined reference to `ippGetCpuFeatures'
/usr/bin/ld: /home/domin144/sources/intel_ipp_playground/ipp_info.cpp:22: undefined reference to `ippGetEnabledCpuFeatures'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

Workaround is to specify the libraries explicitly, e.g.:

target_link_libraries(
    ipp-info
    PUBLIC
        IPP::ippcore)

 

Labels (2)
4 Replies
NoorjahanSk_Intel
Moderator
1,144 Views

Hi,

 

Thanks for reaching out to us.

We are also able to reproduce the issue at our end. We are working on your issue, we will get back to you soon.

 

Thanks & Regards,

Noorjahan.

 

0 Kudos
xipix
Beginner
1,120 Views

Any update, @NoorjahanSk_Intel ?

 

Thank you

0 Kudos
NoorjahanSk_Intel
Moderator
1,119 Views

Hi,


Apologies for the delay.


This is a known issue and we have forwarded this issue to the development team. We will get back to you once we get any update about the fix on this issue.


Thanks & Regards,

Noorjahan.


0 Kudos
NoorjahanSk_Intel
Moderator
968 Views

Hi,

 

Thank you for your patience.

The issue raised by you has been fixed in the IPP 2021.8 version which will be released in the coming months. If the issue still persists with the new release, then you can start a new discussion for the community to investigate

 

Thanks & Regards,

Noorjahan.

 

0 Kudos
Reply