[SOLVED] Compile error in opencl.c

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
kwash
Posts: 17
Joined: 2016-04-30T20:47:29-07:00
Authentication code: 1151

[SOLVED] Compile error in opencl.c

Post by kwash »

I'm getting the following compile error when trying to compile ImageMagick:

Code: Select all

MagickCore/opencl.c: In function ‘LoadOpenCLDeviceBenchmark’:
MagickCore/opencl.c:729:5: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
     status;
     ^~~~~~
MagickCore/opencl.c: In function ‘LoadOpenCLBenchmarks’:
MagickCore/opencl.c:922:10: error: too many arguments to function ‘ConfigureFileToStringInfo’
   option=ConfigureFileToStringInfo(filename,exception);
          ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./MagickCore/profile.h:21:0,
                 from ./MagickCore/image.h:146,
                 from ./MagickCore/blob.h:21,
                 from ./MagickCore/cache.h:21,
                 from MagickCore/opencl.c:45:
./MagickCore/string_.h:88:4: note: declared here
   *ConfigureFileToStringInfo(const char *),
    ^~~~~~~~~~~~~~~~~~~~~~~~~
MagickCore/opencl.c:924:28: warning: passing argument 1 of ‘DestroyStringInfo’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   option=DestroyStringInfo(option);
                            ^~~~~~
In file included from ./MagickCore/profile.h:21:0,
                 from ./MagickCore/image.h:146,
                 from ./MagickCore/blob.h:21,
                 from ./MagickCore/cache.h:21,
                 from MagickCore/opencl.c:45:
./MagickCore/string_.h:89:4: note: expected ‘StringInfo * {aka struct _StringInfo *}’ but argument is of type ‘const StringInfo * {aka const struct _StringInfo *}’
   *DestroyStringInfo(StringInfo *),
    ^~~~~~~~~~~~~~~~~
MagickCore/opencl.c:898:6: warning: unused variable ‘options’ [-Wunused-variable]
     *options;
      ^~~~~~~
MagickCore/opencl.c: In function ‘CompileOpenCLKernel’:
MagickCore/opencl.c:1347:19: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 8 has type ‘size_t {aka long unsigned int}’ [-Wformat=]
     "%s%s%s_%s_%08x_%.20g.bin",GetOpenCLCacheDirectory(),
                   ^
make[1]: *** [Makefile:7853: MagickCore/MagickCore_libMagickCore_7_Q32HDRI_la-opencl.lo] Error 1
make[1]: Leaving directory '/storage/linux/abs/imagemagick-full-git/src/imagemagick-full-git'
make: *** [Makefile:5129: all] Error 2
This error seems to be introduced by the following git commit:
http://git.imagemagick.org/repos/ImageM ... 4dea7e85ac

Commands used:

Code: Select all

$ git clone http://git.imagemagick.org/repos/ImageMagick.git imagemagick-full-git
$ cd imagemagick-full-git
$ CPPFLAGS="-I/usr/include/FLIF" \
  ./configure \
	        --prefix=/usr \
	        --sysconfdir=/etc \
	        --enable-openmp \
	        --enable-opencl \
	        --enable-largefile \
	        --enable-static=no \
	        --enable-shared=yes \
	        --enable-fast-install=yes \
	        --disable-delegate-build \
	        --enable-cipher \
	        --enable-hdri \
	        --enable-hugepages \
	        --enable-docs \
	        --with-threads \
	        --with-modules \
	        --with-quantum-depth=32 \
	        --with-magick-plus-plus \
	        --with-perl \
	        --with-perl-options="INSTALLDIRS=vendor" \
	        --with-jemalloc \
	        --with-umem \
	        --with-bzlib \
	        --with-x \
	        --with-zlib \
	        --with-autotrace \
	        --without-dps \
	        --with-fftw \
	        --with-flif \
	        --with-fpx \
	        --with-djvu \
	        --with-fontconfig \
	        --with-freetype \
	        --with-raqm \
	        --with-gslib \
	        --with-gvc \
	        --with-jbig \
	        --with-jpeg \
	        --with-lcms \
	        --with-openjp2 \
	        --with-lqr \
	        --with-lzma \
	        --with-openexr \
	        --with-pango \
	        --with-png \
	        --with-rsvg \
	        --with-tiff \
	        --with-webp \
	        --with-wmf \
	        --with-xml \
	        --with-dejavu-font-dir="/usr/share/fonts/TTF" \
	        --with-gs-font-dir="/usr/share/fonts/Type1" \
	        --with-windows-font-dir="/usr/share/fonts/WindowsFonts" \
	        --with-apple-font-dir="/usr/share/fonts/TTF" \
	        --with-fontpath="/usr/share/fonts/Type1"
$ make
Using:
OS: Arch Linux x86_64
ImageMagick: git master
Linux: 4.7.0
GCC: 6.1.1
glibc: 2.24
opencl-headers: 2.1.20151224
Last edited by kwash on 2016-08-14T10:44:55-07:00, edited 1 time in total.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Compile error in opencl.c

Post by dlemstra »

Fixed, thanks for reporting this. Visual studio didn't seem to mind the extra arguments.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
kwash
Posts: 17
Joined: 2016-04-30T20:47:29-07:00
Authentication code: 1151

Re: Compile error in opencl.c

Post by kwash »

It's working after your fix.

Thank you dlemstra for the reply and support.
Post Reply