Hi,
I am Yunchuan Li, currently an intern student at UBC. Now I face some problem in compiling the FAST_SFunc for 64 bit Matlab with the FASTGateway.f90 and make_FAST_SFunc.m downloaded from the online folder.
My compiler is Intel Fortran Composer XE 2013 SP1. I use Microsoft Visual Studio 2013 and 64 bit version of Matlab R2013a to compile the FAST_SFunc.
I set my intelf13msvs2012opts.bat file like this:
@echo off
rem INTELF13MSVS2012OPTS.BAT
rem
rem Compile and link options used for building MEX-files using the
rem Intel? Fortran Compiler 13.0 with the Microsoft? Visual Studio?
rem 2012 Professional Edition linker.
rem
rem StorageVersion: 1.0
rem FortrankeyFileName: INTELF13MSVS2012OPTS.BAT
rem FortrankeyName: Intel Visual Fortran
rem FortrankeyManufacturer: Intel
rem FortrankeyVersion: 13.0
rem FortrankeyLanguage: Fortran
rem FortrankeyLinkerName: Microsoft Visual Studio 2012
rem FortrankeyLinkerVersion: 11.0
rem
rem $Revision: 1.1.6.1 $ $Date: 2012/09/25 18:20:21 $
rem
rem ********************************************************************
rem General parameters
rem ********************************************************************
set MATLAB=E:\Program Files\MATLAB\R2013a
set IFORT_COMPILER13=C:\Program Files (x86)\Intel\Composer XE 2013 SP1
set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 12.0
set VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
rem In this case, LINKERDIR is being used to specify the location of the SDK
set LINKERDIR=C:\Program Files (x86)\Windows Kits\8.0
set PATH=%IFORT_COMPILER13%\Bin\Intel64;%VCINSTALLDIR%\bin\amd64;%LINKERDIR%\bin\x64;%VCINSTALLDIR%\BIN;%VSINSTALLDIR%\Common7\Tools;%VSINSTALLDIR%\Common7\Tools\bin;%MATLAB_BIN%;%PATH%
set INCLUDE=%IFORT_COMPILER13%\compiler\Include;%LINKERDIR%\include\um;%LINKERDIR%\include\shared;%LINKERDIR%\include\winrt;%VCINSTALLDIR%\ATLMFC\INCLUDE;%VCINSTALLDIR%\INCLUDE;%VCINSTALLDIR%\VCPackages;%INCLUDE%
set LIB=%IFORT_COMPILER13%\compiler\Lib\Intel64;%LINKERDIR%\LIB\win8\um\x64;%VCINSTALLDIR%\LIB\amd64;%VCINSTALLDIR%\ATLMFC\LIB\amd64;%MATLAB%\extern\lib\win64;%LIB%
set MW_TARGET_ARCH=win64
rem ********************************************************************
rem Compiler parameters
rem ********************************************************************
set COMPILER=ifort
set COMPFLAGS= /fpp /Qprec /assume:byterecl /traceback /real_size:64 /Qzero /Qsave “/I%MATLAB%/extern/include” -c -nologo -DMATLAB_MEX_FILE /MD /fp:source
set OPTIMFLAGS=/O2 /DNDEBUG
set DEBUGFLAGS=/Z7
set NAME_OBJECT=/Fo
rem ********************************************************************
rem Linker parameters
rem ********************************************************************
set LIBLOC=E:\Program Files\MATLAB\R2013a\extern\lib\win64\microsoft
set LINKER=link
set LINKFLAGS=/dll /export:MEXFUNCTION /LIBPATH:“%LIBLOC%” libmx.lib libmex.lib libmat.lib /implib:“%LIB_NAME%.x” /MAP:“%OUTDIR%%MEX_NAME%%MEX_EXT%.map” /NOLOGO /manifest /INCREMENTAL:NO
set LINKOPTIMFLAGS=
set LINKDEBUGFLAGS=/debug /PDB:“%OUTDIR%%MEX_NAME%%MEX_EXT%.pdb”
set LINK_FILE=
set LINK_LIB=
set NAME_OUTPUT=/out:“%OUTDIR%%MEX_NAME%%MEX_EXT%”
set RSP_FILE_INDICATOR=@
rem ********************************************************************
rem Resource compiler parameters
rem ********************************************************************
set RC_COMPILER=rc /fo “%OUTDIR%mexversion.res”
set RC_LINKER=
set POSTLINK_CMDS=del “%LIB_NAME%.x” “%LIB_NAME%.exp”
set POSTLINK_CMDS1=mt -outputresource:“%OUTDIR%%MEX_NAME%%MEX_EXT%”;2 -manifest “%OUTDIR%%MEX_NAME%%MEX_EXT%.manifest”
set POSTLINK_CMDS2=del “%OUTDIR%%MEX_NAME%%MEX_EXT%.manifest”
set POSTLINK_CMDS3=del “%OUTDIR%%MEX_NAME%%MEX_EXT%.map”
But when I try to compile the FAST_SFunc, it results in errors:
→ link /out:“FAST_SFunc.mexw64” /dll /export:MEXFUNCTION /LIBPATH:“E:\Program Files\MATLAB\R2013a\extern\lib\win64\microsoft” libmx.lib libmex.lib libmat.lib /implib:“C:\Users\CEL\AppData\Local\Temp\mex_kBGAR3\templib.x” /MAP:“FAST_SFunc.mexw64.map” /NOLOGO /manifest /INCREMENTAL:NO @C:\Users\CEL\AppData\Local\Temp\mex_kBGAR3\mex_tmp.rsp
Creating library C:\Users\CEL\AppData\Local\Temp\mex_kBGAR3\templib.x and object C:\Users\CEL\AppData\Local\Temp\mex_kBGAR3\templib.exp
MSVCRT.lib(crtdll.obj) : error LNK2019: unresolved external symbol __imp_EncodePointer referenced in function pre_c_init
MSVCRT.lib(atonexit.obj) : error LNK2001: unresolved external symbol __imp_EncodePointer
MSVCRT.lib(crtdll.obj) : error LNK2019: unresolved external symbol __imp_DecodePointer referenced in function _CRT_INIT
MSVCRT.lib(atonexit.obj) : error LNK2001: unresolved external symbol __imp_DecodePointer
MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_QueryPerformanceCounter referenced in function __security_init_cookie
MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentProcessId referenced in function __security_init_cookie
MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentThreadId referenced in function __security_init_cookie
MSVCRT.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetSystemTimeAsFileTime referenced in function __security_init_cookie
MSVCRT.lib(dllmain.obj) : error LNK2019: unresolved external symbol __imp_DisableThreadLibraryCalls referenced in function DllMain
FAST_SFunc.mexw64 : fatal error LNK1120: 7 unresolved externals
E:\PROGRA~1\MATLAB\R2013A\BIN\MEX.PL: Error: Link of ‘FAST_SFunc.mexw64’ failed.
Error using mex (line 206)
Unable to complete successfully.
Error in make_FAST_SFunc (line 69)
mex(‘-v’ , … %verbose
When I did this on 32 bit Version of Matlab and try to comile FAST_SFunc for 32bit Matlab, it compiles smoothly without any error.
I don’t know what the link error is and really exhausted of ideas on how to fix the problem.
Does any body have ideas on how to solve this problem.
Thank you!
Yunchuan