Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 40d4000
  • /
  • cmakemodules
  • /
  • FindPowercap.cmake
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge
swh:1:cnt:a9e9cd26f7b3c85710884874e53301b78b6c6465
directory badge
swh:1:dir:714da39571cd2180063e6584989d9e31ce624990

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
FindPowercap.cmake
# Find Powercap
include(FindPackageHandleStandardArgs)

find_path(POWERCAP_INCLUDE_DIR powercap/powercap.h)
find_library(POWERCAP_LIBRARY powercap)
find_package_handle_standard_args(POWERCAP DEFAULT_MSG POWERCAP_INCLUDE_DIR POWERCAP_LIBRARY)

if(POWERCAP_FOUND)
    add_definitions(-DPOWERCAP_FOUND)
    set(POWERCAP_INCLUDE_DIRS ${POWERCAP_INCLUDE_DIR})
    set(POWERCAP_LIBRARIES ${POWERCAP_LIBRARY})

    # try to find number of RAPL packages
    execute_process(
        COMMAND rapl-info -n
        RESULT_VARIABLE RAPL_INFO_RESULT
        OUTPUT_VARIABLE RAPL_INFO_OUT
        OUTPUT_STRIP_TRAILING_WHITESPACE)

    if(${RAPL_INFO_RESULT} EQUAL 0)
        add_definitions(-DNUM_RAPL_PACKAGES=${RAPL_INFO_OUT})
    else()
        message(WARNING "Failed to find number of RAPL packages on the system, rapl-info returned: ${RAPL_INFO_RESULT}")
    endif()
endif()

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API