# Compile FAST using CVF

**URL:** <https://forums.nlr.gov/t/compile-fast-using-cvf/338>\
**Category:** Computer-Aided Engineering Software Tools\
**Created:** [March 3, 2011, 7:52pm UTC](https://forums.nlr.gov/t/compile-fast-using-cvf/338 "2011-03-03T19:52:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lene.Eliassen](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@Lene.Eliassen](https://forums.nlr.gov/u/Lene.Eliassen)\
**Post date:** [March 3, 2011, 7:52pm UTC](https://forums.nlr.gov/t/compile-fast-using-cvf/338/1 "2011-03-03T19:52:50Z")

</div>

Hi,

I am a novice in using FAST and I am a bit stuck at the moment. The problem that I can´t compile FAST using compaq visual fortran. The compile\_FAST.bat file that I am using is added below. I think my mistake is in the 14th line, starting with “SET COMPOPTS=/…”.

I would be grateful for any advice to guide me in the direction.

regards

Lene

@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 -------------------- LOCAL VARIABLES ---------------------------------------  
REM ----------------------------------------------------------------------------

SET ROOT\_NAME=FAST

SET COMPOPTS=/threads /inline:speed /optimize:5 /traceback /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 CVF\_LOC is the location of the Compaq Visual Fortran files (DFVARS.bat and F90.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 ----------------------------------------------------------------------------

SET IVF\_LOC=C:\Program Files\Microsoft Visual Studio\DF98\BIN

SET NWTC\_Lib\_Loc=C:\NREL\NWTC\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%\F90.EXE”

SET NWTC\_Files=  
SET NWTC\_Files=%NWTC\_Files% “%NWTC\_Lib\_Loc%\SingPrec.f90”  
SET NWTC\_Files=%NWTC\_Files% “%NWTC\_Lib\_Loc%\SysCVF.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 compaq VISUAL FORTRAN -------------------------  
REM ----------------------------------------------------------------------------

REM set compiler internal variables  
IF “%INTEL\_SHARED%”==“” CALL “%IVF\_LOC%\DFVARS.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=

---

<div class="post-metadata">

**Author:** ![Bonnie.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/bonnie.jonkman/32/3230_2.png) [@Bonnie.Jonkman](https://forums.nlr.gov/u/Bonnie.Jonkman)\
**Post date:** [March 3, 2011, 10:47pm UTC](https://forums.nlr.gov/t/compile-fast-using-cvf/338/2 "2011-03-03T22:47:11Z")

</div>

Hi Lene,

Without any error message, it’s difficult to determine exactly what’s wrong, but these two lines of code caught my attention:

> [@Lene.Eliassen](#):
>
> SET IVF=“%IVF\_LOC%\F90.EXE”
> 
> …
> 
> IF “%INTEL\_SHARED%”==“” CALL “%IVF\_LOC%\DFVARS.BAT”

The CVF compiler should be DF.exe, not F90.exe, and %INTEL\_SHARED% is an environment variable set by the IVF compiler.

I would change them to

`
SET IVF="%IVF_LOC%\DF.EXE"
` and

```auto
CALL "%IVF_LOC%\DFVARS.BAT"
```

An alternative (and perhaps easier) method for compiling is to create a new Fortran Console Application Project in CVF’s Developer Studio. The FAST User’s Guide has a chapter on compiling, which may be useful. The user’s guide hasn’t been updated since we’ve modified which files are required to compile it (e.g. you need the NWTC Subroutine Library), but hopefully you will be able to get the gist of it.

---

<div class="post-metadata">

**Author:** ![Lene.Eliassen](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@Lene.Eliassen](https://forums.nlr.gov/u/Lene.Eliassen)\
**Post date:** [March 4, 2011, 12:29pm UTC](https://forums.nlr.gov/t/compile-fast-using-cvf/338/3 "2011-03-04T12:29:29Z")

</div>

Thanks for the help. I chose to use create a new project in Developer Studio, and it ran smoothly 🙂

regards

Lene
