Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linux imagick openmp linking issue #424

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/SPC/builder/extension/imagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class imagick extends Extension
public function patchBeforeMake(): bool
{
// imagick may call omp_pause_all which requires -lgomp
$extra_libs = $this->builder->getOption('extra-libs', '');
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
if ($this->builder instanceof LinuxBuilder) {
$extra_libs .= ' -lgomp ';
$extra_libs .= (empty($extra_libs) ? '' : ' ') . '-lgomp ';
}
$this->builder->setOption('extra-libs', $extra_libs);
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/SPC/builder/unix/library/imagemagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 --disable-openmp --without-bzlib ';
$extra = '--without-jxl --without-x --enable-openmp --without-bzlib ';
$required_libs = '';
$optional_libs = [
'libzip' => 'zip',
Expand Down
4 changes: 2 additions & 2 deletions src/globals/test-extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'intl,posix',
'Windows' => 'mbstring,pdo_sqlite,mbregex,curl',
'Linux', 'Darwin' => 'imagick',
'Windows' => 'mbstring,pdo_sqlite,mbregex',
};

// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
Expand Down
Loading