从英特尔 MKL 调用函数时 Matlab 崩溃
Matlab crashes when invoking functions from intel MKL
我正在尝试使用 Mex
函数 link Fortran
代码 Matlab
。我可以使用以下指令成功编译和 link 代码:
mex COMPFLAGS="$COMPFLAGS -Qopenmp -Qmkl"...
'-IC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include'...
'-LC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64'...
-lmkl_intel_ilp64.lib -lmkl_intel_thread.lib -lmkl_core.lib libiomp5md.lib...
ero_dep_fortran.F Module.F prepare_bank_collapse.F LINEAR_ELASTIC_STIFFNESS.F FAILURE_CRITERION.F OUTPUT.F pardisonew.F
但是,当我执行生成的.mexw64
函数时,Matlab崩溃了,没有任何错误信息。然后我逐行调试我的 Fortran
代码,我发现 Matlab
在调用来自 Intel MKL 库的函数 pardiso
时崩溃。似乎从 MKL 调用函数时,Matlab 会崩溃,我不知道如何修复它。
任何建议将不胜感激。
PS:感谢@Evg 的帮助。最后,以下指令有效:
mex COMPFLAGS="$COMPFLAGS -Qopenmp"...
'-IC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include'...
'-LC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64'...
-lmkl_intel_ilp64.lib -lmkl_intel_thread.lib -lmkl_core.lib libiomp5md.lib...
ero_dep_fortran.F Module.F prepare_bank_collapse.F LINEAR_ELASTIC_STIFFNESS.F FAILURE_CRITERION.F OUTPUT.F pardisonew.F
以前的补充:
我还尝试 运行 使用 makefile 作为 Intel Parallel Studio XE 2017 编译器上的代码:
ifort Module.F OUTPUT.F FAILURE_CRITERION.F pardisonew.F LINEAR_ELASTIC_STIFFNESS.F prepare_bank_collapse.F ero_dep_fortran.F /Qopenmp /Qmkl /nostandard-realloc-lhs /MD -o BANK_COLLAPSE.exe
生成的 .exe 有效。所以问题不是由代码本身或英特尔 MKL 库中的函数 pardiso
引起的。我猜当 Matlab 调用 pardiso
时有问题,尽管它成功地从 'seems' 到 link。
我使用 Matlab 2019b 和 Intel Parallel Studio XE 2017 for Fortran 和 Microsoft Visual Studio 2015 来编译和 link 代码。
使用-v
选项编译mex后的完整输出是
Verbose mode is on.
... Looking for compiler 'Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015' ...
... Looking for environment variable 'IFORT_COMPILER17' ...Yes ('C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\').
... Looking for file 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\Bin\intel64\ifort.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 14.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 14.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 14.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.1\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots' KitsRoot10 ...Yes ('C:\Program Files (x86)\Windows Kits\').
Found installed compiler 'Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015'.
Set PATH = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\bin\intel64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\..\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\..\Common7\Tools;C:\Program Files (x86)\Windows Kits.1\bin\x64;C:\Program Files (x86)\Windows Kits.1\Bin\x86;;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mpi\intel64\bin;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.4.210\windows\mpi\intel64\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\compiler;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi;C:\Users\zk1357\AppData\Local\Microsoft\WindowsApps;C:\Users\zk1357\AppData\Roaming\npm;C:\Delft3D\w32\lib;C:\PROGRA~1\Deltares\w32\lib;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MATLAB\MATLAB Compiler Runtime\v82\runtime\win64;"C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Windows\SysWOW64";C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\system32;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Polyspace\R2019b\runtime\win64;C:\Program Files\Polyspace\R2019b\bin;C:\Program Files\Polyspace\R2019b\polyspace\bin;C:\Users\zk1357\AppData\Local\Microsoft\WindowsApps;C:\Users\zk1357\AppData\Roaming\npm;"C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem";C:\Program Files (x86)\IntelSWTools\parallel_studio_xe_2017.5.060\compilers_and_libraries_2017\windows\bin\intel64;C:\Users\zk1357\iRIC\guis\prepost;
Set INCLUDE = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\include.0.10150.0\ucrt;C:\Program Files (x86)\Windows Kits.1\include\shared;C:\Program Files (x86)\Windows Kits.1\include\um;C:\Program Files (x86)\Windows Kits.1\include\winrt;C:\Program Files\Polyspace\R2019b\extern\include;;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\include.0.10150.0\ucrt;C:\Program Files (x86)\Windows Kits.1\include\shared;C:\Program Files (x86)\Windows Kits.1\include\um;C:\Program Files (x86)\Windows Kits.1\include\winrt;C:\Program Files\Polyspace\R2019b\extern\include;;
Set LIB = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Windows Kits\Lib.0.10150.0\ucrt\x64;C:\Program Files (x86)\Windows Kits.1\lib\winv6.3\um\x64;C:\Program Files\Polyspace\R2019b\lib\win64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Windows Kits\Lib.0.10150.0\ucrt\x64;C:\Program Files (x86)\Windows Kits.1\lib\winv6.3\um\x64;C:\Program Files\Polyspace\R2019b\lib\win64;
Set LIBPATH = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\Lib\Intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Windows Kits.1\LIB\x64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files\Polyspace\R2019b\extern\lib\win64;;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\Lib\Intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Windows Kits.1\LIB\x64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files\Polyspace\R2019b\extern\lib\win64;;
Options file details
-------------------------------------------------------------------
Compiler location: C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows
Options file: C:\Users\zk1357\AppData\Roaming\MathWorks\MATLAB\R2019b\mex_FORTRAN_win64.xml
CMDLINE200 : link /nologo /manifest /INCREMENTAL:NO /DLL /EXPORT:MEXFUNCTION /EXPORT:MEXFILEREQUIREDAPIVERSION C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj "/LIBPATH:C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\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:ero_dep_fortran.mexw64
CMDLINE250 : mt -outputresource:ero_dep_fortran.mexw64;2 -manifest "ero_dep_fortran.mexw64.manifest"
CMDLINE300 : del "ero_dep_fortran.exp" "ero_dep_fortran.lib" "ero_dep_fortran.mexw64.manifest" "ero_dep_fortran.ilk"
COMPILER : ifort
COMPFLAGS : /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64
COMPDEFINES : /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE
OPTIMFLAGS : /O2 /DNDEBUG
INCLUDE : -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include"
DEBUGFLAGS : /Z7
LINKER : link
LINKFLAGS : /nologo /manifest /INCREMENTAL:NO
LINKTYPE : /DLL
LINKEXPORT : /EXPORT:MEXFUNCTION
LINKEXPORTVER : /EXPORT:MEXFUNCTION /EXPORT:MEXFILEREQUIREDAPIVERSION
LINKLIBS : "/LIBPATH:C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\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:"ero_dep_fortran.mexw64.pdb"
LINKOPTIMFLAGS :
OBJEXT : .obj
LDEXT : .mexw64
SETENV : set COMPILER=ifort
set COMPFLAGS=/c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /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 (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\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)\IntelSWTools\compilers_and_libraries_2017.5.267\windows
VCROOT : C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
SDKROOT : C:\Program Files (x86)\Windows Kits.1\
KITSROOT : C:\Program Files (x86)\Windows Kits\
MATLABROOT : C:\Program Files\Polyspace\R2019b
ARCH : win64
SRC : "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\Module.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\prepare_bank_collapse.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\LINEAR_ELASTIC_STIFFNESS.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\FAILURE_CRITERION.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\OUTPUT.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\pardisonew.F";"C:\Program Files\Polyspace\R2019b\extern\version\fortran_mexapi_version.F"
OBJ : C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
OBJS : C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
SRCROOT : C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran
DEF : C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.def
EXP : "ero_dep_fortran.exp"
LIB : "ero_dep_fortran.lib"
EXE : ero_dep_fortran.mexw64
ILK : "ero_dep_fortran.ilk"
MANIFEST : "ero_dep_fortran.mexw64.manifest"
TEMPNAME : ero_dep_fortran
EXEDIR :
EXENAME : ero_dep_fortran
OPTIM : /O2 /DNDEBUG
LINKOPTIM :
CMDLINE100_0 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj
CMDLINE100_1 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\Module.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj
CMDLINE100_2 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\prepare_bank_collapse.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj
CMDLINE100_3 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\LINEAR_ELASTIC_STIFFNESS.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj
CMDLINE100_4 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\FAILURE_CRITERION.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj
CMDLINE100_5 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\OUTPUT.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj
CMDLINE100_6 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\pardisonew.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj
CMDLINE100_7 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Program Files\Polyspace\R2019b\extern\version\fortran_mexapi_version.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
-------------------------------------------------------------------
Building with 'Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015'.
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\Module.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\prepare_bank_collapse.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\LINEAR_ELASTIC_STIFFNESS.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\FAILURE_CRITERION.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\OUTPUT.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\pardisonew.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Program Files\Polyspace\R2019b\extern\version\fortran_mexapi_version.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
link /nologo /manifest /INCREMENTAL:NO /DLL /EXPORT:MEXFUNCTION /EXPORT:MEXFILEREQUIREDAPIVERSION C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj "/LIBPATH:C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\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:ero_dep_fortran.mexw64
Creating ero_dep_fortran.lib and ero_dep_fortran.exp
mt -outputresource:ero_dep_fortran.mexw64;2 -manifest "ero_dep_fortran.mexw64.manifest"
Microsoft (R) Manifest Tool version 6.3.9600.17336
Copyright (c) Microsoft Corporation 2012.
All rights reserved.
del "ero_dep_fortran.exp" "ero_dep_fortran.lib" "ero_dep_fortran.mexw64.manifest" "ero_dep_fortran.ilk"
MEX completed successfully.
最可能的原因是默认整数大小与MKL库接口版本不兼容。
LP64 需要 4 字节整数,ILP64 需要 8 字节整数。 mex
默认添加 /integer-size:64
option, thus making integers 8-byte long. But according to the documentation,使用 /Qmkl
选项编译器 links 针对 LP64 库。
要解决此问题,您需要 link 针对 ILP64
个库 explicitly。为此,删除 /Qopenmp /Qmkl
并使用 -lmkl_intel_ilp64.lib -lmkl_intel_thread.lib -lmkl_core.lib libiomp5md.lib
link 选项。
我正在尝试使用 Mex
函数 link Fortran
代码 Matlab
。我可以使用以下指令成功编译和 link 代码:
mex COMPFLAGS="$COMPFLAGS -Qopenmp -Qmkl"...
'-IC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include'...
'-LC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64'...
-lmkl_intel_ilp64.lib -lmkl_intel_thread.lib -lmkl_core.lib libiomp5md.lib...
ero_dep_fortran.F Module.F prepare_bank_collapse.F LINEAR_ELASTIC_STIFFNESS.F FAILURE_CRITERION.F OUTPUT.F pardisonew.F
但是,当我执行生成的.mexw64
函数时,Matlab崩溃了,没有任何错误信息。然后我逐行调试我的 Fortran
代码,我发现 Matlab
在调用来自 Intel MKL 库的函数 pardiso
时崩溃。似乎从 MKL 调用函数时,Matlab 会崩溃,我不知道如何修复它。
任何建议将不胜感激。
PS:感谢@Evg 的帮助。最后,以下指令有效:
mex COMPFLAGS="$COMPFLAGS -Qopenmp"...
'-IC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include'...
'-LC:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64'...
-lmkl_intel_ilp64.lib -lmkl_intel_thread.lib -lmkl_core.lib libiomp5md.lib...
ero_dep_fortran.F Module.F prepare_bank_collapse.F LINEAR_ELASTIC_STIFFNESS.F FAILURE_CRITERION.F OUTPUT.F pardisonew.F
以前的补充: 我还尝试 运行 使用 makefile 作为 Intel Parallel Studio XE 2017 编译器上的代码:
ifort Module.F OUTPUT.F FAILURE_CRITERION.F pardisonew.F LINEAR_ELASTIC_STIFFNESS.F prepare_bank_collapse.F ero_dep_fortran.F /Qopenmp /Qmkl /nostandard-realloc-lhs /MD -o BANK_COLLAPSE.exe
生成的 .exe 有效。所以问题不是由代码本身或英特尔 MKL 库中的函数 pardiso
引起的。我猜当 Matlab 调用 pardiso
时有问题,尽管它成功地从 'seems' 到 link。
我使用 Matlab 2019b 和 Intel Parallel Studio XE 2017 for Fortran 和 Microsoft Visual Studio 2015 来编译和 link 代码。
使用-v
选项编译mex后的完整输出是
Verbose mode is on.
... Looking for compiler 'Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015' ...
... Looking for environment variable 'IFORT_COMPILER17' ...Yes ('C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\').
... Looking for file 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\Bin\intel64\ifort.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows' ...Yes.
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7' 14.0 ...No.
... Looking for registry setting 'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' 14.0 ...Yes ('C:\Program Files (x86)\Microsoft Visual Studio 14.0\').
... Looking for file 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe' ...Yes.
... Looking for folder 'C:\Program Files (x86)\Microsoft Visual Studio 14.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.1\').
... Looking for registry setting 'HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots' KitsRoot10 ...Yes ('C:\Program Files (x86)\Windows Kits\').
Found installed compiler 'Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015'.
Set PATH = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\bin\intel64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\..\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\..\Common7\Tools;C:\Program Files (x86)\Windows Kits.1\bin\x64;C:\Program Files (x86)\Windows Kits.1\Bin\x86;;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mpi\intel64\bin;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.4.210\windows\mpi\intel64\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\mpirt;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32_win\compiler;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi;C:\Users\zk1357\AppData\Local\Microsoft\WindowsApps;C:\Users\zk1357\AppData\Roaming\npm;C:\Delft3D\w32\lib;C:\PROGRA~1\Deltares\w32\lib;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MATLAB\MATLAB Compiler Runtime\v82\runtime\win64;"C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Windows\SysWOW64";C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\system32;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Polyspace\R2019b\runtime\win64;C:\Program Files\Polyspace\R2019b\bin;C:\Program Files\Polyspace\R2019b\polyspace\bin;C:\Users\zk1357\AppData\Local\Microsoft\WindowsApps;C:\Users\zk1357\AppData\Roaming\npm;"C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem";C:\Program Files (x86)\IntelSWTools\parallel_studio_xe_2017.5.060\compilers_and_libraries_2017\windows\bin\intel64;C:\Users\zk1357\iRIC\guis\prepost;
Set INCLUDE = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\include.0.10150.0\ucrt;C:\Program Files (x86)\Windows Kits.1\include\shared;C:\Program Files (x86)\Windows Kits.1\include\um;C:\Program Files (x86)\Windows Kits.1\include\winrt;C:\Program Files\Polyspace\R2019b\extern\include;;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\include;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\include;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\include.0.10150.0\ucrt;C:\Program Files (x86)\Windows Kits.1\include\shared;C:\Program Files (x86)\Windows Kits.1\include\um;C:\Program Files (x86)\Windows Kits.1\include\winrt;C:\Program Files\Polyspace\R2019b\extern\include;;
Set LIB = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Windows Kits\Lib.0.10150.0\ucrt\x64;C:\Program Files (x86)\Windows Kits.1\lib\winv6.3\um\x64;C:\Program Files\Polyspace\R2019b\lib\win64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Lib\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\Lib\amd64;C:\Program Files (x86)\Windows Kits\Lib.0.10150.0\ucrt\x64;C:\Program Files (x86)\Windows Kits.1\lib\winv6.3\um\x64;C:\Program Files\Polyspace\R2019b\lib\win64;
Set LIBPATH = C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\Lib\Intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Windows Kits.1\LIB\x64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files\Polyspace\R2019b\extern\lib\win64;;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\Lib\Intel64;C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\compiler\lib\intel64_win;C:\Program Files (x86)\Windows Kits.1\LIB\x64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files\Polyspace\R2019b\extern\lib\win64;;
Options file details
-------------------------------------------------------------------
Compiler location: C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows
Options file: C:\Users\zk1357\AppData\Roaming\MathWorks\MATLAB\R2019b\mex_FORTRAN_win64.xml
CMDLINE200 : link /nologo /manifest /INCREMENTAL:NO /DLL /EXPORT:MEXFUNCTION /EXPORT:MEXFILEREQUIREDAPIVERSION C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj "/LIBPATH:C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\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:ero_dep_fortran.mexw64
CMDLINE250 : mt -outputresource:ero_dep_fortran.mexw64;2 -manifest "ero_dep_fortran.mexw64.manifest"
CMDLINE300 : del "ero_dep_fortran.exp" "ero_dep_fortran.lib" "ero_dep_fortran.mexw64.manifest" "ero_dep_fortran.ilk"
COMPILER : ifort
COMPFLAGS : /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64
COMPDEFINES : /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE
OPTIMFLAGS : /O2 /DNDEBUG
INCLUDE : -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include"
DEBUGFLAGS : /Z7
LINKER : link
LINKFLAGS : /nologo /manifest /INCREMENTAL:NO
LINKTYPE : /DLL
LINKEXPORT : /EXPORT:MEXFUNCTION
LINKEXPORTVER : /EXPORT:MEXFUNCTION /EXPORT:MEXFILEREQUIREDAPIVERSION
LINKLIBS : "/LIBPATH:C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\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:"ero_dep_fortran.mexw64.pdb"
LINKOPTIMFLAGS :
OBJEXT : .obj
LDEXT : .mexw64
SETENV : set COMPILER=ifort
set COMPFLAGS=/c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /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 (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\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)\IntelSWTools\compilers_and_libraries_2017.5.267\windows
VCROOT : C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
SDKROOT : C:\Program Files (x86)\Windows Kits.1\
KITSROOT : C:\Program Files (x86)\Windows Kits\
MATLABROOT : C:\Program Files\Polyspace\R2019b
ARCH : win64
SRC : "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\Module.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\prepare_bank_collapse.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\LINEAR_ELASTIC_STIFFNESS.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\FAILURE_CRITERION.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\OUTPUT.F";"C:\Users\zk1357\Desktop\Evolution_Code_Doubon\pardisonew.F";"C:\Program Files\Polyspace\R2019b\extern\version\fortran_mexapi_version.F"
OBJ : C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj;C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
OBJS : C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
SRCROOT : C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran
DEF : C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.def
EXP : "ero_dep_fortran.exp"
LIB : "ero_dep_fortran.lib"
EXE : ero_dep_fortran.mexw64
ILK : "ero_dep_fortran.ilk"
MANIFEST : "ero_dep_fortran.mexw64.manifest"
TEMPNAME : ero_dep_fortran
EXEDIR :
EXENAME : ero_dep_fortran
OPTIM : /O2 /DNDEBUG
LINKOPTIM :
CMDLINE100_0 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj
CMDLINE100_1 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\Module.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj
CMDLINE100_2 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\prepare_bank_collapse.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj
CMDLINE100_3 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\LINEAR_ELASTIC_STIFFNESS.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj
CMDLINE100_4 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\FAILURE_CRITERION.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj
CMDLINE100_5 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\OUTPUT.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj
CMDLINE100_6 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\pardisonew.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj
CMDLINE100_7 : ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Program Files\Polyspace\R2019b\extern\version\fortran_mexapi_version.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
-------------------------------------------------------------------
Building with 'Intel Parallel Studio XE 2017 for Fortran with Microsoft Visual Studio 2015'.
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\ero_dep_fortran.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\Module.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\prepare_bank_collapse.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\LINEAR_ELASTIC_STIFFNESS.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\FAILURE_CRITERION.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\OUTPUT.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Users\zk1357\Desktop\Evolution_Code_Doubon\pardisonew.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj
ifort /c /nologo /fpp /Qprec /MD /fp:source /assume:bscc -I"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\include" -I"C:\Program Files\Polyspace\R2019b\extern\include" /DMATLAB_DEFAULT_RELEASE=R2017b /DUSE_MEX_CMD /DMATLAB_MEX_FILE -Qopenmp -Qmkl /integer-size:64 /O2 /DNDEBUG "C:\Program Files\Polyspace\R2019b\extern\version\fortran_mexapi_version.F" /FoC:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj
link /nologo /manifest /INCREMENTAL:NO /DLL /EXPORT:MEXFUNCTION /EXPORT:MEXFILEREQUIREDAPIVERSION C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\ero_dep_fortran.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\Module.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\prepare_bank_collapse.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\LINEAR_ELASTIC_STIFFNESS.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\FAILURE_CRITERION.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\OUTPUT.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\pardisonew.obj C:\Users\zk1357\AppData\Local\Temp\mex_155853875819566_16652\fortran_mexapi_version.obj "/LIBPATH:C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2017.5.267\windows\mkl\lib\intel64" /LIBPATH:"C:\Program Files\Polyspace\R2019b\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:ero_dep_fortran.mexw64
Creating ero_dep_fortran.lib and ero_dep_fortran.exp
mt -outputresource:ero_dep_fortran.mexw64;2 -manifest "ero_dep_fortran.mexw64.manifest"
Microsoft (R) Manifest Tool version 6.3.9600.17336
Copyright (c) Microsoft Corporation 2012.
All rights reserved.
del "ero_dep_fortran.exp" "ero_dep_fortran.lib" "ero_dep_fortran.mexw64.manifest" "ero_dep_fortran.ilk"
MEX completed successfully.
最可能的原因是默认整数大小与MKL库接口版本不兼容。
LP64 需要 4 字节整数,ILP64 需要 8 字节整数。 mex
默认添加 /integer-size:64
option, thus making integers 8-byte long. But according to the documentation,使用 /Qmkl
选项编译器 links 针对 LP64 库。
要解决此问题,您需要 link 针对 ILP64
个库 explicitly。为此,删除 /Qopenmp /Qmkl
并使用 -lmkl_intel_ilp64.lib -lmkl_intel_thread.lib -lmkl_core.lib libiomp5md.lib
link 选项。