Compiling FAST with IVF

Hi again,

I’ve recently download the new FAST & AeroDyn archives and tried the new compile method using the file ‘Compile_Fast.bat’. It actually worked, in the sense that I got the file ‘Fast_test.exe’ apparently without errors. When doing so I got the following:

c:\Users\tolsaj\Desktop\CompilacionV7>Compile_Fast

Intel(R) Visual Fortran Compiler Professional for applications running on IA-32, Version 11.1.051
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

Setting environment for using Microsoft Visual Studio 2008 x86 tools.


Compiling FAST, AeroDyn, and NWTC_Library routines to create FAST_test.exe:
Intel(R) Visual Fortran Compiler Professional for applications running on IA-32, Version 11.1    Build 20091012 Package ID: w_cprof_p_11.1.051
Copyright (C) 1985-2009 Intel Corporation.  All rights reserved.

Space exceeded in Data Dependence Test in _FAST_IO_SUBS_mp_CHCKOUTLST
Subdivide routine into smaller ones to avoid optimization loss
An internal threshold was exceeded for routine _FAST_IO_SUBS_mp_CHCKOUTLST and optimization level may be reduced. See HTTP://SOFTWARE.INTEL.COM/EN-US/
ARTICLES/INTERNAL-THRESHOLD-WAS-EXCEEDED for more information and advice.
An internal threshold was exceeded for routine _FAST2ADAMSSUBS_mp_MAKEADM and optimization level may be reduced. See http://software.intel.com/en-us/a
rticles/internal-threshold-was-exceeded for more information and advice.
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:SingPrec.exe
-subsystem:console
-incremental:no
/out:FAST_test.exe
SingPrec.obj
SysIVF.obj
NWTC_IO.obj
NWTC_Num.obj
NWTC_Aero.obj
NWTC_Library.obj
SharedInflowDefs.obj
HHWind.obj
FFWind.obj
FDWind.obj
CTWind.obj
UserWind.obj
InflowWindMod.obj
SharedTypes.obj
AeroMods.obj
GenSubs.obj
AeroSubs.obj
AeroDyn.obj
fftpack.obj
FFTMod.obj
HydroCalc.obj
FAST_Mods.obj
Noise.obj
FAST_IO.obj
FAST.obj
FAST_Lin.obj
FAST2ADAMS.obj
PitchCntrl_ACH.obj
UserSubs.obj
UserVSCont_KP.obj
AeroCalc.obj
SetVersion.obj
FAST_Prog.obj


c:\Users\tolsaj\Desktop\CompilacionV7>

I was concerned about those ‘warnings’ with respect the routines _FAST_IO_SUBS_mp_CHCKOUTLST, _FAST_IO_SUBS_mp_CHCKOUTLST and _FAST2ADAMSSUBS_mp_MAKEADM. As read in the suggested websites, since I’m using version 11.1, I guess that the solution would be to use the switch /Qoverride-limits to avoid skipping optimizations.

What would be your advice? This kind of warning isn’t very important, is it? Should I do this and get full optimizations? The computer I’m using is a Quad-core with 8Gb of RAM, which I think should be enough…

Thanks in advance.

Best regards,
Javi

Hi, Javier.

I wouldn’t worry too much about the warnings about skipping the optimizations. We have briefly tested the run times for FAST compiled with IVF 11.1 (which gives the warnings below) compared with the code compiled with IVF 10.1 (which does not produce the warnings). In the comparison, the numerical results were the same to round-off error, and the run times were very similar on the same machine. In the future, we hope to modify the routines that give the warnings in IVF 11.1 so they can be better optimized and avoid warnings. For now, you can try the /Qoverride-limits switch–it might give you faster code, but if you are satisfied with the current simulation speed, it is not necessary.

Also, I guess I forgot to change the script to name the executable output “FAST.exe” instead of “FAST_test.exe” (I didn’t want to overwrite the old version when I was testing it). Sorry about that. Please change it in the script if it is annoying.

Best regards,
Bonnie

Hi Javier,

One more thing: these routines that are not fully optimized (ChckOutLst and MakeADM) are only used by FAST during model initialization. So their optimization is not critical to the solution time of FAST.

Best regards,

Thank you very much Jason and Bonnie for your quick response. I think I will leave it without using that switch.

Regards,
Javier

FAST build from IVF IDE…

I’ve just gotten the latest IVF from Intel, and was wondering if any FAST users have a “template” solution/project file that I could use as a starting point for building FAST from within the MS Visual Studio 2008 Shell IDE. I see that NREL ships FAST with a batch-file that acts as a make-file, but I think it might be mighty convenient to edit, compile, and build from right within the free IDE that ships with IVF.

*.sln file, comments, or suggestions all welcome.

Thanks

Toby Wehrhan
werhrhan@sbcglobal.net

Javier, Bonnie, Jason:

Unlike Javier, I can’t seem to get your DOS batch file for compiling and linking FAST to work properly. I’ve edited the location/path strings in the “SET” commands to point to my locations for FAST, AERODYN, etc. Also note that I had to change the location string for the IVF batch file “IFORTVARS.bat”-- my install of IVF put it in a different subdirectory than IFORT.exe.

Below is the batch file with my changes, and after that is a record of the errors displayed to the dos console. I get the optimization errors that Javier got, but I got two other more serious ones-- switch not recoginzed, and link not found.

Any help you can offer will be greatly appreciated. (Hope I’m not using up too much of your good will by asking so many questions on these forums.)

Sincerely,

Toby Wehrhan
wehrhan@sbcglobal.net

@ECHO OFF
REM ----------------------------------------------------------------------------
REM file: Build_FAST_test.bat
REM purpose: This batch file acts as a “make-file” for compiling, linking, and
REM building of FAST from FORTRAN source code.
REM rev: 04/30/2010 TGW created Build_FAST01.bat from Compile_FAST.bat
REM Compile_FAST.bat was downloaded from NREL design codes web site.
REM Changed locations of directories for source files.
REM ----------------------------------------------------------------------------

REM The calling syntax for this script is
REM Compile_FAST [dll]
REM
REM Add the “dll” to the command line to compile FAST for the Bladed-style dll.

REM ----------------------------------------------------------------------------
REM -------------------- LOCAL VARIABLES ---------------------------------------
REM ----------------------------------------------------------------------------

SET ROOT_NAME=FAST_test

SET COMPOPTS=/threads /inline:speed /optimize:5 /traceback /Qzero /Qsave /real_size:32 /assume:byterecl /nostand
rem SET LINKOPTS=/link /stack:64000000
SET LINKOPTS=/link

REM ----------------------------------------------------------------------------
REM ------------------------- LOCAL PATHS --------------------------------------
REM ----------------------------------------------------------------------------
REM – USERS WILL NEED TO EDIT THESE PATHS TO POINT TO FOLDERS ON THEIR LOCAL –
REM ------- NOTE: do not use quotation marks around the path names!!! ---------
REM ----------------------------------------------------------------------------
REM IVF_LOC is the location of the Intel Visual Fortran files (IFORTVARS.bat and IFORT.exe).
REM AeroDyn_Loc is the location of the AeroDyn source files
REM Wind_Loc is the location of the AeroDyn wind inflow source files
REM FAST_LOC is the location of the FAST source files
REM NWTC_Lib_Loc is the location of the NWTC subroutine library files
REM ----------------------------------------------------------------------------

REM SET IVF_LOC = C:\Program Files\Intel\Compiler\Fortran\10.1.024\IA32\Bin
REM SET NWTC_Lib_Loc = D:\DATA\Fortran\Fortran Subs\NWTC_subs\v1.02.00\Source
REM SET AeroDyn_Loc = D:\DATA\Fortran\IVF Projects\AeroDyn\Release\Source
REM SET Wind_Loc = D:\DATA\Fortran\IVF Projects\AeroDyn\Release\Source\InflowWind\Source
REM SET FAST_Loc = D:\DATA\Fortran\IVF Projects\FAST\Release\Source

SET IVF_LOC=C:\PROGRA~1\Intel\Compiler\11.1\065\bin\ia32
SET IVF_VARBAT_LOC=C:\PROGRA~1\Intel\Compiler\11.1\065\bin
SET NWTC_Lib_Loc=C:\NREL\NWTC_LIB\Source
SET AeroDyn_Loc=C:\NREL\AeroDyn\Source
SET Wind_Loc=C:\NREL\AeroDyn\Source\InflowWind\Source
SET FAST_Loc=C:\NREL\FAST\Source

REM ----------------------------------------------------------------------------
REM -------------------- LIST OF ALL SOURCE FILES ------------------------------
REM ----------------------------------------------------------------------------

SET IVF=“%IVF_LOC%\IFORT.EXE”

SET NWTC_Files=
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\SingPrec.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\SysIVF.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_IO.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Num.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Aero.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Library.f90”

SET Wind_Files=
SET Wind_Files=%Wind_Files% “%Wind_Loc%\SharedInflowDefs.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\HHWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\FFWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\FDWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\CTWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\UserWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\InflowWindMod.f90”

SET AeroDyn_Files=
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\SharedTypes.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroMods.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\GenSubs.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroSubs.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroDyn.f90”

SET FAST_Files=
SET FAST_Files=%FAST_Files% “%FAST_LOC%\fftpack.f”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FFTMod.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\HydroCalc.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Mods.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\Noise.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_IO.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Lin.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST2ADAMS.f90”

IF /I “%1”==“DLL” GOTO dllFiles

SET FAST_Files=%FAST_Files% “%FAST_LOC%\PitchCntrl_ACH.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserSubs.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserVSCont_KP.f90”

GOTO endFASTfiles

:dllFiles
SET FAST_Files=%FAST_Files% “%FAST_LOC%\BladedDLLInterface.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserSubs_forBladedDLL.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserVSCont_KP_forBladedDLL.f90”

REM NOTE: UserSubs_forBladedDLL.f90 is a copy of UserSubs.f90 with SUBROUTINES UserHSSBr() and UserYawCont() commented out
REM UserVSCont_KP_forBladedDLL.f90 is a copy of UserVSCont_KP.f90 with SUBROUTINE UserVSCont() commented out

SET ROOT_NAME=%ROOT_NAME%_DLL

:endFASTfiles
SET FAST_Files=%FAST_Files% “%FAST_LOC%\AeroCalc.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\SetVersion.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Prog.f90”

:ivf
REM ----------------------------------------------------------------------------
REM ---------------- COMPILE WITH INTEL VISUAL FORTRAN -------------------------
REM ----------------------------------------------------------------------------

REM set compiler internal variables
IF “%INTEL_SHARED%”==“” CALL %IVF_VARBAT_LOC%\IFORTVARS.bat

REM compile

ECHO.
ECHO Compiling FAST, AeroDyn, and NWTC_Library routines to create %ROOT_NAME%.exe:

%IVF% %COMPOPTS% %NWTC_Files% %Wind_Files% %AeroDyn_Files% %FAST_Files% %LINKOPTS% /out:%ROOT_NAME%.exe

:end
REM ----------------------------------------------------------------------------
REM ------------------------- CLEAR MEMORY -------------------------------------
REM ------------- and delete all .mod and .obj files ---------------------------
REM ----------------------------------------------------------------------------
ECHO a

DEL *.mod
DEL *.obj

SET IVF_LOC=
SET IVF=
SET ROOT_NAME=
SET COPTS=

SET NWTC_Files=
SET Wind_Files=
SET AeroDyn_Files=
SET FAST_Files=
SET A2AD_Files=
SET Fixed_Files=

SET NWTC_Lib_Loc=
SET Wind_Loc=
SET AeroDyn_Loc=
SET A2AD_Loc=
SET FAST_Loc=

SET COMPOPTS=
SET LINKOPTS=

*** RECORD OF DOS CONSOLE ERROR MESSAGES…

c:\NREL\FAST>build_fast_test
ERROR: Unknown switch ‘’
Accepted values: ia32, ia32_intel64, intel64, ia32_ia64, ia64

Compiling FAST, AeroDyn, and NWTC_Library routines to create FAST_test.exe:
Intel(R) Visual Fortran Compiler Professional for applications running on IA-32,
Version 11.1 Build 20100414
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

Space exceeded in Data Dependence Test in _FAST_IO_SUBS_mp_CHCKOUTLST
Subdivide routine into smaller ones to avoid optimization loss
An internal threshold was exceeded for routine _FAST_IO_SUBS_mp_CHCKOUTLST and o
ptimization level may be reduced. See SOFTWARE.INTEL.COM/EN-US/ARTICLES/I
NTERNAL-THRESHOLD-WAS-EXCEEDED for more information and advice.
An internal threshold was exceeded for routine _FAST2ADAMSSUBS_mp_MAKEADM and op
timization level may be reduced. See software.intel.com/en-us/articles/in
ternal-threshold-was-exceeded for more information and advice.
IFORT: error #10037: could not find ‘link’

Javier, Jason, Bonnie:

I think I’ve solved my compile and link problem with the batch “make-file.”

Seems that the IVF environment-setting batch file, “IFORTVARS.bat,” needs one of these input switches-- “ia32, ia32_intel64, intel64, ia32_ia64, ia64,” to be happy. So as shown in the updated batch file I now have–

IF “%INTEL_SHARED%”==“” CALL %IVF_VARBAT_LOC%\IFORTVARS.bat ia32.

With that change, the batch file built FAST_test.exe just fine-- I only get the optimization warnings that Javier got.

I think I’m in business now. Hope this “find” might help someone else.

Say, this project seems to take pretty long to compile and build-- about six minutes. Seem normal? (I’m running Windows XP Home Edition version 5.1 on a Dell lap-top with Intel Core 2 CPU T7200 @ 2.0 GHz.)

Best regards,

Toby
wehrhan@sbcglobal.net

@ECHO OFF
REM ----------------------------------------------------------------------------
REM file: Build_FAST_test.bat
REM purpose: This batch file acts as a “make-file” for compiling, linking, and
REM building of an executable of FAST from FORTRAN source code.
REM
REM rev: 04/30/2010 TGW created Build_FAST_test.bat from Compile_FAST.bat
REM Change list:
REM Compile_FAST.bat was downloaded from NREL design codes web site.
REM Changed locations of directories for source files.
REM Added “ia32” switch to call to batch file, “IFORTVARS.bat”
REM ----------------------------------------------------------------------------

REM The calling syntax for this script is
REM Compile_FAST [dll]
REM
REM Add the “dll” to the command line to compile FAST for the Bladed-style dll.

REM ----------------------------------------------------------------------------
REM -------------------- LOCAL VARIABLES ---------------------------------------
REM ----------------------------------------------------------------------------

SET ROOT_NAME=FAST_test

SET COMPOPTS=/threads /inline:speed /optimize:5 /traceback /Qzero /Qsave /real_size:32 /assume:byterecl /nostand
rem SET LINKOPTS=/link /stack:64000000
SET LINKOPTS=/link

REM ----------------------------------------------------------------------------
REM ------------------------- LOCAL PATHS --------------------------------------
REM ----------------------------------------------------------------------------
REM – USERS WILL NEED TO EDIT THESE PATHS TO POINT TO FOLDERS ON THEIR LOCAL –
REM ------- NOTE: do not use quotation marks around the path names!!! ---------
REM ----------------------------------------------------------------------------
REM IVF_LOC is the location of the Intel Visual Fortran files (IFORTVARS.bat and IFORT.exe).
REM AeroDyn_Loc is the location of the AeroDyn source files
REM Wind_Loc is the location of the AeroDyn wind inflow source files
REM FAST_LOC is the location of the FAST source files
REM NWTC_Lib_Loc is the location of the NWTC subroutine library files
REM ----------------------------------------------------------------------------

REM SET IVF_LOC = C:\Program Files\Intel\Compiler\Fortran\10.1.024\IA32\Bin
REM SET NWTC_Lib_Loc = D:\DATA\Fortran\Fortran Subs\NWTC_subs\v1.02.00\Source
REM SET AeroDyn_Loc = D:\DATA\Fortran\IVF Projects\AeroDyn\Release\Source
REM SET Wind_Loc = D:\DATA\Fortran\IVF Projects\AeroDyn\Release\Source\InflowWind\Source
REM SET FAST_Loc = D:\DATA\Fortran\IVF Projects\FAST\Release\Source

SET IVF_LOC=C:\PROGRA~1\Intel\Compiler\11.1\065\bin\ia32
SET IVF_VARBAT_LOC=C:\PROGRA~1\Intel\Compiler\11.1\065\bin
SET NWTC_Lib_Loc=C:\NREL\NWTC_LIB\Source
SET AeroDyn_Loc=C:\NREL\AeroDyn\Source
SET Wind_Loc=C:\NREL\AeroDyn\Source\InflowWind\Source
SET FAST_Loc=C:\NREL\FAST\Source

REM ----------------------------------------------------------------------------
REM -------------------- LIST OF ALL SOURCE FILES ------------------------------
REM ----------------------------------------------------------------------------

SET IVF=“%IVF_LOC%\IFORT.EXE”

SET NWTC_Files=
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\SingPrec.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\SysIVF.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_IO.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Num.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Aero.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Library.f90”

SET Wind_Files=
SET Wind_Files=%Wind_Files% “%Wind_Loc%\SharedInflowDefs.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\HHWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\FFWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\FDWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\CTWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\UserWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\InflowWindMod.f90”

SET AeroDyn_Files=
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\SharedTypes.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroMods.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\GenSubs.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroSubs.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroDyn.f90”

SET FAST_Files=
SET FAST_Files=%FAST_Files% “%FAST_LOC%\fftpack.f”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FFTMod.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\HydroCalc.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Mods.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\Noise.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_IO.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Lin.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST2ADAMS.f90”

IF /I “%1”==“DLL” GOTO dllFiles

SET FAST_Files=%FAST_Files% “%FAST_LOC%\PitchCntrl_ACH.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserSubs.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserVSCont_KP.f90”

GOTO endFASTfiles

:dllFiles
SET FAST_Files=%FAST_Files% “%FAST_LOC%\BladedDLLInterface.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserSubs_forBladedDLL.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserVSCont_KP_forBladedDLL.f90”

REM NOTE: UserSubs_forBladedDLL.f90 is a copy of UserSubs.f90 with SUBROUTINES UserHSSBr() and UserYawCont() commented out
REM UserVSCont_KP_forBladedDLL.f90 is a copy of UserVSCont_KP.f90 with SUBROUTINE UserVSCont() commented out

SET ROOT_NAME=%ROOT_NAME%_DLL

:endFASTfiles
SET FAST_Files=%FAST_Files% “%FAST_LOC%\AeroCalc.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\SetVersion.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Prog.f90”

:ivf
REM ----------------------------------------------------------------------------
REM ---------------- COMPILE WITH INTEL VISUAL FORTRAN -------------------------
REM ----------------------------------------------------------------------------

ECHO.
ECHO DEBUGG…GOT TO INTEL_SHARED IF STATMENT

REM set compiler internal variables
IF “%INTEL_SHARED%”==“” CALL %IVF_VARBAT_LOC%\IFORTVARS.bat ia32

ECHO DEBUGG…GOT PASSED INTEL_SHARED IF STATMENT
ECHO.

REM compile

ECHO.
ECHO Compiling FAST, AeroDyn, and NWTC_Library routines to create %ROOT_NAME%.exe:

%IVF% %COMPOPTS% %NWTC_Files% %Wind_Files% %AeroDyn_Files% %FAST_Files% %LINKOPTS% /out:%ROOT_NAME%.exe

:end
REM ----------------------------------------------------------------------------
REM ------------------------- CLEAR MEMORY -------------------------------------
REM ------------- and delete all .mod and .obj files ---------------------------
REM ----------------------------------------------------------------------------
ECHO a

DEL *.mod
DEL *.obj

SET IVF_LOC=
SET IVF=
SET ROOT_NAME=
SET COPTS=

SET NWTC_Files=
SET Wind_Files=
SET AeroDyn_Files=
SET FAST_Files=
SET A2AD_Files=
SET Fixed_Files=

SET NWTC_Lib_Loc=
SET Wind_Loc=
SET AeroDyn_Loc=
SET A2AD_Loc=
SET FAST_Loc=

SET COMPOPTS=
SET LINKOPTS=

Hi, Toby.

First of all, I’m glad you got the script to work. IVF 11 with Visual Studio 2008 has become more versatile, but also more complicated to work with. As you found out, you’ll need to change the script to set the IVF environment variables correctly.

The batch script is really just meant to be a starting place for those who want to compile FAST, particularly for those who must or prefer to use the command line. I almost never use the script because I do find Visual Studio easier. However, because it is very easy to create a solution file (.sln), we have not found it worth our time to try to support a template. You basically just create a new solution (create a blank Intel(R) Fortran Project from the Console Application template), add the files listed in the batch file to your new solution, and set the compile options provided in the batch file.

I’ve never timed it, but yes, it does take a while. There is a lot of code to optimize.

Thanks for your comments Bonnie.

Also thanks to you-all for setting up the batch “build” file and commenting it so well. I was able to buy IVF and get FAST working in just a few hours on Friday. One of the longest things was downloading IVF from INTEL!-- I think it must have taken two hours!

I’ll give making a project/solution file from MS Studio 2008 Shell a go. Sounds pretty easy.

Best regards,

Toby

Tobias Wehrhan
Oak Engineering, LLC
718 Oak Ave.
Davis, CA 95616
wehrhan@sbcglobal.net

Hi all,

First of all, I wanted to thank Toby for posting how he managed to get FAST to compile with IVF 11. That really helped me out. I was trying to implement my own User_Gen code and having never worked with Fortran before,Toby’s suggestion along with the .bat file from the helpful folks at NREL helped out quite a bit.

The problem I am having now is that I am trying to do a batch run and for this I want to use one of our severs which is running Window Server 2008 64bit. I tried to run the same file that I ran on my Xp 32 bit pc and it took twice as long eventhough the server is a monster compared to my little desktop. I assume this is because the code is not optimized for the particular OS. Is there a simple way to do this? I am hoping that I can add a line or change some option in the bat file and compile with IVF 11 to get it to run faster. I tried changing the -ia32 option that Toby mentioned in his post to -ia64 and that didnt seem to make any difference. If anyone has already done this or has any suggestions, I would really appreciate it. Thank you.

Best Regards,

Subin.

Subin,

If you want to modify the script to use the Intel 64-bit compiler, you will need to change the location of the compiler (i.e. SET IVF_LOC=C:\PROGRA~1\Intel\Compiler\11.1\065\bin\intel64 or the equivalent path on your machine). Then, you will need to change the argument to the ifortvars.bat file to -intel64 instead of -ia32. If necessary, you can also modify the optimization levels using the COMPOPTS variable.

Keep in mind that other things could cause the code to be slow. For instance, I/O can be particulary bad if you are not writing to the local machine.

Hope that helps.

Bonnie,

I was writing to the local machine. After messing around for a few hours, I realized that there were a couple issues:

  1. For whatever reason the code runs faster when compiled with -ia32 even though its a 64 bit processor.
  2. The true culprit however turned out to be the User_Gen subroutine I wrote. Since I am really new to Fortran, I think I created some really bad code :cry:

The time ratios I was getting were without using my User_Gen routine

a) 6.6 - With original FAST code that I downloaded
b) 5.8 - With FAST code recompiled for 64 bit
c) 9.48 - With FAST code recompiled for 32 - bit but different optimization options !!!

And with my User_Gen routine -

:blush: 2.8 :blush:

I apologize for wasting your time. I guess its back to the drawing board for me. I also probably need to find someone who can write better Fortran code :slight_smile:. Thank you for taking the time.

Regards,

Subin.

Hi Everyone,

After my last post in this thread, I have played around quite a bit with the source code and been able to get my UserGen files to work. The issue I realized was that I was writing data to a text file which was slowing the code down. I changed that to use the FAST output routines and now output the variables I need through AllOuts and that works much better. So far so good. I even compared the results I was getting with my recompiled code and the original distributable and they were in agreement.

However when I tried to simulate parked rotor conditions (0 rpm) at survival speed, things started going wrong. Except for the Time and WindSpeed output channel, I started getting all the other channels as NAN or 0 !!! I assumed that it was my UserGen routine and so turned the GenDOF off and set the GenModel to 1. Still no luck. I noticed that the output seems to be correct for the first timestep but then it goes south from there. I have only the CompAero DOF turned on.

The odd thing is that if I use the original .exe supplied with the FAST archive then I get the correct output. However if I recompile the original source code (either with IVF or with the supplied batch file) I cant seem to get it to work. This leads me to believe that it might have to do with some compiler options that I am using. However since the batch file that came with the FAST archive is also producing similar results, I am at a loss. Has anyone else experienced similar problems? If anyone has any clues as to what might be causing this, I would really appreciate the advice. Thank you.

Best Regards,

Subin

Hi again,

I figured out the issue although I am not yet sure why it happens - the ouputs match if I set the IndModel in Aerodyn.ipt model to none when I am using the recompiled code!!! Just wanted to post it here in case someone else ran into the same problem and also to see if some of the folks here who know Fortran a lot better than I do have an explanation for this.

Best Regards,

Subin

Subin,

You should definitely turn off the induction in AeroDyn for parked or idling turbines. It’s just not meaningful.

Jason, Bonnie: I suggest you mention this in the next FAST UG on Special Events and in the section on AeroDyn input. Do the same for the next AeroDyn manual.

Marshall

Hi Marshall,

Thank you for the response. Although I am still not sure why it shows up in my recompiled code and not the original executable that was distributed with the FAST archive. The only reason I am concerned is because I am not sure if I am not setting my compiler options correctly which might lead to errors in the future (when I make changes to the source code) that may go undetected.

Regards,

Subin

Subin,

If you have compiled the original FAST 7.00.00a-bjj source code without any changes and don’t get the same results as the executable we’ve supplied, I would agree that there is something strange going on. Often, the errors you mention are a result of omitting the /Qsave or /Qzero flags. I’d also double check that the batch file and/or your IVF project are using the correct versions of the source files.

If you are still having a problem, it would help to have more information. Which compiler are you using? Are you runing on 64bit architecture? Do you get any error/warning/information messages when you compile? Does the FAST CertTest give the same results? Are you compiling in single or double precision? Do you get different results if you change optimization levels (e.g., if you change from “debug” to “release” configurations in the IVF project or if you change “/optimize:5” to “/O3” or “/O2” in the batch file)?

I don’t know if that will help, but that’s where I’d start.

Regards,
Bonnie

Bonnie,

Thank you for the response. To answer some of your questions:

  1. I did compile the original source code without any changes and was getting different results, albeit only when RPM was zero and induction was turned on.
  2. I did not have the /Qsave or the /Qzero flags set in my project initially, but they were present in the batch file that you had supplied. Regardless, adding those options to my project did not change anything.
  3. I am pretty sure I am using the latest versions of the source files which I assume is what you mean by correct versions. I will double check.
  4. I am using IVF compiler running on IA-32 ver 11.1.060. I am running on 32 bit architecture.
  5. I do not get any error/warning/information messages if I compile the project but I do get some warnings when I use the batch file which I think are not really an issue as discussed earlier in the thread. (See compiler output below). Also the file size of my recompiled code is larger than the original .exe. I am not sure if that is relevant.

[code]
Intel(R) Visual Fortran Compiler Professional for applications running on IA-32,
Version 11.1.060
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

Setting environment for using Microsoft Visual Studio 2005 x86 tools.

C:\WindTurbineSoftware\NWTC_Revised_Codes_March_2010\FAST_2010>Compile_FAST.bat
‘C:\Program’ is not recognized as an internal or external command,
operable program or batch file.

Compiling FAST, AeroDyn, and NWTC_Library routines to create FAST_orginal_recomp
iled.exe:
Intel(R) Visual Fortran Compiler Professional for applications running on IA-32,
Version 11.1 Build 20100203 Package ID: w_cprof_p_11.1.060
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

Space exceeded in Data Dependence Test in _FAST_IO_SUBS_mp_CHCKOUTLST
Subdivide routine into smaller ones to avoid optimization loss
An internal threshold was exceeded for routine _FAST_IO_SUBS_mp_CHCKOUTLST and o
ptimization level may be reduced. See Intel Developer Zone
NTERNAL-THRESHOLD-WAS-EXCEEDED for more information and advice.
An internal threshold was exceeded for routine _FAST2ADAMSSUBS_mp_MAKEADM and op
timization level may be reduced. See Intel Developer Zone
ternal-threshold-was-exceeded for more information and advice.
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

-out:SingPrec.exe
-subsystem:console
-incremental:no
/out:FAST_orginal_recompiled.exe
SingPrec.obj
SysIVF.obj
NWTC_IO.obj
NWTC_Num.obj
NWTC_Aero.obj
NWTC_Library.obj
SharedInflowDefs.obj
HHWind.obj
FFWind.obj
FDWind.obj
CTWind.obj
UserWind.obj
InflowWindMod.obj
SharedTypes.obj
AeroMods.obj
GenSubs.obj
AeroSubs.obj
AeroDyn.obj
fftpack.obj
FFTMod.obj
HydroCalc.obj
FAST_Mods.obj
Noise.obj
FAST_IO.obj
FAST.obj
FAST_Lin.obj
FAST2ADAMS.obj
PitchCntrl_ACH.obj
UserSubs.obj
UserVSCont_KP.obj
AeroCalc.obj
SetVersion.obj
FAST_Prog.obj

C:\WindTurbineSoftware\NWTC_Revised_Codes_March_2010\FAST_2010>[/code]

  1. I did not see any difference when I went from “debug” to “release”. I have not tried to change optimization settings in the batch file. I will give that a shot.

I will try some of the things that you suggested and see if I can get the two codes to agree. Once again thank you for the suggestions.

Regards,

Subin.

Because of this:

I suspect the call to IFORTVARS.bat did not happen and the IVF environment is not properly set up . This is due to a small error in the Compile_FAST.bat batch file. Change line 115 from:

IF "%INTEL_SHARED%"=="" CALL %IVF_LOC%\IFORTVARS.bat

to

IF "%INTEL_SHARED%"=="" CALL "%IVF_LOC%\IFORTVARS.bat"

Because the path (as contained in "%IVF_LOC%) is not enclosed in quotes, the batch file looked for “C:\Program” instead of “C:\Program Files\Intel\Compiler\Fortran\10.1.024\IA32\Bin\Compile_FAST.bat”.

Bonnie/Jason, please fix the batch file.

Dear community,

I have downloaded the trial vesion of Intel Fortran Composer XE (Intel Visual Fotran) and Microsoft Visual Studio 2008.
I am trying to compile FAST_v7.01.00a-bjj but I meet one problem concerning three libraries: LIBCMT.lib, libifcoremt.lib and libirc.lib.
The errors are LNK 2019, LNK 2001and LNK1120.

I would like to know if you have ever met this problem.

I have atached to this post, first, my compile_fast.bat (inspired by Tobias Wehran (thank you)) and then an extract of the dos problems file log.txt.

Thank you very much for your help.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ECHO OFF

REM The calling syntax for this script is
REM Compile_FAST [dll]
REM
REM Add the “dll” to the command line to compile FAST for the Bladed-style dll.

REM ----------------------------------------------------------------------------
REM set compiler internal variables
REM ----------------------------------------------------------------------------
REM You can run this bat file from the IVF compiler’s command prompt (and not
REM do anything in this section). If you choose not to run from the IVF command
REM prompt, you must call the compiler’s script to set internal variables.
REM TIP: Right click on the IVF Compiler’s Command Prompt shortcut, click
REM properties, and copy the target (without cmd.exe and/or its switches) here:

REM CALL “C:\Program Files\Intel\Composer XE 2011 SP1\bin\ipsxe-comp-vars.bat” ia32 vs2008

REM IF “%INTEL_SHARED%”==“” CALL “C:\Program Files\Intel\Compiler\Fortran\10.1.024\IA32\Bin\IFORTVARS.bat”

REM ----------------------------------------------------------------------------
REM -------------------- LOCAL VARIABLES ---------------------------------------
REM ----------------------------------------------------------------------------

SET ROOT_NAME=FAST_test

SET COMPOPTS=/threads /inline:speed /traceback /Qzero /Qsave /real_size:32 /assume:byterecl /nostand
REM SET LINKOPTS=/link /stack:64000000
SET LINKOPTS=/link

REM ----------------------------------------------------------------------------
REM ------------------------- LOCAL PATHS --------------------------------------
REM ----------------------------------------------------------------------------
REM – USERS WILL NEED TO EDIT THESE PATHS TO POINT TO FOLDERS ON THEIR LOCAL –
REM ------- NOTE: do not use quotation marks around the path names!!! ---------
REM ----------------------------------------------------------------------------
REM NWTC_Lib_Loc is the location of the NWTC subroutine library files
REM AeroDyn_Loc is the location of the AeroDyn source files
REM Wind_Loc is the location of the AeroDyn wind inflow source files
REM FAST_LOC is the location of the FAST source files
REM ----------------------------------------------------------------------------

SET IVF_LOC=“C:\Program Files\Intel\Composer XE\bin\ia32”
SET IVF_VARBAT_LOC=“C:\Program Files\Intel\Composer XE\bin”

SET NWTC_Lib_Loc=C:\Documents and Settings\bdq\Bureau\FAST_v7.01.00a-bjj\Librairie\Source
SET AeroDyn_Loc=C:\Documents and Settings\bdq\Mes documents\FAST\Aerodyn\Source
SET Wind_Loc=C:\Documents and Settings\bdq\Mes documents\FAST\Aerodyn\Source\InflowWind\Source
SET FAST_Loc=C:\Documents and Settings\bdq\Bureau\FAST_v7.01.00a-bjj\Source

REM SET NWTC_Lib_Loc=D:\DATA\DesignCodes\miscellaneous\nwtc_subs\SVNdirectory\source
REM SET AeroDyn_Loc=D:\DATA\DesignCodes\simulators\AeroDyn\SVNdirectory\trunk\Source
REM SET Wind_Loc=D:\DATA\DesignCodes\simulators\AeroDyn\SVNdirectory\trunk\Source\InflowWind\Source
REM SET FAST_Loc=D:\DATA\DesignCodes\simulators\FAST\SVNdirectory\trunk\Source

REM ----------------------------------------------------------------------------
REM -------------------- LIST OF ALL SOURCE FILES ------------------------------
REM ----------------------------------------------------------------------------

SET IVF=%IVF_LOC%\IFORT.EXE

SET NWTC_Files=
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\SingPrec.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\SysIVF.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_IO.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Num.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Aero.f90”
SET NWTC_Files=%NWTC_Files% “%NWTC_Lib_Loc%\NWTC_Library.f90”

SET Wind_Files=
SET Wind_Files=%Wind_Files% “%Wind_Loc%\SharedInflowDefs.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\HHWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\FFWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\FDWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\CTWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\UserWind.f90”
SET Wind_Files=%Wind_Files% “%Wind_Loc%\InflowWindMod.f90”

SET AeroDyn_Files=
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\SharedTypes.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroMods.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\GenSubs.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroSubs.f90”
SET AeroDyn_Files=%AeroDyn_Files% “%AeroDyn_Loc%\AeroDyn.f90”

SET FAST_Files=
SET FAST_Files=%FAST_Files% “%FAST_LOC%\fftpack.f”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FFTMod.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\HydroCalc.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Mods.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\Noise.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_IO.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Lin.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST2ADAMS.f90”

IF /I “%1”==“DLL” GOTO dllFiles

SET FAST_Files=%FAST_Files% “%FAST_LOC%\PitchCntrl_ACH.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserSubs.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserVSCont_KP.f90”

GOTO endFASTfiles

:dllFiles
SET FAST_Files=%FAST_Files% “%FAST_LOC%\BladedDLLInterface.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserSubs.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\UserVSCont_KP.f90”

REM NOTE: UserSubs_forBladedDLL.f90 is a copy of UserSubs.f90 with SUBROUTINES UserHSSBr() and UserYawCont() commented out
REM UserVSCont_KP_forBladedDLL.f90 is a copy of UserVSCont_KP.f90 with SUBROUTINE UserVSCont() commented out

SET ROOT_NAME=%ROOT_NAME%_DLL

:endFASTfiles
SET FAST_Files=%FAST_Files% “%FAST_LOC%\AeroCalc.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\SetVersion.f90”
SET FAST_Files=%FAST_Files% “%FAST_LOC%\FAST_Prog.f90”

:ivf
REM ----------------------------------------------------------------------------
REM ---------------- COMPILE WITH INTEL VISUAL FORTRAN -------------------------
REM ----------------------------------------------------------------------------

ECHO.
ECHO DEBUGG…GOT TO INTEL_SHARED IF STATMENT

REM set compiler internal variables
IF “%INTEL_SHARED%”==“” CALL %IVF_VARBAT_LOC%\IFORTVARS.bat ia32

ECHO DEBUGG…GOT PASSED INTEL_SHARED IF STATMENT
ECHO.

REM compile

ECHO.
ECHO Compiling FAST, AeroDyn, and NWTC_Library routines to create %ROOT_NAME%.exe:

%IVF% %COMPOPTS% %NWTC_Files% %Wind_Files% %AeroDyn_Files% %FAST_Files% %LINKOPTS% /out:%ROOT_NAME%.exe

:end
REM ----------------------------------------------------------------------------
REM ------------------------- CLEAR MEMORY -------------------------------------
REM ------------- and delete all .mod and .obj files ---------------------------
REM ----------------------------------------------------------------------------
ECHO a

DEL *.mod
DEL *.obj

SET IVF_LOC=
SET IVF=
SET ROOT_NAME=
SET COPTS=

SET NWTC_Files=
SET Wind_Files=
SET AeroDyn_Files=
SET FAST_Files=
SET A2AD_Files=
SET Fixed_Files=

SET NWTC_Lib_Loc=
SET Wind_Loc=
SET AeroDyn_Loc=
SET A2AD_Loc=
SET FAST_Loc=

SET COMPOPTS=
SET LINKOPTS=

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Intel Parallel Studio XE 2011 SP1
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
Intel Composer XE 2011 Update 9 (package 300)
Setting environment for using Microsoft Visual Studio 2008 x86 tools.

Compiling FAST, AeroDyn, and NWTC_Library routines to create FAST.exe:
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

-out:SingPrec.exe
-subsystem:console
-incremental:no
/out:FAST.exe
SingPrec.obj
SysIVF.obj
NWTC_IO.obj
NWTC_Num.obj
NWTC_Aero.obj
NWTC_Library.obj
SharedInflowDefs.obj
HHWind.obj
FFWind.obj
HAWCWind.obj
FDWind.obj
CTWind.obj
UserWind.obj
InflowWindMod.obj
SharedTypes.obj
AeroMods.obj
GenSubs.obj
AeroSubs.obj
AeroDyn.obj
fftpack.obj
FFTMod.obj
HydroCalc.obj
FAST_Mods.obj
Noise.obj
FAST_IO.obj
FAST.obj
FAST_Lin.obj
FAST2ADAMS.obj
PitchCntrl_ACH.obj
UserSubs.obj
UserVSCont_KP.obj
AeroCalc.obj
SetVersion.obj
FAST_Prog.obj
LIBCMT.lib(lseek.obj) : error LNK2001: unresolved external symbol __imp__SetFilePointer@16
libifcoremt.lib(for_get.obj) : error LNK2001: unresolved external symbol __imp__SetFilePointer@16
libifcoremt.lib(for_wseq.obj) : error LNK2001: unresolved external symbol __imp__SetFilePointer@16
libifcoremt.lib(for_portlib.obj) : error LNK2001: unresolved external symbol __imp__SetFilePointer@16
LIBCMT.lib(lseeki64.obj) : error LNK2001: unresolved external symbol __imp__SetFilePointer@16
libifcoremt.lib(for_diags_intel.obj) : error LNK2019: unresolved external symbol __imp__SetFilePointer@16 referenced in function _for_emit_diagnostic
libifcoremt.lib(for_nt_open_proc.obj) : error LNK2001: unresolved external symbol __imp__SetFilePointer@16
libifcoremt.lib(for_put.obj) : error LNK2001: unresolved external symbol __imp__SetFilePointer@16



FAST.exe : fatal error LNK1120: 131 unresolved externals