Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/automated-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DBUILD_TESTING:BOOL=ON \
-DCTEST_PLOT_ERRORS:BOOL=ON \
-DVARIABLE_TRACKING=OFF \
${GITHUB_WORKSPACE}
- name: Build OpenFAST
# if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All')
Expand Down Expand Up @@ -275,6 +276,7 @@ jobs:
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
-DBUILD_TESTING:BOOL=ON \
-DCTEST_PLOT_ERRORS:BOOL=ON \
-DVARIABLE_TRACKING=OFF \
${GITHUB_WORKSPACE}
- name: Build FAST.Farm
# if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All')
Expand Down Expand Up @@ -447,6 +449,7 @@ jobs:
-DBUILD_SHARED_LIBS:BOOL=ON \
-DBUILD_TESTING:BOOL=ON \
-DCTEST_PLOT_ERRORS:BOOL=ON \
-DVARIABLE_TRACKING=OFF \
${GITHUB_WORKSPACE}

- name: Build OpenFAST C-Interfaces
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ if (NOT CMAKE_BUILD_TYPE)
"Choose the build type: Debug Release" FORCE)
endif (NOT CMAKE_BUILD_TYPE)

option(VARIABLE_TRACKING "Enables variable tracking for better runtime debugging output. May increase compile time. Valid only for GNU." on)
option(GENERATE_TYPES "Use the openfast-regsitry to autogenerate types modules" off)
option(BUILD_SHARED_LIBS "Enable building shared libraries" off)
option(DOUBLE_PRECISION "Treat REAL as double precision" on)
Expand All @@ -45,6 +46,12 @@ if(APPLE)
option(CMAKE_MACOSX_RPATH "Use RPATH runtime linking" on)
endif()

# Warn if atypical configuration for variable tracking and build type
string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type)
if(NOT ${VARIABLE_TRACKING} AND (${_build_type} STREQUAL "DEBUG" OR ${_build_type} STREQUAL "RELWITHDEBINFO") )
message(WARNING "Variable tracking is disabled and build type includes debug symbols. This may reduce the ability to debug.")
endif()

# Precompiler/preprocessor flag configuration
# Do this before configuring modules so that the flags are included
option(BUILD_TESTING "Build the testing tree." OFF)
Expand Down
9 changes: 5 additions & 4 deletions glue-codes/fast-farm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ set_property(TARGET FAST.Farm PROPERTY LINKER_LANGUAGE Fortran)

string(TOUPPER ${CMAKE_Fortran_COMPILER_ID} _compiler_id)
string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type)
if (${_compiler_id} STREQUAL "GNU" AND ${_build_type} STREQUAL "RELEASE")
if (${_compiler_id} STREQUAL "GNU" AND NOT ${VARIABLE_TRACKING})
# With variable tracking enabled, the compile step frequently aborts on large modules and
# restarts with this option off. Disabling in Release mode avoids this problem when compiling with
# full optimizations, but leaves it enabled for RelWithDebInfo which adds both -O2 and -g flags.
# restarts with this option off. Disabling avoids this problem when compiling with
# full optimizations. However, variable tracking should be enabled when actively debugging
# for better runtime debugging output.
# https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
set_source_files_properties(src/FAST_Farm_Types.f90 src/FASTWrapper_Types.f90 PROPERTIES COMPILE_FLAGS "-fno-var-tracking -fno-var-tracking-assignments")
set_source_files_properties(src/FAST_Farm_Types.f90 src/FASTWrapper_Types.f90 src/FASTWrapper.f90 PROPERTIES COMPILE_FLAGS "-fno-var-tracking -fno-var-tracking-assignments")
endif()
if (${_compiler_id} MATCHES "^INTEL" AND ${_build_type} STREQUAL "RELEASE" AND NOT WIN32)
# Compilation hangs on FAST_Farm_Types.f90 with -O3 on linux (on some hardware)
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 @@ -27,11 +27,11 @@ 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)
string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type)
if (${_compiler_id} STREQUAL "GNU" AND ${_build_type} STREQUAL "RELEASE")
if (${_compiler_id} STREQUAL "GNU" AND NOT ${VARIABLE_TRACKING})
# With variable tracking enabled, the compile step frequently aborts on large modules and
# restarts with this option off. Disabling in Release mode avoids this problem when compiling with
# full optimizations, but leaves it enabled for RelWithDebInfo which adds both -O2 and -g flags.
# restarts with this option off. Disabling avoids this problem when compiling with
# full optimizations. However, variable tracking should be enabled when actively debugging
# for better runtime debugging output.
# https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
set_source_files_properties(src/FAST_Prog.f90 PROPERTIES COMPILE_FLAGS "-fno-var-tracking -fno-var-tracking-assignments")
endif()
Expand Down
7 changes: 4 additions & 3 deletions modules/openfast-library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ target_link_libraries(openfastlib openfast_postlib openfast_prelib scdataexlib f

string(TOUPPER ${CMAKE_Fortran_COMPILER_ID} _compiler_id)
string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type)
if (${_compiler_id} STREQUAL "GNU" AND ${_build_type} STREQUAL "RELEASE")
if (${_compiler_id} STREQUAL "GNU" AND NOT ${VARIABLE_TRACKING})
# With variable tracking enabled, the compile step frequently aborts on large modules and
# restarts with this option off. Disabling in Release mode avoids this problem when compiling with
# full optimizations, but leaves it enabled for RelWithDebInfo which adds both -O2 and -g flags.
# restarts with this option off. Disabling avoids this problem when compiling with
# full optimizations. However, variable tracking should be enabled when actively debugging
# for better runtime debugging output.
# https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
set_source_files_properties(
src/FAST_Subs.f90 src/FAST_Types.f90 src/FAST_Library.f90
Expand Down