# OC3 blade pitch control problem & its errors

**URL:** <https://forums.nlr.gov/t/oc3-blade-pitch-control-problem-its-errors/414>\
**Category:** Computer-Aided Engineering Software Tools\
**Created:** [October 16, 2011, 1:38am UTC](https://forums.nlr.gov/t/oc3-blade-pitch-control-problem-its-errors/414 "2011-10-16T01:38:10Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![Mehdi.Baghaee](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mehdi.Baghaee](https://forums.nlr.gov/u/Mehdi.Baghaee)\
**Post date:** [May 3, 2012, 11:34am UTC](https://forums.nlr.gov/t/oc3-blade-pitch-control-problem-its-errors/414/28 "2012-05-03T11:34:25Z")

</div>

Dear All,

I couldn’t install matlab 32bit on my machine, so started to compile mexw64 myself.  
I have installed IVF 11(32bit) and visual studio 2005 on my win 7 (64bit) machine.  
I changed “make\_FAST\_SFunc.m” file as below:  
FortranOptionsFile = ‘intelf11msvs2005opts.bat’;  
OutputRootName = ‘FAST\_SFunc’;  
NWTC\_LIB = ‘C:\Design Codes\NWTC\_Lib\_v1.03.01\Source’;  
WIND\_LOC = ‘C:\Design Codes\AeroDyn\Source\InflowWind\Source’;  
AD\_LOC = ‘C:\Design Codes\AeroDyn\Source’;  
FAST\_LOC = ‘C:\Design Codes\FAST\Source’;  
Sim\_LOC = ‘C:\Design Codes\FAST\Simulink\Source’;  
mex(‘-v’ , … %verbose  
‘-f’, FortranOptionsFile , … %file containing fortran options  
‘-output’, OutputRootName , … %name of the resulting mex function  
fullfile(NWTC\_LIB, ‘DoubPrec.f90’ ), …  
fullfile(NWTC\_LIB, ‘SysMatlab.f90’ ), …  
fullfile(NWTC\_LIB, ‘NWTC\_IO.f90’ ), …  
fullfile(NWTC\_LIB, ‘NWTC\_Num.f90’ ), …  
fullfile(NWTC\_LIB, ‘NWTC\_Aero.f90’ ), …  
fullfile(NWTC\_LIB, ‘NWTC\_Library.f90’ ), …  
fullfile(WIND\_LOC, ‘SharedInflowDefs.f90’), …  
fullfile(WIND\_LOC, ‘HHWind.f90’ ), …  
fullfile(WIND\_LOC, ‘FFWind.f90’ ), …  
fullfile(WIND\_LOC, ‘FDWind.f90’ ), …  
fullfile(WIND\_LOC, ‘CTWind.f90’ ), …  
fullfile(WIND\_LOC, ‘UserWind.f90’ ), …  
fullfile(WIND\_LOC, ‘InflowWindMod.f90’ ), …  
fullfile(AD\_LOC, ‘SharedTypes.f90’ ), …  
fullfile(AD\_LOC, ‘AeroMods.f90’ ), …  
fullfile(AD\_LOC, ‘GenSubs.f90’ ), …  
fullfile(AD\_LOC, ‘AeroSubs.f90’ ), …  
fullfile(AD\_LOC, ‘AeroDyn.f90’ ), …  
fullfile(FAST\_LOC, ‘FAST\_Mods.f90’ ), …  
fullfile(FAST\_LOC, ‘Noise.f90’ ), …  
fullfile(FAST\_LOC, ‘fftpack.f’ ), …  
fullfile(FAST\_LOC, ‘FFTMod.f90’ ), …  
fullfile(FAST\_LOC, ‘HydroCalc.f90’ ), …  
fullfile(FAST\_LOC, ‘AeroCalc.f90’ ), …  
fullfile(FAST\_LOC, ‘FAST\_IO.f90’ ), …  
fullfile(FAST\_LOC, ‘FAST.f90’ ), …  
fullfile(FAST\_LOC, ‘PitchCntrl\_ACH.f90’ ), …  
fullfile(FAST\_LOC, ‘SetVersion.f90’ ), …  
fullfile(FAST\_LOC, ‘UserSubs.f90’ ), …  
fullfile(FAST\_LOC, ‘UserVSCont\_KP.f90’ ), …  
fullfile(Sim\_LOC , ‘FASTSimulink.f90’ ), …  
fullfile(Sim\_LOC, ‘FASTGateway.f90’ ) );  
delete (‘\*.mod’)  
disp([‘mex completed: ’ OutputRootName ‘.’ mexext ’ has been created.’])

Also create the intelf11msvs2005opts batch file include:  
set MATLAB=C:\Program Files\MATLAB\R2010b  
SET IFORT\_COMPILER11=C:\Program Files (x86)\Intel\Compiler\11.0\066\fortran  
set VS80COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools  
set LINKERDIR=%VS80COMNTOOLS%....  
set PATH=%IFORT\_COMPILER11%\Bin\ia32;%LINKERDIR%\VC\BIN;%LINKERDIR%\Common7\Tools;%LINKERDIR%\Common7\Tools\bin;%LINKERDIR%\Common7\IDE;%LINKERDIR%\SDK\v2.0\bin;%PATH%  
set INCLUDE=%IFORT\_COMPILER11%\Include;%IFORT\_COMPILER11%\Include\ia32;%LINKERDIR%\VC\ATLMFC\INCLUDE;%LINKERDIR%\VC\INCLUDE;%LINKERDIR%\VC\PlatformSDK\include;%LINKERDIR%\SDK\v2.0\include;%INCLUDE%  
set LIB=%IFORT\_COMPILER11%\Lib\ia32;%LINKERDIR%\VC\ATLMFC\LIB\AMD64;%LINKERDIR%\VC\LIB\AMD64;%LINKERDIR%\VC\PlatformSDK\lib\AMD64;%LINKERDIR%\SDK\v2.0\lib\AMD64;%MATLAB%\extern\lib\win64;%LIB%  
set MW\_TARGET\_ARCH=win64  
set COMPILER=ifort  
set COMPFLAGS= /Qprec “/I%MATLAB%/extern/include” -c -nologo -DMATLAB\_MEX\_FILE /MD /fp:source /assume:bscc /assume:byterecl /traceback /real\_size:64 /Qzero /Qsave  
set OPTIMFLAGS=-Ox -DNDEBUG  
set DEBUGFLAGS=/Z7  
set NAME\_OBJECT=/Fo  
set LIBLOC=%MATLAB%\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 /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=@  
set RC\_COMPILER=rc /fo “%OUTDIR%mexversion.res”  
set RC\_LINKER=  
set POSTLINK\_CMDS=del “%OUTDIR%%MEX\_NAME%%MEX\_EXT%.map”  
set POSTLINK\_CMDS1=del “%LIB\_NAME%.x” “%LIB\_NAME%.exp”  
set POSTLINK\_CMDS2=mt -outputresource:“%OUTDIR%%MEX\_NAME%%MEX\_EXT%”;2 -manifest “%OUTDIR%%MEX\_NAME%%MEX\_EXT%.manifest”  
set POSTLINK\_CMDS3=del “%OUTDIR%%MEX\_NAME%%MEX\_EXT%.manifest”

Then run the “make\_FAST\_SFunc.m” file in matlab command window and tons of lines of commands passed as below:  
Annexed File  
[command line .txt](https://forums.nlr.gov/uploads/short-url/d83tZIiIa1q3seAt1Bt46amfxMP.txt) (79 KB)  
And at the end, the following error appeared in matlab command line:  
??? Error using ==\> mex at 208  
Unable to complete successfully.  
Error in ==\> make\_FAST\_SFunc at 65  
mex(‘-v’ , … %verbose

I myself think I set compiler parameters wrongly, or the IVF 32bit dont work with matlab2010b 64bit.  
Any way:  
Any help to fix this problem to create mexw64 will be appreciable.

Thanks  
Mehdi

---

_[View the full topic](https://forums.nlr.gov/t/oc3-blade-pitch-control-problem-its-errors/414)._
