Remove openmp support for imagemagick

This commit is contained in:
crazywhalecc 2025-03-29 22:51:12 +08:00
parent ee54b6d347
commit 4115e42dc6
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
4 changed files with 3 additions and 19 deletions

View File

@ -5,23 +5,11 @@ declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\builder\linux\LinuxBuilder;
use SPC\util\CustomExt;
#[CustomExt('imagick')]
class imagick extends Extension
{
public function patchBeforeMake(): bool
{
// imagick may call omp_pause_all which requires -lgomp
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
if ($this->builder instanceof LinuxBuilder) {
$extra_libs .= (empty($extra_libs) ? '' : ' ') . '-lgomp ';
}
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
return true;
}
public function getUnixConfigureArg(): string
{
return '--with-imagick=' . BUILD_ROOT_PATH;

View File

@ -19,7 +19,7 @@ trait imagemagick
protected function build(): void
{
// TODO: imagemagick build with bzip2 failed with bugs, we need to fix it in the future
$extra = '--without-jxl --without-x --enable-openmp --without-bzlib ';
$extra = '--without-jxl --without-x --disable-openmp --without-bzlib ';
$required_libs = '';
$optional_libs = [
'libzip' => 'zip',

View File

@ -90,10 +90,6 @@ class SPCConfigUtil
}
}
}
// patch: imagick (imagemagick wrapper) for linux needs -lgomp
if (in_array('imagemagick', $libraries) && PHP_OS_FAMILY === 'Linux') {
$short_name[] = '-lgomp';
}
return implode(' ', $short_name);
}

View File

@ -24,7 +24,7 @@ $test_os = [
// 'macos-13',
// 'macos-14',
'ubuntu-latest',
'windows-latest',
// 'windows-latest',
];
// whether enable thread safe
@ -40,7 +40,7 @@ $prefer_pre_built = false;
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'pgsql,pdo_pgsql',
'Linux', 'Darwin' => 'imagick',
'Windows' => 'pgsql,pdo_pgsql',
};