From 7cbd2f62ac963f91cb0d0ca38beeb469020e4a24 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Tue, 23 May 2023 13:45:24 -0600 Subject: [PATCH 1/5] OpFM: fix inconsistent typing of NodeCluster in FAST_Types --- modules/openfast-library/src/FAST_Registry.txt | 2 +- modules/openfast-library/src/FAST_Types.f90 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openfast-library/src/FAST_Registry.txt b/modules/openfast-library/src/FAST_Registry.txt index b869f5202..7a3deecc3 100644 --- a/modules/openfast-library/src/FAST_Registry.txt +++ b/modules/openfast-library/src/FAST_Registry.txt @@ -747,7 +747,7 @@ typedef ^ FAST_ExternInitType ReKi windGrid_pZero 3 - - "fixed position of the X typedef ^ FAST_ExternInitType CHARACTER(1024) RootName - - - "Root name of FAST output files (overrides normal operation)" - typedef ^ FAST_ExternInitType IntKi NumActForcePtsBlade - - - "number of actuator line force points in blade" - typedef ^ FAST_ExternInitType IntKi NumActForcePtsTower - - - "number of actuator line force points in tower" - -typedef ^ FAST_ExternInitType logical NodeClusterType - - - "Node clustering for actuator line (0 - Uniform, 1 - Non-uniform clustered towards tip)" - +typedef ^ FAST_ExternInitType IntKi NodeClusterType - - - "Node clustering for actuator line (0 - Uniform, 1 - Non-uniform clustered towards tip)" - # ..... FAST Turbine Data (one realization) ....................................................................................................... typedef ^ FAST_TurbineType IntKi TurbID - 1 - "Turbine ID Number" - diff --git a/modules/openfast-library/src/FAST_Types.f90 b/modules/openfast-library/src/FAST_Types.f90 index fc8eac4b8..fdc0a632c 100644 --- a/modules/openfast-library/src/FAST_Types.f90 +++ b/modules/openfast-library/src/FAST_Types.f90 @@ -48250,7 +48250,7 @@ SUBROUTINE FAST_PackExternInitType( ReKiBuf, DbKiBuf, IntKiBuf, Indata, ErrStat, Int_Xferred = Int_Xferred + 1 IntKiBuf(Int_Xferred) = InData%NumActForcePtsTower Int_Xferred = Int_Xferred + 1 - IntKiBuf(Int_Xferred) = TRANSFER(InData%NodeClusterType, IntKiBuf(1)) + IntKiBuf(Int_Xferred) = InData%NodeClusterType Int_Xferred = Int_Xferred + 1 END SUBROUTINE FAST_PackExternInitType @@ -48367,7 +48367,7 @@ SUBROUTINE FAST_UnPackExternInitType( ReKiBuf, DbKiBuf, IntKiBuf, Outdata, ErrSt Int_Xferred = Int_Xferred + 1 OutData%NumActForcePtsTower = IntKiBuf(Int_Xferred) Int_Xferred = Int_Xferred + 1 - OutData%NodeClusterType = TRANSFER(IntKiBuf(Int_Xferred), OutData%NodeClusterType) + OutData%NodeClusterType = IntKiBuf(Int_Xferred) Int_Xferred = Int_Xferred + 1 END SUBROUTINE FAST_UnPackExternInitType From 55b8e11b1b0403347e2546f8088edd64efc64421 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Tue, 23 May 2023 13:47:39 -0600 Subject: [PATCH 2/5] cmake: remove openfast_cpp_api from default build if not selected --- glue-codes/openfast/CMakeLists.txt | 15 +++++++++++---- reg_tests/CTestList.cmake | 4 +++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/glue-codes/openfast/CMakeLists.txt b/glue-codes/openfast/CMakeLists.txt index 24dcb4d84..efab078df 100644 --- a/glue-codes/openfast/CMakeLists.txt +++ b/glue-codes/openfast/CMakeLists.txt @@ -20,9 +20,6 @@ add_executable(openfast src/FAST_Prog.f90) target_link_libraries(openfast openfastlib_static) set_target_properties(openfast PROPERTIES LINKER_LANGUAGE Fortran) -add_executable(openfast_cpp src/FAST_Prog.cpp src/FastLibAPI.cpp) -target_link_libraries(openfast_cpp openfastlib) - string(TOUPPER ${CMAKE_Fortran_COMPILER_ID} _compiler_id) if (${_compiler_id} STREQUAL "GNU" AND NOT ${VARIABLE_TRACKING}) # With variable tracking enabled, the compile step frequently aborts on large modules and @@ -33,5 +30,15 @@ if (${_compiler_id} STREQUAL "GNU" AND NOT ${VARIABLE_TRACKING}) set_source_files_properties(src/FAST_Prog.f90 PROPERTIES COMPILE_FLAGS "-fno-var-tracking -fno-var-tracking-assignments") endif() -install(TARGETS openfast openfast_cpp +install(TARGETS openfast RUNTIME DESTINATION bin) + +if(BUILD_OPENFAST_CPP_API) + add_executable(openfast_cpp src/FAST_Prog.cpp src/FastLibAPI.cpp) + target_link_libraries(openfast_cpp openfastlib) + + install(TARGETS openfast_cpp + RUNTIME DESTINATION bin) +endif(BUILD_OPENFAST_CPP_API) + + diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index f5164270d..3dc491daa 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -291,7 +291,9 @@ endif() # OpenFAST C++ Driver test for OpenFAST Library # This tests the FAST Library and FAST_Library.h -of_fastlib_regression("AWT_YFree_WSt" "fastlib;elastodyn;aerodyn15;servodyn") +if(BUILD_OPENFAST_CPP_API) + of_fastlib_regression("AWT_YFree_WSt" "fastlib;elastodyn;aerodyn15;servodyn") +endif() # OpenFAST Python API test of_regression_py("5MW_Land_DLL_WTurb_py" "openfast;fastlib;python;elastodyn;aerodyn15;servodyn") From 94ca6ed79af3fa09d829100a218711f8f9b48d4a Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Tue, 23 May 2023 14:34:27 -0600 Subject: [PATCH 3/5] Add CMake option for BUILD_OPENFAST_CPP_DRIVER for openfast_cpp_driver target --- .github/workflows/automated-dev-tests.yml | 3 ++- CMakeLists.txt | 1 + glue-codes/openfast/CMakeLists.txt | 10 +++++----- reg_tests/CTestList.cmake | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 3567571a2..c25a5c238 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -200,6 +200,7 @@ jobs: -DVARIABLE_TRACKING=OFF \ -DBUILD_FASTFARM:BOOL=ON \ -DBUILD_OPENFAST_CPP_API:BOOL=ON \ + -DBUILD_OPENFAST_CPP_DRIVER:BOOL=ON \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DBUILD_TESTING:BOOL=ON \ -DCTEST_PLOT_ERRORS:BOOL=ON \ @@ -244,7 +245,7 @@ jobs: - name: Build OpenFAST C-Interfaces working-directory: ${{runner.workspace}}/openfast/build run: | - cmake --build . --target openfastlib openfast_cpp openfastcpp aerodyn_inflow_c_binding moordyn_c_binding ifw_c_binding hydrodyn_c_binding regression_test_controllers + cmake --build . --target openfastlib openfast_cpp_driver openfastcpp aerodyn_inflow_c_binding moordyn_c_binding ifw_c_binding hydrodyn_c_binding regression_test_controllers - name: Cache the workspace uses: actions/cache@v3.0.4 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c9dda925..e41e2b7bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,7 @@ option(FPE_TRAP_ENABLED "Enable FPE trap in compiler options" off) option(ORCA_DLL_LOAD "Enable OrcaFlex Library Load" on) option(BUILD_FASTFARM "Enable building FAST.Farm" off) option(BUILD_OPENFAST_CPP_API "Enable building OpenFAST - C++ API" off) +option(BUILD_OPENFAST_CPP_DRIVER "Enable building OpenFAST C++ driver using C++ API" off) option(BUILD_OPENFAST_SIMULINK_API "Enable building OpenFAST for use with Simulink" off) option(OPENMP "Enable OpenMP support" off) option(USE_LOCAL_STATIC_LAPACK "Enable downloading and building static LAPACK and BLAS libs" off) diff --git a/glue-codes/openfast/CMakeLists.txt b/glue-codes/openfast/CMakeLists.txt index efab078df..a22cbde0a 100644 --- a/glue-codes/openfast/CMakeLists.txt +++ b/glue-codes/openfast/CMakeLists.txt @@ -33,12 +33,12 @@ endif() install(TARGETS openfast RUNTIME DESTINATION bin) -if(BUILD_OPENFAST_CPP_API) - add_executable(openfast_cpp src/FAST_Prog.cpp src/FastLibAPI.cpp) - target_link_libraries(openfast_cpp openfastlib) +if(BUILD_OPENFAST_CPP_API AND BUILD_OPENFAST_CPP_DRIVER) + add_executable(openfast_cpp_driver src/FAST_Prog.cpp src/FastLibAPI.cpp) + target_link_libraries(openfast_cpp_driver openfastlib) - install(TARGETS openfast_cpp + install(TARGETS openfast_cpp_driver RUNTIME DESTINATION bin) -endif(BUILD_OPENFAST_CPP_API) +endif(BUILD_OPENFAST_CPP_API AND BUILD_OPENFAST_CPP_DRIVER) diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index 3dc491daa..797c3c8bd 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -291,9 +291,9 @@ endif() # OpenFAST C++ Driver test for OpenFAST Library # This tests the FAST Library and FAST_Library.h -if(BUILD_OPENFAST_CPP_API) +if(BUILD_OPENFAST_CPP_DRIVER) of_fastlib_regression("AWT_YFree_WSt" "fastlib;elastodyn;aerodyn15;servodyn") -endif() +endif(BUILD_OPENFAST_CPP_DRIVER) # OpenFAST Python API test of_regression_py("5MW_Land_DLL_WTurb_py" "openfast;fastlib;python;elastodyn;aerodyn15;servodyn") From a4163030f10e43fe3c922ca41ed91b8443144281 Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Tue, 23 May 2023 14:39:37 -0600 Subject: [PATCH 4/5] CTest: openfast_cpp_driver executable name --- reg_tests/CTestList.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index 797c3c8bd..8aa86ae6e 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -85,7 +85,7 @@ endfunction(of_regression) function(of_fastlib_regression TESTNAME LABEL) set(TEST_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/executeOpenfastRegressionCase.py") - set(OPENFAST_EXECUTABLE "${CMAKE_BINARY_DIR}/glue-codes/openfast/openfast_cpp") + set(OPENFAST_EXECUTABLE "${CMAKE_BINARY_DIR}/glue-codes/openfast/openfast_cpp_driver") set(SOURCE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/..") set(BUILD_DIRECTORY "${CTEST_BINARY_DIR}/glue-codes/openfast") regression(${TEST_SCRIPT} ${OPENFAST_EXECUTABLE} ${SOURCE_DIRECTORY} ${BUILD_DIRECTORY} "${TESTNAME}_fastlib" "${LABEL}" ${TESTNAME}) From 10094c584c91bd626ba18402c49842990f32f99e Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Thu, 12 Oct 2023 15:20:59 -0600 Subject: [PATCH 5/5] OFcpp: some updates based on PR feedback --- glue-codes/openfast/CMakeLists.txt | 4 ++-- reg_tests/CMakeLists.txt | 2 +- reg_tests/CTestList.cmake | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/glue-codes/openfast/CMakeLists.txt b/glue-codes/openfast/CMakeLists.txt index a22cbde0a..bc2e13233 100644 --- a/glue-codes/openfast/CMakeLists.txt +++ b/glue-codes/openfast/CMakeLists.txt @@ -33,12 +33,12 @@ endif() install(TARGETS openfast RUNTIME DESTINATION bin) -if(BUILD_OPENFAST_CPP_API AND BUILD_OPENFAST_CPP_DRIVER) +if(BUILD_OPENFAST_CPP_DRIVER) add_executable(openfast_cpp_driver src/FAST_Prog.cpp src/FastLibAPI.cpp) target_link_libraries(openfast_cpp_driver openfastlib) install(TARGETS openfast_cpp_driver RUNTIME DESTINATION bin) -endif(BUILD_OPENFAST_CPP_API AND BUILD_OPENFAST_CPP_DRIVER) +endif() diff --git a/reg_tests/CMakeLists.txt b/reg_tests/CMakeLists.txt index 268e188f9..70cbf6717 100644 --- a/reg_tests/CMakeLists.txt +++ b/reg_tests/CMakeLists.txt @@ -42,7 +42,7 @@ option(CTEST_NO_RUN_FLAG "Complete the regression test comparison but do not ex # Set the OpenFAST executable configuration option and default set(CTEST_OPENFAST_EXECUTABLE "${CMAKE_BINARY_DIR}/glue-codes/openfast/openfast${CMAKE_EXECUTABLE_SUFFIX}" CACHE FILEPATH "Specify the OpenFAST executable to use in testing.") -if(BUILD_OPENFAST_CPP_API) +if(BUILD_OPENFAST_CPP_DRIVER) # Set the OpenFAST executable configuration option and default set(CTEST_OPENFASTCPP_EXECUTABLE "${CMAKE_BINARY_DIR}/glue-codes/openfast-cpp/openfastcpp${CMAKE_EXECUTABLE_SUFFIX}" CACHE FILEPATH "Specify the OpenFAST C++ executable to use in testing.") endif() diff --git a/reg_tests/CTestList.cmake b/reg_tests/CTestList.cmake index 8aa86ae6e..7fda42b58 100644 --- a/reg_tests/CTestList.cmake +++ b/reg_tests/CTestList.cmake @@ -285,7 +285,7 @@ of_regression("MHK_RM1_Floating" "openfast;elastodyn;aerod of_regression("Tailfin_FreeYaw1DOF_PolarBased" "openfast;elastodyn;aerodyn15") # OpenFAST C++ API test -if(BUILD_OPENFAST_CPP_API) +if(BUILD_OPENFAST_CPP_DRIVER) of_cpp_interface_regression("5MW_Land_DLL_WTurb_cpp" "openfast;fastlib;cpp") endif()