Remove openmp support for imagemagick

This commit is contained in:
crazywhalecc
2025-03-29 22:51:12 +08:00
parent ee54b6d347
commit 4115e42dc6
4 changed files with 3 additions and 19 deletions

View File

@@ -5,23 +5,11 @@ declare(strict_types=1);
namespace SPC\builder\extension; namespace SPC\builder\extension;
use SPC\builder\Extension; use SPC\builder\Extension;
use SPC\builder\linux\LinuxBuilder;
use SPC\util\CustomExt; use SPC\util\CustomExt;
#[CustomExt('imagick')] #[CustomExt('imagick')]
class imagick extends Extension 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 public function getUnixConfigureArg(): string
{ {
return '--with-imagick=' . BUILD_ROOT_PATH; return '--with-imagick=' . BUILD_ROOT_PATH;

View File

@@ -19,7 +19,7 @@ trait imagemagick
protected function build(): void protected function build(): void
{ {
// TODO: imagemagick build with bzip2 failed with bugs, we need to fix it in the future // 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 = ''; $required_libs = '';
$optional_libs = [ $optional_libs = [
'libzip' => 'zip', '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); return implode(' ', $short_name);
} }

View File

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