Instructions for Compiling FAST

Provide feedback, request enhancements, and get help with wind-turbine computer-aided engineering tools.

Moderators: Bonnie.Jonkman, Jason.Jonkman

Bonnie.Jonkman
Posts: 561
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: Instructions for Compiling FAST

Postby Bonnie.Jonkman » Wed Mar 11, 2015 9:23 am

The linking errors you are getting are all ADAMS routines, which makes me think there is something wrong with some of the paths Adams is using. Actually, looking back at your previous post, it looks like you're using a 32-bit compiler with 64-bit Adams. You should use the 64-bit platform of the compiler (intel64) so that the libraries are compatible.
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016

Nagore.Zestafe
Posts: 5
Joined: Mon Mar 09, 2015 5:00 am
Organization: Self
Location: Spain

Re: Instructions for Compiling FAST

Postby Nagore.Zestafe » Wed Mar 25, 2015 5:03 am

Hi Bonnie,

First of all, thanks for your quick answers.
I have been able to acquire the dll and the library files. But when I try to simulate with Adams the "acf" or "adm" files obtained from the Fast simulation, I get the next errors:

Code: Select all

C:\Users\Nagore\Desktop\Fast v7\Prueba 5>adams2013_2_x64

     +------------------------------------------------------+
     |        | Adams 2013.2                     |          |
     |        ------------------------------------          |
     |Action                                  Selection Code|
     |------                                  --------------|
     |                                                      |
     |Create Adams/Solver with                              |
     |   Adams User-DLL                          cr-user    |
     |                                                      |
     |Run Adams/Solver with                                 |
     |   Standard Adams executable               ru-standard|
     |   User executable                         ru-user    |
     |                                                      |
     |Pre- or Post-process with                             |
     |   Adams/View                              aview      |
     |   Adams/Car                               acar       |
     |   Adams/Driveline                         adriveline |
     |   Adams/PostProcessor                     appt       |
     |   Adams/Insight                           ainsight   |
     |   Adams/Flex Toolkit                      flextk     |
     |   Adams/Durability Toolkit                durtk      |
     |   MSC Registry Editor                     redit      |
     |   MSC Registry Shell Tool                 rtool      |
     |   Custom Memory Model (uconfg_user)       cmm        |
     +------------------------------------------------------+

     Enter your selection code or EXIT: ru-user

 Enter name of your Adams/Solver User-DLL, or EXIT:
ADAMS.dll

 Enter the name of the Adams command file or EXIT (<CR>=none):
Test01_ADAMS.acf


-------------------------------------------------------------------------------
|        ..          ..                                                       |
|       ####*.      ####.                                                     |
|         `###*.       `#.                 MSC Software                       |
|            `###.       #.                ------------                       |
|               `##.     ##                                                   |
|                 `##.   ##                                                   |
|                   `## ##'                A d a m s   C++   S o l v e r      |
|                     ####                 [Build:         2013.2.0-CL221316] |
|                     ###.                 Version:        2013.2             |
|                    ###`#.                Patch Version:  None               |
|                  .###  `#                                                   |
|                 ####    `#                                                  |
|                ####      #.                                                 |
|              #####       `#              http://www.mscsoftware.com         |
|            .#####                                                           |
|           #####'                                                            |
|           ####                                                              |
|                                                                             |
|    *********************************************************************    |
|    *                                                                   *    |
|    *                      MSC Software Corporation                     *    |
|    *                                                                   *    |
|    *                             A d a m s                             *    |
|    *                                                                   *    |
|    *          Automatic Dynamic Analysis of Mechanical Systems         *    |
|    *                                                                   *    |
|    *********************************************************************    |
|    *                                                                   *    |
|    *                         LEGAL INFORMATION                         *    |
|    *                                                                   *    |
|    *  Warning:  This computer  program is protected  by copyright law  *    |
|    *  and  international  treaties.    Unauthorized  reproduction  or  *    |
|    *  distribution  of this  computer program, or any  portion of it,  *    |
|    *  may result in severe civil and criminal penalties.               *    |
|    *                                                                   *    |
|    *  Copyright (C) 2013 MSC Software Corporation and  its licensors.  *    |
|    *                        All rights reserved.                       *    |
|    *                                                                   *    |
|    *********************************************************************    |
|                                                                             |
|-----------------------------------------------------------------------------|
|                                                                             |
|    *********************************************************************    |
|    *                                                                   *    |
|    *   Local Time: 2015-03-24 14:28:31                                 *    |
|    *    Host Name: Nagore1                                             *    |
|    *        Uname: MS Windows NT                                       *    |
|    *      OS Info: 6.2                                                 *    |
|    *         User: Nagore                                              *    |
|    *  Customer ID: 0897E1FA-D938F5BC                                   *    |
|    *  Current dir: C:\Users\Nagore\Desktop\Fast v7\Prueba 5            *    |
|    *                                                                   *    |
|    *********************************************************************    |
|                                                                             |
-------------------------------------------------------------------------------

 command: FILE/MODEL=Test01_ADAMS, OUTPUT_PREFIX=Test01_ADAMS

 Running NWTC Subroutine Library (v1.07.02a-mlb, 21-May-2013).

 Running A2AD (v13.01.00a-bjj, 15-Feb-2012).
-------------------------------------------------------------------------------
|                                 Model Title                                 |
|=============================================================================|
|                                                                             |
| !ADAMS/View model name: FAST certification Test #01: AWT-27CR2 with many DOFs
wi|
|                                                                             |
-------------------------------------------------------------------------------

 command: INTEGRATOR/GSTIFF, ERROR = 0.001, HMAX =  4.000000E-03, INTERPOLATE =
ON
 command: SIMULATE/DYNAMICS, END =  4.000000E-03, DTOUT =  2.000000E-02


  Begin Simulation

  ****** Performing Dynamic Simulation using Gstiff I3 Integrator ******

---- START: WARNING ----
The data set is kinematically determinate.  However, a dynamic analysis
has been requested.  A kinematic analysis with the SIMULATE/KINEMATICS
command would be more efficient and possibly more accurate for some of
the computed quantities.
As requested, the simulation will continue with a dynamic analysis.

---- END: WARNING ----
   The system is modelled with INDEX-3 DAEs.
   The integrator is GSTIFF, CORRECTOR = original
   Integration error =    1.000000E-03


 Detected system force units of kilonewtons (kN).

---- START: ERROR ----
GFOSUB(11010, 1, 1) has been illegally defined.  A new functional dependency on
the measure
TDISP(4000,1,1) has been encountered during execution.

---- END: ERROR ----

Error calling INFARY for hub position coordinates.

 Aborting A2AD.



I want to make that simulation, so can you help me with the errors I have obtained?
Thank you very much,

Nagore

AhmedJenan.Mostafa
Posts: 4
Joined: Mon Mar 23, 2015 3:21 pm
Organization: UTSA
Location: Texas

Re: Instructions for Compiling FAST

Postby AhmedJenan.Mostafa » Thu Mar 26, 2015 8:58 am

Hello,

I am trying to install FAST v8 in Linux in a cloud.

I was wondering in which platform it has been tested previously. I have two other questions regarding the make file in the FAST_V_8/FAST/Compiling > compiling folder .

1. Was there any flag used?
2. What were the compiling options used

Thanks.

Bonnie.Jonkman
Posts: 561
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: Instructions for Compiling FAST

Postby Bonnie.Jonkman » Thu Mar 26, 2015 11:38 am

I have not tested FAST v8 on Linux. It compiles using gfortran for Windows, but as of yet, the offshore cases do not properly run using gfortran. The <FAST8>\Compiling folder contains a makefile you can use to compile with gfortran; you should be able to use it on Linux with little change. Please read the FAST8 ReadMe and compiling instructions that are distributed in the FAST archive.
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016

Nagore.Zestafe
Posts: 5
Joined: Mon Mar 09, 2015 5:00 am
Organization: Self
Location: Spain

Re: Instructions for Compiling FAST

Postby Nagore.Zestafe » Sun Apr 12, 2015 1:32 pm

Hello Bonnie,

I do not know if you had read my last post. I have been hardly trying to solve my problem, but I have not been able to find a solution.
The fact is that I created the DLL file with CompileLinkA2AD.bat. And when I try to make a simulation with Adams, I get the next error.

Code: Select all

---- START: ERROR ----
GFOSUB(11010, 1, 1) has been illegally defined.  A new functional dependency on
the measure
TDISP(4000,1,1) has been encountered during execution.

---- END: ERROR ----

Error calling INFARY for hub position coordinates.

 Aborting A2AD.


If you require any further information (the complete code or the versions of the programs I am using) it is detailed in my previous post.
I am developing my final degree project and I need this simulation to continue with it.
Thank you very much and I hope you could help me.
Regards,

Nagore

Bonnie.Jonkman
Posts: 561
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: Instructions for Compiling FAST

Postby Bonnie.Jonkman » Mon Apr 13, 2015 2:12 pm

Hi, Nagore.

Thanks for drawing my attention to your last post.

I haven't used Adams in quite some time, so I'm a little rusty with this. But, my first thought is to make sure you are using the Fortran solver (under Adams - Settings, make sure ASolver / solverSelection) is F77. It seems to be complaining about InfAry, which isn't supported in the C++ solver.

Hope that solves the problem.
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016

Nagore.Zestafe
Posts: 5
Joined: Mon Mar 09, 2015 5:00 am
Organization: Self
Location: Spain

Re: Instructions for Compiling FAST

Postby Nagore.Zestafe » Tue Apr 14, 2015 4:32 am

Hi Bonnie,

Thank you very much for your answers. I have solved my problem!
Kind regards,

Nagore

Keshan.He
Posts: 3
Joined: Sat Mar 22, 2014 10:09 pm
Organization: STU
Location: CHINA

Re: Instructions for Compiling FAST

Postby Keshan.He » Sat Apr 18, 2015 10:00 am

Dear all
I am a beginner. I want to design an controller for wind turbine smart blade( use flaps). The FAST_SFunc block have 3 control signal inputs (the Generator torque, nacelle yaw, and pitch), now i want to add an flap control signal input to the FAST_SFunc block. So far as I know, I need to modify FASTSimulink.f90 (add flap control signal input) and AeroSubs.f90 (choose the flap aerodata) , and recompile the mex function. But I met a problem.
Could FASTSimulink.f90 compile with FAST program package? I could successfully compile the FAST program package by IVF, but when I add FASTSimulink.f90 and FASTGateway.f90 to the IVF project, then compile it, lots of errors occur. I don’t know if FASTSimulink.f90 could compile with FAST program package by IVF, if no, how can I check the modification of program package is correct?

Best regards,
keshan

Bonnie.Jonkman
Posts: 561
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: Instructions for Compiling FAST

Postby Bonnie.Jonkman » Mon Apr 20, 2015 9:33 am

When you use FAST_SFunc (for FAST v7), you need to compile the FAST source code using MATLAB with the "make_FAST_SFunc.m" script found in the Simulink\Source folder of the archive. This will create a dynamic library with a ".mex*" extension; it is completely separate from the main FAST executable (FAST.exe).

The main FAST program used to generated FAST.exe does not compile with FASTSimulink.f90 or FASTGateway.f90. Those two files are used only when compiling in MATLAB (and are used instead of FAST_Prog.f90).
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016

JeanMarc.Cherfils
Posts: 4
Joined: Fri Jul 04, 2014 6:20 am
Organization: Institut National des Sciences Appliquées
Location: France

Re: Instructions for Compiling FAST

Postby JeanMarc.Cherfils » Fri Apr 24, 2015 5:23 am

Dear all,

I am performing tests with FAST on Linux and OSX platforms, compiled using gfortran or Intel Fortran Compiler. I mode little modifications on the FAST makefile and on SysGnuLinux.f90 (to allow dll loading).
I can send you my modified scripts when everything will be ready but I'm still experiencing a problem:

Both Gfortran and Ifort compilations work succesfully and give the same results as Windows executables on certification tests, but when turning on the new TMD module, the gfortran-compiled executable crashes (not the Ifort one), with this output:

Code: Select all


 **************************************************************************************************
 FAST (v8.10.00a-bjj, 31-Mar-2015)

 Copyright (C) 2015 National Renewable Energy Laboratory

 This program comes with ABSOLUTELY NO WARRANTY. See the "license.txt" file distributed with this
 software for details.
 **************************************************************************************************

  Running FAST (v8.10.00a-bjj, 31-Mar-2015), compiled as a 64-bit application using single
  precision
  linked with NWTC Subroutine Library (v2.05.02a-bjj, 25-Feb-2015)

  Heading of the FAST input file:
    FAST Certification Test #18: NREL 5.0 MW Baseline Wind Turbine (Onshore)

  Running ElastoDyn (v1.02.00a-bjj, 31-Mar-2015).

  Running ServoDyn (v1.02.00a-bjj, 31-Mar-2015).

  Running ServoDyn Interface for Bladed Controllers (using GNU Fortran for Linux, 1-May-2013).

  Running TMD (v1.00.00-wgl, 11-March-2015).

  Running AeroDyn (v14.03.01a-bjj, 13-Mar-2015).

  Running InflowWind (v2.01.00a-bjj, 13-Mar-2015).

    Assuming ./NoShr_12.wnd is a formatted HH wind file.
    Processed 3 records of HH data
  Timestep: 0 of 60 seconds.

 FAST_Solution0:CalcOutputs_And_SolveForInputs:SolveOption2:SrvD_CalcOutput:Running with torque
 and pitch control of the NREL offshore 5MW baseline wind turbine from DISCON.dll as written by J.
 Jonkman of NREL/NWTC for use in the IEA Annex XXIII OC3 studies.


Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:



and no backtrace...

Does anyone have an idea about the reason of this crash?

Thank you.
Jean-Marc Cherfils

PhD - Research Ingeneer
Institut National des Sciences Appliquées
Rouen - France

Bonnie.Jonkman
Posts: 561
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: Instructions for Compiling FAST

Postby Bonnie.Jonkman » Tue Apr 28, 2015 5:43 pm

Hi, Jean Marc.

Thanks for reporting this issue. I took a look at it in the gnu debugger (gdb) and it seems similar to the issue preventing us from running models with HydroDyn when compiling with gfortran. It looks like some memory related to the TMD mesh is getting overwritten somehow, and it's crashing on a call to MeshCopy. I don't have a solution right now (other than to use Intel Fortran), but I'll keep looking as I find time.
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016

Bonnie.Jonkman
Posts: 561
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: Instructions for Compiling FAST

Postby Bonnie.Jonkman » Thu Apr 30, 2015 1:29 pm

Jean Marc,

I was able to track down the issue with Test18 with TMD in gfortran, and have it running on my version of the code. I'll get this fix in the next FAST release, but meanwhile, I've put new source files for ServoDyn and TMD that you can use here.
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016

JeanMarc.Cherfils
Posts: 4
Joined: Fri Jul 04, 2014 6:20 am
Organization: Institut National des Sciences Appliquées
Location: France

Re: Instructions for Compiling FAST

Postby JeanMarc.Cherfils » Mon May 04, 2015 2:38 am

Thank you so much Bonnie!

I will test these routines right now. Do you have the 2.07 registry so I could test my own modules as well?
Jean-Marc Cherfils

PhD - Research Ingeneer
Institut National des Sciences Appliquées
Rouen - France

Bonnie.Jonkman
Posts: 561
Joined: Thu Nov 10, 2005 10:51 am
Organization: Envision Energy USA
Location: Colorado
Location: Boulder, CO
Contact:

Re: Instructions for Compiling FAST

Postby Bonnie.Jonkman » Mon May 04, 2015 12:32 pm

Here are some links to archives of the latest version of the Registry:
Bonnie Jonkman

Envision Energy USA, 2016-
National Renewable Energy Laboratory, 2003-2016

JeanMarc.Cherfils
Posts: 4
Joined: Fri Jul 04, 2014 6:20 am
Organization: Institut National des Sciences Appliquées
Location: France

Re: Instructions for Compiling FAST

Postby JeanMarc.Cherfils » Tue May 05, 2015 7:20 am

Thank you very much, it works.

Here are some tricks to build a version of FAST for linux and/or osx using gfortran or ifort:

Firstly, we need to patch the SysGnuLinux.f90 file (NWTC Library) using:

Code: Select all

@@ -92,7 +92,11 @@
 
 !=======================================================================
    FUNCTION FileSize( Unit )
-
+   
+#ifndef __GFORTRAN__
+    USE IFPORT
+#else
+#endif
 
       ! This function calls the portability routine, FSTAT, to obtain the file size
       ! in bytes corresponding to a file unit number or returns -1 on error.
@@ -149,7 +153,10 @@
 !bjj note: this subroutine is not tested for this compiler
    SUBROUTINE Get_CWD ( DirName, Status )
 
-
+#ifndef __GFORTRAN__
+    USE IFPORT
+#else
+#endif
       ! This routine retrieves the path of the current working directory.
 
 
@@ -433,6 +440,11 @@
 
 !   WRITE (CU,'(1X,A)',ADVANCE='NO')  Str
    WRITE (CU,'(A)',ADVANCE='NO')  Str
+   
+#ifndef __GFORTRAN__
+      FLUSH(CU)
+#else
+#endif
 
 
    RETURN
@@ -465,10 +477,21 @@
       WRITE (Fmt(5:7),'(I3)')  NChars
 
       WRITE (CU,Fmt,ADVANCE='NO')  CR, Str
+   
+#ifndef __GFORTRAN__
+      FLUSH(CU)
+#else
+#endif
 
    ELSE
       ! bjj: note that this will almost certainly write more than MaxWrScrLen characters on a line
       WRITE (CU,'(A)',ADVANCE='NO')  CR, Str
+   
+#ifndef __GFORTRAN__
+      FLUSH(CU)
+#else
+#endif
+
    END IF
 
 
@@ -524,11 +547,11 @@
    INTEGER(C_INT), PARAMETER :: RTLD_LOCAL=0           ! "This is the converse of RTLD_GLOBAL, and the default if neither flag is specified. Symbols defined in this library are not made available to resolve references in subsequently loaded libraries."
 
 
-   ErrStat = ErrID_Fatal
-   ErrMsg = ' LoadDynamicLib: Not implemented for '//TRIM(OS_Desc)
-   
-   
-#if 0           
+!   ErrStat = ErrID_Fatal
+!   ErrMsg = ' LoadDynamicLib: Not implemented for '//TRIM(OS_Desc)
+   
+   
+!#if 0           
 !bjj: note that this is not tested:
    INTERFACE !linux API routines
       !bjj see http://linux.die.net/man/3/dlopen
@@ -582,7 +605,7 @@
       RETURN
    END IF
 
-#endif
+!#endif
   
    RETURN
 END SUBROUTINE LoadDynamicLib
@@ -602,11 +625,11 @@
    INTEGER(C_INT), PARAMETER                 :: TRUE  = 0
 
 
-   ErrStat = ErrID_Fatal
-   ErrMsg = ' FreeDynamicLib: Not implemented for '//TRIM(OS_Desc)
-   
-   
-#if 0   
+!   ErrStat = ErrID_Fatal
+!   ErrMsg = ' FreeDynamicLib: Not implemented for '//TRIM(OS_Desc)
+   
+   
+!#if 0   
 !bjj: note that this is not tested.
    INTERFACE !linux API routine
       !bjj see http://linux.die.net/man/3/dlopen
@@ -635,7 +658,7 @@
       ErrStat = ErrID_None
       ErrMsg = ''
    END IF
-#endif
+!#endif
   
    RETURN
 END SUBROUTINE FreeDynamicLib


This allows the loading of dlls, and it resolves some portability issues between gfortran and ifort.

Next, here are the compilers options I used to build the code.

  • Using gfortran

    Code: Select all

    FC              =       gfortran

    F90_FLAGS       =       -x f95-cpp-input -ffree-line-length-none -O2 -m64 -finit-local-zero -fno-automatic
    F77_FLAGS       =       -x f77-cpp-input -O2 -m64 -finit-local-zero -fno-automatic
    LD_FLAGS         =       -O2 -m64 -ldl -finit-local-zero -fno-automatic
  • Using Intel Fortran for Linux

    Code: Select all

    FC              =       ifort

    F90_FLAGS       =       -fpp -threads -O2 -mkl:sequential -finline-functions -xhost
    F77_FLAGS       =       -fpp -threads -O2 -mkl:sequential -finline-functions -xhost
    LD_FLAGS         =       -fpp -threads -O2 -I$(MKLROOT)/include -mkl:sequential -finline-functions -xhost

Hope this helps someone.
Jean-Marc Cherfils

PhD - Research Ingeneer
Institut National des Sciences Appliquées
Rouen - France


Return to “Computer-Aided Engineering Software Tools”

Who is online

Users browsing this forum: No registered users and 1 guest