How to Compile FAST_v7.02.00d-bjj to get a FAST.exe file?

Dear all

I have got a questions about compuile FAST 7_v7.02.00d-bjj.

I have read the pdf “Instructions for Compiling FAST using IVF for Windows®” while I still encountered some problems. I have downloaded the Visual Studio 2013 with Intel Visual Fortran.

I followed the instructions in the pdf I mentioned to import the source files provided by FAST 7 into Visual Studio under the ‘Source’ folder. I changed all the settings as the pdf required but there are still errors when I tried to compile. I am wondering is there anything I need to do before compiling or I still lack something.

By the way, I tried to compile FAST8 and got an file ‘FAST_Project.exe’ but the size of it is 53M which twice the size of the FAST_x64.exe or FAST_win32.exe existed when I downloaded the FAST 8 archive. I am wondering if I was right or there is still some problem?

Thank you very much!

XING WEI

Please post the first errors you received when compiling. It’s very difficult to tell what’s wrong without specific error messages.

The size of the binary files (exe or dll) that are generated when compiling aren’t typically useful information, unless they’re 0 KB. Different versions of the compiler and different compiling options all can affect the size of the binary file. The best way to tell if it compiled properly is to run the code and test the results against known answers (like the FAST CertTest files).

Dear Jonkman

Thank you for your advice. I have compiled FAST_v7.02.00d-bjj successfully by following the pdf “Instructions for Compiling FAST using IVF for Windows®” and also changed a little bit of Project Properties in Visual Studio.

I selected the runtime library to Multithreaded which was blank there as can be seen in the attachment.

I am wondering if there will be any influence in generating SFunc.mex64 or compiling FAST_Library.dll or any other effect in the future?

Regards

XING WEI

The reason the Runtime Library was blank is that you have selected “All Configurations” and the individual configurations (Release, Debug) were set to different values. When all configurations are the same value, you will see a value there. If you selected “Release” or “Debug” separately, the property pages window would tell you what runtime library it is using.

I wouldn’t worry about the effect of using multithreaded libraries too much. In some rare cases (e.g., FAST v7’s LabVIEW interface) it can be dangerous, but generally it’s preferred.

Dear Jonkam

Thank you for your advice. I would like to raise another question about running the OpenLoop.mdl in MATLAB of the latest version FAST 8.

I generated a SFunc.mex64 file by MATLAB 2015b without compiling the FAST_Library.dll. Then I used the SFunc.mex64 I generated to run the OpenLoop.mdl. All the Test primary input files went well until Test18. I encountered an error shown below.

I checked the directory and found that DISCON_Win32.dll was there as well as DISCON_x64.dll. Hence I am confused by the reason of it.
The dll files are shwon below

Capture1.PNG

You could find that the modified data of DISCON_Win32.dll is different from others and that data is the day when I compiled FAST 8 to get FAST_Project.exe and used MATLAB 2015b to get SFunc.mex64. I am wondering is there any relations between these actions?

Thank you very much!

Regards

XING WEI

You are probably running a 64-bit version of Matlab and have not changed the ServoDyn input file to read the 64-bit version of the DLL. You will need to go into your ServoDyn input file and change the name of the DLL_FileName parameter.

Dear Xing,

It looks like you are running a 64-bit version of MATLAB but are trying to use a 32-bit version of the DISCON.dll. Both must use the same addressing scheme. Change the name of the DLL in the ServoDyn input file to DISCON_x64.dll to use the 64-bit version.

Best regards,

Dear Jonkman

Thank you for your advice and I have tried several times and finally made it. By the way, I am going to do something on TMD (tuned mass damper). I found that there is a TMD.f90 file in FAST 8 while I am wondering if there is a TMD file in FAST 7 because FAST 8 could not be linearized. I searched in the source file provided by FAST 7 finding that there is no such a file called TMD.f90. and I think maybe there are some codes about TMD in one file but I do not which one. Hope you can help me to figure it out. Thank you!

Regards

XING WEI

Dear Xing Wei,

Prof. Matthew Lackner of the University of Massachusetts developed a custom version of FAST v7 that had some of the features of the TMD submodule of FAST v7. This version was called FAST-SC. (Prof. Lackner and his students also developed the TMD submodule of FAST v8.) More information is the following forum topic: TMDs in ServoDyn module - #4 by Jason.Jonkman.

Best regards,

Dear Jonkman

Thank you for your advice. I have downloaded the FAST-SC and try to generate a SFunc.mex32 to use the simulink. While I was using the make_FAST_SFunc.m in MATLAB 2015a. I got some errors. Hope some one could figure it out. I have followed the instructions given by Prof. Matthew Lackner and got the errors shown below.

Options file specified on command line

→ Options file = intelf13msvs2012opts.bat
MATLAB = C:\Program Files (x86)\MATLAB\R2015a
→ COMPILER = ifort
→ Compiler flags:
COMPFLAGS = /assume:byterecl /traceback /real_size:64 /Qzero /Qsave /Qprec “/IC:\Program Files (x86)\MATLAB\R2015a/extern/include” -c -nologo -DMATLAB_MEX_FILE /MD /fp:source /assume:bscc
OPTIMFLAGS = /O2 /DNDEBUG
DEBUGFLAGS = /Z7
arguments =
Name switch = /Fo
→ Pre-linking commands =
→ LINKER = link
→ Link directives:
LINKFLAGS = /dll /export:MEXFUNCTION /LIBPATH:“C:\Program Files (x86)\MATLAB\R2015a\extern\lib\win32\microsoft” libmx.lib libmex.lib libmat.lib /implib:“C:\Users\u1591961\AppData\Local\Temp\mex_RKFZLE\templib.x” /MAP:“FAST_SC_SFunc.mexw32.map” /NOLOGO /manifest /INCREMENTAL:NO
LINKDEBUGFLAGS = /debug /PDB:“FAST_SC_SFunc.mexw32.pdb”
LINKFLAGSPOST =
Name directive = /out:“FAST_SC_SFunc.mexw32”
File link directive =
Lib. link directive =
Rsp file indicator = @
→ Resource Compiler = rc /fo “mexversion.res”
→ Resource Linker =

→ ifort /assume:byterecl /traceback /real_size:64 /Qzero /Qsave /Qprec “/IC:\Program Files (x86)\MATLAB\R2015a/extern/include” -c -nologo -DMATLAB_MEX_FILE /MD /fp:source /assume:bscc /FoC:\Users\u1591961\AppData\Local\Temp\mex_RKFZLE\DoubPrec.obj /O2 /DNDEBUG -DMX_COMPAT_32 “C:\Wind Turbine Files\FAST-SC-Files\NWTC_Lib\Source\DoubPrec.f90”

→ ifort /assume:byterecl /traceback /real_size:64 /Qzero /Qsave /Qprec “/IC:\Program Files (x86)\MATLAB\R2015a/extern/include” -c -nologo -DMATLAB_MEX_FILE /MD /fp:source /assume:bscc /FoC:\Users\u1591961\AppData\Local\Temp\mex_RKFZLE\SysMatlab.obj /O2 /DNDEBUG -DMX_COMPAT_32 “C:\Wind Turbine Files\FAST-SC-Files\NWTC_Lib\Source\SysMatlab.f90”

C:\Wind Turbine Files\FAST-SC-Files\NWTC_Lib\Source\SysMatlab.f90(64): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [IFPORT]
USE IFPORT
-----------------------------------^
C:\Wind Turbine Files\FAST-SC-Files\NWTC_Lib\Source\SysMatlab.f90(165): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [IFPORT]
USE IFPORT
-----------------------------------^
C:\Wind Turbine Files\FAST-SC-Files\NWTC_Lib\Source\SysMatlab.f90(245): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [IFPORT]
USE IFPORT
-----------------------------------^
C:\Wind Turbine Files\FAST-SC-Files\NWTC_Lib\Source\SysMatlab.f90(270): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [IFPORT]
USE IFPORT
-----------------------------------^
C:\Wind Turbine Files\FAST-SC-Files\NWTC_Lib\Source\SysMatlab.f90(298): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [IFPORT]
USE IFPORT !remove with use of next line (not implemented in all versions of the IVF compiler)
-----------------------------------^
C:\Wind Turbine Files\FAST-SC-Files\NWTC_Lib\Source\SysMatlab.f90(93): error #6404: This name does not have a type, and must have an explicit type. [FSTAT]
Status = FSTAT( Unit , StatArray )
---------------^
C:\Wind Turbine Files\FAST-SC-Files\NWTC_Lib\Source\SysMatlab.f90(256): error #6404: This name does not have a type, and must have an explicit type. [GETCWD]
Status = GETCWD ( DirName )
------------^
compilation aborted for C:\Wind Turbine Files\FAST-SC-Files\NWTC_Lib\Source\SysMatlab.f90 (code 1)

C:\PROGRAM FILES (X86)\MATLAB\R2015A\BIN\MEX.PL: Error: Compile of ‘C:\Wind Turbine Files\FAST-SC-Files\NWTC_Lib\Source\SysMatlab.f90’ failed.

Unable to complete successfully.

Error in make_FAST_SFunc (line 64)
mex(‘-v’ , … %verbose

It seems there is some problem with SysMatlab.f90 but I do not think Prof. Matthew Lackner modified anything in it. By the way, I used all the source files from FAST_v7.02.00d-bjj except the files modified by Prof. Matthew Lackner.

Thank you very much!

Regards

XING WEI

The error message says it can’t find IFPORT, which is an Intel-internal module. As the message indicates, you probably have a problem in your INCLUDE path in the FortranOptionsFile batch file. Please see this post for detail instructions on setting the correct PATH, INCLUDE, and LIB values for compiling FAST 7 in MATLAB: Beginner to Simulink and FAST V7 - #19 by Bonnie.Jonkman