Skip to content

Commit 40ac705

Browse files
committed
remove openmp support entirely, system packages distribute it disabled, the ini disables it by default and the authors recommend disabling it. WIth a distinction between libgomp, libomp and the non-existent usable static libraries for them, it's just not worth it.
1 parent 5334727 commit 40ac705

File tree

5 files changed

+10
-30
lines changed

5 files changed

+10
-30
lines changed

docs/en/guide/extension-notes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ This extension contains an implementation of the coroutine environment for `pdo_
4848

4949
## swow
5050

51-
1. Only PHP 8.0 ~ 8.4 is supported.
51+
1. Only PHP 8.0+ is supported.
5252

5353
## imagick
5454

55-
1. The imagick extension currently only has openmp support on musl libc. This means that multithreading is disabled on glibc or other operating systems. The extension is still fully functional.
55+
1. Openmp support is disabled, this is recommended by the maintainers and also the case system packages.
5656

5757
## imap
5858

5959
1. Kerberos is not supported
60-
2. ext-imap is not thread safe due to the underlying c-client. It's not possible to use it in --enable-zts builds.
61-
3. Because the extension may be dropped from php, we recommend you look for an alternative implementation, such as [Webklex/php-imap](https://github.com/Webklex/php-imap)
60+
2. ext-imap is not thread safe due to the underlying c-client. It's not possible to use it in `--enable-zts` builds.
61+
3. The extension was dropped from php 8.4, we recommend you look for an alternative implementation, such as [Webklex/php-imap](https://github.com/Webklex/php-imap)
6262

6363
## gd
6464

docs/zh/guide/extension-notes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ swoole-hook-sqlite 与 `pdo_sqlite` 扩展冲突。如需使用 Swoole 和 `pdo_
4545

4646
## swow
4747

48-
1. swow 仅支持 PHP 8.0 ~ 8.4 版本。
48+
1. swow 仅支持 PHP 8.0+ 版本。
4949

5050
## imagick
5151

52-
imagick 扩展目前仅在 musl libc 上支持 OpenMP(libgomp)。使用 glibc 方式构建的 imagick 扩展无法支持多线程特性
52+
1. OpenMP 支持已被禁用,这是维护者推荐的做法,系统软件包也是如此配置
5353

5454
## imap
5555

5656
1. 该扩展目前不支持 Kerberos。
5757
2. 由于底层的 c-client、ext-imap 不是线程安全的。 无法在 `--enable-zts` 构建中使用它。
58-
3. 由于该扩展可能会从未来的 PHP 中删除,因此我们建议您寻找替代实现,例如 [Webklex/php-imap](https://github.com/Webklex/php-imap)
58+
3. 该扩展已在 PHP 8.4 中被移除,因此我们建议您寻找替代实现,例如 [Webklex/php-imap](https://github.com/Webklex/php-imap)
5959

6060
## gd
6161

src/SPC/builder/extension/imagick.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,16 @@
1010
#[CustomExt('imagick')]
1111
class imagick extends Extension
1212
{
13-
public function patchBeforeMake(): bool
14-
{
15-
if (PHP_OS_FAMILY !== 'Linux') {
16-
return false;
17-
}
18-
if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) {
19-
return false;
20-
}
21-
// imagick with calls omp_pause_all, which requires openmp, on non-musl we build imagick without openmp
22-
$extra_libs = trim(getenv('SPC_EXTRA_LIBS') . ' -lomp');
23-
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
24-
return true;
25-
}
26-
2713
public function getUnixConfigureArg(bool $shared = false): string
2814
{
29-
$disable_omp = !(getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) ? '' : ' ac_cv_func_omp_pause_resource_all=no';
30-
return '--with-imagick=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $disable_omp;
15+
return '--with-imagick=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . ' ac_cv_func_omp_pause_resource_all=no';
3116
}
3217

3318
protected function getStaticAndSharedLibs(): array
3419
{
3520
// on centos 7, it will use the symbol _ZTINSt6thread6_StateE, which is not defined in system libstdc++.so.6
3621
[$static, $shared] = parent::getStaticAndSharedLibs();
37-
if (getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10')) {
22+
if (str_contains(getenv('CC'), 'devtoolset-10')) {
3823
$static .= ' -lstdc++';
3924
$shared = str_replace('-lstdc++', '', $shared);
4025
}

src/SPC/builder/unix/library/imagemagick.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ protected function build(): void
3232
->optionalLib('freetype', ...ac_with_args('freetype'))
3333
->optionalLib('bzip2', ...ac_with_args('bzlib'))
3434
->addConfigureArgs(
35-
// TODO: glibc rh 10 toolset's libgomp.a was built without -fPIC so we can't use openmp without depending on libgomp.so
36-
getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10') ? '--disable-openmp' : '--enable-openmp',
35+
'--disable-openmp',
3736
'--without-jxl',
3837
'--without-x',
3938
);

src/SPC/util/SPCConfigUtil.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ private function getLibsString(array $libraries, bool $withDependencies = false)
149149
}
150150
}
151151
}
152-
// patch: imagick (imagemagick wrapper) for linux needs libgomp
153-
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Linux' && !(getenv('SPC_LIBC') === 'glibc' && str_contains(getenv('CC'), 'devtoolset-10'))) {
154-
$short_name[] = '-lomp';
155-
}
156152
return implode(' ', $short_name);
157153
}
158154

0 commit comments

Comments
 (0)