Skip to content

Commit df3ed19

Browse files
committed
Fixed GitHub Actions CI and replaced macOS 13.
1 parent 4d0e759 commit df3ed19

File tree

6 files changed

+45
-33
lines changed

6 files changed

+45
-33
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,31 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
os: [ubuntu-22.04, ubuntu-24.04]
16+
os: [ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm]
1717
cxx: [g++, clang++]
18+
exclude:
19+
- os: ubuntu-22.04-arm
20+
cxx: clang++
1821
fail-fast: false
1922
env:
2023
CXX: ${{ matrix.cxx }}
2124
steps:
22-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v6
2326
- name: Install
2427
run: |
2528
sudo apt-get update -y
2629
sudo apt-get install -y cppcheck ocl-icd-opencl-dev pocl-opencl-icd
2730
$CXX --version
2831
- name: Script
2932
run: |
30-
make prpll -O -j "$(nproc)"
33+
make -O -j "$(nproc)"
3134
cd build-release
3235
rm -f -- *.o
3336
./prpll -h
34-
- uses: actions/upload-artifact@v4
37+
- uses: actions/upload-artifact@v6
3538
if: always()
3639
with:
37-
name: ${{ matrix.os }}_${{ matrix.cxx }}_prpll
40+
name: ${{ matrix.os }}_${{ endsWith(matrix.os, '-arm') && 'arm' || 'x86' }}_${{ matrix.cxx }}_prpll
3841
path: ${{ github.workspace }}
3942
- name: Cppcheck
4043
run: cppcheck --enable=all --force .
@@ -49,15 +52,17 @@ jobs:
4952
Windows:
5053
name: Windows
5154

52-
runs-on: windows-latest
55+
runs-on: ${{ matrix.os }}
5356
strategy:
5457
matrix:
58+
os: [windows-latest] # windows-11-arm
5559
cxx: [g++, clang++]
5660
fail-fast: false
5761
env:
5862
CXX: ${{ matrix.cxx }}
63+
PACKAGE_PREFIX: mingw-w64-${{ endsWith(matrix.os, '-arm') && 'clang-aarch64' || 'x86_64' }}-
5964
steps:
60-
- uses: actions/checkout@v4
65+
- uses: actions/checkout@v6
6166
- name: Before Install
6267
run: |
6368
echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
@@ -66,42 +71,48 @@ jobs:
6671
echo "LIBPATH=-LC:\msys64\mingw64\lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
6772
- name: Install
6873
run: |
69-
pacman -S --noconfirm mingw-w64-x86_64-gmp mingw-w64-x86_64-opencl-icd
74+
pacman -S --noconfirm "${env:PACKAGE_PREFIX}opencl-icd"
7075
& $env:CXX --version
7176
- name: Install Clang
7277
if: ${{ matrix.cxx == 'clang++' }}
7378
run: |
7479
pacman -S --noconfirm mingw-w64-x86_64-clang
7580
& $env:CXX --version
7681
- name: Script
77-
run: | # Cannot use `make exe`, as the OpenCL ICD Loader does not support static linking
78-
make prpll -O -j $env:NUMBER_OF_PROCESSORS
82+
run: |
83+
make -O -j $env:NUMBER_OF_PROCESSORS
7984
cd build-release
8085
rm *.o
8186
.\prpll.exe -h
82-
- uses: actions/upload-artifact@v4
87+
- uses: actions/upload-artifact@v6
8388
if: always()
8489
with:
85-
name: win_${{ matrix.cxx }}_prpll
90+
name: win_${{ endsWith(matrix.os, '-arm') && 'arm' || 'x86' }}_${{ matrix.cxx }}_prpll
8691
path: ${{ github.workspace }}
8792

8893
macOS:
8994
name: macOS
9095

91-
runs-on: macos-13
96+
runs-on: ${{ matrix.os }}
97+
strategy:
98+
matrix:
99+
os: [macos-15-intel, macos-latest]
100+
fail-fast: false
101+
env:
102+
CXX: g++-15
92103
steps:
93-
- uses: actions/checkout@v4
104+
- uses: actions/checkout@v6
94105
- name: Install
95106
run: |
96-
brew install gcc@14
107+
$CXX --version
97108
- name: Script
98109
run: |
99-
make prpll -j "$(sysctl -n hw.ncpu)"
110+
make -j "$(sysctl -n hw.ncpu)"
100111
cd build-release
101112
rm -f -- *.o
102113
./prpll -h
103-
- uses: actions/upload-artifact@v4
114+
- uses: actions/upload-artifact@v6
104115
if: always()
105116
with:
106-
name: macos_prpll
117+
name: macos_${{ endsWith(matrix.os, '-intel') && 'x86' || 'arm' }}_prpll
107118
path: ${{ github.workspace }}

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ HOST_OS = $(shell uname -s)
1414

1515
ifeq ($(HOST_OS), Darwin)
1616
# Real GCC (not clang), needed for 128-bit floats and std::filesystem::path
17-
CXX = g++-14
17+
CXX ?= g++-15
1818
else
19-
CXX = g++
19+
CXX ?= g++
2020
endif
2121

2222
ifneq ($(findstring MINGW, $(HOST_OS)), MINGW)
@@ -45,7 +45,7 @@ else
4545

4646
BIN=build-release
4747

48-
CXXFLAGS = -O2 -DNDEBUG $(COMMON_FLAGS)
48+
CXXFLAGS = -O3 -DNDEBUG $(COMMON_FLAGS)
4949
STRIP=-s
5050

5151
endif
@@ -90,7 +90,7 @@ $(BIN)/%.o : src/%.cpp $(DEPDIR)/%.d
9090
# src/bundle.cpp is just a wrapping of the OpenCL sources (*.cl) as a C string.
9191

9292
src/bundle.cpp: genbundle.sh src/cl/*.cl
93-
./genbundle.sh $^ > src/bundle.cpp
93+
bash genbundle.sh $^ > src/bundle.cpp
9494

9595
$(DEPDIR)/%.d: ;
9696
.PRECIOUS: $(DEPDIR)/%.d

genbundle.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
cat <<EOM
23
// Copyright (C) Mihai Preda
34
// Generated file, do not edit. See genbundle.sh and src/cl/*.cl
@@ -9,24 +10,24 @@ EOM
910

1011
names=
1112

12-
for xx in $*
13+
for xx in "$@"
1314
do
14-
x=`basename $xx`
15+
x=$(basename "$xx")
1516

1617
if [ "$x" = "genbundle.sh" ] ; then continue ; fi
1718

1819
names=${names}\"${x}\",
1920

20-
echo // $xx
21+
echo "// $xx"
2122
#echo const char ${x}_cl[] = R\"cltag\(
22-
echo R\"cltag\(
23-
cat $xx
24-
echo \)cltag\"\,
23+
echo 'R"cltag('
24+
cat "$xx"
25+
echo ')cltag",'
2526
echo
2627
done
27-
echo \}\;
28+
echo '};'
2829

29-
echo static const std::vector\<const char*\> CL_FILE_NAMES\{${names}\}\;
30+
echo "static const std::vector<const char*> CL_FILE_NAMES{${names}};"
3031

3132
cat <<EOM
3233
const std::vector<const char*>& getClFileNames() { return CL_FILE_NAMES; }

src/Args.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ and should be able to run.
118118
PRPLL keeps the active tasks in per-worker files worktodo-0.txt, worktodo-1.txt etc in the local directory.
119119
These per-worker files are supplied from the global worktodo.txt file if -pool is used.
120120
In turn the global worktodo.txt can be supplied through the primenet.py script,
121-
either the one located at gpuowl/tools/primenet.py or https://download.mersenne.ca/primenet.py
121+
either the one located at gpuowl/tools/primenet.py or https://download.mersenne.ca/AutoPrimeNet
122122

123123
It is also possible to manually add exponents by adding lines of the form "PRP=118063003" to worktodo-<N>.txt
124124

src/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using i64 = int64_t;
1313
using u64 = uint64_t;
1414
using i128 = __int128;
1515
using u128 = unsigned __int128;
16-
using f128 = __float128;
16+
// using f128 = __float128;
1717

1818
static_assert(sizeof(u8) == 1, "size u8");
1919
static_assert(sizeof(u32) == 4, "size u32");

src/tune.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ void Tune::tune() {
947947
config.write("\n -log 1000000\n");
948948
}
949949
if (args->workers < 2) {
950-
config.write("\n# Running two workers sometimes gives better throughput. Autoprimenet will need to create up a second worktodo file.");
950+
config.write("\n# Running two workers sometimes gives better throughput. AutoPrimeNet will need to create up a second worktodo file (use --num-workers 2).");
951951
config.write("\n# -workers 2\n");
952952
config.write("\n# Changing TAIL_KERNELS to 3 when running two workers may be better.");
953953
config.write("\n# -use TAIL_KERNELS=3\n");

0 commit comments

Comments
 (0)