Intel MKL 7.0 crashes Microsoft Excel 2000

Intel MKL 7.0 crashes Microsoft Excel 2000

Hello all!

I should start saying I am a new user of Intel MKL 7.0.

I am trying to create a dll (callable from Microsoft Excel 2000) that exports a function called func_pow_MKL. This function makes a call to one of the functions inside VML library, namely vdPowx.

Well, this is the implementation:

#include "mkl_vml.h"

double _stdcall func_pow_MKL(double x, double y) {

double arr1[1];

double arr2[1];

arr1[0] = x;

vdPowx(1, arr1, y, arr2);

return arr2[0];

}

I am using Visual Studio 6.0 on a machine with Windows 2000 operating system.

The Visual C++ project links to mkl_s.lib library. Also, I have included MKL_VML_STDCALL preprocessor identifier.

In an Excel Workbook, I have the following function declaration (in the VBA code):

Public Declare Function func_pow_MKL _

Lib "MKL_Test.dll" _

(ByVal x As Double, ByVal y As Double) As Double

The problem I have is Excel crashes every time I call func_pow_MKL function. While trying to debug my function I noticed that func_pow_MKL crashes whenever vdPowx(1, arr1, y, arr2); line is executed.

If I create a Win32 Console application (i.e. a simple exe program) func_pow_MKL works as expected. Also, if I comment vdPowx(1, arr1, y, arr2); line, Excel does not crash.

Any suggestions in how to use Intel MKL when implementing functions that are going to be used in Microsoft Excel?

Just in case, I have attached the Excel Workbook "MKL Test Wkbook.xls", as well as the files used in creating my test dll (MKL_TEST.dll). Change cell C6 (from MKL Test Wkbook.xls!Sheet1) to "=func_pow_MKL(C3,C4)" and you will get a beautiful Excel.exe - Application error message box... (however, before you try this, inside "MKL Test Wkbook.xls" vba's code, update "C:YourFolderHereMKL_Test.dll" to the proper path...)

Regards,

Manuel C.

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.