amr-wind icon indicating copy to clipboard operation
amr-wind copied to clipboard

Compiling with latest OpenFAST version

Open lawrenceccheung opened this issue 1 year ago • 7 comments

I'm getting an error if I compile amr-wind with the latest version of OpenFAST (v3.5+):

/projects/wind_uq/lcheung/AMRWindBuilds/hfm.20230525/amr-wind/amr-wind/wind_energy/actuator/turbine/fast/FastIface.cpp: In instantiation of 'void exw_fast::{anonymous}::fast_func(const FType&&, Args ...) [with FType = void(int*, double*, const char*, int*, int*, int*, int*, float*, float*, int*, int*, float*, int*, double*, int*, int*, int*, exw_fast::OpFM_InputType*, exw_fast::OpFM_OutputType*, exw_fast::SC_DX_InputType*, exw_fast::SC_DX_OutputType*, int*, char*); Args = {int*, double*, char*, int*, int*, int*, int*, float*, float*, int*, int*, float*, int*, double*, int*, int*, exw_fast::OpFM_InputType*, exw_fast::OpFM_OutputType*, exw_fast::SC_DX_InputType*, exw_fast::SC_DX_OutputType*}]':
/projects/wind_uq/lcheung/AMRWindBuilds/hfm.20230525/amr-wind/amr-wind/wind_energy/actuator/turbine/fast/FastIface.cpp:216:77:   required from here
/projects/wind_uq/lcheung/AMRWindBuilds/hfm.20230525/amr-wind/amr-wind/wind_energy/actuator/turbine/fast/FastIface.cpp:22:9: error: cannot convert 'exw_fast::OpFM_InputType*' to 'int*' in argument passing
   22 |     func(std::forward<Args>(args)..., &ierr, err_msg);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/amrwind_obj.dir/amr-wind/wind_energy/actuator/turbine/fast/FastIface.cpp.o] Error 1

This occurs with both gcc and intel compilers, at least on Sandia HPC machines. However, if I switch to OpenFAST v3.4 (https://github.com/OpenFAST/openfast/commit/e8ec53f9c7f9d3f6a13bfb61dba12a0ca04d8a2f), this problem goes away.

It will take some time to bisect the problem and find out the problem, but perhaps one thing to look at is this commit: https://github.com/OpenFAST/openfast/commit/a4740d72a2d04bc2104f71bf60159d1cadac106c

Not sure yet what the right corrective action is, but will keep digging.

Lawrence

lawrenceccheung avatar May 25 '23 22:05 lawrenceccheung

Looks like a function signature changed and broke the forwarding arguments. What's the priority like for a fix here? What project is this for?

psakievich avatar May 26 '23 03:05 psakievich

It's not super-urgent, most projects that I'm aware of will be relying on older, established versions of OpenFAST to do their runs. But be aware that compiling with OpenFAST will be broken until we find a fix.

lawrenceccheung avatar May 26 '23 04:05 lawrenceccheung

I made a change to OpenFAST's C++ API that allows for non-uniform force point spacing. That requires one extra input that must be passed. I will try to tackle this issue as I understand why it is happening and introduced the OpenFAST change.

mchurchf avatar Jun 16 '23 23:06 mchurchf

@mchurchf I don't think there is an issue with your change on the openfast side. The issue is more the mechanics of how we handle openfast inside amr-wind. I think we need to convert amr-wind to use the c++ API or devote some time to adding in an abstraction. FYI @michaelasprague

psakievich avatar Jun 20 '23 13:06 psakievich

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar Jul 21 '23 02:07 github-actions[bot]

On Frontier a specific version of OpenFAST needs to be used right now. AMR-Wind doesn't work with version v3.5.0, but also doesn't work with v3.4.1:

     5    -- Cray Programming Environment 2.7.19 CXX
     6    -- Cray Programming Environment 2.7.19 C
     7    -- Cray Programming Environment 2.7.19 Fortran
  >> 8    CMake Error at cmake/OpenfastFortranOptions.cmake:46 (message):
     9      OpenFAST requires either GFortran or Intel Fortran Compiler.  Compiler
     10     detected by CMake: mpif90.
     11   Call Stack (most recent call first):
     12     CMakeLists.txt:68 (set_fast_fortran)
     13   
     14   

See build log for details:
  /lustre/orion/cfd162/proj-shared/lcheung/spackbuilds/spack-manager.1/environments/exawind1/openfast/spack-build-out.txt

==> Warning: Skipping build of amr-wind-main-zwfyd432cdgopgtxg7xyjj3nqdirewlo since openfast-main-pfd5sphb4apzvecmfph2gvjjo7ufzgst failed
==> Error: amr-wind-main-zwfyd432cdgopgtxg7xyjj3nqdirewlo: Package was not installed
==> Error: openfast-main-pfd5sphb4apzvecmfph2gvjjo7ufzgst: Package was not installed
==> Error: Installation request failed.  Refer to reported errors for failing package(s).

However, version bb72d2622 of OpenFAST seems be compiling successfully for me.

Lawrence

lawrenceccheung avatar Jul 31 '23 23:07 lawrenceccheung

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar Aug 31 '23 02:08 github-actions[bot]