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

VML - user DLL

vikrantca
Beginner
1,503 Views
Hello,

Previously, there was an issue with the VML - i.e. not being able to build user/custom dll with VML with static linking.
Is this issue still present in 9.1 ?

I am trying to build a dll which requires the optimization solver and the VML. Turns out, the optimization solver requires static linking, but then, ALL my routines that call VML fail.
If I comment out the optimization solver calls and link dynamically, the VML calls work (the optimization calls dont work, ofcourse).

Any help is appreciated ?
Thank you.
vikrantca
0 Kudos
25 Replies
rockballad
Beginner
260 Views
Oops, I don't have the source code, how can I modify the header file and recompile the library? Fortunately I have done successfully with the second way in VS2005, but the DLL is in CDECL calling convention. I still need the STDCALL version, dear Andrey.

0 Kudos
Andrey_G_Intel2
Employee
260 Views

project -> properties -> c/c++ -> preprocessor

put MKL_VML_STDCALL to the "preprocessor definitions" field.

0 Kudos
rockballad
Beginner
260 Views
Thanks a lot! Very simple, right? I was so confused :-P

Thank you so much! I'll return with the Borland VML HowTo if I succeed!

Have a nice weekend!
0 Kudos
rockballad
Beginner
260 Views
OK. I found out the way to use MKL in Borland, using DLLs. Here's the progress:
  1. Building the custom DLL using MKL's tool. Run this command line in the directory <%MKL_ROOT%>9.1.027 oolsuilder:
    nmakeia32interface=cdeclname=mkl_vmlexport=vml_vsl_cdecl_list
    You'll get a file named mkl_vml.dll - This file will be used at run-time.

  2. Using IMPLIB utility as usual to import the lib for using at compile-time:
    IMPLIB-a-f-cmkl_vml.libmkl_vml.dll

  3. Create a console application in Borland to test. Save this project to a specific directory.

  4. The main function can be copied as <%MKL_ROOT%>9.1.027examplesvmlcsourcevdsin.c
    Notice, vssin using float array, vdsin using double, vzsin and vcsin using MKL_Complex type.

  5. Alt+F7 to access Project Setting. [C/C++ Compiler] -> [Path and defines] add the include dir to [Include search path], e.g. c:Program FilesIntelMKL9.1.027include

  6. Compile app now to let it create the output folder. Copy mkl_vml.dll to that output folder, copy mkl_vml.lib to the project folder.

  7. Right click at the project, [Add...] to add this lib file

  8. Run the project to test
I'd like to thank Andery very much for your help! Hope this quick HowTo will help someone who had the same problem.

Have a nice day!
0 Kudos
Andrey_G_Intel2
Employee
260 Views
Thank you for HowTo! :-)
0 Kudos
Reply