[1/1] package/imagemagick: disable opencl
diff mbox series

Message ID 20190823191417.8748-1-juju@cotds.org
State New
Headers show
Series
  • [1/1] package/imagemagick: disable opencl
Related show

Commit Message

Julien Olivain Aug. 23, 2019, 7:14 p.m. UTC
Some packages installs libOpenCL without declaring
BR2_PACKAGE_PROVIDES_LIBOPENCL (e.g. imx-gpu-viv). ImageMagick will
detect the library and will require libtool. Since libtool is not in
dependencies, build might fail.

To prevent that situation, this patch explicitly disable opencl
support.

Signed-off-by: Julien Olivain <juju@cotds.org>
---
 package/imagemagick/imagemagick.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Peter Korsgaard Aug. 25, 2019, 7:04 a.m. UTC | #1
>>>>> "Julien" == Julien Olivain <juju@cotds.org> writes:

 > Some packages installs libOpenCL without declaring
 > BR2_PACKAGE_PROVIDES_LIBOPENCL (e.g. imx-gpu-viv). ImageMagick will
 > detect the library and will require libtool. Since libtool is not in
 > dependencies, build might fail.

 > To prevent that situation, this patch explicitly disable opencl
 > support.

 > Signed-off-by: Julien Olivain <juju@cotds.org>
 > ---
 >  package/imagemagick/imagemagick.mk | 6 +++++-
 >  1 file changed, 5 insertions(+), 1 deletion(-)

 > diff --git a/package/imagemagick/imagemagick.mk b/package/imagemagick/imagemagick.mk
 > index 0bac0b4fc3..58c8637efc 100644
 > --- a/package/imagemagick/imagemagick.mk
 > +++ b/package/imagemagick/imagemagick.mk
 > @@ -18,10 +18,13 @@ ifeq ($(BR2_INSTALL_LIBSTDCPP)$(BR2_USE_WCHAR),yy)
 >  IMAGEMAGICK_CONFIG_SCRIPTS += Magick++-config
 >  endif
 
 > -IMAGEMAGICK_CONF_ENV = ac_cv_sys_file_offset_bits=64
 > +IMAGEMAGICK_CONF_ENV = \
 > +	ac_cv_sys_file_offset_bits=64 \
 > +	ax_cv_check_cl_libcl=no

Why is this needed? From a quick look at m4/ax_opencl.m4, this only
seems to be used when we do not pass --disable-opencl?
Julien Olivain Aug. 25, 2019, 10:47 a.m. UTC | #2
Hi Peter,

On 2019-08-25 09:04, Peter Korsgaard wrote:
>>>>>> "Julien" == Julien Olivain <juju@cotds.org> writes:
> 
>  > Some packages installs libOpenCL without declaring
>  > BR2_PACKAGE_PROVIDES_LIBOPENCL (e.g. imx-gpu-viv). ImageMagick will
>  > detect the library and will require libtool. Since libtool is not in
>  > dependencies, build might fail.
> 
>  > To prevent that situation, this patch explicitly disable opencl
>  > support.
> 
>  > Signed-off-by: Julien Olivain <juju@cotds.org>
>  > ---
>  >  package/imagemagick/imagemagick.mk | 6 +++++-
>  >  1 file changed, 5 insertions(+), 1 deletion(-)
> 
>  > diff --git a/package/imagemagick/imagemagick.mk
> b/package/imagemagick/imagemagick.mk
>  > index 0bac0b4fc3..58c8637efc 100644
>  > --- a/package/imagemagick/imagemagick.mk
>  > +++ b/package/imagemagick/imagemagick.mk
>  > @@ -18,10 +18,13 @@ ifeq 
> ($(BR2_INSTALL_LIBSTDCPP)$(BR2_USE_WCHAR),yy)
>  >  IMAGEMAGICK_CONFIG_SCRIPTS += Magick++-config
>  >  endif
> 
>  > -IMAGEMAGICK_CONF_ENV = ac_cv_sys_file_offset_bits=64
>  > +IMAGEMAGICK_CONF_ENV = \
>  > +	ac_cv_sys_file_offset_bits=64 \
>  > +	ax_cv_check_cl_libcl=no
> 
> Why is this needed? From a quick look at m4/ax_opencl.m4, this only
> seems to be used when we do not pass --disable-opencl?

For some reasons, just passing --disable-opencl will not set
$ax_cv_check_cl_libcl to "no", but to an empty string, when tested at:
https://github.com/ImageMagick/ImageMagick/blob/7.0.8-59/configure.ac#L1725

This test will still enable the need of libltdl.

Forcing ax_cv_check_cl_libcl to "no" is a workaround this behavior.

Do you want me to add this comment in the .mk file and update the patch?

Best regards,

Julien.

Patch
diff mbox series

diff --git a/package/imagemagick/imagemagick.mk b/package/imagemagick/imagemagick.mk
index 0bac0b4fc3..58c8637efc 100644
--- a/package/imagemagick/imagemagick.mk
+++ b/package/imagemagick/imagemagick.mk
@@ -18,10 +18,13 @@  ifeq ($(BR2_INSTALL_LIBSTDCPP)$(BR2_USE_WCHAR),yy)
 IMAGEMAGICK_CONFIG_SCRIPTS += Magick++-config
 endif
 
-IMAGEMAGICK_CONF_ENV = ac_cv_sys_file_offset_bits=64
+IMAGEMAGICK_CONF_ENV = \
+	ac_cv_sys_file_offset_bits=64 \
+	ax_cv_check_cl_libcl=no
 
 IMAGEMAGICK_CONF_OPTS = \
 	--program-transform-name='s,,,' \
+	--disable-opencl \
 	--disable-openmp \
 	--without-djvu \
 	--without-dps \
@@ -152,6 +155,7 @@  IMAGEMAGICK_CONF_OPTS += --without-bzlib
 endif
 
 HOST_IMAGEMAGICK_CONF_OPTS = \
+	--disable-opencl \
 	--disable-openmp \
 	--without-djvu \
 	--without-dps \