Skip to content

Commit bfda993

Browse files
committed
macOS
1 parent afd1b61 commit bfda993

File tree

5 files changed

+30
-34
lines changed

5 files changed

+30
-34
lines changed

.github/workflows/tests.yml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ jobs:
2525
os: ubuntu-latest
2626
php: '8.4'
2727
phpunit: '11.5'
28+
- name: PHP8.4
29+
os: windows-latest
30+
php: '8.4'
31+
phpunit: '11.5'
32+
- name: PHP8.4
33+
os: macos-latest
34+
php: '8.4'
35+
phpunit: '11.5'
2836

2937
steps:
3038
- name: Setup PHP ${{ matrix.php }}
@@ -33,44 +41,23 @@ jobs:
3341
php-version: ${{ matrix.php }}
3442
# PHP Extras
3543
coverage: none
36-
tools: composer, phpunit:${{ matrix.phpunit }}, phpstan
44+
tools: composer, phpstan
3745
#ini-values: "memory_limit=512M"
38-
extensions: ffi
39-
40-
#- name: Install OpenBLAS
41-
# run: |
42-
# sudo apt install -y clinfo
43-
# sudo apt install -y pocl-opencl-icd
46+
extensions: ffi, mbstring
47+
env:
48+
fail-fast: true
4449

4550
- name: Checkout codes
4651
uses: "actions/checkout@v4"
4752

48-
#- name: Composer
49-
# uses: php-actions/composer@v6
50-
# with:
51-
# php_version: ${{ matrix.php }}
52-
# php_extensions: ffi
53-
5453
- name: Composer
55-
run: composer update
56-
57-
#- name: PHP Static Analysys
58-
# uses: php-actions/phpstan@v3
59-
# with:
60-
# php_version: ${{ matrix.php }}
61-
# path: src/
54+
run: |
55+
composer update
56+
composer require --dev phpunit/phpunit=^${{ matrix.phpunit }}
6257
6358
- name: PHP Static Analysys
6459
run: phpstan
6560

66-
#- name: PHPUnit Tests
67-
# uses: php-actions/phpunit@v3
68-
# with:
69-
# configuration: tests/phpunit.xml
70-
# version: ${{ matrix.phpunit }}
71-
# php_version: ${{ matrix.php }}
72-
# filter: ReleaseTest
73-
7461
- name: PHPUnit Tests
75-
run: phpunit -c tests --filter ReleaseTest
62+
run: vendor/bin/phpunit -c tests --filter ReleaseTest
7663

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ vendor/
33
composer.lock
44
composer.phar
55
tests/.phpunit.*
6-
build/
6+
build/
7+
.vscode/

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ Please see the documents about Buffer objects on [Rindow Mathematics](https://ri
1313
Requirements
1414
============
1515

16-
- PHP 8.1 or PHP8.2 or PHP8.3 or PHP8.4
16+
- PHP 8.1, PHP8.2, PHP8.3, PHP8.4
1717
- CLBlast 1.5.1 or later
18+
- Windows 10/11, Ubuntu(Recommends 2204-), Debian(Recommends 12-), or later
1819

1920
How to setup OpenCL & CLBlast
2021
=============================

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"license": "BSD-3-Clause",
77
"require": {
88
"php": "^8.1",
9-
"interop-phpobjects/polite-math": "~1.0.7",
10-
"rindow/rindow-opencl-ffi": "^1.0"
9+
"interop-phpobjects/polite-math": "^1.0.7",
10+
"rindow/rindow-opencl-ffi": "^1.0.5"
1111
},
1212
"require-dev": {
1313
"ext-ffi": "*",
14-
"rindow/rindow-math-buffer-ffi": "^1.0",
14+
"rindow/rindow-math-buffer-ffi": "^1.0.5",
1515
"rindow/rindow-openblas-ffi": "^1.0",
1616
"rindow/rindow-matlib-ffi": "^1.0"
1717
},

src/CLBlastFactory.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ class CLBlastFactory
1414
protected array $libs_win = ['clblast.dll'];
1515
/** @var array<string> $libs_linux */
1616
protected array $libs_linux = ['libclblast.so.1'];
17+
/** @var array<string> $libs_mac */
18+
protected array $libs_mac = [
19+
'/opt/homebrew/lib/libclblast.dylib',
20+
'/usr/local/lib/libclblast.dylib'
21+
];
1722

1823
/**
1924
* @param array<string> $libFiles
@@ -36,6 +41,8 @@ public function __construct(
3641
$libFiles = $this->libs_linux;
3742
} elseif(PHP_OS=='WINNT') {
3843
$libFiles = $this->libs_win;
44+
} elseif(PHP_OS=='Darwin') {
45+
$libFiles = $this->libs_mac;
3946
} else {
4047
throw new RuntimeException('Unknown operating system: "'.PHP_OS.'"');
4148
}

0 commit comments

Comments
 (0)