Skip to content

Commit

Permalink
Merge pull request #2564 from deslaughter/f/build_openfast_cfd_driver
Browse files Browse the repository at this point in the history
Create BUILD_OPENFAST_LIB_DRIVER flag for the OpenFAST C++ Library Interface (not CFD)
  • Loading branch information
andrew-platt authored Dec 18, 2024
2 parents 64e00f4 + 0e99c52 commit 5656574
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/automated-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ jobs:
-DVARIABLE_TRACKING=OFF \
-DBUILD_FASTFARM:BOOL=ON \
-DBUILD_OPENFAST_CPP_API:BOOL=ON \
-DBUILD_OPENFAST_LIB_DRIVER:BOOL=ON \
-DBUILD_OPENFAST_CPP_DRIVER:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DBUILD_TESTING:BOOL=ON \
Expand Down Expand Up @@ -242,7 +243,7 @@ jobs:
- name: Build OpenFAST C-Interfaces
working-directory: ${{runner.workspace}}/openfast/build
run: |
cmake --build . --target openfastlib openfast_cpp_driver openfastcpp aerodyn_inflow_c_binding moordyn_c_binding ifw_c_binding hydrodyn_c_binding regression_test_controllers
cmake --build . --target openfastlib openfast_lib_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@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ 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_CPP_DRIVER "Enable building OpenFAST C++ driver using C++ CFD API" off)
option(BUILD_OPENFAST_LIB_DRIVER "Enable building OpenFAST driver using C++ Library 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)
Expand Down
8 changes: 4 additions & 4 deletions glue-codes/openfast/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ endif()
install(TARGETS openfast
RUNTIME DESTINATION bin)

if(BUILD_OPENFAST_CPP_DRIVER)
add_executable(openfast_cpp_driver src/FAST_Prog.cpp src/FastLibAPI.cpp)
target_link_libraries(openfast_cpp_driver openfastlib)
if(BUILD_OPENFAST_LIB_DRIVER)
add_executable(openfast_lib_driver src/FAST_Prog.cpp src/FastLibAPI.cpp)
target_link_libraries(openfast_lib_driver openfastlib)

install(TARGETS openfast_cpp_driver
install(TARGETS openfast_lib_driver
RUNTIME DESTINATION bin)
endif()

Expand Down
2 changes: 1 addition & 1 deletion reg_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 5 additions & 5 deletions reg_tests/CTestList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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_driver")
set(OPENFAST_EXECUTABLE "${CMAKE_BINARY_DIR}/glue-codes/openfast/openfast_lib_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})
Expand Down Expand Up @@ -285,15 +285,15 @@ 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()

# OpenFAST C++ Driver test for OpenFAST Library
# OpenFAST Driver test for OpenFAST C++ Library
# This tests the FAST Library and FAST_Library.h
if(BUILD_OPENFAST_CPP_DRIVER)
if(BUILD_OPENFAST_LIB_DRIVER)
of_fastlib_regression("AWT_YFree_WSt" "fastlib;elastodyn;aerodyn15;servodyn")
endif(BUILD_OPENFAST_CPP_DRIVER)
endif()

# OpenFAST Python API test
of_regression_py("5MW_Land_DLL_WTurb_py" "openfast;fastlib;python;elastodyn;aerodyn15;servodyn")
Expand Down

0 comments on commit 5656574

Please sign in to comment.