Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build system: cygwin/mingw #271

Merged
merged 15 commits into from
Apr 19, 2019
Merged

Conversation

rafmudaf
Copy link
Collaborator

@rafmudaf rafmudaf commented Apr 12, 2019

Complete this sentence
THIS PULL REQUEST IS NOT READY TO MERGE

Feature or improvement description
This pull request fixes some known issues in compiling and running OpenFAST with Cygwin and MinGW primarily in the MAP project. Also, the CMake configuration and documentation are updated. I started this branch from another branch which I've pull requested in #270. This should not be merged until that one is.

In MAP:

  • Fixes an ifdef
  • Compiler flags expected in the source code are added to the CMake config

In CMake:

  • The OS type is added for Cygwin when it checks for which Sys-file to use.

This pull request is based off of #68 and supercedes it. Per @bjonkman's comments there, I've configured CMake to pass the appropriate compiler flags to MAP so that cminpack is not modified. These compiler flags were found in the MAP makefile, and thats where _MINGW is set. However, this compiler flag is only used in mapsys.h to add dllexport. Is there any reason to not use __MINGW32__ there and remove this single-use compiler flag altogether? On @bjonkman's second comment, this pull request adds the missing flag but I'm wondering if its actually needed.

Related issue, if one exists
#144

Impacted areas of the software
MAP, CMake configuration, and documentation

Additional supporting information
None

Test results, if applicable
Here are the results from the regression tests involving MAP on my Mac:

>>mbp@~/Development/openfast/build (build_system/cygwin $)$ ctest -L map
Test project /Users/rmudafor/Development/openfast/build
    Start 21: 5MW_ITIBarge_DLL_WTurb_WavesIrr
1/3 Test #21: 5MW_ITIBarge_DLL_WTurb_WavesIrr .........   Passed   40.44 sec
    Start 22: 5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti
2/3 Test #22: 5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti ...   Passed   68.06 sec
    Start 23: 5MW_OC3Spar_DLL_WTurb_WavesIrr
3/3 Test #23: 5MW_OC3Spar_DLL_WTurb_WavesIrr ..........   Passed   61.51 sec

100% tests passed, 0 tests failed out of 3

Label Time Summary:
aerodyn14    =  40.44 sec*proc (1 test)
aerodyn15    = 129.57 sec*proc (2 tests)
elastodyn    = 170.01 sec*proc (3 tests)
hydrodyn     = 170.01 sec*proc (3 tests)
map          = 170.01 sec*proc (3 tests)
openfast     = 170.01 sec*proc (3 tests)
servodyn     = 170.01 sec*proc (3 tests)

Total Test time (real) = 170.02 sec

On Windows with MinGW, there aren't a set of appropriate baseline solutions so all tests are not expected to pass. Below are the results from running one of the MAP tests:

C:\Users\rmudafor\Development\openfast_mingw\reg_tests>py manualRegressionTest.py ..\build\glue-codes\openfast\openfast.exe Windows GNU 1e-5 -case 5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti
executing 5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti At line 1113 of file C:\Users\rmudafor\Development\openfast_mingw\modules\hydrodyn\src\HydroDyn_Input.f90
Fortran runtime warning: An array temporary was created for argument 'ary' of procedure 'readr8ary'
At line 1129 of file C:\Users\rmudafor\Development\openfast_mingw\modules\hydrodyn\src\HydroDyn_Input.f90
Fortran runtime warning: An array temporary was created for argument 'ary' of procedure 'readr8ary'

...
Repeated errors removed
...

Fortran runtime warning: An array temporary was created for argument 'vector1' of procedure 'cross_productr8'
At line 7474 of file C:\Users\rmudafor\Development\openfast_mingw\modules\elastodyn\src\ElastoDyn.f90
Fortran runtime warning: An array temporary was created for argument 'vector1' of procedure 'cross_productr8'
FAIL

Regression test execution completed with these results:
5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti FAIL
Total PASSING tests - 0
Total FAILING tests - 1

Rather than validating the solution, I think its sufficient to validate that the tests case finished successfully, so here's the log file from the regression test:

MAP++ environment properties (set externally)...
    Gravity constant          [m/s^2]  : 9.81
    Sea density               [kg/m^3] : 1025.00
    Water depth               [m]      : 200.00
    Vessel reference position [m]      : 0.00 , 0.00 , 0.00

 **************************************************************************************************
 OpenFAST

 Copyright (C)  National Renewable Energy Laboratory
 Copyright (C)  Envision Energy USA LTD

 This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
 See the "LICENSE" file distributed with this software for details.
 **************************************************************************************************

 OpenFAST-v2.1.0-70-g34182e35-dirty
 Compile Info:
  - Architecture: 32 bit
  - Precision: double
  - Date: Apr 11 2019
  - Time: 11:02:21
 Execution Info:
  - Date: 04/11/2019
  - Time: 16:47:28-0600

 OpenFAST input file heading:
     FAST Certification Test #23: NREL 5.0 MW Baseline Wind Turbine with MIT-NREL TLP
     Configuration, for use in offshore analysis

 Running ElastoDyn.
 Running AeroDyn.
 Running AirfoilInfo.
 Running BEM.
 Running UnsteadyAero.
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 1, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 2, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 3, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 4, Blade = 1
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 1, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 2, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 3, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 4, Blade = 2
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 1, Blade = 3
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 2, Blade = 3
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 3, Blade = 3
 Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0.  BladeNode = 4, Blade = 3
 Running InflowWind.

    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.
 Running ServoDyn Interface for Bladed Controllers.
 Running HydroDyn.
  Generating incident wave kinematics and current time history.
  Reading in WAMIT output with root name
  "..\build\reg_tests\glue-codes\openfast\5MW_TLP_DLL_WTurb_WavesIrr_WavesMulti\../5MW_Baseline/Hyd
  roData/tlpmit".
  Computing radiation impulse response functions and wave diffraction forces.



 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.
 VariousWaves_Init:Changed WaveNDir from 13 to 15 so that an equal number of frequencies are
 assigned to each direction.

  Time: 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.


                                                                                                  
 Time: 1 of 60 seconds. Estimated final completion at 16:52:29.                                   
                                                                                                  
 Time: 2 of 60 seconds. Estimated final completion at 16:51:26.                                   
                                                                                                  
 Time: 3 of 60 seconds. Estimated final completion at 16:51:23.                                   
                                                                                                  
 Time: 4 of 60 seconds. Estimated final completion at 16:52:04.                                   
                                                                                                  
 Time: 5 of 60 seconds. Estimated final completion at 16:52:42.                                   
                                                                                                  
 Time: 6 of 60 seconds. Estimated final completion at 16:52:28.                                   
                                                                                                  
 Time: 7 of 60 seconds. Estimated final completion at 16:52:01.                                   
                                                                                                  
 Time: 8 of 60 seconds. Estimated final completion at 16:51:18.                                   
                                                                                                  
 Time: 9 of 60 seconds. Estimated final completion at 16:50:57.                                   
                                                                                                  
 Time: 10 of 60 seconds. Estimated final completion at 16:50:52.                                  
                                                                                                  
 Time: 11 of 60 seconds. Estimated final completion at 16:50:52.                                  
                                                                                                  
 Time: 12 of 60 seconds. Estimated final completion at 16:50:55.                                  
                                                                                                  
 Time: 13 of 60 seconds. Estimated final completion at 16:50:50.                                  
                                                                                                  
 Time: 14 of 60 seconds. Estimated final completion at 16:50:52.                                  
                                                                                                  
 Time: 15 of 60 seconds. Estimated final completion at 16:50:52.                                  
                                                                                                  
 Time: 16 of 60 seconds. Estimated final completion at 16:50:51.                                  
                                                                                                  
 Time: 17 of 60 seconds. Estimated final completion at 16:51:01.                                  
                                                                                                  
 Time: 18 of 60 seconds. Estimated final completion at 16:52:08.                                  
                                                                                                  
 Time: 19 of 60 seconds. Estimated final completion at 17:01:45.                                  
                                                                                                  
 Time: 20 of 60 seconds. Estimated final completion at 16:52:44.                                  
                                                                                                  
 Time: 21 of 60 seconds. Estimated final completion at 16:52:34.                                  
                                                                                                  
 Time: 22 of 60 seconds. Estimated final completion at 16:52:29.                                  
                                                                                                  
 Time: 23 of 60 seconds. Estimated final completion at 16:52:12.                                  
                                                                                                  
 Time: 24 of 60 seconds. Estimated final completion at 16:52:24.                                  
                                                                                                  
 Time: 25 of 60 seconds. Estimated final completion at 16:52:34.                                  
                                                                                                  
 Time: 26 of 60 seconds. Estimated final completion at 16:52:16.                                  
                                                                                                  
 Time: 27 of 60 seconds. Estimated final completion at 16:52:25.                                  
                                                                                                  
 Time: 28 of 60 seconds. Estimated final completion at 16:52:22.                                  
                                                                                                  
 Time: 29 of 60 seconds. Estimated final completion at 16:52:19.                                  
                                                                                                  
 Time: 30 of 60 seconds. Estimated final completion at 16:52:24.                                  
                                                                                                  
 Time: 31 of 60 seconds. Estimated final completion at 16:45:42.                                  
                                                                                                  
 Time: 32 of 60 seconds. Estimated final completion at 16:52:10.                                  
                                                                                                  
 Time: 33 of 60 seconds. Estimated final completion at 16:52:10.                                  
                                                                                                  
 Time: 34 of 60 seconds. Estimated final completion at 16:52:09.                                  
                                                                                                  
 Time: 35 of 60 seconds. Estimated final completion at 16:52:09.                                  
                                                                                                  
 Time: 36 of 60 seconds. Estimated final completion at 16:52:04.                                  
                                                                                                  
 Time: 37 of 60 seconds. Estimated final completion at 16:52:03.                                  
                                                                                                  
 Time: 38 of 60 seconds. Estimated final completion at 16:52:08.                                  
                                                                                                  
 Time: 39 of 60 seconds. Estimated final completion at 16:52:07.                                  
                                                                                                  
 Time: 40 of 60 seconds. Estimated final completion at 16:52:03.                                  
                                                                                                  
 Time: 41 of 60 seconds. Estimated final completion at 16:52:05.                                  
                                                                                                  
 Time: 42 of 60 seconds. Estimated final completion at 16:52:14.                                  
                                                                                                  
 Time: 43 of 60 seconds. Estimated final completion at 16:52:12.                                  
                                                                                                  
 Time: 44 of 60 seconds. Estimated final completion at 16:52:11.                                  
                                                                                                  
 Time: 45 of 60 seconds. Estimated final completion at 16:52:13.                                  
                                                                                                  
 Time: 46 of 60 seconds. Estimated final completion at 16:52:16.                                  
                                                                                                  
 Time: 47 of 60 seconds. Estimated final completion at 16:52:14.                                  
                                                                                                  
 Time: 48 of 60 seconds. Estimated final completion at 16:52:12.                                  
                                                                                                  
 Time: 49 of 60 seconds. Estimated final completion at 16:52:14.                                  
                                                                                                  
 Time: 50 of 60 seconds. Estimated final completion at 16:52:12.                                  
                                                                                                  
 Time: 51 of 60 seconds. Estimated final completion at 16:52:12.                                  
                                                                                                  
 Time: 52 of 60 seconds. Estimated final completion at 16:52:10.                                  
                                                                                                  
 Time: 53 of 60 seconds. Estimated final completion at 16:52:10.                                  
                                                                                                  
 Time: 54 of 60 seconds. Estimated final completion at 16:52:11.                                  
                                                                                                  
 Time: 55 of 60 seconds. Estimated final completion at 16:52:11.                                  
                                                                                                  
 Time: 56 of 60 seconds. Estimated final completion at 16:52:12.                                  
                                                                                                  
 Time: 57 of 60 seconds. Estimated final completion at 16:52:13.                                  
                                                                                                  
 Time: 58 of 60 seconds. Estimated final completion at 16:52:11.                                  
                                                                                                  
 Time: 59 of 60 seconds. Estimated final completion at 16:52:12.                                  
                                                                                                  
 Time: 60 of 60 seconds. Estimated final completion at 16:52:12.                                  
                                                                                                  
  Total Real Time:       4.725 minutes
  Total CPU Time:        4.4326 minutes
  Simulation CPU Time:   4.3346 minutes
  Simulated Time:        1 minutes
  Time Ratio (Sim/CPU):  0.2307

  OpenFAST terminated normally.

@rafmudaf rafmudaf self-assigned this Apr 12, 2019
@rafmudaf rafmudaf changed the title Build system/cygwin Build system: cygwin/mingw Apr 18, 2019
@rafmudaf
Copy link
Collaborator Author

Additionally, I found that Cygwin requires the Linux Sys file in order to properly load the dll's. This change has been added to the CMakeLists in nwtclib.

@rafmudaf rafmudaf merged commit f01cbd7 into OpenFAST:dev Apr 19, 2019
@rafmudaf rafmudaf deleted the build_system/cygwin branch April 22, 2019 16:59
@rafmudaf rafmudaf mentioned this pull request Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant