Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
252 Views

Linking IPP with MinGW_64 for Windows undefined reference errors

We are using Qt 5.12.0 and MinGW 64bit for our Windows application.  We statically link IPP libraries to perform FFTs.

If I use MSVC2017 I get no link errors, however when I use mingw73_64 I get 234 errors, e.g. undefined reference to `__security_check_cookie', undefined reference to `__GSHandlerCheck' and undefined reference to `__chkstk'.

Note that to get just these errors, it is important to link the following libraries in this order: 1. ippsmt.lib 2. ippvmt.lib 3. ippcoremt.lib; otherwise you get more errors.  The library order does not matter if using MSVC2017.

I find if I include the following code I can successfully link to the IPP libraries for Windows using mingw_64:

#ifdef __MINGW64__
void __chkstk() {}
void __GSHandlerCheck() {}
void __security_check_cookie() {}
#endif //__MINGW64__

1. Does Intel IPP support MinGW?  If not, does it only support MSVC compilers? 

2. Can you (Intel) clearly post what compilers IPP does support? Or point me where it is documented as I can't seem to find it?

3. Does the above "void _functionName() {}" workaround have any negative consequences?

4. Is there a better workaround than "void _functionName() {}"?

Thanks,

-Joe

Test Code:

#include <stdint.h>
#include <ipps.h>
int main()
{
  int size_fft_spec, size_fft_init_buffer, size_fft_work_buffer;
  ippsFFTGetSize_C_64fc(4, IPP_FFT_NODIV_BY_ANY, ippAlgHintNone, &size_fft_spec, &size_fft_init_buffer, &size_fft_work_buffer);

  return 0;
}

Compile and Link commands:
gcc -c -fno-keep-inline-dllexport -O2 -g -Wall -W -Wextra -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_QML_DEBUG -I..\ippTest -I. -I..\include -I..\include -IC:\Qt\5.12.0\mingw73_64\mkspecs\win32-g++  -o release\main.o ..\ippTest\main.c
g++ -Wl,-subsystem,console -mthreads -o release\ippTest.exe release/main.o  -LC:\<path>\ipp\lib -lippsmt -lippvmmt -lippcoremt 

Errors:

C:\<path>\ipp\lib/ippsmt.lib(C:/Temp/commander/build_lib/ipp-2019u1-rls/.build/windows/obj/intel64/ipps/mrg_cpu/k0/st/dfti_get_size_k0/dfti_get_size_k0---mkl_dft_avx512_dfti_get_size_dc1d.obj):(.text[k0_mkl_dft_avx512_dfti_get_size_dc1d]+0x1cd): undefined reference to `__security_check_cookie'

C:\<path>\ipp\lib/ippsmt.lib(C:/Temp/commander/build_lib/ipp-2019u1-rls/.build/windows/obj/intel64/ipps/mrg_cpu/k0/st/dfti_get_size_k0/dfti_get_size_k0---mkl_dft_avx512_dfti_get_size_dc1d.obj):(.xdata+0x14): undefined reference to `__GSHandlerCheck'

C:\<path>\ipp\lib/ippsmt.lib(C:/Temp/commander/build_lib/ipp-2019u1-rls/.build/windows/obj/intel64/ipps/mrg_cpu/k0/st/pscmndft_dftsfactmicca_k0/pscmndft_dftsfactmicca_k0---ownscDftInv_Prime14_32fc.obj):(.text[k0_ownscDftInv_Prime14_32fc]+0x10c9): undefined reference to `__chkstk'

0 Kudos
1 Reply
Highlighted
Employee
252 Views

Hi, 

IPP does not support the MinGW.  The "__security_check_cookie" some symbols from Microsoft libraries.  There is some workaround someone used before to pass the linkage errors:

https://software.intel.com/en-us/forums/intel-integrated-performance-primitives/topic/288853

thanks,
Chao

 

0 Kudos