Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6981 Discussions

Building building mkl_dfti.h with icpc on MacOSX-10.6

Sunny_Beast
Beginner
254 Views
Dear Support Provider

I am trying to build the following code using icpc and MKL library provided with C++ composerxe-2011.4.184 using Xcode.


#include
#include


main (){
complex x[64][64];
int loop = 0;
DFTI_DESCRIPTOR_HANDLE my_desc1_handle;
MKL_LONG status, l[2];

for (int ro = 0; ro<64; ro++)
for (int pe = 0; pe<64; pe++) {
x[ro][pe] = complex (1,1);
loop++;
}
l[0] = 64; l[1] = 64;

status = DftiCreateDescriptor( &my_desc1_handle, DFTI_SINGLE, DFTI_COMPLEX, 2, 1 );
status = DftiCommitDescriptor( my_desc1_handle);
status = DftiComputeForward( my_desc1_handle, x);
status = DftiFreeDescriptor(&my_desc1_handle);
}

It giges the following error with warnig symbols(s) not defined.

Ld /Users/shubhamgupta/Desktop/test/Debug/SENSE_SG normal x86_64
cd /Users/shubhamgupta/Desktop/SENSE_SG
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/icpc -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -L/Users/shubhamgupta/Desktop/test/Debug -L/Developer/opt/intel/composerxe-2011.4.184/mkl/lib -L/Developer/opt/intel/composerxe-2011.4.184/mkl/lib/locale -L/Developer/opt/intel/composerxe-2011.4.184/mkl/lib/locale/en_US -F/Users/shubhamgupta/Desktop/test/Debug -filelist /Users/shubhamgupta/Desktop/test/SENSE_SG.build/Debug/SENSE_SG.build/Objects-normal/x86_64/SENSE_SG.LinkFileList -mmacosx-version-min=10.6 -dev-usr-root=/Developer/usr "" "" -o /Users/shubhamgupta/Desktop/test/Debug/SENSE_SG

Undefined symbols:
"_DftiFreeDescriptor", referenced from:
_main in main.o
"_DftiComputeForward", referenced from:
_main in main.o
"_DftiCommitDescriptor", referenced from:
_main in main.o
"_DftiCreateDescriptor_s_md", referenced from:
_main in main.o
ld: symbol(s) not found
Command /Developer/usr/bin/icpc failed with exit code 1


//please provide the trick or solution for buliding the above code.
0 Kudos
1 Reply
barragan_villanueva_
Valued Contributor I
254 Views
Hi,

Please check that variable l[2] of type MKL_LONG is used as the last argument in the following line:
status = DftiCreateDescriptor( &my_desc1_handle, DFTI_SINGLE, DFTI_COMPLEX, 2,l );

Also, correct your linking line using Intel MKL Link Line Advisor
0 Kudos
Reply