Compiling FAST v8.12 on Mac

Hello

I’ve tried to compile FAST v8.12 on Mac OS X 10.11, with gfortran 5.2, following the instructions in the pdf document. Firstly, many thanks for a nice descriptive document on how to proceed with compiling FAST.

Although, I’m still unable to compile the code. The following error is seen:


gfortran -I Obj_lin64 -O2 -m64 -fbacktrace -ffree-line-length-none -x f95-cpp-input -DUSE_DLL_INTERFACE -c ../Source/dependencies/BeamDyn/BeamDyn_IO.f90 -o Obj_lin64/BeamDyn_IO.o -J Obj_lin64 -B Obj_lin64
gfortran -I Obj_lin64 -O2 -m64 -fbacktrace -ffree-line-length-none -x f95-cpp-input -DUSE_DLL_INTERFACE -c ../Source/dependencies/BeamDyn/BeamDyn.f90 -o Obj_lin64/BeamDyn.o -J Obj_lin64 -B Obj_lin64
gfortran -I Obj_lin64 -O2 -m64 -fbacktrace -ffree-line-length-none -x f95-cpp-input -DUSE_DLL_INTERFACE -c ../Source/dependencies/OrcaFlex/OrcaFlexInterface.f90 -o Obj_lin64/OrcaFlexInterface.o -J Obj_lin64 -B Obj_lin64
‘
../Source/dependencies/OrcaFlex/OrcaFlexInterface.f90:792:0:

       CALL C_F_PROCPOINTER( p%DLL_Orca%ProcAddr(2), OrcaDLL_Calc )
 1
in pp_format, at pretty-print.c:614

Internal compiler error: Error reporting routines re-entered.
gfortran: internal compiler error: Abort trap: 6 (program f951)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [OrcaFlexInterface.o] Error 4

Any ideas?

Thanks a lot for your help!

Glad the compiling document is useful. We’ve seen a few weird things come up with gfortran 5.x. Looks like this is another one to look into.

One workaround is to compile with preprocessor directive NO_LibLoad: just add -DNO_LibLoad to the FFLAGS variable in the makefile you are using. This will effectively prevent you from loading a DLL for OrcaFlex, but that library doesn’t exist for Mac anyway.

Thanks a lot Bonnie for your response. That did the trick!
Now compiling DISCON and S-function… I shall keep you posted. :slight_smile:

Regards,
Surya.

Hello Bonnie,
Yet another problem… how do i generate a mex using the ‘Create_Fast_SFunc’ ? It throws an error “-lFast_Libraryx64” library not found.
I could compile FAST in Mac but the discon is yet another problem. I see in your document you mentioned that it won’t compile with gfortran 5. version. So I’ve tried with version 4.9. and it still doesn’t work (on os X 10.11)
Many thanks for your help.

Hi, Surya.

Before you make the mex function on Mac, you’ll need to create the FAST_Library. Theoretically you could uncomment line 20 in the FAST makefile, comment out line 22 (i.e., set FAST_driver = FAST_Library) and then compile it to make the FAST library (if you’re using 64-bit Matlab, you’d also need to make sure BITS=64 in lines 15-16 of the makefile). I think it will call it FAST_Library_glin64.so or FAST_Library_glin32.so, so you’d need to modify Create_FAST_SFunc to look for it instead of FAST_Libraryx64.

I am a little concerned that your compiler won’t create the library, though, because it’s creating a dynamic library like the DISCON library that doesn’t seem to work on your Mac. I do know that at least two people at NREL have compiled the DISCON library on Mac OS X; one used GNU Fortran (MacPorts gcc49 4.9.3_0+universal) 4.9.3.

Hi Bonnie,

Thanks for your reply. I’ve accepted defeat :slight_smile: and now using the mexw32 on parallels.

Regards,
Surya.

Hi Surya,

The trick is to compile the code use GNU fortran 4.9.3 as mentioned by Bonnie.

Steps:
1.install Macports
2.use Macport to install gcc4.9
3.active gcc4.9
4.use gcc to compile all the files in the instructions.

I have tested it. It works for me.

However, when I compiled the FAST_Library, it gave me some warnings.

…/Source/FAST_Library.f90:496:0: warning: ‘dllexport’ attribute directive ignored [-Wattributes]
subroutine FAST_OpFM_Step(ErrStat_c, ErrMsg_c) BIND (C, NAME=‘FAST_OpFM_Step’)
^
…/Source/FAST_Library.f90:448:0: warning: ‘dllexport’ attribute directive ignored [-Wattributes]
subroutine FAST_OpFM_Restart(CheckpointRootName_c, AbortErrLev_c, dt_c, n_t_global_c, &
^
…/Source/FAST_Library.f90:430:0: warning: ‘dllexport’ attribute directive ignored [-Wattributes]
subroutine FAST_OpFM_Solution0(ErrStat_c, ErrMsg_c) BIND (C, NAME=‘FAST_OpFM_Solution0’)
^
…/Source/FAST_Library.f90:362:0: warning: ‘dllexport’ attribute directive ignored [-Wattributes]
subroutine FAST_OpFM_Init(TMax, InputFileName_c, TurbID, NumSCin, NumSCout, TurbPosn, AbortErrLev_c, dt_c, NumBl_c, NumBlElem_c, &
^
…/Source/FAST_Library.f90:312:0: warning: ‘dllexport’ attribute directive ignored [-Wattributes]
subroutine FAST_Restart(CheckpointRootName_c, AbortErrLev_c, NumOuts_c, dt_c, n_t_global_c, ErrStat_c, ErrMsg_c) BIND (C, NAME=‘FAST_Restart’)
^
…/Source/FAST_Library.f90:273:0: warning: ‘dllexport’ attribute directive ignored [-Wattributes]
subroutine FAST_CreateCheckpoint(CheckpointRootName_c, ErrStat_c, ErrMsg_c) BIND (C, NAME=‘FAST_CreateCheckpoint’)
^
…/Source/FAST_Library.f90:264:0: warning: ‘dllexport’ attribute directive ignored [-Wattributes]
subroutine FAST_End() BIND (C, NAME=‘FAST_End’)
^
…/Source/FAST_Library.f90:167:0: warning: ‘dllexport’ attribute directive ignored [-Wattributes]
subroutine FAST_Update(NumInputs_c, NumOutputs_c, InputAry, OutputAry, ErrStat_c, ErrMsg_c) BIND (C, NAME=‘FAST_Update’)
^
…/Source/FAST_Library.f90:109:0: warning: ‘dllexport’ attribute directive ignored [-Wattributes]
subroutine FAST_Start(NumInputs_c, NumOutputs_c, InputAry, OutputAry, ErrStat_c, ErrMsg_c) BIND (C, NAME=‘FAST_Start’)
^
…/Source/FAST_Library.f90:37:0: warning: ‘dllexport’ attribute directive ignored [-Wattributes]
subroutine FAST_Sizes(TMax, InitInpAry, InputFileName_c, AbortErrLev_c, NumOuts_c, dt_c, ErrStat_c, ErrMsg_c, ChannelNames_c) BIND (C, NAME=‘FAST_Sizes’)

The file can be generated, but I am not sure if these warnings are harmful or not.

Thanks
Xiao

Thanks for the feedback, Xiao. The warnings about dllexport can be safely ignored on Mac OS. Someday I will probably update the code so you don’t get those warnings on non-Windows environments, but for now, just ignore them.

One other thing I should mention about trying to use this FAST_Library with Simulink on Mac. On Windows, I compile using the SysMatlab.f90 code to call Matlab routines for writing to the Matlab Command Window. SysMatlab.f90 is basically SysIVF.f90 with the write-to-screen calls replaced with calls to Matlab’s mexPrintf routine. Then, I link with the Matlab libmex.lib library, which is found in this Matlab directory: %matlabroot%/extern/lib/{architecture}/{compiler}/

If you don’t replace the write-to-screen calls with something else, everything that normally gets printed on the screen when FAST runs gets lost. You may want to replace them with either the mexPrintf routine or just write to a file (e.g., you could set CU = 8 and have it get printed to fort.8 )

Thanks Xiao and Bonnie for your replies. I will give it a shot once again.
By the way, did you get the discon.dll compiled for Mac as well?

Regards,
Surya.

Hi Surya,

Yes, I compiled the FAST.exe, the FAST_library, and the DISCON.dll.
And I tested several CertTest, it worked.

Regards,
Xiao

Ah! Thanks a ton Xiao!
Yes, now i could compile the FAST and DISCON functions. Could you also compile the mex function?

Regards,
Surya.

Hello Surya,

I can compile the FAST_library for the mex compiling.
However, I don’t currently have a matlab installed on my mac.
I will try it later on.

Best regards,
Xiao

Hi Xiao,

Thanks for your reply. I’ll keep you posted on my success with the mex compilation.

Regards,
Surya.

I’m trying to simulate the Test #19 with FAST. The following error pops up. I haven’t made any modifications to the .fst or wind files.
It works fine on Windows but I see this issue on mac.
Any help is greatly appreciated. :slight_smile:

**************************************************************************************************
 FAST (v8.12.00a-bjj, 6-Oct-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.12.00a-bjj, 6-Oct-2015), compiled as a 64-bit application using single precision
  linked with NWTC Subroutine Library (v2.06.05a-bjj, 5-Oct-2015)

  Heading of the FAST input file:
    FAST Certification Test #19: NREL 5.0 MW Baseline Wind Turbine with OC3 Monopile RF
    Configuration, for use in offshore analysis

  Running ElastoDyn (v1.03.00a-bjj, 5-Oct-2015).

  Running AeroDyn14 (v14.04.00a-bjj, 6-Oct-2015).

  Running InflowWind (v3.01.00a-adp, 5-Oct-2015).
  Opening InflowWind input file:  ./5MW_Baseline/NRELOffshrBsline5MW_InflowWind_12mps.dat

    Reading a 31x31 grid (145 m wide, 17.5 m to 162.5 m above ground) with a characteristic wind
    speed of 12 m/s. This full-field file was generated by TurbSim (v1.06.00, 21-Sep-2012) on
    07-Jan-2014 at 12:50:45.

    Processed 1442 time steps of 20-Hz full-field data (72.05 seconds).

  Running ServoDyn (v1.03.01a-bjj, 5-Oct-2015).

  Running ServoDyn Interface for Bladed Controllers (using GNU Fortran for Linux, 20-Aug-2015).

  Running HydroDyn (v2.03.00c-adp, 05-Oct-2015).
  Generating incident wave kinematics and current time history.
  Calculating second order difference frequency wave kinematics.
  Calculating second order sum frequency wave kinematics.

  Running SubDyn (v1.02.00a-rrd, 5-Oct-2015).
    Calculating Internal Modal Eigenvectors

 FAST_InitializeAll:HydroDyn_Init:Waves_Init:VariousWaves_Init: The random number generator in use
 differs from the original code provided by NREL. This pRNG uses 12 seeds instead of the 2 in the
 HydroDyn input file.

  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.


 FAST_Solution:CalcOutputs_And_SolveForInputs:SolveOption1:ED_SD_HD_BD_Orca_InputOutputSolve:SD_Cal
 cOutput:Small angle assumption violated in SUBROUTINE SmllRotTrans() due to a large UL input
 angles. The solution may be inaccurate. Simulation continuing, but future warnings from
 SmllRotTrans() will be suppressed.
  Additional debugging message from SUBROUTINE SmllRotTrans():


 FAST_Solution:FAST_AdvanceStates:ED_ABM4:ED_AB4:ED_RK4:SetCoordSy:Small angle assumption violated
 in SUBROUTINE SmllRotTrans() due to a large blade deflection (ElastoDyn SetCoordSy). The solution
 may be inaccurate. Simulation continuing, but future warnings from SmllRotTrans() will be
 suppressed.
  Additional debugging message from SUBROUTINE SmllRotTrans(): 1.25000E-02 s
 FAST_Solution:CalcOutputs_And_SolveForInputs:SolveOption2:InflowWind_CalcOutput:CalcOutput:IfW_TSF
 FWind_CalcOutput [position=(6123, 2592.1, 622.46) in wind-file coordinates]: Error: FF wind array
 was exhausted at 1.50000E-02 seconds (trying to access data at -504.19 seconds).
 SolveOption2:AD14_CalcOutput:ELEMFRC:BeddoesModel:ATTACH: Blade #1 element #4 is supersonic!
 Other elements are likely supersonic as well. Supersonic mach nos. will be set to 0.7 to attempt
 continuation.
 AD14_CalcOutput:ELEMFRC:vindinf:Value of Rzero = 2.4636 must be smaller than 1 in xphi().
 CalcOutputs_And_SolveForInputs:SolveOption1:ED_SD_HD_BD_Orca_InputOutputSolve:

 FAST encountered an error at simulation time 1.00000E-02 of 60 seconds.
  Simulation error level: FATAL ERROR

  Aborting FAST.

Hello Surya,

I saw you have a problem of violating the small angle assumption.
You can read this poster to check your simulation case.
http://forums.nrel.gov/t/nrel-5mw-controls-dll-interface/183/1

Thanks
Xiao

Hello Xiao,

Thanks for your response. It is somehow working (miraculously) :slight_smile:

Hi Xiao,

Thanks a lot for your response. The test case 19 is also working… all by itself.

Regards,
Surya.