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!

pthread_atfork link error with IPP

frenet
Beginner
150 Views
I am statically linking to the ipp, umc & uic libraries.I am using IPP 6.1.6.063 and have downloaded the 6.1 sample code. I am using g++.

I can build my own shared object that statically links to ipp and umc, but when I try to build an application that links to my shared object, I get the following link error:

/opt/intel/ipp/6.1.6.063/ia32/sharedlib/libiomp5.so: undefined reference to `pthread_atfork'

I did see the following note in this article:
Error message: /opt/intel/ipp/6.0.0.045/em64t/sharedlib/libiomp5.so: undefined reference to `pthread_atfork'
  • Please make sure to link "-lpthread" library in your command line.

I do have -lpthread specified, but the error still occurs. Here are my ipp library lists:

IPP_LIBS = "${IPP_DIR}/lib/libippdcemerged$(IPP_FILE_EXT).a" \\
"${IPP_DIR}/lib/libippdcmerged$(IPP_FILE_EXT).a""${IPP_DIR}/lib/libippccemerged$(IPP_FILE_EXT).a" \\
"${IPP_DIR}/lib/libippccmerged$(IPP_FILE_EXT).a""${IPP_DIR}/lib/libippcvemerged$(IPP_FILE_EXT).a" \\
"${IPP_DIR}/lib/libippcvmerged$(IPP_FILE_EXT).a""${IPP_DIR}/lib/libippjemerged$(IPP_FILE_EXT).a" \\
"${IPP_DIR}/lib/libippjmerged$(IPP_FILE_EXT).a" "${IPP_DIR}/lib/libippvcemerged$(IPP_FILE_EXT).a" \\
"${IPP_DIR}/lib/libippvcmerged$(IPP_FILE_EXT).a""${IPP_DIR}/lib/libippiemerged$(IPP_FILE_EXT).a" \\
"${IPP_DIR}/lib/libippimerged$(IPP_FILE_EXT).a" "${IPP_DIR}/lib/libippsemerged$(IPP_FILE_EXT).a" \\
"${IPP_DIR}/lib/libippsmerged$(IPP_FILE_EXT).a" "${IPP_DIR}/lib/libippcore$(IPP_FILE_EXT).a" \\
"${IPP_DIR}/sharedlib/libiomp5.so"

UIC_LIBS = "${UIC_IMAGE_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/uic_core_l.a" \\
"${UIC_IMAGE_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/uic_io_l.a" \\
"${UIC_IMAGE_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/uic_jpeg_enc_l.a" \\
"${UIC_IMAGE_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/uic_jpeg_dec_l.a" \\
"${UIC_IMAGE_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/uic_jpeg_common_l.a"

UMC_LIBS ="${UMC_AVCODEC_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/libmpeg4_mux.a" \\
"${UMC_AVCODEC_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/libscene_analyzer.a" \\
"${UMC_AVCODEC_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/libh264_enc.a" \\
"${UMC_AVCODEC_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/libcolor_space_converter.a" \\
"${UMC_AVCODEC_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/libumc_io.a" \\
"${UMC_AVCODEC_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/libmedia_buffers.a" \\
"${UMC_AVCODEC_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/libcommon.a" \\
"${UMC_AVCODEC_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/libumc.a" \\
"${UMC_AVCODEC_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/libvm_plus.a" \\
"${UMC_AVCODEC_DIR}/_bin/linux$(IPP_LIB_ARCH)_/lib/libvm.a"

I have added -lpthread before any of the ipp, uic or umc library lists.

Can anyone tell me what it is I am doing wrong?
Thanks.
0 Kudos
3 Replies
frenet
Beginner
150 Views
Adding -lpthread to the application that links to my shared object fixes this. Is there any way to avoid this? Is there a way to link to pthread in my shared object without requiring users to link to pthread in their own applications?
frenet
Beginner
150 Views
This is resolved.

Listing -lpthread after the IPP libraries fixed this issue.
Naveen_G_Intel
Employee
150 Views
Hi,
Nice to know that it works fine, In Linux, linking order is very important.

Regards,
Naveen Gv
Reply