Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Issue installing imagemagick on Mountain Lion (missing fontconfig due to missing freetype) #13638

Closed
johnhutch opened this issue Jul 27, 2012 · 5 comments

Comments

@johnhutch
Copy link

I'm running a newly installed Mountain Lion and decided to switch from MacPorts to brew. I (believe) I removed everything having anything to do with Macports, installed XCode 4.4, installed XQuartz 2.7.2, and everything seems to be running smoothly with brew:

~/ $ brew doctor
Your system is raring to brew.

And I've got a few kegs in the cellar already:

~/ $ brew list
gettext jasper jpeg libgpg-error libksba libtiff libxml2 libxslt little-cms pkg-config

However, when installing imagemagick, everything goes to hell. I get the same result with and without the -without-x flag.

    ~/ $ brew install imagemagick
    ==> Downloading http://downloads.sf.net/project/machomebrew/mirror/ImageMagick-6.7.7-6.tar.bz2
    Already downloaded: /Library/Caches/Homebrew/imagemagick-6.7.7-6.tar.bz2
    ==> Patching
    patching file configure
    Hunk #1 succeeded at 32371 (offset 447 lines).
    ==> ./configure --disable-osx-universal-binary --without-perl --prefix=/usr/local/Cellar/imagemagick/6.7.7-6 --enable-shared --disable-static --with-modules --without-gslib --without-magick-plus-plus
    ==> make install
    /bin/sh ./config/mkinstalldirs . ltdl/
    cp ./ltdl/argz_.h ltdl/argz.h-t
    mv ltdl/argz.h-t ltdl/argz.h
    make  install-am
    CC     ltdl/argz.lo
    CC     coders/coders_aai_la-aai.lo
    CC     magick/magick_libMagickCore_la-accelerate.lo
    CC     magick/magick_libMagickCore_la-animate.lo
    CC     magick/magick_libMagickCore_la-annotate.lo
    CC     magick/magick_libMagickCore_la-artifact.lo
    CC     magick/magick_libMagickCore_la-attribute.lo
    CC     magick/magick_libMagickCore_la-blob.lo
    CC     magick/magick_libMagickCore_la-cache.lo
    CC     magick/magick_libMagickCore_la-cache-view.lo
    CC     magick/magick_libMagickCore_la-cipher.lo
    CC     magick/magick_libMagickCore_la-client.lo
    CC     magick/magick_libMagickCore_la-coder.lo
    CC     magick/magick_libMagickCore_la-color.lo
    CC     magick/magick_libMagickCore_la-colormap.lo
    CC     magick/magick_libMagickCore_la-colorspace.lo
    CC     magick/magick_libMagickCore_la-compare.lo
    CC     magick/magick_libMagickCore_la-composite.lo
    CC     magick/magick_libMagickCore_la-compress.lo
    CC     magick/magick_libMagickCore_la-configure.lo
    CC     magick/magick_libMagickCore_la-constitute.lo
    CC     magick/magick_libMagickCore_la-decorate.lo
    CC     magick/magick_libMagickCore_la-delegate.lo
    CC     magick/magick_libMagickCore_la-deprecate.lo
    CC     magick/magick_libMagickCore_la-display.lo
    CC     magick/magick_libMagickCore_la-distort.lo
    CC     magick/magick_libMagickCore_la-draw.lo
    CC     magick/magick_libMagickCore_la-effect.lo
    CC     magick/magick_libMagickCore_la-enhance.lo
    CC     magick/magick_libMagickCore_la-exception.lo
    CC     magick/magick_libMagickCore_la-feature.lo
    CC     magick/magick_libMagickCore_la-fourier.lo
    CC     magick/magick_libMagickCore_la-fx.lo
    CC     magick/magick_libMagickCore_la-gem.lo
    CC     magick/magick_libMagickCore_la-geometry.lo
    CC     magick/magick_libMagickCore_la-hashmap.lo
    CC     magick/magick_libMagickCore_la-histogram.lo
    CC     magick/magick_libMagickCore_la-identify.lo
    CC     magick/magick_libMagickCore_la-image.lo
    CC     magick/magick_libMagickCore_la-image-view.lo
    CC     magick/magick_libMagickCore_la-layer.lo
    CC     magick/magick_libMagickCore_la-list.lo
    CC     magick/magick_libMagickCore_la-locale.lo
    CC     magick/magick_libMagickCore_la-log.lo
    CC     magick/magick_libMagickCore_la-magic.lo
    CC     magick/magick_libMagickCore_la-magick.lo
    CC     magick/magick_libMagickCore_la-matrix.lo
    CC     magick/magick_libMagickCore_la-memory.lo
    CC     magick/magick_libMagickCore_la-mime.lo
    CC     magick/magick_libMagickCore_la-module.lo
    CC     magick/magick_libMagickCore_la-monitor.lo
    CC     magick/magick_libMagickCore_la-montage.lo
    CC     magick/magick_libMagickCore_la-morphology.lo
    CC     magick/magick_libMagickCore_la-option.lo
    CC     magick/magick_libMagickCore_la-paint.lo
    CC     magick/magick_libMagickCore_la-pixel.lo
    CC     magick/magick_libMagickCore_la-policy.lo
    CC     magick/magick_libMagickCore_la-PreRvIcccm.lo
    CC     magick/magick_libMagickCore_la-prepress.lo
    CC     magick/magick_libMagickCore_la-property.lo
    CC     magick/magick_libMagickCore_la-profile.lo
    CC     magick/magick_libMagickCore_la-quantize.lo
    CC     magick/magick_libMagickCore_la-quantum.lo
    CC     magick/magick_libMagickCore_la-quantum-export.lo
    CC     magick/magick_libMagickCore_la-quantum-import.lo
    CC     magick/magick_libMagickCore_la-random.lo
    CC     magick/magick_libMagickCore_la-registry.lo
    CC     magick/magick_libMagickCore_la-resample.lo
    CC     magick/magick_libMagickCore_la-resize.lo
    CC     magick/magick_libMagickCore_la-resource.lo
    CC     magick/magick_libMagickCore_la-segment.lo
    CC     magick/magick_libMagickCore_la-semaphore.lo
    CC     magick/magick_libMagickCore_la-shear.lo
    CC     magick/magick_libMagickCore_la-signature.lo
    CC     magick/magick_libMagickCore_la-splay-tree.lo
    CC     magick/magick_libMagickCore_la-static.lo
    CC     magick/magick_libMagickCore_la-statistic.lo
    CC     magick/magick_libMagickCore_la-stream.lo
    CC     magick/magick_libMagickCore_la-string.lo
    CC     magick/magick_libMagickCore_la-thread.lo
    CC     magick/magick_libMagickCore_la-timer.lo
    CC     magick/magick_libMagickCore_la-token.lo
    CC     magick/magick_libMagickCore_la-transform.lo
    CC     magick/magick_libMagickCore_la-threshold.lo
    CC     magick/magick_libMagickCore_la-type.lo
    CC     magick/magick_libMagickCore_la-utility.lo
    CC     magick/magick_libMagickCore_la-version.lo
    magick/type.c:62:11: fatal error: 'fontconfig/fontconfig.h' file not found
    # include "fontconfig/fontconfig.h"
            ^
    1 error generated.
    make[1]: *** [magick/magick_libMagickCore_la-type.lo] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make: *** [install] Error 2
    config.log was copied to /Users/johnhutch/Library/Logs/Homebrew
    ==> Build Environment
    HOMEBREW_VERSION: 0.9.2
    HEAD: 94cb77d22c04ff4bd7e7f6cc54b2cd54494271a0
    CPU: 8-core 64-bit nehalem
    OS X: 10.8-x86_64
    Xcode: 4.4
    CLT: 4.4.0.0.1.1249367152
    X11: 2.7.2 @ /opt/X11
    CC: /usr/bin/clang
    CXX: /usr/bin/clang++ => /usr/bin/clang
    LD: /usr/bin/clang
    CFLAGS: -Os -w -pipe -march=native -Xclang -target-feature -Xclang -aes -Qunused-arguments -mmacosx-version-min=10.8
    CXXFLAGS: -Os -w -pipe -march=native -Xclang -target-feature -Xclang -aes -Qunused-arguments -mmacosx-version-min=10.8
    CPPFLAGS: -I/usr/local/Cellar/gettext/0.18.1.1/include -isystem /usr/local/include -I/opt/X11/include
    CMAKE_PREFIX_PATH: /opt/X11:/opt/X11
    LDFLAGS: -L/usr/local/Cellar/gettext/0.18.1.1/lib -L/usr/local/lib -L/opt/X11/lib
    MACOSX_DEPLOYMENT_TARGET: 10.8
    MAKEFLAGS: -j8
    PKG_CONFIG_PATH: /opt/X11/share/pkgconfig:/opt/X11/lib/pkgconfig
    Error: Failed executing: make install (imagemagick.rb:137)
    These existing issues may help you:
        https://github.com/mxcl/homebrew/issues/13618
    Otherwise, this may help you fix or report the issue:
        https://github.com/mxcl/homebrew/wiki/bug-fixing-checklist

So I try to install fontconfig:

    ~/ $ brew install fontconfig
    ==> Downloading http://fontconfig.org/release/fontconfig-2.8.0.tar.gz
    Already downloaded: /Library/Caches/Homebrew/fontconfig-2.8.0.tar.gz
    ==> ./configure --prefix=/usr/local/Cellar/fontconfig/2.8.0
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... ./install-sh -c -d
    checking for gawk... no
    checking for mawk... no
    checking for nawk... no
    checking for awk... awk
    checking whether make sets $(MAKE)... yes
    checking whether to enable maintainer-specific portions of Makefiles... no
    checking for gcc... /usr/bin/clang
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables... 
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether /usr/bin/clang accepts -g... yes
    checking for /usr/bin/clang option to accept ISO C89... none needed
    checking for style of include used by make... GNU
    checking dependency style of /usr/bin/clang... none
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether ln -s works... yes
    checking build system type... i386-apple-darwin12.0.0
    checking host system type... i386-apple-darwin12.0.0
    checking for a sed that does not truncate output... /usr/bin/sed
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for fgrep... /usr/bin/grep -F
    checking for ld used by /usr/bin/clang... /usr/bin/clang
    checking if the linker (/usr/bin/clang) is GNU ld... no
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
    checking the name lister (/usr/bin/nm) interface... BSD nm
    checking the maximum length of command line arguments... 196608
    checking whether the shell understands some XSI constructs... yes
    checking whether the shell understands "+="... yes
    checking for /usr/bin/clang option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for ar... ar
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /usr/bin/nm output from /usr/bin/clang object... ok
    checking for dsymutil... dsymutil
    checking for nmedit... nmedit
    checking for lipo... lipo
    checking for otool... otool
    checking for otool64... no
    checking for -single_module linker flag... yes
    checking for -exported_symbols_list linker flag... yes
    checking how to run the C preprocessor... /usr/bin/clang -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if /usr/bin/clang supports -fno-rtti -fno-exceptions... yes
    checking for /usr/bin/clang option to produce PIC... -fno-common -DPIC
    checking if /usr/bin/clang PIC flag -fno-common -DPIC works... yes
    checking if /usr/bin/clang static flag -static works... no
    checking if /usr/bin/clang supports -c -o file.o... yes
    checking if /usr/bin/clang supports -c -o file.o... (cached) yes
    checking whether the /usr/bin/clang linker (/usr/bin/clang) supports shared libraries... yes
    checking dynamic linker characteristics... darwin12.0.0 dyld
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    checking for bash... /bin/bash
    checking if dolt supports this host... no, falling back to libtool
    checking whether make sets $(MAKE)... (cached) yes
    checking for a C compiler for build tools... /usr/bin/clang
    checking for suffix of executable build tools... 
    checking for dirent.h that defines DIR... yes
    checking for library containing opendir... none required
    checking for ANSI C header files... (cached) yes
    checking fcntl.h usability... yes
    checking fcntl.h presence... yes
    checking for fcntl.h... yes
    checking for stdlib.h... (cached) yes
    checking for string.h... (cached) yes
    checking for unistd.h... (cached) yes
    checking for an ANSI C-conforming const... yes
    checking for inline... inline
    checking for pid_t... yes
    checking for vprintf... yes
    checking for _doprnt... no
    checking for stdlib.h... (cached) yes
    checking for unistd.h... (cached) yes
    checking for getpagesize... yes
    checking for working mmap... yes
    checking for geteuid... yes
    checking for getuid... yes
    checking for link... yes
    checking for memmove... yes
    checking for memset... yes
    checking for mkstemp... yes
    checking for strchr... yes
    checking for strrchr... yes
    checking for strtol... yes
    checking for getopt... yes
    checking for getopt_long... yes
    checking for sysconf... yes
    checking for ftruncate... yes
    checking for chsize... no
    checking for rand... yes
    checking for random... yes
    checking for lrand48... yes
    checking for a usable iconv... libiconv
    checking for freetype-config... no
    configure: error: You must have freetype installed; see http://www.freetype.org/
    config.log was copied to /Users/johnhutch/Library/Logs/Homebrew
    ==> Build Environment
    HOMEBREW_VERSION: 0.9.2
    HEAD: 94cb77d22c04ff4bd7e7f6cc54b2cd54494271a0
    CPU: 8-core 64-bit nehalem
    OS X: 10.8-x86_64
    Xcode: 4.4
    CLT: 4.4.0.0.1.1249367152
    X11: 2.7.2 @ /opt/X11
    CC: /usr/bin/clang
    CXX: /usr/bin/clang++ => /usr/bin/clang
    LD: /usr/bin/clang
    CFLAGS: -Os -w -pipe -march=native -Xclang -target-feature -Xclang -aes -Qunused-arguments -mmacosx-version-min=10.8
    CXXFLAGS: -Os -w -pipe -march=native -Xclang -target-feature -Xclang -aes -Qunused-arguments -mmacosx-version-min=10.8
    CPPFLAGS: -I/usr/local/Cellar/gettext/0.18.1.1/include -isystem /usr/local/include -I/opt/X11/include
    CMAKE_PREFIX_PATH: /opt/X11:/opt/X11
    LDFLAGS: -L/usr/local/Cellar/gettext/0.18.1.1/lib -L/usr/local/lib -L/opt/X11/lib
    MACOSX_DEPLOYMENT_TARGET: 10.8
    MAKEFLAGS: -j8
    PKG_CONFIG_PATH: /opt/X11/share/pkgconfig:/opt/X11/lib/pkgconfig
    Error: Failed executing: ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/fontconfig/2.8.0 (fontconfig.rb:15)
    This may help you fix or report the issue if `brew doctor` does not:
        https://github.com/mxcl/homebrew/wiki/bug-fixing-checklist
    We saved the configure log:
        ~/Library/Logs/Homebrew/config.log
    When you report the issue please paste the config.log here:
        http://gist.github.com/

Which leads me to trying to install freetype:

~/ $ brew install freetype
Error: No available formula for freetype
Apple distributes freetype with OS X, you can find it in /usr/X11/lib.
However not all build scripts look here, so you may need to call ENV.x11
in your formula's install function.

But freetype exists right where it's supposed to be:

~/ $ ls /usr/X11/lib/ | grep free
libfreetype.6.dylib
libfreetype.dylib

Sooooo, I'm not sure what "call ENV.x11" means, but I suspect maybe that's the key? I can't seem to find anything on google about what that means, though. Any help would be much appreciated. Thanks!

@johnhutch
Copy link
Author

So, after some research and on a whim, I tried adding ENV.x11 to /usr/local/Library/Formula/fontconfig.rb:

 14   def install
 15     ENV.x11
 16     system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
 17     system "make install"
 18   end

....Still no dice. Refuses to see freetype.

@dvydra
Copy link

dvydra commented Aug 1, 2012

I could not get imagemagick to compile using clang.

I got it working installing the apple-gcc42 package from homebrew/dupes:

brew tap homebrew/dupes
brew install apple-gcc42

Then exporting CC:

export CC=`which gcc-4.2`

And finally installing imagemagick

brew install imagemagick

@MikeMcQuaid
Copy link
Member

I'm working on this in #13784.

@MikeMcQuaid
Copy link
Member

Should be fixed now.

@johnhutch
Copy link
Author

Beautiful, thank you much!

Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Aug 13, 2012
fgeller pushed a commit to fgeller/homebrew that referenced this issue Aug 22, 2012
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants