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

#648: Cabal incorrectly reports missing C library IL ----------------------------+----------------------------------------------- Reporter: GregoryWeber | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.6.0.1 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Linux | ----------------------------+----------------------------------------------- This problem occurs with Cabal version 1.8.0.2 on Arch Linux (this version number does not appear in the Version selector, so I have left it at 1.6.0.1) 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 flags --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/libILUT.so.1@ /usr/lib/libIL.so.1.1.0* /usr/lib/libILU.so.1.1.0* /usr/lib/libILUT.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

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
#648: Cabal incorrectly reports missing C library IL ----------------------------+----------------------------------------------- Reporter: GregoryWeber | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.6.0.1 Severity: normal | Keywords: Difficulty: unknown | Ghcversion: Platform: Linux | ----------------------------+----------------------------------------------- Comment(by duncan): Replying to [ticket:648 GregoryWeber]: the C compiler's and linker's error messages more carefully. This is correct. We cannot in general interpret the C compilers error messages. They are too varied. We should consult what autoconf does here. It takes the same strategy and does not try to interpret error messages. Perhaps we can just improve the message, to make clear it's only the mostly likely reason, not an absolute conclusion. We should also save the log for users to inspect if they choose. This should make it easier to see what is really going on. See also #532 for other instances of this problem. As you say, although the error message is wrong here, the problem is real. The package does depend on pthread or rt but does not say so. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/648#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage