libcpuid evacuated from NSA/Microsoft github

anonymous 949420b7d4 why are we doing this? 5 years ago
cpuid_tool 0510b18fa3 remove some microsoft-specific crap 5 years ago
debian b71f77c39e remove more microsoft things 5 years ago
libcpuid db41c6fb7f more microsoft files 5 years ago
tests a9c739d312 virtual machine test 6 years ago
.gitignore c07d8a79d9 Fix a typo. 7 years ago
AUTHORS bb045e7178 Moving the repository one level deeper 15 years ago
COPYING bb045e7178 Moving the repository one level deeper 15 years ago
ChangeLog 4cf8cfa862 Related to issue #67: Information about the availability of SGX 7 years ago
Makefile.am 51aac9f852 Update .am files about the vc9->vc10 file change. 7 years ago
NEWS bb045e7178 Moving the repository one level deeper 15 years ago
Readme.md 949420b7d4 why are we doing this? 5 years ago
configure.ac 2f1031543c Fix issue #101: Package should not use obsolete m4 macros 6 years ago
libcpuid.pc.in f46fd2635e Incorrect path in .pc file - fixed; Clarified documentation a bit 15 years ago

Readme.md

libcpuid

libcpuid provides CPU identification for the x86 (and x86_64). For details about the programming API, you might want to take a look at the project's old website on sourceforge (http://libcpuid.sourceforge.net/)(Warning: sourceforge link). There you'd find a short tutorial(Warning: sourceforge link), as well as the full API reference(Warning: sourceforge link).

(This branch of libcpuid is intended to be the main one, post-microsoft's purchasing of github.)

Configuring after checkout

Under Linux, where you download the sources, there's no configure script to run. This is because it isn't a good practice to keep such scripts in a source control system. To create it, you need to run the following commands once, after you checkout the libcpuid sources from github:

    1. run "libtoolize"
    2. run "autoreconf --install"

You need to have autoconf, automake and libtool installed.

After that you can run ./configure and make - this will build the library.

make dist will create a tarball (with "configure" inside) with the sources.

Prerequisites

Using libcpuid requires no dependencies on any of the supported OSes. Building it requires the aforementioned libtool and autotools commands to be available, which is a matter of installing a few common packages with related names (e.g. automake, autoconf, libtool). It also requires a POSIX-compatible shell. On NetBSD, you may need to install one (credits to @brucelilly):

  1. Install a POSIX-compatible shell such as ksh93 (pkg_add ast-ksh || pkgin in ast-ksh)
  2. export CONFIG_SHELL=/usr/pkg/bin/ksh93 (substitute the correct path if required)
  3. Follow the regular Linux instructions

Testing

After any change to the detection routines or match tables, it's always a good idea to run make test. If some test fails, and you're confident that the test is wrong and needs fixing, run make fix-tests.

You can also add a new test (which is basically a file containing the raw CPUID data and the expected decoded items) by using tests/create_test.py. The workflow there is as follows:

  1. Run "cpuid_tool" with no arguments. It will tell you that it has written a pair of files, raw.txt and report.txt. Ensure that report.txt contains meaningful data.
  2. Run "tests/create_test.py raw.txt report.txt > «my-cpu».test"
  3. Use a proper descriptive name for the test (look into tests/amd and tests/intel to get an idea) and copy your test file to an appropriate place within the tests directory hierarchy.

For non-developers, who still want to contribute tests for the project, use this page to report misdetections or new CPUs that libcpuid doesn't handle well yet.

Users

So far, I'm aware of the following projects which utilize libcpuid:

We'd love to hear from you if you are also using libcpuid and want your project listed above.