tlk / homebrew-imagemagick-x11

macOS Homebrew tap: ImageMagick with X11 support
BSD 2-Clause "Simplified" License
27 stars 1 forks source link

Error while trying to install imagemagick #4

Closed vfournier closed 3 years ago

vfournier commented 3 years ago

Hi!

So I am having a problem while trying to install your version. When I run brew install tlk/imagemagick-x11/imagemagick, at the make install step, I get an error which makes the software to never install.

image

I am not sure what could be causing this. Let me know if you have any step you'd like me to try.

I could also provide the log file if needed.

Thank you.

ThatIsAPseudo commented 3 years ago

Same error, here is the full message I get :

==> Upgrading tlk/imagemagick-x11/imagemagick 7.0.10-54 -> 7.0.10-57
==> Downloading https://dl.bintray.com/homebrew/mirror/ImageMagick-7.0.10-57.tar.xz
Already downloaded: /Users/User/Library/Caches/Homebrew/downloads/314e592134d5800460eb299042b41af757866996a5ed857afac5d79b20f38e14--ImageMagick-7.0.10-57.tar.xz
==> ./configure --enable-osx-universal-binary=no --prefix=/usr/local/Cellar/imagemagick/7.0.10-57 --disable-opencl --enable-shared --enable-static --with-freetype=yes --with-modu
==> make install
Last 15 lines from /Users/User/Library/Logs/Homebrew/imagemagick/02.make:
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I./config -I. -I. -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/ilmbase/2.5.4/include -I/usr/local/Cellar/ilmbase/2.5.4/include/OpenEXR -I/usr/local/Cellar/openexr/2.5.4/include/OpenEXR -I/usr/local/Cellar/xz/5.2.5/include -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/glib/2.66.4_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.66.4_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/liblqr/0.4.2_1/include/lqr-1 -I/usr/local/Cellar/openjpeg/2.3.1/include/openjpeg-2.3 -I/usr/local/Cellar/little-cms2/2.11/include -I/usr/local/Cellar/libde265/1.0.8/include -I/usr/local/Cellar/x265/3.4_2/include -I/usr/local/Cellar/libheif/1.10.0/include -I/usr/local/opt/freetype/include/freetype2 -Xpreprocessor -fopenmp -Wall -g -O2 -mtune=broadwell -fexceptions -D_FORTIFY_SOURCE=0 -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -c MagickCore/xml-tree.c -o MagickCore/libMagickCore_7_Q16HDRI_la-xml-tree.o >/dev/null 2>&1
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I./config -I. -I. -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/ilmbase/2.5.4/include -I/usr/local/Cellar/ilmbase/2.5.4/include/OpenEXR -I/usr/local/Cellar/openexr/2.5.4/include/OpenEXR -I/usr/local/Cellar/xz/5.2.5/include -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/glib/2.66.4_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.66.4_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/liblqr/0.4.2_1/include/lqr-1 -I/usr/local/Cellar/openjpeg/2.3.1/include/openjpeg-2.3 -I/usr/local/Cellar/little-cms2/2.11/include -I/usr/local/Cellar/libde265/1.0.8/include -I/usr/local/Cellar/x265/3.4_2/include -I/usr/local/Cellar/libheif/1.10.0/include -I/usr/local/opt/freetype/include/freetype2 -Xpreprocessor -fopenmp -Wall -g -O2 -mtune=broadwell -fexceptions -D_FORTIFY_SOURCE=0 -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -c MagickCore/visual-effects.c -o MagickCore/libMagickCore_7_Q16HDRI_la-visual-effects.o >/dev/null 2>&1
/bin/sh ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I./config  -I. -I.  -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16   -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/ilmbase/2.5.4/include -I/usr/local/Cellar/ilmbase/2.5.4/include/OpenEXR -I/usr/local/Cellar/openexr/2.5.4/include/OpenEXR -I/usr/local/Cellar/xz/5.2.5/include -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/glib/2.66.4_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.66.4_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/liblqr/0.4.2_1/include/lqr-1 -I/usr/local/Cellar/openjpeg/2.3.1/include/openjpeg-2.3 -I/usr/local/Cellar/little-cms2/2.11/include -I/usr/local/Cellar/libde265/1.0.8/include -I/usr/local/Cellar/x265/3.4_2/include -I/usr/local/Cellar/libheif/1.10.0/include -I/usr/local/opt/freetype/include/freetype2  -Xpreprocessor -fopenmp -Wall -g -O2 -mtune=broadwell -fexceptions -D_FORTIFY_SOURCE=0 -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -c -o MagickCore/libMagickCore_7_Q16HDRI_la-xwindow.lo `test -f 'MagickCore/xwindow.c' || echo './'`MagickCore/xwindow.c
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I./config -I. -I. -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/ilmbase/2.5.4/include -I/usr/local/Cellar/ilmbase/2.5.4/include/OpenEXR -I/usr/local/Cellar/openexr/2.5.4/include/OpenEXR -I/usr/local/Cellar/xz/5.2.5/include -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/glib/2.66.4_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.66.4_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/liblqr/0.4.2_1/include/lqr-1 -I/usr/local/Cellar/openjpeg/2.3.1/include/openjpeg-2.3 -I/usr/local/Cellar/little-cms2/2.11/include -I/usr/local/Cellar/libde265/1.0.8/include -I/usr/local/Cellar/x265/3.4_2/include -I/usr/local/Cellar/libheif/1.10.0/include -I/usr/local/opt/freetype/include/freetype2 -Xpreprocessor -fopenmp -Wall -g -O2 -mtune=broadwell -fexceptions -D_FORTIFY_SOURCE=0 -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -c MagickCore/xwindow.c  -fno-common -DPIC -o MagickCore/.libs/libMagickCore_7_Q16HDRI_la-xwindow.o
/bin/sh ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I. -I./config  -I. -I.  -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16   -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/ilmbase/2.5.4/include -I/usr/local/Cellar/ilmbase/2.5.4/include/OpenEXR -I/usr/local/Cellar/openexr/2.5.4/include/OpenEXR -I/usr/local/Cellar/xz/5.2.5/include -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/glib/2.66.4_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.66.4_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/liblqr/0.4.2_1/include/lqr-1 -I/usr/local/Cellar/openjpeg/2.3.1/include/openjpeg-2.3 -I/usr/local/Cellar/little-cms2/2.11/include -I/usr/local/Cellar/libde265/1.0.8/include -I/usr/local/Cellar/x265/3.4_2/include -I/usr/local/Cellar/libheif/1.10.0/include -I/usr/local/opt/freetype/include/freetype2  -Xpreprocessor -fopenmp -Wall -g -O2 -mtune=broadwell -fexceptions -D_FORTIFY_SOURCE=0 -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -c -o MagickWand/libMagickWand_7_Q16HDRI_la-animate.lo `test -f 'MagickWand/animate.c' || echo './'`MagickWand/animate.c
MagickCore/xwindow.c:104:10: fatal error: 'X11/extensions/XShm.h' file not found
#include <X11/extensions/XShm.h>
         ^~~~~~~~~~~~~~~~~~~~~~~
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I./config -I. -I. -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/ilmbase/2.5.4/include -I/usr/local/Cellar/ilmbase/2.5.4/include/OpenEXR -I/usr/local/Cellar/openexr/2.5.4/include/OpenEXR -I/usr/local/Cellar/xz/5.2.5/include -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/glib/2.66.4_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.66.4_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/liblqr/0.4.2_1/include/lqr-1 -I/usr/local/Cellar/openjpeg/2.3.1/include/openjpeg-2.3 -I/usr/local/Cellar/little-cms2/2.11/include -I/usr/local/Cellar/libde265/1.0.8/include -I/usr/local/Cellar/x265/3.4_2/include -I/usr/local/Cellar/libheif/1.10.0/include -I/usr/local/opt/freetype/include/freetype2 -Xpreprocessor -fopenmp -Wall -g -O2 -mtune=broadwell -fexceptions -D_FORTIFY_SOURCE=0 -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -c MagickWand/animate.c  -fno-common -DPIC -o MagickWand/.libs/libMagickWand_7_Q16HDRI_la-animate.o
1 error generated.
make[1]: *** [MagickCore/libMagickCore_7_Q16HDRI_la-xwindow.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I./config -I. -I. -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/ilmbase/2.5.4/include -I/usr/local/Cellar/ilmbase/2.5.4/include/OpenEXR -I/usr/local/Cellar/openexr/2.5.4/include/OpenEXR -I/usr/local/Cellar/xz/5.2.5/include -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/glib/2.66.4_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.66.4_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/liblqr/0.4.2_1/include/lqr-1 -I/usr/local/Cellar/openjpeg/2.3.1/include/openjpeg-2.3 -I/usr/local/Cellar/little-cms2/2.11/include -I/usr/local/Cellar/libde265/1.0.8/include -I/usr/local/Cellar/x265/3.4_2/include -I/usr/local/Cellar/libheif/1.10.0/include -I/usr/local/opt/freetype/include/freetype2 -Xpreprocessor -fopenmp -Wall -g -O2 -mtune=broadwell -fexceptions -D_FORTIFY_SOURCE=0 -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -c MagickCore/widget.c -o MagickCore/libMagickCore_7_Q16HDRI_la-widget.o >/dev/null 2>&1
libtool: compile:  clang -DHAVE_CONFIG_H -I. -I./config -I. -I. -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/webp/1.1.0/include -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/ilmbase/2.5.4/include -I/usr/local/Cellar/ilmbase/2.5.4/include/OpenEXR -I/usr/local/Cellar/openexr/2.5.4/include/OpenEXR -I/usr/local/Cellar/xz/5.2.5/include -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/glib/2.66.4_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.66.4_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/liblqr/0.4.2_1/include/lqr-1 -I/usr/local/Cellar/openjpeg/2.3.1/include/openjpeg-2.3 -I/usr/local/Cellar/little-cms2/2.11/include -I/usr/local/Cellar/libde265/1.0.8/include -I/usr/local/Cellar/x265/3.4_2/include -I/usr/local/Cellar/libheif/1.10.0/include -I/usr/local/opt/freetype/include/freetype2 -Xpreprocessor -fopenmp -Wall -g -O2 -mtune=broadwell -fexceptions -D_FORTIFY_SOURCE=0 -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -c MagickWand/animate.c -o MagickWand/libMagickWand_7_Q16HDRI_la-animate.o >/dev/null 2>&1
make: *** [install] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/tlk/homebrew-imagemagick-x11/issues

These open issues may also help:
Error while trying to install imagemagick https://github.com/tlk/homebrew-imagemagick-x11/issues/4
tlk commented 3 years ago

Hi! Thanks for reporting. Looks like there may be some dependencies missing...

tlk commented 3 years ago

Adding these dependencies allows the software to build and magick tools such as convert and identify works, but display wizard: aborts with return code 134.

+  depends_on "libxext"
+  depends_on "libsm"
+  depends_on "libxt"
tlk commented 3 years ago

The way I test this is simply to edit the local formula file in /usr/local/Homebrew/Library/Taps/tlk/homebrew-imagemagick-x11/Formula/imagemagick.rb and running brew reinstall tlk/imagemagick-x11/imagemagick.

Not sure if there is a smarter way to do it. It is a git clone so it may have to be left untouched after testing: cd /usr/local/Homebrew/Library/Taps/tlk/homebrew-imagemagick-x11; git checkout Formula/imagemagick.rb

tlk commented 3 years ago

So just as a baseline, cloning the ImageMagick project and building it manually works as expected:

$ git clone git@github.com:ImageMagick/ImageMagick.git
$ cd ImageMagick
$ ./configure
$ make clean
$ make
$ ./utilities/magick display wizard:
$ echo $?
0
$
tlk commented 3 years ago

Debug log from a functional build:

$ ./utilities/magick display wizard: -debug all 2>&1 |head -n 50
2021-01-14T22:19:18+00:00 0:00.001 0.000u 7.0.10 Configure display[25926]: utility.c/ExpandFilenames/971/Configure
  Command line: display {wizard:} {-debug} {all}
2021-01-14T22:19:18+00:00 0:00.002 0.000u 7.0.10 Policy display[25926]: policy.c/IsRightsAuthorized/635/Policy
  Domain: Module; rights=Read; pattern="WIZARD" ...
2021-01-14T22:19:18+00:00 0:00.002 0.000u 7.0.10 Configure display[25926]: configure.c/GetConfigureOptions/675/Configure
  Searching for configure file: "/usr/local/share/ImageMagick-7/delegates.xml"
…

The broken build aborts immediately after logging this:

$ magick display wizard: -debug all
2021-01-14T22:20:11+00:00 0:00.001 0.000u 7.0.10 Configure display[25964]: utility.c/ExpandFilenames/971/Configure
  Command line: display {wizard:} {-debug} {all}
vfournier commented 3 years ago

Adding these dependencies allows the software to build and magick tools such as convert and identify works, but display wizard: aborts with return code 134.

+  depends_on "libxext"
+  depends_on "libsm"
+  depends_on "libxt"

I can confirm on my end that doing this seems to have everything working beside the display command. Is there anything else I can do on my end to have this command working ?

vfournier commented 3 years ago

Here's the debug I have if it can be of any help. It seems different from yours : image

tlk commented 3 years ago

Maybe adding those dependencies is not the way to go after all.

I cleaned up before testing this: brew uninstall libice libxext libsm libxt imagemagick

When I compare the original compile error with the vanilla build that works, MAGICKCORE_HAVE_SHARED_MEMORY and MAGICKCORE_HAVE_SHAPE are defined in the Homebrew build but not in the vanilla build.

This is breaking the formula at the moment: https://github.com/ImageMagick/ImageMagick/blob/master/MagickCore/xwindow.c#L98-L108

tlk commented 3 years ago

When I compare the configuration output in config.log with the vanilla build where it says "checking for XShmAttach in -lXext" the check fails in the vanilla build and MAGICKCORE_HAVE_SHARED_MEMORY is not set.

The check succeeds in the homebrew build, MAGICKCORE_HAVE_SHARED_MEMORY is set but later X11/extensions/XShm.h cannot be found.

Fantastic :-)

tlk commented 3 years ago

Here's the debug I have if it can be of any help. It seems different from yours :

@vinofou Thank you for sharing the output.

I went down the rabbit hole and convinced ImageMagick to build under homebrew without additional dependencies but display is still crashing. No success so far.

Steps to reproduce this experiment:

cd $(brew --repo tlk/imagemagick-x11)
git pull
git checkout fix_build_error

brew uninstall imagemagick

# uninstall formula dependencies that are no longer needed, fx libxext
brew autoremove    
brew install --debug tlk/imagemagick-x11/imagemagick

/usr/local/bin/display wizard -debug all

# cd $(brew --repo tlk/imagemagick-x11)
# git checkout master
tlk commented 3 years ago

I have tested an older version of the formula that used to install fine but now fails with the same error message ('X11/extensions/XShm.h' file not found).

I am not sure what broke this formula.

Most likely the fix for https://github.com/tlk/homebrew-imagemagick-x11/issues/2 was incomplete (but then why did it work back then?) or perhaps homebrew-core has made breaking changes again?

tlk commented 3 years ago

I noticed over at https://github.com/Homebrew/discussions/discussions that it is possible to disable homebrew auto updates:

echo "export HOMEBREW_NO_AUTO_UPDATE=1" >> ~/.zshrc
tlk commented 3 years ago

I have added some changes and display wizard: should now be back in all its glory.

vfournier commented 3 years ago

Wow. Thanks a lot! I updated using brew upgrade and I can confirm this is now working.