C++ Library for pulling system and hardware information, without hitting the command line.

Related tags

CLI infoware
Overview

infoware License TravisCI build status AppVeyorCI build status

C++ Library for pulling system and hardware information, without hitting the command line.

Requirements

No non-built-in ones by default.
Some libraries are required for extended functionality. See the Configurability section below for details.

On Windows one needs to link to gdi32, version, Ole32, OleAut32, wbemuuid and ntdll.

A usable git binary is required by default, to clone https://github.com/pciutils/pciids. INFOWARE_PCI_IDS_REPOSITORY can be set to override that clone URI. INFOWARE_PCI_IDS_PATH can be set to use the specified file instead of using git at all.

Configurability

CMake definition and C++ preprocessor macro Meaning Linker library Priority
INFOWARE_USE_X11 Use X11 for display detection X11 <Win32/Darwin
INFOWARE_USE_D3D Use D3D for GPU detection dxgi >OpenCL
INFOWARE_USE_OPENCL Use OpenCL for GPU detection OpenCL <D3D
INFOWARE_USE_OPENGL Use OpenGL for GPU detection OS-dependent* <OpenGL

*Consult the section under the if(INFOWARE_USE_OPENGL) condition in CMakeLists.txt for variants.

Comments
  • Handle Macs' CPUs better

    Handle Macs' CPUs better

    #11 happened because the Mac the author was using didn't have /proc/cpuinfo – there should probably be either (a) an alt name for /proc/cpuinfo or (b) some other way of getting that data out of Macs.

    enhancement help wanted 
    opened by nabijaczleweli 29
  • Why is INFOWARE_GENERATED_PCI_INDICES not defined?

    Why is INFOWARE_GENERATED_PCI_INDICES not defined?

    I can't build all because this macro isn't defined apparently, but why? That's why then I get this linker error: LINK : fatal error LNK1104: cannot open file 'lib\Debug\infowared.lib'

    Latest version of infoware MSVC2019 Windows10

    3>C:\GitHub\infoware\src\pci.cpp(38,34): error C2065: 'INFOWARE_GENERATED_PCI_INDICES': undeclared identifier
    3>C:\GitHub\infoware\src\pci.cpp(39,42): error C2065: 'INFOWARE_GENERATED_PCI_VENDORS': undeclared identifier
    3>C:\GitHub\infoware\src\pci.cpp(40,42): error C2065: 'INFOWARE_GENERATED_PCI_DEVICES': undeclared identifier
    
    question 
    opened by patlecat 13
  • C++ package management?

    C++ package management?

    I've used vcpkg and Conan before, but I'm keen to try Hunter or the decentralised Buckaroo https://hackingcpp.com/cpp/tools/package_managers.html

    Happy to contribute, just want to know what you want

    enhancement 
    opened by SamuelMarks 8
  • The GPU 1050 Ti name is GP107?

    The GPU 1050 Ti name is GP107?

    See the figure below: _20180422160145

    ther software displays: _20180422160202

    I hope to be updated. Thank you very much.

    Maybe I misunderstood the description. The above two pictures are other computers. The picture below is my computer.

    My notebook display is correct. Why? _20180422160628

    question 
    opened by webees 7
  • System abstraction

    System abstraction

    We need a way of finding out more overarching system information not directly related to the internal hardware. May include:

    • [x] OS Vendor / Information (Ubuntu, Windows 10, etc.) (Probably going to need a versioning structure for these things too)
    • [x] Kernel Information (Linux, Vista, whatever the fuck is inside Mac OSX)
    • [x] Monitor/Display Count (kind've stretch, but would be nice, can also include extra information like 'High DPI' and what not)
    • [x] Memory (size in bytes)

    Fancy:

    • [x] # of mice
    • [x] # of keyboards
    enhancement 
    opened by ThePhD 7
  • Expose PCI vendor/device-by-id funxions to the public?

    Expose PCI vendor/device-by-id funxions to the public?

    As of now we have them in iware::detail::identify_{vendor,device}(), but moving them to iware::[subsystem]::idenify_pci_{vendor,device}()/pci_{vendor,device}_id() where [subsystem] is system maybe but it's not strictly a discovery method so maybe new data? or straight up pci module? would be nice.

    question 
    opened by nabijaczleweli 6
  • Install target: Export library and Cmake configuration files

    Install target: Export library and Cmake configuration files

    Making a second PR for the installation target as requested

    With these additions, when running the installation target (make install), the installation directory will be set with:

    ├── include
       ├── cpu.hpp
       ├── gpu.hpp
       ├── infoware.hpp
       ├── system.hpp
       └── version.hpp
    ├── lib
       └── libinfowared.a
    └── share
        └── infoware
            ├── infowareConfig-debug.cmake
            ├── infowareConfig.cmake
            └── infowareConfigVersion.cmake
    

    Note: The installation directory can be set with CMAKE_INSTALL_PREFIX, otherwise it will be the default GNU directories on UNIX platforms (/usr/include,/usr/lib )

    To choose the headers that will be exported, they have to be labelled as PUBLIC_HEADERS, hence the variable I added and the set_target_properties

    The share folder is useful for external projects built with CMake too using the library. Indeed in another project, to use this library, all you have to do then is find_package(infoware) and target_link_libraries(${PROJECT_NAME} PRIVATE infoware). CMake is then handling everything else (Include directories, compile definitions, dependencies).

    CMake is creating infowareConfig.cmake that contains the common infos for you project and is creating a config file by build type (infowareConfig-debug.cmake for instance) for specific rules. The infowareConfigVersion.cmake is just here to handle the versions, for instance an external project can do find_package(infoware 1.0) to have a specific version

    When doing find_package(infoware) in my project, CMake will take automatically the corresponding library (debug or release), depending on my project's CMAKE_BUILD_TYPE.

    The debug postfix I added (notice the d at the end libinfowared) is not mandatory but useful just to know in which mode the library was built (when configured with CMake with CMAKE_BUILD_TYPE).

    enhancement 
    opened by arthurbiancarelli 6
  • vcpkg install infoware doesn't get the detail includes

    vcpkg install infoware doesn't get the detail includes

    Got infoware through vcpkg, installed fine. Added to my cmake lists, also ok. Tried to include - compile time errors: Cannot open include file: 'infoware/detail/linkage.hpp': No such file or directory (...).

    Looked into vcpkg/packages/infoware_x64-windows/include/infoware, and yeah, there's no detail folder in there.

    bug 
    opened by Dreamykass 5
  • CPU Frequency on Windows is bogus

    CPU Frequency on Windows is bogus

    The windows implementation of iware::cpu::frequency does basically QueryPerformanceFrequency() * 1000 -- which returns completely bogus values. On my machine, QueryPerformanceFrequency returns e.g. 10 MHz, so this reports 10 GHz...

    Finding accurate values may be hard, but would it be preferable to return a guesstimate from HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\~MHz (e.g. 3696 on my machine)?

    bug 
    opened by melak47 4
  • segfault on example

    segfault on example "cpu"

      Quantities:
        Logical CPUs : 8
        Physical CPUs: 0
        CPU packages : 0
    
      Caches:
        L1:
          Size         : 0B
          Line size    : 0B
          Associativity: 0
          Type         : Unified
        L2:
          Size         : 0B
          Line size    : 0B
          Associativity: 0
          Type         : Unified
        L3:
          Size         : 0B
          Line size    : 0B
          Associativity: 0
          Type         : Unified
    
      Architecture: x64
      Frequency: 0 Hz
      Endianness: Little-Endian
    Segmentation fault: 11
    

    Done on a 2015 15" MacbookPro with 2.2 GHz Core i7 4770HQ cpu.

    bug 
    opened by Oreilles 4
  • Visual Studio solution build fails

    Visual Studio solution build fails

    First it requires me to retarget solution. Afterwards building examples & generator projects fails with these errors:

    Severity	Code	Description	Project	File	Line	Suppression State
    Error	LNK2019	unresolved external symbol "struct iware::cpu::quantities_t __cdecl iware::cpu::quantities(void)" (?quantities@cpu@iware@@YA?AUquantities_t@12@XZ) referenced in function main	examples	E:\infoware\infoware\cpu.obj	1	
    Error	LNK1120	5 unresolved externals	examples	E:\infoware\infoware\x64\Debug\examples.exe	1	
    Error	C1083	Cannot open source file: 'pci_generator\src\pci_generator.cpp': No such file or directory	generator	E:\infoware\infoware\c1xx	1	
    Warning	MSB8028	The intermediate directory (x64\Debug\) contains files shared from another project (generator.vcxproj).  This can lead to incorrect clean and rebuild behavior.	infoware	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	392	
    Warning	MSB8028	The intermediate directory (x64\Debug\) contains files shared from another project (generator.vcxproj, infoware.vcxproj).  This can lead to incorrect clean and rebuild behavior.	examples	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	392	
    Warning	MSB8028	The intermediate directory (x64\Debug\) contains files shared from another project (infoware.vcxproj).  This can lead to incorrect clean and rebuild behavior.	generator	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	392	
    Warning	MSB8027	Two or more files with the name of non-windows.cpp will produce outputs to the same location. This can lead to an incorrect build result.  The files involved are src\cpu\vendor_model_name\non-windows.cpp, src\system\amounts\non-windows.cpp, src\system\kernel_info\non-windows.cpp, src\system\memory\non-windows.cpp, src\system\OS_info\non-windows.cpp.	infoware	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	936	
    Warning	MSB8027	Two or more files with the name of non_windows.cpp will produce outputs to the same location. This can lead to an incorrect build result.  The files involved are src\cpu\architecture\non_windows.cpp, src\cpu\frequency\non_windows.cpp, src\cpu\instuction_set\non_windows.cpp, src\cpu\quantities_cache\non_windows.cpp.	infoware	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	936	
    Warning	MSB8027	Two or more files with the name of windows.cpp will produce outputs to the same location. This can lead to an incorrect build result.  The files involved are src\cpu\architecture\windows.cpp, src\cpu\frequency\windows.cpp, src\cpu\instuction_set\windows.cpp, src\cpu\quantities_cache\windows.cpp, src\cpu\vendor_model_name\windows.cpp, src\system\amounts\windows.cpp, src\system\displays\windows.cpp, src\system\kernel_info\windows.cpp, src\system\memory\windows.cpp, src\system\OS_info\windows.cpp.	infoware	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets	936	
    Error	LNK2019	unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl iware::cpu::model_name(void)" (?model_name@cpu@iware@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function main	examples	E:\infoware\infoware\cpu.obj	1	
    Error	LNK2019	unresolved external symbol "enum iware::cpu::architecture_t __cdecl iware::cpu::architecture(void)" (?architecture@cpu@iware@@YA?AW4architecture_t@12@XZ) referenced in function main	examples	E:\infoware\infoware\cpu.obj	1	
    Error	LNK2019	unresolved external symbol "struct iware::cpu::cache_t __cdecl iware::cpu::cache(unsigned int)" (?cache@cpu@iware@@YA?AUcache_t@12@I@Z) referenced in function main	examples	E:\infoware\infoware\cpu.obj	1	
    Error	LNK2019	unresolved external symbol "__int64 __cdecl iware::cpu::frequency(void)" (?frequency@cpu@iware@@YA_JXZ) referenced in function main	examples	E:\infoware\infoware\cpu.obj	1	
    
    question 
    opened by Enhex 4
  • OS_Info.full_name on MacOS

    OS_Info.full_name on MacOS

    OS_Info.full_name on MacOS gives me information about the kernel (basically uname -a).

    On Linux it gives information (name and version) about the distribution, and that looks more coherent.

    Shouldn't the MacOS version do something similar, like the output of the sw_vers command?

    enhancement 
    opened by bart9h 1
  • Info about the system, disks and a lot others

    Info about the system, disks and a lot others

    Hi, was thinking if getting info on Disks, VM's etc. was ever planned or in the works. Specifically looking for something similar to systeminformation

    AFAIK that is the most complete info collection tool out there, and if that is done in Node.js. I think all that is definitely possible with C++.

    question 
    opened by TheCelebrimbor 1
  • ARM support

    ARM support

    I currently try to compile infoware on aarch64. But on all tried distribution the <cpuid.h> is missing. (debain for arm, raspberry OS) In this source the header is referenced. Is there a possibility to add support for aarch64?

    enhancement 
    opened by der-imp 7
  • TravisCI and Appveyor

    TravisCI and Appveyor

    Both projects are starting to wind down open source support so it's time to find other alternatives.

    And by other alternatives I mean GITHUB ACTIONS BAYBEEE.

    enhancement 
    opened by ThePhD 5
Owner
The Phantom Derpstorm
C++ is my jam (but I program in many other languages, too!)
The Phantom Derpstorm
A command line tool with no external dependencies to print information about an X server instance.

xinfo A command line tool with no external dependencies to print information about an X server instance. Building and running To build the code in thi

Jean-Michel Gorius 6 Jan 13, 2022
led is a line-oriented text editor in command line

led is a line-oriented text editor in command line. This editor is similar to the standard program on unix systems - GNU ed. But i'm not going to make an exact clone of that program, it's just a pet project.

Artem Mironov 16 Dec 27, 2022
A single header C++ library for parsing command line arguments and options with minimal amount of code

Quick Arg Parser Tired of unwieldy tools like getopt or argp? Quick Arg Parser is a single header C++ library for parsing command line arguments

null 47 Dec 21, 2022
null 77 Dec 27, 2022
A library for interactive command line interfaces in modern C++

cli A cross-platform header only C++14 library for interactive command line interfaces (Cisco style) Features Header only Cross-platform (linux and wi

Daniele Pallastrelli 888 Dec 31, 2022
CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface.

CLI11: Command line parser for C++11 What's new • Documentation • API Reference CLI11 is a command line parser for C++11 and beyond that provides a ri

null 2.4k Dec 30, 2022
A simple to use, composable, command line parser for C++ 11 and beyond

Clara v1.1.5 !! This repository is unmaintained. Go here for a fork that is somewhat maintained. !! A simple to use, composable, command line parser f

Catch Org 648 Dec 27, 2022
A simple to use, composable, command line parser for C++ 11 and beyond

Lyra A simple to use, composing, header only, command line arguments parser for C++ 11 and beyond. Obtain License Standards Stats Tests License Distri

Build Frameworks Group 388 Dec 22, 2022
Rizin - UNIX-like reverse engineering framework and command-line toolset.

Rizin - UNIX-like reverse engineering framework and command-line toolset.

Rizin Organization 1.7k Dec 30, 2022
Simple command line utilities for extracting data from Fallout 4 and 76 files

fo76utils Simple command line utilities for extracting data from Fallout 4 and 76 files. baunpack - list the contents of, or extract from .BA2 archive

null 15 Dec 6, 2022
A command line tool for numerically computing Out-of-time-ordered correlations for N=4 supersymmetric Yang-Mills theory and Beta deformed N=4 SYM.

A command line tool to compute OTOC for N=4 supersymmetric Yang–Mills theory This is a command line tool to numerically compute Out-of-time-ordered co

Gaoli Chen 1 Oct 16, 2021
EAMain provides a multi-platform entry point used for platforms that don't support console output, return codes and command-line arguments.

EAMain provides a multi-platform entry point used for platforms that don't support console output, return codes and command-line arguments.

Electronic Arts 34 Oct 1, 2022
Lightweight C++ command line option parser

Release versions Note that master is generally a work in progress, and you probably want to use a tagged release version. Version 3 breaking changes I

null 3.3k Dec 30, 2022
CLIp is a clipboard emulator for a command line interface written in 100% standard C only. Pipe to it to copy, pipe from it to paste.

CLIp v2 About CLIp is a powerful yet easy to use and minimal clipboard manager for a command line environment, with no dependencies or bloat. Usage Sy

A.P. Jo. 12 Sep 18, 2021
pbr2gltf2 is a command line tool for converting PBR images to a glTF 2.0 material.

pbr2gltf2 is a command line tool for converting PBR images to a glTF 2.0 material. The tool is detecting depending on the filename, which PBR information is stored. It swizzles the images and does reassign the channels to a glTF 2.0 image. The tool stores the images plus a minimal, valid glTF 2.0 file containing the required material, textures and images.

UX3D GmbH 23 Jul 31, 2022
LwSHELL is lightweight, platform independent, command line shell for embedded systems.

LwSHELL is lightweight, platform independent, command line shell for embedded systems. It targets communication with embedded systems from remote terminal to quickly send commands and the retrieve data from the device.

Tilen Majerle 80 Dec 25, 2022
Toybox: all-in-one Linux command line.

Toybox: all-in-one Linux command line.

Rob Landley 1.8k Dec 27, 2022
Simple command line tool that processes image files using the FidelityFX Super Resolution (FSR) or Contrast Adaptive Sharpening (CAS) shader systems.

Simple command line tool that processes image files using the FidelityFX Super Resolution (FSR) or Contrast Adaptive Sharpening (CAS) shader systems.

GPUOpen Effects 190 Dec 12, 2022
Command-line flag parsing in C

flag.h Inspired by Go's flag module: https://pkg.go.dev/flag WARNING! The design of the library is not finished and may be a subject to change. Quick

Tsoding 41 Nov 10, 2022