Hello,
We need your assistance with using the MKL library.
We are using the following configuration:
OS – Ubuntu 12.04 LTS 32 bit.
SDK – Eclipse 3.7.2.
Compiler - Intel IA-32 C++ Compiler (v13.0.0), using composer_xe_2013.1.117.
We are trying to run the following code:
int main()
{
double a[100], yr[100], yi[100[ ;
int n = 100;
vdSinCos(n,a,yi,yr);
double p1r[10], p2r[20], resultrr[30];
int n1 = 10, n2 = 20, start = 0, stride = 1;
vSLConvTaskPtr m_task;
vsldConvNewTask1D(&m_task, VSL_CONV_MODE_AUTO, n1, n2, n1);
vslConvSetStart(m_task, &start);
vsldConvExec(m_task, &p1r[0], &stride, &p2r[0], &stride, &resultrr[0], &stride);
vslConvDeleteTask(&m_task);
}
When we define dynamic linking to the MKL library the compilation and linking phase are completed with success
and we can run the program.
Our problem starts when we are trying to link the MKL statically.
From our knowledge, when using the –mkl flag the static linking should work without and further requirement of
us to specify any additional libraries of the MKL that should be linked since using the –mkl flag should enable all
the library functionality. But still, we are getting the following errors during the linking phase:
Building target: TestMath
Invoking: Intel IA-32 C++ Linker
icpc -static -L/opt/intel/composer_xe_2013.1.117/mkl/lib/ia32 -mkl=sequential -o "TestMath" ./src/TestMath.o
/. src/TestMath.o: In function `main ' :
/ home/user/workspace/TestMath/Debug/../src/TestMath.cpp:17: undefined reference to `vdSinCos '
/ home/user/workspace/TestMath/Debug/../src/TestMath.cpp:23: undefined reference to `vsldConvNewTask1D '
/ home/user/workspace/TestMath/Debug/../src/TestMath.cpp:24: undefined reference to `vslConvSetStart '
/ home/user/workspace/TestMath/Debug/../src/TestMath.cpp:25: undefined reference to `vsldConvExec '
/ home/user/workspace/TestMath/Debug/../src/TestMath.cpp:26: undefined reference to `vslConvDeleteTask '
We have tried to manually link specific libraries in order to overcome this linking issue and only after we have
specifically linked the mkl_intel, mkl_core and mkl_sequential libraries the project linking phase completes
without any error, with the exception of the vsIdConvExec function, so we have commented.
make -k all
Building file: ../src/TestMath.cpp
Invoking: Intel IA-32 C++ Compiler
icpc -g -mkl=sequential -I/opt/intel/composer_xe_2013.1.117/mkl/include -MMD -MP -MF"src/TestMath.d" -
MT"src/TestMath.d" -c -o "src/TestMath.o" "../src/TestMath.cpp"
Finished building: ../src/TestMath.cpp
Building target: TestMath
Invoking: Intel IA-32 C++ Linker
icpc -static -L/opt/intel/composer_xe_2013.1.117/mkl/lib/ia32 -mkl=sequential -o "TestMath"
./src/TestMath.o -lmkl_intel -lmkl_core -lmkl_sequential
Finished building target: TestMath
When we have tryied to uncomment the call to the vsIdConvExec function we got enormous number of
undefined reference errors.
Even when we`ve tried to statically link all the .a libraries in the ia32 folder we still got the undefined reference
erros.
Please advise how to configure correctly our static linking (shouldn’t –mkl be enough?) since dynamic linking is
not possible in order environment.
Thanks.
↧
Problems with Static Linking with MKL
↧