48 Commits

Author SHA1 Message Date
67aec7aa01 Bump project version to 2.2.0
All checks were successful
Build Alpine Package / build-alpine (push) Successful in 1m49s
Build Debian Package / build-debian (push) Successful in 2m7s
- Update CMakeLists.txt project version from 20181130 to 2.2.0
- Align version number with current project development state
2025-02-01 07:22:08 +00:00
4ef3eec229 Add curl package for Gitea Alpine Package Registry upload
Some checks failed
Build Debian Package / build-debian (push) Successful in 2m3s
Build Alpine Package / build-alpine (push) Failing after 2m26s
- Install curl package in Alpine build workflow
- Ensure curl is available for package upload step
- Prepare for package registry upload with authentication
2025-02-01 07:11:38 +00:00
16d35c2a0e Add Gitea Alpine Package Registry upload step
Some checks failed
Build Debian Package / build-debian (push) Successful in 2m5s
Build Alpine Package / build-alpine (push) Failing after 2m14s
- Configure upload of Alpine package to personal Gitea package registry
- Add conditional upload step for master branch
- Use curl to upload package with authentication
2025-02-01 07:08:35 +00:00
372c43caea Add Alpine package build target and metadata generation
All checks were successful
Build Debian Package / build-debian (push) Successful in 2m3s
Build Alpine Package / build-alpine (push) Successful in 2m6s
- Create CMake target for generating Alpine package (apk)
- Add APKBUILD metadata generation in GitHub workflow
- Configure package details including version, description, and dependencies
- Streamline Alpine package creation process
2025-02-01 07:02:59 +00:00
06a0b682c0 Update system header includes in fvt_controller.cc
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 1m53s
Build Debian Package / build-debian (push) Successful in 1m57s
- Remove deprecated <error.h> include
- Add <system_error> for std::system_error
- Add <cerrno> for errno handling
- Streamline and modernize system header includes
2025-02-01 06:59:33 +00:00
31077367bb Add musl-dev to Alpine build workflow dependencies
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 1m46s
Build Debian Package / build-debian (push) Successful in 1m56s
- Include musl-dev package in Alpine build environment
- Ensure complete set of development dependencies for compilation
2025-02-01 06:54:52 +00:00
b9f6ef50af Add fallback for cache line size detection
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 1m50s
Build Debian Package / build-debian (push) Successful in 1m58s
- Provide default cache line size for systems without _SC_LEVEL1_DCACHE_LINESIZE
- Set default to 64 bytes, which is common on x86_64 architectures
- Improve portability of cache line size detection
2025-02-01 06:52:15 +00:00
79c652cd7c Add OpenSSL development dependencies to Alpine build workflow
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 1m59s
Build Debian Package / build-debian (push) Successful in 2m6s
- Include openssl-dev and openssl-libs-static packages
- Expand build environment dependencies for static library compilation
2025-02-01 06:48:24 +00:00
8c965a25e2 Add zlib development dependencies to Alpine build workflow
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 1m51s
Build Debian Package / build-debian (push) Successful in 1m54s
- Include zlib-dev and zlib-static packages in build environment
- Ensure complete set of dependencies for static library compilation
2025-02-01 06:44:08 +00:00
b01131eaee Update Alpine package build workflow naming
- Clarify step names for cpu-check Alpine package build and upload
- Improve workflow readability without changing core functionality
2025-02-01 06:41:48 +00:00
dc63b5bb59 Remove ldconfig from Alpine build workflow
Some checks failed
Build Debian Package / build-debian (push) Successful in 1m58s
Build Alpine Package / build-alpine (push) Failing after 2m0s
- Remove unnecessary ldconfig command from build steps
- Simplify build process in Alpine Linux workflow
2025-02-01 06:40:53 +00:00
65a2de7025 Add linux-headers to Alpine build workflow dependencies
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 1m54s
Build Debian Package / build-debian (push) Successful in 1m55s
- Include linux-headers package in Alpine build environment
- Ensure complete set of build dependencies for compilation
2025-02-01 06:35:45 +00:00
b01f0d9807 Add Git installation step to Alpine Linux build workflow
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 57s
Build Debian Package / build-debian (push) Successful in 1m36s
- Install Git in the Alpine Linux container
- Ensure Git is available for repository checkout
- Resolve potential Git-related issues in the workflow
2025-02-01 06:33:17 +00:00
ebed40b93d Update Alpine Linux build workflow to use Node.js Alpine container
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 13s
Build Debian Package / build-debian (push) Successful in 1m35s
- Switch container from node:latest to node:current-alpine
- Ensure consistent Alpine Linux environment for build process
2025-02-01 06:31:00 +00:00
1e4c5b630c Switch Alpine Linux build workflow to Node.js container
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 38s
Build Debian Package / build-debian (push) Successful in 1m44s
- Change container from python:3-alpine to node:latest
- Prepare for Node.js-based build environment
2025-02-01 06:29:06 +00:00
827c44ba88 Update Alpine Linux build workflow container
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 8s
Build Debian Package / build-debian (push) Successful in 1m20s
- Switch container from alpine:latest to python:3-alpine
- Remove Node.js setup step
- Simplify workflow configuration
2025-02-01 06:27:42 +00:00
7fbd3fb29a Add Node.js setup to Alpine Linux build workflow
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 41s
Build Debian Package / build-debian (push) Successful in 1m27s
- Include Node.js setup step in Alpine build job
- Use actions/setup-node@v3 to prepare Node.js environment
2025-02-01 06:24:59 +00:00
2fbc59be7f revert 9fce46386b
Some checks failed
Build Alpine Package / build-alpine (push) Failing after 3s
Build Debian Package / build-debian (push) Has been cancelled
revert Modify Alpine Linux build workflow to run on host runner

- Change Alpine build job to run directly on host runner
- Remove container specification from workflow configuration
2025-02-01 06:23:53 +00:00
9fce46386b Modify Alpine Linux build workflow to run on host runner
Some checks are pending
Build Debian Package / build-debian (push) Successful in 1m38s
Build Alpine Package / build-alpine (push) Waiting to run
- Change Alpine build job to run directly on host runner
- Remove container specification from workflow configuration
2025-02-01 06:13:32 +00:00
5235205167 Add Debian and Alpine Linux package build support to GitHub Actions
Some checks failed
Build Debian Package / build-debian (push) Successful in 1m31s
Build Alpine Package / build-alpine (push) Failing after 3s
- Introduce Debian and Alpine Linux package build stages in CI/CD pipeline
- Configure CMake for static compilation on both platforms
- Add artifact upload for Debian (.deb) and Alpine (.apk) packages
- Include static Abseil library build process for both distributions
2025-02-01 06:06:24 +00:00
2be3544cd2 Add Alpine Linux package build support to GitHub Actions workflow
Some checks failed
Build / build (push) Failing after 1m43s
- Introduce Alpine Linux package build stage in CI/CD pipeline
- Install Alpine SDK, CMake, Clang, and LLVM dependencies
- Configure CMake for Alpine package compilation
- Add artifact upload for Alpine package (.apk)
2025-02-01 05:58:17 +00:00
7448e23bb0 Update .github/workflows/build.yml
All checks were successful
Build / build (push) Successful in 2m14s
2025-01-28 08:00:32 +00:00
a933bcfd7a Simplify static linking configuration in build workflow
All checks were successful
Build / build (push) Successful in 2m4s
- Remove redundant static linking CMake flags
- Streamline build configuration for Clang compilation
- Reduce complexity of static build settings
2025-01-28 07:57:51 +00:00
cb7f03cfaf remove abseil
Some checks failed
Build / build (push) Failing after 1m51s
2025-01-28 07:51:05 +00:00
e8d9fc284d Consolidate library installation in build workflow
Some checks failed
Build / build (push) Failing after 4s
- Simplify apt-get commands by combining library package installations
- Remove commented-out installation instructions
- Streamline dependency setup for more concise workflow configuration
2025-01-28 07:39:11 +00:00
f777317406 Enhance static library support in build workflow
Some checks failed
Build / build (push) Failing after 8s
- Install static library development packages
- Update CMake linker flags to improve static linking
- Remove redundant library installation step
- Refine static compilation configuration
2025-01-28 07:34:56 +00:00
496d558574 Improve static linking configuration in build workflow
Some checks failed
Build / build (push) Failing after 3m8s
- Modify CMake linker and compiler flags for better static linking
- Add step to install static library dependencies
- Adjust static compilation flags to support cross-compilation
2025-01-28 07:30:29 +00:00
d8fcced921 Update build workflow to statically build Abseil and project dependencies
Some checks failed
Build / build (push) Failing after 2m4s
Modify GitHub Actions workflow to:
- Build Abseil from source statically
- Configure CMake for static linking
- Remove external Abseil library dependency
- Update build flags to support static compilation
2025-01-28 07:23:54 +00:00
5bfc44d46c Bump package version to 2.1.0
All checks were successful
Build / build (push) Successful in 1m25s
Update package version in build workflow to reflect new release version
2025-01-28 06:51:58 +00:00
eb3c9ac653 Modify build workflow to disable static build and update Abseil library dependency
Some checks failed
Build / build (push) Has been cancelled
Change CMake configuration to build dynamic libraries and update the required Abseil library package to libabsl20220623t64
2025-01-28 06:51:29 +00:00
eda1dcc4be Update build workflow to use environment variables for package version
All checks were successful
Build / build (push) Successful in 1m32s
Refactor package version and release configuration in GitHub Actions workflow to use environment variables, improving maintainability and consistency
2025-01-28 06:39:26 +00:00
d56772a8c0 Bump package version to 2.0.0
Some checks failed
Build / build (push) Failing after 1m52s
Update package version in build workflow to reflect new release version
2025-01-28 06:33:44 +00:00
acd19b5467 Configure CMake build options for Release and static build
Some checks failed
Build / build (push) Has been cancelled
Update build workflow to set Release build type, enable Clang, and build static binaries
2025-01-28 06:33:19 +00:00
c7e76a7945 Update Gitea Package Registry upload URL to bionic distribution
All checks were successful
Build / build (push) Successful in 3m18s
Change Debian package upload endpoint to use 'bionic' distribution pool
2025-01-28 06:06:53 +00:00
97b76dce3f Update Gitea Package Registry upload URL
All checks were successful
Build / build (push) Successful in 1m17s
Change Gitea package upload endpoint from gitea.ericxliu.me to git.ericxliu.me
2025-01-28 05:58:56 +00:00
22740f3841 Replace GitHub Release with Gitea Package Registry upload
Some checks failed
Build / build (push) Failing after 1m11s
Switch from GitHub Release upload to direct Gitea Package Registry deployment for Debian package, using curl and authentication via secrets
2025-01-28 05:54:25 +00:00
49305e089f Update GitHub Release workflow configuration
Some checks failed
Build / build (push) Failing after 2m2s
Upgrade action-gh-release to v2, add draft and prerelease flags, and simplify token configuration
2025-01-28 05:37:15 +00:00
0c3f21f16b Add GitHub Release upload to build workflow
Some checks failed
Build / build (push) Failing after 3m4s
Configure automatic GitHub Release creation for Debian package when pushing to master branch, including version tagging and release notes generation
2025-01-28 05:28:57 +00:00
d48053750c revert 59a05063a8
All checks were successful
Build / build (push) Successful in 1m16s
revert Update .github/workflows/build.yml
2025-01-28 05:22:15 +00:00
59a05063a8 Update .github/workflows/build.yml
Some checks failed
Build / build (push) Failing after 1m5s
2025-01-28 05:18:27 +00:00
0f5768f436 Add Debian package creation to GitHub Actions workflow
All checks were successful
Build / build (push) Successful in 1m2s
Update build workflow to generate a Debian package using checkinstall, including package metadata and artifact upload
2025-01-28 05:11:44 +00:00
39f2fc317e Configure GitHub Actions workflow to use Clang compiler
All checks were successful
Build / build (push) Successful in 58s
Update build workflow to use Clang as the default compiler for building the project
2025-01-28 05:06:45 +00:00
69e26738f3 Update abseil package installation in GitHub Actions workflow
Some checks failed
Build / build (push) Failing after 1m3s
Use libabsl-dev package for proper abseil dependency resolution
2025-01-28 05:02:03 +00:00
0cbeece3ef Add abseil dependency to GitHub Actions workflow
Some checks failed
Build / build (push) Failing after 13s
Install abseil package during CI build setup to support project dependencies
2025-01-28 04:59:27 +00:00
d0b8138dc9 Simplify CMake setup in GitHub Actions workflow
Some checks failed
Build / build (push) Failing after 43s
Remove explicit CMake version setup and install CMake via apt-get instead
2025-01-28 04:55:08 +00:00
26ee290c24 Update .github/workflows/build.yml
Some checks failed
Build / build (push) Failing after 12s
2025-01-28 04:50:01 +00:00
1dfefb70c7 Update GitHub Actions workflow to use master branch
Some checks failed
Build / build (push) Failing after 1m7s
2025-01-28 04:44:20 +00:00
74baee0ef7 Add GitHub Actions workflow for building the project
Configure CI pipeline to build the project on Ubuntu, using CMake and creating a build artifact
2025-01-28 04:43:34 +00:00
7 changed files with 234 additions and 2 deletions

88
.github/workflows/build-alpine.yml vendored Normal file
View File

@@ -0,0 +1,88 @@
name: Build Alpine Package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
PKG_VERSION: "2.2.0"
PKG_RELEASE: "1"
ABSEIL_VERSION: "20230125.3"
jobs:
build-alpine:
runs-on: ubuntu-latest
container: node:current-alpine
steps:
- name: Install Git
run: |
apk add --no-cache git
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Alpine Packaging Dependencies
run: |
apk update
apk add alpine-sdk cmake clang llvm linux-headers zlib-dev zlib-static openssl-dev openssl-libs-static musl-dev
- name: Build Static Abseil
run: |
git clone https://github.com/abseil/abseil-cpp.git
cd abseil-cpp
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DABSL_BUILD_TESTING=OFF \
-DABSL_USE_GOOGLETEST_HEAD=OFF \
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=OFF \
..
make -j$(nproc)
make install
- name: Build cpu-check Alpine Package
run: |
mkdir -p alpine_build && cd alpine_build
cmake -DCMAKE_BUILD_TYPE=Release \
-DUSE_CLANG=ON \
-DBUILD_STATIC=ON \
..
make
# Create package metadata
mkdir -p pkg/APKBUILD
cat > pkg/APKBUILD/APKBUILD << EOF
# Contributor: Maintainer <maintainer@example.com>
# Maintainer: Maintainer <maintainer@example.com>
pkgname=cpu-check
pkgver=${{ env.PKG_VERSION }}
pkgrel=${{ env.PKG_RELEASE }}
pkgdesc="CPU validation and stress testing tool"
url="https://github.com/google/cpu-check"
arch="x86_64"
license="Apache-2.0"
depends=""
makedepends="cmake clang llvm linux-headers zlib-dev zlib-static openssl-dev openssl-libs-static musl-dev"
source=""
options="!check"
EOF
make apk
- name: Upload cpu-check Alpine Package
uses: actions/upload-artifact@v3
with:
name: cpu-check-alpine
path: alpine_build/*.apk
- name: Upload to Gitea Alpine Package Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
apk add --no-cache curl
curl --user "eric:df299a6e592a8bd829d018b7816e76d03756408d" \
--upload-file alpine_build/cpu-check-${{ env.PKG_VERSION }}-r${{ env.PKG_RELEASE }}.apk \
"https://git.ericxliu.me/api/packages/eric/alpine/v3.17/main"

85
.github/workflows/build-debian.yml vendored Normal file
View File

@@ -0,0 +1,85 @@
name: Build Debian Package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
PKG_VERSION: "2.2.0"
PKG_RELEASE: "1"
ABSEIL_VERSION: "20230125.3"
jobs:
build-debian:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake clang checkinstall zlib1g-dev musl-tools libstdc++-11-dev libgcc-11-dev libc6-dev
- name: Build Static Abseil
run: |
git clone https://github.com/abseil/abseil-cpp.git
cd abseil-cpp
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DABSL_BUILD_TESTING=OFF \
-DABSL_USE_GOOGLETEST_HEAD=OFF \
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=OFF \
..
make -j$(nproc)
make install
ldconfig
- name: Configure the project
run: |
mkdir build; cd build
CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release \
-DUSE_CLANG=ON \
-DBUILD_STATIC=ON \
..
- name: Build the project
run: |
cd build
make
- name: Create Debian Package
run: |
cd build
sudo checkinstall --pkgname=cpu-check \
--pkgversion=${{ env.PKG_VERSION }} \
--pkgrelease=${{ env.PKG_RELEASE }} \
--maintainer="maintainer@example.com" \
--requires="" \
--default \
--pakdir=. \
--backup=no \
--deldoc=yes \
--deldesc=yes \
--delspec=yes \
make install
- name: Upload Debian Package
uses: actions/upload-artifact@v3
with:
name: cpu-check-deb
path: build/*.deb
- name: Upload to Gitea Package Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
curl --user "eric:df299a6e592a8bd829d018b7816e76d03756408d" \
--upload-file build/cpu-check_${{ env.PKG_VERSION }}-${{ env.PKG_RELEASE }}_amd64.deb \
"https://git.ericxliu.me/api/packages/eric/debian/pool/bionic/main/upload"

43
.gitignore vendored Normal file
View File

@@ -0,0 +1,43 @@
# CMake build directories
build/
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
compile_commands.json
CTestTestfile.cmake
Testing/
_deps/
# Compiled files
*.o
*.obj
*.exe
*.out
*.app
*.dll
*.so
*.dylib
# IDE specific files
.vscode/
.idea/
*.swp
*.swo
.DS_Store
# Generated files
Makefile
*.make
*.cmake
!CMakeLists.txt
# Dependencies
_deps/
vcpkg_installed/
# Debug symbols
*.pdb
*.dSYM/
# Generated documentation
docs/_build/

View File

@@ -13,7 +13,7 @@
# limitations under the License.
cmake_minimum_required (VERSION 3.2)
project (cpu_check VERSION 20181130 LANGUAGES C CXX)
project (cpu_check VERSION 2.2.0 LANGUAGES C CXX)
# Options
# Use clang/llvm by default.
@@ -136,3 +136,12 @@ target_link_libraries(silkscreen utils)
target_link_libraries(cpu_check avx compressor crc32c crypto fvt_controller hasher malign_buffer pattern_generator silkscreen utils)
install (TARGETS cpu_check DESTINATION bin)
# Alpine package target
add_custom_target(apk
COMMAND mkdir -p "${CMAKE_BINARY_DIR}/pkg/usr/bin"
COMMAND cp "${CMAKE_BINARY_DIR}/cpu_check" "${CMAKE_BINARY_DIR}/pkg/usr/bin/"
COMMAND cd "${CMAKE_BINARY_DIR}" && tar -czf "cpu-check-${PROJECT_VERSION}-r$ENV{PKG_RELEASE}.apk" -C pkg .
DEPENDS cpu_check
COMMENT "Creating Alpine package"
)

View File

@@ -15,12 +15,13 @@
#include "config.h"
#include "fvt_controller.h"
#include <error.h>
#include <fcntl.h>
#include <math.h>
#include <stdint.h>
#include <atomic>
#include <system_error> // for std::system_error
#include <cerrno> // for errno
#undef NDEBUG
#include <cassert>
#include <cstring>

View File

@@ -127,7 +127,12 @@ void MalignBuffer::InitializeMemoryForSanitizer(char *addr, size_t size) {
}
const size_t MalignBuffer::kPageSize = sysconf(_SC_PAGESIZE);
#ifdef _SC_LEVEL1_DCACHE_LINESIZE
const size_t MalignBuffer::kCacheLineSize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
#else
// Default to 64 bytes which is common on x86_64
const size_t MalignBuffer::kCacheLineSize = 64;
#endif
std::string MalignBuffer::ToString(CopyMethod m) {
switch (m) {

View File

@@ -16,6 +16,7 @@
#define UTILS_H_
#include <string>
#include <cstdint>
#include "absl/strings/string_view.h"