Issue #8 resolved
repo owner created an issue

This is to discuss how to build issues of CamlImages in OSX

A recommended way to tes compilation of CamlImages today is:

  • OCaml 4.00.1 or higher
  • OPAM 1.1.0-beta
  1. opam add repo test
  2. opam info camlimages and check it contains version: 4.1.1
  3. opam install --verbose camlimages.4.1.1
  4. Yell me here if things go wrong

One more thing:

  1. Do not forget opam remove repo test once you get bored.

Comments (11)

  1. Yoshifumi YAMAGUCHI

    Build test on Mac OS X 10.8.5 was conducted and operation log during it is as follows:

    $ gcc --version
    i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
    $ make --version
    GNU Make 3.81
    $ ocaml -version
    The OCaml toplevel, version 4.02.0+dev2-2013-09-12
    $ opam --version
    $ opam repo add test
    $ opam info camlimages
                 package: camlimages
                 version: 4.1.1
              repository: test
           upstream-kind: http
    $ opam install --verbose camlimages.4.1.1
    ocamlfind: [WARNING] You have installed DLLs but the directory /Users/yoshifumi/.opam/system/lib/stublibs is not mentioned in ld.conf
    Installing camlimages.4.1.1.

    It seems camlimages installation succeeded but it would be great if you have any sample programs to build for camlimages linking test.

  2. camlspotter reporter

    Thanks, can I see the part of configuration? It should be look like:

    --- C libraries
    libgif:   true
    libpng:   true
    libjpeg:  true
    libexif:  true
    libtiff:  true
    libxpm:   true
    libz:     true
    --- Subpackages
    gif:      true (-lgif)
    png:      true (-I/usr/include/libpng12 -lpng12)
    jpeg:     true (-ljpeg)
    exif:     true (-I/usr/include/libexif -lexif)
    tiff:     true (-ltiff)
    xpm:      true (-lXpm -lX11)
    freetype: true (/usr/bin/freetype-config) (-I/usr/include/freetype2 -L/usr/lib/i386-linux-gnu -lfreetype -lz)
    ps:       true (/usr/bin/gs)
    rgb.txt:  true (/etc/X11 /usr/share/X11)
    lablgtk2: true
    graphics: true
    --- Summary

    You can rebuild the thing by opam reinstall --verbose camlimages.4.1.1. Thanks!

  3. camlspotter reporter

    hmmm, there is no easy way to build a test program.

    There is one way:

    $ opam reinstall --verbose --keep-build-dir camlimages.4.1.1
    $ cd $HOME/.opam/system/build/camlimages.4.1.1      # system can be 4.00.1 or 4.01.0
    $ ls test examples/*

    There should be several execs available in test and examples directory. Which files are available is depending on which library the build could find.

  4. Yoshifumi YAMAGUCHI

    Regarding to configuration, here it is:

    --- Configuring
    wordsize  8
    --- C libraries
    libgif:   false
    libpng:   true
    libjpeg:  false
    libexif:  false
    libtiff:  true
    libxpm:   false
    libz:     true
    --- Subpackages
    gif:      false ()
    png:      true (-I/opt/local/include/libpng15 -L/opt/local/lib -lpng15)
    jpeg:     false ()
    exif:     false ()
    tiff:     true (-L/opt/local/lib -ltiff)
    xpm:      false ()
    freetype: true (/opt/local/bin/freetype-config) (-I/opt/local/include/freetype2 -I/opt/local/include -L/opt/local/lib -lfreetype -lz -lbz2)
    ps:       false (false)
    rgb.txt:  false (/etc/X11 /usr/share/X11)
    lablgtk2: false
    graphics: true
    --- Summary
    supported subpackages: png tiff graphics freetype
    supported formats:     png tiff
    supported non-formats: graphics freetype

    It look my env is lacking some libraries for gif and jpeg...

  5. camlspotter reporter

    Thanks! I got build failure report around libtiff + OSX but you could build the latest version with libtiff! This is a very good news.

    Do you have gif and jpeg development library installed? If so, could you tell me the places of the followings?

    • jpeglib.h libjpeg.*
    • gif_lib.h libgif.*
  6. Yoshifumi YAMAGUCHI

    Since I'm using MacPorts, those files are under /opt/local/include/ and /opt/local/lib/ respectively. In concrete:

    • /opt/local/include/jpeglib.h
    • /opt/local/include/gif_lib.h
    • /opt/local/lib/libjpeg.9.dylib
    • /opt/local/lib/libjpeg.a
    • /opt/local/lib/libjpeg.dylib
    • /opt/local/lib/
    • /opt/local/lib/libgif.4.dylib
    • /opt/local/lib/libgif.a
    • /opt/local/lib/libgif.dylib
    • /opt/local/lib/
  7. Log in to comment