Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Mengtao_Yuan
Beginner
188 Views

Run time error

I am trying to include a Fortran package Ain my VC++ projectd (visual studio 2008). The Fortran package calls BLAS/LAPACK routines.
I use Intel Fortran compiler 11.1.065to compile the package and generate static library A.lib. The properties in Fortran project are set as:
Runtime Library: "Debug Multithread DLL (/libs:dll /threads /dbglibs)"
Use Intel Math Kernel Library: "Parallel(/Qmkl:parallel)"

In VC++ project, A.lib is added as dependency. In C/C++ Code Generation property, I chose runtime library as "Multi-threaded Debug DLL (/MDd)", which is consistent to the Fortran project. The main.cc in successfully compiled and linked. However, when I try to run it there is runtime error:
"The application was unable to start correctly (0xc000007b). Click OK to close the application. "

However, if I keep the settings the same, but do not use Intel Math Kernel Library ("No"). The BLAS/LAPACK Fortran source codes are directlyincluded and compiled to generate A.lib. Using thisA.lib without MKL there is no runtime error in the VC++ project.

Since the difference is using and not using MKL, I would assume the runtime error is caused by something related to MKL.

Any suggestions?

0 Kudos
6 Replies
Mengtao_Yuan
Beginner
188 Views

No replies? I would assume this be a common problem of MKL. Any suggestion would be appreciated.
Chao_Y_Intel
Employee
188 Views


Hello,

Could it be possible to attach your project? It will help to find the problem more quickly.

Thanks,
Chao
Dmitry_B_Intel
Employee
188 Views

Hi,

A thread at Microsoft forum says [0xc000007b isSTATUS_INVALID_IMAGE_FORMAT - "The application or DLL %hs is not a valid Windows image.Please check this against your installation diskette." This suggests some file got corrupted and was not able to be interpreted as an executable file, for some reason.]

I guess the reason you are seeing the error is that wrong DLL is found; which mayoccur, for example, ifa 32-bit applicationlooks for DLLsin mkl/intel64/bin (path to dlls should be present in environment variable PATH when the application is run). The easiest way to know what the PATH is, is to insert something like this in your main() program:
printf("%s\n",getenv("PATH"));
and lookat the printout, it should contain this for 32-bit application
C:\Program Files\Intel\Compiler\11.1\065\mkl\ia32\bin
or this for 64-bit application
C:\Program Files\Intel\Compiler\11.1\065\mkl\intel64\bin

There is also dependency walker tool that may help to identify the problem. If "depends.exe" is not found in your MS VC installation, you could get it from here.

I hope this information will help you.
Thanks
Dima

Mengtao_Yuan
Beginner
188 Views

HI Dima,

You are right. The PATH pointed to C:\Program Files\Intel\Compiler\11.1\065\mkl\em64t\bin, while I am building the solution in 32bit mode! It looks like the environmental variablesoverwrite what I set in VSoptions.After I changed the path everything works OK.

Thanks
Mengtao_Yuan
Beginner
188 Views

I have another question related to this. If I want to build both 32bit and 64bit targets in my 64bit machine, what should I do? Now I can successfully build and run 32bit targets. To build 64bit targets, should I change the PATH and compile it again? Is there any automatic way to do it?

Thanks
Gennady_F_Intel
Moderator
188 Views

There are no automatic ways to do that under Microsoft Visual Studio* IDE ( from command line you can just call \tools\environment\ mklvarsem64t.bat file and link before building ..).

Please look at the MKL User's Guide ( see Chapter 10,Creating, Configuring, and Running the Intel C/C++ and/or Visual C++* 2008 Project ). May it will help you.

--Gennady

Reply