Compare commits
10 Commits
dc63b5bb59
...
master
Author | SHA1 | Date | |
---|---|---|---|
67aec7aa01 | |||
4ef3eec229 | |||
16d35c2a0e | |||
372c43caea | |||
06a0b682c0 | |||
31077367bb | |||
b9f6ef50af | |||
79c652cd7c | |||
8c965a25e2 | |||
b01131eaee |
34
.github/workflows/build-alpine.yml
vendored
34
.github/workflows/build-alpine.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
|||||||
- name: Install Alpine Packaging Dependencies
|
- name: Install Alpine Packaging Dependencies
|
||||||
run: |
|
run: |
|
||||||
apk update
|
apk update
|
||||||
apk add alpine-sdk cmake clang llvm linux-headers
|
apk add alpine-sdk cmake clang llvm linux-headers zlib-dev zlib-static openssl-dev openssl-libs-static musl-dev
|
||||||
|
|
||||||
- name: Build Static Abseil
|
- name: Build Static Abseil
|
||||||
run: |
|
run: |
|
||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
make install
|
make install
|
||||||
|
|
||||||
- name: Build Alpine Package
|
- name: Build cpu-check Alpine Package
|
||||||
run: |
|
run: |
|
||||||
mkdir -p alpine_build && cd alpine_build
|
mkdir -p alpine_build && cd alpine_build
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||||
@@ -54,11 +54,35 @@ jobs:
|
|||||||
-DBUILD_STATIC=ON \
|
-DBUILD_STATIC=ON \
|
||||||
..
|
..
|
||||||
make
|
make
|
||||||
# Example packaging command; adjust according to your packaging scripts
|
# 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
|
make apk
|
||||||
|
|
||||||
- name: Upload Alpine Package
|
- name: Upload cpu-check Alpine Package
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: cpu-check-alpine
|
name: cpu-check-alpine
|
||||||
path: alpine_build/*.apk
|
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"
|
@@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
cmake_minimum_required (VERSION 3.2)
|
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
|
# Options
|
||||||
# Use clang/llvm by default.
|
# 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)
|
target_link_libraries(cpu_check avx compressor crc32c crypto fvt_controller hasher malign_buffer pattern_generator silkscreen utils)
|
||||||
|
|
||||||
install (TARGETS cpu_check DESTINATION bin)
|
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"
|
||||||
|
)
|
||||||
|
@@ -15,12 +15,13 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "fvt_controller.h"
|
#include "fvt_controller.h"
|
||||||
|
|
||||||
#include <error.h>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <system_error> // for std::system_error
|
||||||
|
#include <cerrno> // for errno
|
||||||
#undef NDEBUG
|
#undef NDEBUG
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
@@ -127,7 +127,12 @@ void MalignBuffer::InitializeMemoryForSanitizer(char *addr, size_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const size_t MalignBuffer::kPageSize = sysconf(_SC_PAGESIZE);
|
const size_t MalignBuffer::kPageSize = sysconf(_SC_PAGESIZE);
|
||||||
|
#ifdef _SC_LEVEL1_DCACHE_LINESIZE
|
||||||
const size_t MalignBuffer::kCacheLineSize = sysconf(_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) {
|
std::string MalignBuffer::ToString(CopyMethod m) {
|
||||||
switch (m) {
|
switch (m) {
|
||||||
|
Reference in New Issue
Block a user