Can Run Emacs But Can't Compile Org-Mode After Upgrading ImageMagick With Solution

Today on my box I upgraded ImageMagick and now I can’t compile Org-Mode but I can run Emacs. Here is what I did to make Org-Mode build again on my box.

Every day I update Org-Mode from Git and rebuild it with

cd ~/src/org-mode/ && git ls-remote && make update

Today it failed with the error

make[1]: Nothing to be done for `all'.
rm -f org-version.el org-loaddefs.el org-version.elc org-loaddefs.elc org-install.elc
org-version: 9.0.9 (release_9.0.9-654-g421421)
dyld: Library not loaded: /usr/local/opt/imagemagick@6/lib/libMagickWand-6.Q16.4.dylib
  Referenced from: /usr/local/Cellar/emacs-plus/25.2/Emacs.app/Contents/MacOS/Emacs
  Reason: image not found
make[1]: *** [org-version.el] Trace/BPT trap: 5
make: *** [all] Error 2

Figured that can’t be related to Org-Mode though I saw today after updating brew that a new ImageMagick got installed so I rebuilt Emacs (it takes minutes) because maybe it had to do with the new ImageMagick library

brew remove emacs-mac
brew install emacs-mac \
     --with-dbus \
     --with-gnutls \
     --with-imagemagick \
     --with-modules \
     --with-natural-title-bar \
     --with-official-icon \
     --with-xml2

But the error didn’t go away so this time I read the error message and started searching the Internet to find out if it is normal for the directory to change and found this discussion that confirms that it it is normal for the directory to change so just like author of the post did I found it

sudo find / -name "libMagickWand-6.Q16.4.dylib" -print
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/usr/local/Cellar/imagemagick@6/6.9.8-10/lib/libMagickWand-6.Q16.4.dylib
/usr/local/Cellar/imagemagick@6/6.9.8-3/lib/libMagickWand-6.Q16.4.dylib
/usr/local/Cellar/imagemagick@6/6.9.8-4/lib/libMagickWand-6.Q16.4.dylib
/usr/local/Cellar/imagemagick@6/6.9.8-5/lib/libMagickWand-6.Q16.4.dylib
/usr/local/Cellar/imagemagick@6/6.9.8-6/lib/libMagickWand-6.Q16.4.dylib
/usr/local/Cellar/imagemagick@6/6.9.8-8/lib/libMagickWand-6.Q16.4.dylib

And linked it

ln -s /usr/local/Cellar/imagemagick@6/6.9.8-10/lib/libMagickWand-6.Q16.4.dylib /usr/local/opt/imagemagick@6/lib/libMagickWand-6.Q16.4.dylib

Then when I rebuild Org-Mode I got another error

dyld: Library not loaded: /usr/local/opt/imagemagick@6/lib/libMagickCore-6.Q16.4.dylib
Referenced from: /usr/local/Cellar/emacs-plus/25.2/Emacs.app/Contents/MacOS/Emacs
Reason: image not found

So I’ll keep linking them until it works

ln -s /usr/local/Cellar/imagemagick@6/6.9.8-10/lib/libMagickCore-6.Q16.4.dylib /usr/local/opt/imagemagick@6/lib/libMagickCore-6.Q16.4.dylib

That is all it took. Now it builds for me.

Leave a Reply

Your email address will not be published. Required fields are marked *