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

MKL on command line

quantum_penguin
Beginner
511 Views

Hello,

I have the Intel Compiler with MKL, but I do not have Visual Studio or the like and thus must use the command line. This is not familiar to me at all.

Some sample code ('hello world' variety) has compiled fine, but the sample programs that use MKL functions do not work.

Specifically, I tried to compile,

C:Program FilesIntelMKL8.1examplesvslcsourcevdrnguniform.c and got the error 2019 unrecognized external for vslRngUniform and the like.

vdrnguniform.obj : error LNK2019: unresolved external symbol _vslNewStream referenced in function _main

vdrnguniform.obj : error LNK2019: unresolved external symbol _vslRngUniform referenced in function _main

vdrnguniform.obj : error LNK2019: unresolved external symbol _vslDeleteStream referenced in function _main

vdrnguniform.exe : fatal error LNK1120: 3 unresolved externals.

The command I used to compile it was "icl.exe vdrnguniform.c"

Thanks for the help!

0 Kudos
3 Replies
TimP
Honored Contributor III
511 Views
Even when you have the MKL library directory path, you still must name the libraries you want in your compile command, e.g.
icl -Qopenmp yourfile.c mkl_em64t.lib (if using the x64 icl).
0 Kudos
quantum_penguin
Beginner
511 Views

I tried this command with exactly the same error (with and without the -Qopenmp):

C:code>icl -Qopenmp uniform.cpp "C:Program FilesIntelMKL8.1ia32liblibgui
de40.lib" "C:Program FilesIntelMKL8.1ia32libmkl_ia32.lib"

Intel C++ Compiler for 32-bit applications, Version 9.1 Build 20060323Z Pa
ckage ID: W_CC_P_9.1.022
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.

uniform.cpp
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

-out:uniform.exe
-nodefaultlib:libguide_stats.lib
-nodefaultlib:libguide40_stats.lib
-defaultlib:libguide.lib
uniform.obj
"C:Program FilesIntelMKL8.1ia32liblibguide40.lib"
"C:Program FilesIntelMKL8.1ia32libmkl_ia32.lib"
uniform.obj : error LNK2019: unresolved external symbol _vslNewStream referenced
in function _main
uniform.obj : error LNK2019: unresolved external symbol _vdRngUniform referenced
in function _main
uniform.obj : error LNK2019: unresolved external symbol _vslDeleteStream referen
ced in function _main
uniform.exe : fatal error LNK1120: 3 unresolved externals

0 Kudos
quantum_penguin
Beginner
511 Views

Alright,

I did get SOMETHING to compile with this command:


C:code>icl -Qopenmp uniform.cpp "C:Program FilesIntelMKL8.1ia32libmkl_c
.lib"

but it did this...


Intel C++ Compiler for 32-bit applications, Version 9.1 Build 20060323Z Pa
ckage ID: W_CC_P_9.1.022
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.

uniform.cpp
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

-out:uniform.exe
-nodefaultlib:libguide_stats.lib
-nodefaultlib:libguide40_stats.lib
-defaultlib:libguide.lib
uniform.obj
"C:Program FilesIntelMKL8.1ia32libmkl_c.lib"
mkl_c.lib(_xerbla.obj) : warning LNK4078: multiple '_RDATA' sections found with
different attributes (C0300040)

The program seemed to work, but I'm not so sure I'm really linking the proper library. This was found by trial and error, and that warning sort of scares me.

Thanks again for the help!

0 Kudos
Reply