我试图执行Fortran语言编写的一个MATLAB MEX函数,采用Intel MKL与以下设置(每http://www.mathworks.com/support/compilers/R2015b/):“的模块无法找到”使用MATLAB MEX Fortran和英特尔MKL
- MATLAB 2015B,Win64的
- 的Visual Studio专业2013
- 英特尔Fortran的视觉作曲家XE 2013 SP1
- 的Rogue Wave IMSL * Fortran数值库7.0.1
到目前为止一切编译成功,例如,
mex -v Fsolution.f90 COMPFLAGS="/Qopenmp $COMPFLAGS" ...
-I"C:\Program Files (x86)\Intel\Composer XE 2013 SP1\redist\intel64\mkl" ...
-I"C:\Program Files (x86)\VNI\imsl\fnl701\Intel64\include\dll"
产生
... Looking for compiler 'Intel Visual Fortran Composer XE 2013 with Microsoft Visual Studio 2013' ...
... Looking for environment variable 'IFORT_COMPILER14' ...Yes ('C:\Program Files (x86)\Intel\Composer XE 2013 SP1\').
... Looking for file 'C:\Program Files (x86)\Intel\Composer XE 2013 SP1\/Bin/intel64/ifort.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Intel\Composer XE 2013 SP1\' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 12.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 12.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1' InstallationFolder ...Yes ('C:\Program Files (x86)\Windows Kits\8.1\').
Found installed compiler 'Intel Visual Fortran Composer XE 2013 with Microsoft Visual Studio 2013'.
Set PATH = C:\Program Files (x86)\Intel\Composer XE 2013 SP1\\bin\intel64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\..\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\..\Common7\Tools;C:\Program Files (x86)\Windows Kits\8.1\\bin\x64;C:\Program Files (x86)\Windows Kits\8.1\\Bin\x86;;C:\Program Files (x86)\VNI\imsl\fnl701\Intel64\lib;C:\Program Files (x86)\VNI\imsl\fnl701\IA32\lib;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\MATLAB\R2015b\runtime\win64;C:\Program Files\MATLAB\R2015b\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Skype\Phone\
Set INCLUDE = C:\Program Files (x86)\Intel\Composer XE 2013 SP1\\include;C:\Program Files (x86)\Intel\Composer XE 2013 SP1\\compiler\include;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\\include\shared;C:\Program Files (x86)\Windows Kits\8.1\\include\um;C:\Program Files (x86)\Windows Kits\8.1\\include\winrt;C:\Program Files\MATLAB\R2015b\extern\include;;
Set LIB = C:\Program Files (x86)\Intel\Composer XE 2013 SP1\\lib\intel64;C:\Program Files (x86)\Intel\Composer XE 2013 SP1\\compiler\lib\intel64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Windows Kits\8.1\\lib\winv6.3\um\x64;C:\Program Files\MATLAB\R2015b\lib\win64;
Set LIBPATH = C:\Program Files (x86)\Intel\Composer XE 2013 SP1\\compiler\Lib\Intel64;C:\Program Files (x86)\Windows Kits\8.1\\LIB\x64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\LIB\amd64;C:\Program Files\MATLAB\R2015b\extern\lib\win64;;
Options file details
-------------------------------------------------------------------
Compiler location: C:\Program Files (x86)\Intel\Composer XE 2013 SP1\
Options file: C:\Users\Marx\AppData\Roaming\MathWorks\MATLAB\R2015b\mex_FORTRAN_win64.xml
CMDLINE100 : ifort /c /Qopenmp /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\Intel\Composer XE 2013 SP1\redist\intel64\mkl" -I"C:\Program Files (x86)\VNI\imsl\fnl701\Intel64\include\dll" -I"C:\Program Files\MATLAB\R2015b\extern\include" /DMX_COMPAT_32 /DMATLAB_MEX_FILE /O2 /DNDEBUG "C:\Users\Marx\Dropbox\PRT Uncertainty\Code\Revised Manuscript\Habit-fixme-test\Fsolution.f90" /FoC:\Users\Marx\AppData\Local\Temp\mex_8780273189710_2516\Fsolution.obj
CMDLINE200 : link /nologo /manifest /INCREMENTAL:NO /DLL /EXPORT:MEXFUNCTION C:\Users\Marx\AppData\Local\Temp\mex_8780273189710_2516\Fsolution.obj /LIBPATH:"C:\Program Files\MATLAB\R2015b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /out:Fsolution.mexw64
CMDLINE250 : mt -outputresource:Fsolution.mexw64;2 -manifest Fsolution.mexw64.manifest
CMDLINE300 : del Fsolution.exp Fsolution.lib Fsolution.mexw64.manifest Fsolution.ilk
COMPILER : ifort
COMPFLAGS : /Qopenmp /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\Intel\Composer XE 2013 SP1\redist\intel64\mkl" -I"C:\Program Files (x86)\VNI\imsl\fnl701\Intel64\include\dll" -I"C:\Program Files\MATLAB\R2015b\extern\include" /DMX_COMPAT_32 /DMATLAB_MEX_FILE
COMPDEFINES : /DMX_COMPAT_32 /DMATLAB_MEX_FILE
OPTIMFLAGS : /O2 /DNDEBUG
INCLUDE : -I"C:\Program Files (x86)\Intel\Composer XE 2013 SP1\redist\intel64\mkl" -I"C:\Program Files (x86)\VNI\imsl\fnl701\Intel64\include\dll" -I"C:\Program Files\MATLAB\R2015b\extern\include"
DEBUGFLAGS : /Z7
LINKER : link
LINKFLAGS : /nologo /manifest /INCREMENTAL:NO
LINKTYPE : /DLL
LINKEXPORT : /EXPORT:MEXFUNCTION
LINKLIBS : /LIBPATH:"C:\Program Files\MATLAB\R2015b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
LINKDEBUGFLAGS : /debug /PDB:"Fsolution.mexw64.pdb"
LINKOPTIMFLAGS :
OBJEXT : .obj
LDEXT : .mexw64
SETENV : set COMPILER=ifort
set COMPFLAGS=/c /Qopenmp /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\Intel\Composer XE 2013 SP1\redist\intel64\mkl" -I"C:\Program Files (x86)\VNI\imsl\fnl701\Intel64\include\dll" -I"C:\Program Files\MATLAB\R2015b\extern\include" /DMX_COMPAT_32 /DMATLAB_MEX_FILE /DMX_COMPAT_32 /DMATLAB_MEX_FILE $MATLABMEX
set OPTIMFLAGS=/O2 /DNDEBUG
set DEBUGFLAGS=/Z7
set LINKER=link
set LINKFLAGS= /nologo /manifest /INCREMENTAL:NO /export:%ENTRYPOINT% /DLL /LIBPATH:"C:\Program Files\MATLAB\R2015b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /EXPORT:MEXFUNCTION
set LINKDEBUGFLAGS=/debug /PDB:"%OUTDIR%%MEX_NAME%.mexw64.pdb"
set NAME_OUTPUT=/out:"%OUTDIR%%MEX_NAME%%MEX_EXT%"
FORTRANROOT : C:\Program Files (x86)\Intel\Composer XE 2013 SP1\
VCROOT : C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
SDKROOT : C:\Program Files (x86)\Windows Kits\8.1\
MATLABROOT : C:\Program Files\MATLAB\R2015b
ARCH : win64
SRC : "C:\Users\Marx\Dropbox\PRT Uncertainty\Code\Revised Manuscript\Habit-fixme-test\Fsolution.f90"
OBJ : C:\Users\Marx\AppData\Local\Temp\mex_8780273189710_2516\Fsolution.obj
OBJS : C:\Users\Marx\AppData\Local\Temp\mex_8780273189710_2516\Fsolution.obj
SRCROOT : C:\Users\Marx\Dropbox\PRT Uncertainty\Code\Revised Manuscript\Habit-fixme-test\Fsolution
DEF : C:\Users\Marx\AppData\Local\Temp\mex_8780273189710_2516\Fsolution.def
EXP : Fsolution.exp
LIB : Fsolution.lib
EXE : Fsolution.mexw64
ILK : Fsolution.ilk
MANIFEST : Fsolution.mexw64.manifest
TEMPNAME : Fsolution
EXEDIR :
EXENAME : Fsolution
OPTIM : /O2 /DNDEBUG
LINKOPTIM :
-------------------------------------------------------------------
Building with 'Intel Visual Fortran Composer XE 2013 with Microsoft Visual Studio 2013'.
ifort /c /Qopenmp /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\Intel\Composer XE 2013 SP1\redist\intel64\mkl" -I"C:\Program Files (x86)\VNI\imsl\fnl701\Intel64\include\dll" -I"C:\Program Files\MATLAB\R2015b\extern\include" /DMX_COMPAT_32 /DMATLAB_MEX_FILE /O2 /DNDEBUG "C:\Users\Marx\Dropbox\PRT Uncertainty\Code\Revised Manuscript\Habit-fixme-test\Fsolution.f90" /FoC:\Users\Marx\AppData\Local\Temp\mex_8780273189710_2516\Fsolution.obj
link /nologo /manifest /INCREMENTAL:NO /DLL /EXPORT:MEXFUNCTION C:\Users\Marx\AppData\Local\Temp\mex_8780273189710_2516\Fsolution.obj /LIBPATH:"C:\Program Files\MATLAB\R2015b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /out:Fsolution.mexw64
Creating library Fsolution.lib and object Fsolution.exp
mt -outputresource:Fsolution.mexw64;2 -manifest Fsolution.mexw64.manifest
Microsoft (R) Manifest Tool version 6.3.9600.16384
Copyright (c) Microsoft Corporation 2012.
All rights reserved.
del Fsolution.exp Fsolution.lib Fsolution.mexw64.manifest Fsolution.ilk
MEX completed successfully.
然而,Fsolution.mexw64失败,出现以下错误执行:
Invalid MEX-file '...\Fsolution.mexw64': The specified module could not be found.
的Dependency Walker显示,
MKL_INTEL_THREAD.DLL "Error opening file. The system cannot find the file specified (2)."
作为替代我编译
mex -v Fsolution.f90 COMPFLAGS="/Qopenmp $COMPFLAGS" ...
-L"C:\Program Files (x86)\Intel\Composer XE 2013 SP1\mkl\lib\intel64" -lmkl_intel_thread ...
-I"C:\Program Files (x86)\VNI\imsl\fnl701\Intel64\include\dll"
但在这两种MATLAB和依赖学步车收到了同样的错误。其他不依赖于MKL_INTEL_THREAD.DLL的mex函数无错地执行。