[Hackage] #648: Cabal incorrectly reports missing C library IL

Hackage trac at galois.com
Fri Mar 26 16:51:40 EDT 2010

#648: Cabal incorrectly reports missing C library IL
  Reporter:  GregoryWeber   |        Owner:         
      Type:  defect         |       Status:  new    
  Priority:  normal         |    Milestone:         
 Component:  Cabal library  |      Version:
  Severity:  normal         |     Keywords:         
Difficulty:  unknown        |   Ghcversion:         
  Platform:  Linux          |  
 This problem occurs with Cabal version on Arch Linux
 (this version number does not appear in the Version selector, so I have
 left it at and ghc version 6.12.1.

 Trying to install Codec-Image-DevIL, either version 0.1 or 0.2.0, 'runghc
 Setup configure' produces a misleading error message:

 $ runghc Setup configure

 Configuring Codec-Image-DevIL-0.2.0...
 Setup: Missing dependency on a foreign library:
 * Missing C library: IL
 This problem can usually be solved by installing the system package that
 provides this library (you may need the "-dev" version). If the library is
 already installed but in a non-standard location then you can use the
 --extra-include-dirs= and --extra-lib-dirs= to specify where it is.

 The error message "Missing C library: IL" is incorrect:
 the Arch 'devil' package
 is installed, and the include and library files are present in
 the normal locations:

 $ pacman -Q devil

 devil 1.7.8-6

 $ ls /usr/include/IL

 devil_cpp_wrapper.hpp  il.h  ilu.h  ilu_region.h  ilut.h

 $ ls /usr/lib/*IL*

 /usr/lib/libIL.a          /usr/lib/libILU.a          /usr/lib/libILUT.a
 /usr/lib/libIL.so@        /usr/lib/libILU.so@        /usr/lib/libILUT.so@
 /usr/lib/libIL.so.1@      /usr/lib/libILU.so.1@
 /usr/lib/libIL.so.1.1.0*  /usr/lib/libILU.so.1.1.0*

 There does seem to be an error in Codec-Image-DevIL.cabal: where it says

      Extra-Libraries: IL

 it should say any of the following (take your choice, all of them work):

      Extra-Libraries: IL, pthread

      Extra-Libraries: IL, rt

      Extra-Libraries: IL, pthread, rt

 It seems that using the IL library in a C program requires linking with
 -lrt or -pthread in addition to -lIL.

 I have the impression that in the
 configuration step, when Cabal sees the line

 Extra-Libraries: IL

 it writes a small C program that tries to include that library,
 and reports the library is missing if there's an error
 in compiling and linking the C program.  Maybe Cabal needs to interpret
 the C compiler's and linker's error messages more carefully.

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/648>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list