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

Improve gcov coverage reporting logic (and other minor changes) #766

Merged
merged 2 commits into from
Mar 21, 2020
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
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,27 @@ Synopsis of Active Draco Packages
---------------------------------

* c4 - A communications library for message passing interfaces (MPI).
* For builds without MPI, all communication commnds will be no-op functions
(`DRACO_C4={MPI;SCALAR}`).
* For builds without MPI, all communication commnds will be no-op
functions (`DRACO_C4={MPI;SCALAR}`). Also proivdes a wrapper to
[libquo](https://github.com/lanl/libquo)
* cdi - Access to material data. The Common Data Interface (CDI) specifies a
common abstraction for objects and libraries that return material data
(opacities, atomic cross sections, equation-of-state data, etc.)
* cdi_analytic - Analytic models for physical data
* cdi_CPEloss - Stopping power models for charged particles.
* cdi_eospac - Equation-of-State data
* These classes wrap the EOSPAC6 libraries that read sesame files; Commonly
used to access gray opacity data and heat capacities.
(`EOSPAC_LIB_DIR=<path>`).
* These classes wrap the [EOSPAC6
libraries](https://laws.lanl.gov/projects/data/eos.html) that read
sesame files; Commonly used to access gray opacity data and heat
capacities. (`EOSPAC_LIB_DIR=<path>`).
* cdi_ipcress - Gray and multigroup opacities
* The classes in this component will read and parse opacity values from an
IPCRESS file produced by TOPS.
* cdi_ndi - Wrapper around LANL's Nuclear Data Interface (NDI) library for
accessing [nuclear data
tables](https://xweb.lanl.gov/projects/data/nuclear/ndi/ndi.html).
* compton - Provides access to Compton scattering models and data as provided
by the CSK library.
by the [CSK library](https://gitlab.lanl.gov/CSK/CSK)..
* device - Wrapper for heterogeneous device communication
* The classes in this component provide access to DaCS (deprecated) and CUDA
calls for use on heterogeneous architecture platforms (GPU machines).
Expand Down Expand Up @@ -97,16 +99,18 @@ Many thanks go to Draco's [contributors](https://github.com/lanl/Draco/graphs/co

Draco was originally written by staff from Los Alamos's [CCS-2 Computational Physics and Methods Group](http://www.lanl.gov/org/padste/adtsc/computer-computational-statistical-sciences/computational-physics-methods/index.php):

> *CCS-2 Draco Team:* Kelly G. Thompson, Kent G. Budge, Ryan T. Wollaeger,
> James S. Warsa, Alex R. Long, Kendra P. Long, Jae H. Chang,
> Matt A. Cleveland, Andrew T. Till, and Tim Kelley.
> *CCS-2 Draco Team:* Kelly G. Thompson, Kent G. Budge,
> Ryan T. Wollaeger, Alex R. Long, Ben R. Ryan, Kendra P. Long,
> James S. Warsa, Matt A. Cleveland, Tim Kelley, Jae H. Chang,
> Andrew T. Till, Seth D. Cook, Ondrej Certik, and David A. Dixon.

> *Prior Contributers:* Gabriel M. Rockefeller, Allan B. Wollaber,
> Lori A. Pritchett-Sheats, Rob B. Lowrie, Paul W. Talbot, Katherine J. Wang,
> Peter Ahrens, Daniel Holladay, Jeff D. Densmore, Massimiliano Rosa,
> Todd J. Urbatsch, Jeff Furnish, John McGhee, Kris C. Garrett, Mike Buksas,
> Nick Myers, Paul Henning, Randy Roberts, Seth Johnson, Todd Adams, and
> Tom Evans.

> *Prior Contributers:* Gabriel M. Rockefeller,
> Allan B. Wollaber, Rob B. Lowrie, Paul W. Talbot, Katherine J. Wang,
> Peter Ahrens, Daniel Holladay, Jeff D. Densmore, Massimiliano Rosa,
> Todd J. Urbatsch, Jeff Furnish, John McGhee, Kris C. Garrett, Mike Buksas,
> Nick Myers, Paul Henning, Randy Roberts, Seth Johnson, Todd Adams,
> Tom Evans, and Lori Pritchett-Sheats.

Release
----------------
Expand Down
42 changes: 23 additions & 19 deletions config/compilerEnv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

include_guard(GLOBAL)
include( FeatureSummary )
include( string_manip )

if( NOT DEFINED PLATFORM_CHECK_OPENMP_DONE OR
NOT DEFINED CCACHE_CHECK_AVAIL_DONE )
Expand Down Expand Up @@ -124,16 +125,16 @@ macro(dbsSetupCompilers)
message( STATUS "Code coverage build ... disabled (Compiler not GNU|Clang)")
endif()
if(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
if( NOT CODE_COVERAGE_IGNORE_REGEX)
message( "Setting CODE_COVERAGE_IGNORE_REGEX...")
set(CODE_COVERAGE_IGNORE_REGEX
/usr/*
*test/*
*/opt/spack/*
*terminal/*
*FortranChecks/*
CACHE STRING "List of regex that lcov will ignore")
endif()
list(APPEND CODE_COVERAGE_IGNORE_REGEX
/usr/*
*test/*
*/opt/spack/*
*terminal/*
*FortranChecks/*)
list(REMOVE_DUPLICATES CODE_COVERAGE_IGNORE_REGEX)
set( CODE_COVERAGE_IGNORE_REGEX ${CODE_COVERAGE_IGNORE_REGEX}
CACHE STRING "List of regex that lcov will ignore" FORCE)

if( CMAKE_BUILD_TYPE STREQUAL Debug )
# Add required flags (GCC & LLVM/Clang)
target_compile_options(coverage_config INTERFACE --coverage )
Expand All @@ -159,19 +160,22 @@ macro(dbsSetupCompilers)
COMMAND ${CMAKE_COMMAND} -E echo \"==> View HTML coverage report with command: firefox cov-html/index.html\"
COMMAND ${CMAKE_COMMAND} -E echo \"==> Repeat text coverage report with command: lcov --list coverage.info\"
BYPRODUCTS "${PROJECT_BINARY_DIR}/coverage.info" )
message( STATUS "Code coverage build ... enabled ('make covrep' to "
"see a text and/or a html report)")
else()
message( STATUS "Code coverage build ... disabled (lcov and/or gcov "
"not found)" )
endif()
message( STATUS "Code coverage build ... enabled ('make covrep' to "
"see a text and/or a html report)")
message("CODE_COVERAGE_IGNORE_REGEX = ${CODE_COVERAGE_IGNORE_REGEX}")
block_indent( 90 27
"CODE_COVERAGE_IGNORE_REGEX = ${CODE_COVERAGE_IGNORE_REGEX}")
else()
message( STATUS "Code coverage build ... disabled (CMAKE_BUILD_TYPE "
"!= Debug" )
message( STATUS "Code coverage build ... disabled (lcov and/or gcov "
"not found)" )
endif()
else()
message( STATUS "Code coverage build ... disabled (CMAKE_BUILD_TYPE "
"!= Debug" )
endif()
endif()

endif() # dbsSetupCompilers_done
endif() # dbsSetupCompilers_done
endmacro()

#------------------------------------------------------------------------------#
Expand Down
60 changes: 60 additions & 0 deletions config/string_manip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ include_guard(GLOBAL)
#
# hanging_indent( 80 5 ${mymsg} )
#
# output:
#
# Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
# tempor incididunt ut labore et dolore magna aliqua. Ut sem nulla
# pharetra diam sit amet nisl suscipit adipiscing. Venenatis a condimentum
# vitae sapien pellentesque habitant. Urna porttitor rhoncus dolor
# purus
#
# See src/CMakeLists.txt for an other example.
#------------------------------------------------------------------------------#
function (hanging_indent width indent message)
Expand Down Expand Up @@ -50,6 +58,58 @@ function (hanging_indent width indent message)

endfunction()

#------------------------------------------------------------------------------#
# Print the string ${message} formatted as a block indent. Text will be wrapped
# at column ${width} and all lines will be indented ${indent} spaces.
#
# Example use:
#
# set( mymsg "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do \
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut sem nulla \
# pharetra diam sit amet nisl suscipit adipiscing. Venenatis a condimentum \
# vitae sapien pellentesque habitant. Urna porttitor rhoncus dolor \
# purus.")
#
# block_indent( 80 5 ${mymsg} )
#
# output:
#
# Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
# tempor incididunt ut labore et dolore magna aliqua. Ut sem nulla
# pharetra diam sit amet nisl suscipit adipiscing. Venenatis a condimentum
# vitae sapien pellentesque habitant. Urna porttitor rhoncus dolor
# purus
#
#------------------------------------------------------------------------------#
function (block_indent width indent message)

string(REPLACE ";" " " message "${message}")
foreach(idx RANGE 1 ${indent})
string(APPEND padding " ")
endforeach()
set(line "${padding}") # 1st line

string(REPLACE " " ";" msg_list "${message}" )

foreach(word ${msg_list} )
string(LENGTH "${word}" word_len)
string(LENGTH "${line}" line_len)
math( EXPR proposed_len "${word_len} + ${line_len}" )
if( ${word_len} GREATER ${width} )
message("${line}")
message("${padding}${word}")
set(line "${padding}")
elseif( ${proposed_len} LESS_EQUAL ${width} )
string(APPEND line "${word} ")
else()
message("${line}")
set(line "${padding}${word} ")
endif()
endforeach()
message("${line}")

endfunction()

#------------------------------------------------------------------------------#
# End config/string_manip.cmake
#------------------------------------------------------------------------------#
7 changes: 5 additions & 2 deletions config/vendor_libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -844,16 +844,19 @@ Looking for Draco...\")
# Provide helper functions used by component CMakeLists.txt files
# This block of code generated by draco/config/vendor_libraries.cmake.

# Setup defaults, value checks, etc.
include(buildEnv)
dbsSetDefaults()

# CMake macros that check the system for features like 'gethostname', etc.
include( platform_checks )

# Sanity check for Cray Programming Environments
query_craype()

# Set compiler options
include( compilerEnv )
dbsSetupCxx()
dbsSetupFortran()
dbsSetupCuda()
dbsSetupProfilerTools()

# CMake macros like 'add_component_library' and 'add_component_executable'
Expand Down
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ message(" ")
message( STATUS "Configuring Level 1 packages --" )
add_dir_if_exists( ds++ )

# Only test ds++ if CI_CLANG_TIDY is running
if( NOT CI_CLANG_TIDY )

# Level 2
message(" ")
message( STATUS "Configuring Level 2 packages --" )
Expand Down Expand Up @@ -93,6 +96,8 @@ message( STATUS "Configuring Level 5 packages --" )
add_dir_if_exists( mesh ) # needs c4, ds++, mesh_element
add_dir_if_exists( quadrature ) # needs mesh_element, parser, special_functions

endif()

# Summary

if( VERBOSE OR ENV{VERBOSE} )
Expand Down
2 changes: 1 addition & 1 deletion src/ds++/StackTrace.hh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace rtt_dsxx {
* - http://stackoverflow.com/questions/77005/how-to-generate-a-stacktrace-when-my-gcc-c-app-crashes
* - http://stackwalker.codeplex.com
*/
DLL_PUBLIC_dsxx std::string print_stacktrace(std::string const &error_name);
std::string print_stacktrace(std::string const &error_name);

} // end namespace rtt_dsxx

Expand Down