X11 package installation problem..

I wanted to install xmonad; the X11 package however does not build:
runhaskell Setup.hs build Preprocessing library X11-1.2.2... /usr/bin/ld: cannot find -lX11
collect2: ld returned 1 exit status linking Graphics/X11/Types_hsc_make.o failed command was: ghc -lX11 Graphics/X11/Types_hsc_make.o -o Graphics/X11/Types_hsc_make Setup.hs: got error code while preprocessing: Graphics.X11.Types
The buildinfo has this: -- X11.buildinfo. Generated from X11.buildinfo.in by configure. -- System-dependent values used by Distribution.Simple.defaultUserHooks -- buildable: True cc-options: -I/usr/X11R6/include ld-options: -L/usr/X11R6/lib And they seem all right. Can someone please help to get past this? Regards, Madhu Rao

On Sat, Jun 30, 2007 at 08:15:05PM +0530, bgm-rao@ieee.org wrote:
I wanted to install xmonad; the X11 package however does not build:
runhaskell Setup.hs build Preprocessing library X11-1.2.2... /usr/bin/ld: cannot find -lX11
collect2: ld returned 1 exit status linking Graphics/X11/Types_hsc_make.o failed command was: ghc -lX11 Graphics/X11/Types_hsc_make.o -o Graphics/X11/Types_hsc_make Setup.hs: got error code while preprocessing: Graphics.X11.Types
The buildinfo has this: -- X11.buildinfo. Generated from X11.buildinfo.in by configure. -- System-dependent values used by Distribution.Simple.defaultUserHooks -- buildable: True cc-options: -I/usr/X11R6/include ld-options: -L/usr/X11R6/lib
And they seem all right.
Do you actually have the X11 development files installed? If so, what did 'runhaskell Setup.hs configure' say? Stefan

> Do you actually have the X11 development files installed? > If so, what did 'runhaskell Setup.hs configure' say? Sorry for not being clear earlier, but I thought, I was actually trying to install these X11 development files you mention: I first did: ~/xmonad-0.2 <45> runhaskell Setup.lhs configure --prefix=$HOME Configuring xmonad-0.2... configure: /apps/free/ghc/6.6/bin/ghc-pkg configure: Dependency base>=1.0: using base-2.0 Setup.lhs: cannot satisfy dependency X11>=1.2.1 Then, I downloaded the X11-1.2.2 package and that's when I get the link error. Here's the entire transcript: Please let me know if this is what you asked. -Madhu ~/X11-1.2.2 <51> runhaskell Setup.hs configure --prefix=$HOME Configuring X11-1.2.2... configure: /apps/free/ghc/6.6/bin/ghc-pkg configure: Dependency base-any: using base-2.0 configure: Using install prefix: /user/a0875389 configure: Binaries installed in: /user/a0875389/bin configure: Libraries installed in: /user/a0875389/lib/X11-1.2.2/ghc-6.6.20070213 configure: Private binaries installed in: /user/a0875389/libexec configure: Data files installed in: /user/a0875389/share/X11-1.2.2 configure: Using compiler: /apps/free/ghc/6.6/bin/ghc configure: Compiler flavor: GHC configure: Compiler version: 6.6.20070213 configure: Using package tool: /apps/free/ghc/6.6/bin/ghc-pkg configure: Using ar found on system at: /usr/bin/ar configure: No haddock found configure: No pfesetup found configure: Using ranlib found on system at: /usr/bin/ranlib configure: Using runghc found on system at: /apps/free/ghc/6.6/bin/runghc configure: No runhugs found configure: No happy found configure: No alex found configure: Using hsc2hs: /apps/free/ghc/6.6/bin/hsc2hs configure: No c2hs found configure: No cpphs found configure: No greencard found checking for gcc... gcc 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 gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking how to run the C preprocessor... gcc -E checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include checking whether -R must be followed by a space... neither works checking for gethostbyname... yes checking for connect... yes checking for remove... yes checking for shmat... yes checking for IceConnectionNumber in -lICE... yes configure: creating ./config.status config.status: creating config.mk config.status: creating X11.buildinfo config.status: creating include/HsX11Config.h config.status: include/HsX11Config.h is unchanged ~/X11-1.2.2 <52> runhaskell Setup.hs build Preprocessing library X11-1.2.2... /usr/bin/ld: cannot find -lX11 collect2: ld returned 1 exit status linking Graphics/X11/Types_hsc_make.o failed command was: ghc -lX11 Graphics/X11/Types_hsc_make.o -o Graphics/X11/Types_hsc_make Setup.hs: got error code while preprocessing: Graphics.X11.Types

On Sat, Jun 30, 2007 at 08:59:36PM +0530, bgm-rao@ieee.org wrote:
> Do you actually have the X11 development files installed? > If so, what did 'runhaskell Setup.hs configure' say?
Sorry for not being clear earlier, but I thought, I was actually trying to install these X11 development files you mention:
I first did:
~/xmonad-0.2 <45> runhaskell Setup.lhs configure --prefix=$HOME Configuring xmonad-0.2... configure: /apps/free/ghc/6.6/bin/ghc-pkg configure: Dependency base>=1.0: using base-2.0 Setup.lhs: cannot satisfy dependency X11>=1.2.1
Then, I downloaded the X11-1.2.2 package and that's when I get the link error.
Here's the entire transcript: Please let me know if this is what you asked.
Yup, it's what I wanted. If autoconf can find Xlib but ghc can't, this is almost certainly a GHC bug... (be sure to include your system information, those paths are pretty unusual) http://hackage.haskell.org/trac/ghc/newticket?type=bug Stefan

> Yup, it's what I wanted. If autoconf can find Xlib but ghc can't, > this is almost certainly a GHC bug... (be sure to include your system > information, those paths are pretty unusual) > http://hackage.haskell.org/trac/ghc/newticket?type=bug Stefan, Thanks for the help. I did manage to build X11 and the X11-extras package. I removed the extra libs from cabal and aliased ghc to ghc -LX11. The problem seems to be with the lower case "-l" that the compiler was passed due to extra libs. The installation happened all right. Now, however, I have another problem during xmonad build; presumably these is related to the work-around I figured? ~/xmonad-0.2 <216> runhaskell Setup.lhs build Preprocessing executables for xmonad-0.2... Building xmonad-0.2... [3 of 6] Compiling Config[boot] ( Config.hs-boot, nothing ) Linking dist/build/xmonad/xmonad ... /user/a0875389/X11-extras-0.2/lib/X11-extras-0.2/ghc-6.6.20070213/libHSX11-extras-0.2.a(Extras.o)(.text+0x139c7): In function `X11zmextraszm0zi2_GraphicsziX11ziXlibziExtras_zdwccall_info': : undefined reference to `XConfigureWindow' /user/a0875389/X11-extras-0.2/lib/X11-extras-0.2/ghc-6.6.20070213/libHSX11-extras-0.2.a(Extras.o)(.text+0x13adb): In function `X11zmextraszm0zi2_GraphicsziX11ziXlibziExtras_zdwccall1_info': : undefined reference to `XKillClient' /user/a0875389/X11-extras-0.2/lib/X11-extras-0.2/ghc-6.6.20070213/libHSX11-extras-0.2.a(Extras.o)(.text+0x13b9f): In function `X11zmextraszm0zi2_GraphicsziX11ziXlibziExtras_zdwccall2_info': : undefined reference to `XFree' -Madhu Rao

On Sat, Jun 30, 2007 at 11:08:23PM +0530, bgm-rao@ieee.org wrote:
> Yup, it's what I wanted. If autoconf can find Xlib but ghc can't, > this is almost certainly a GHC bug... (be sure to include your system > information, those paths are pretty unusual)
> http://hackage.haskell.org/trac/ghc/newticket?type=bug
Stefan, Thanks for the help. I did manage to build X11 and the X11-extras package. I removed the extra libs from cabal and aliased ghc to ghc -LX11. The problem seems to be with the lower case "-l" that the compiler was passed due to extra libs. The installation happened all right.
Now, however, I have another problem during xmonad build; presumably these is related to the work-around I figured?
~/xmonad-0.2 <216> runhaskell Setup.lhs build Preprocessing executables for xmonad-0.2... Building xmonad-0.2... [3 of 6] Compiling Config[boot] ( Config.hs-boot, nothing ) Linking dist/build/xmonad/xmonad ... /user/a0875389/X11-extras-0.2/lib/X11-extras-0.2/ghc-6.6.20070213/libHSX11-extras-0.2.a(Extras.o)(.text+0x139c7): In function `X11zmextraszm0zi2_GraphicsziX11ziXlibziExtras_zdwccall_info': : undefined reference to `XConfigureWindow' /user/a0875389/X11-extras-0.2/lib/X11-extras-0.2/ghc-6.6.20070213/libHSX11-extras-0.2.a(Extras.o)(.text+0x13adb): In function `X11zmextraszm0zi2_GraphicsziX11ziXlibziExtras_zdwccall1_info': : undefined reference to `XKillClient' /user/a0875389/X11-extras-0.2/lib/X11-extras-0.2/ghc-6.6.20070213/libHSX11-extras-0.2.a(Extras.o)(.text+0x13b9f): In function `X11zmextraszm0zi2_GraphicsziX11ziXlibziExtras_zdwccall2_info': : undefined reference to `XFree'
Your workaround is completely false. -LX11 adds a nonexistant directory to the library search path, and as such does absolutely nothing. Since the library X11 is not selected, it cannot find the X11 functions! Library linking under Unix is quite lazy, and the missing dependancies are not found until xmonad is linked. GHC is apparently unable to use the path found by autoconf; try adding -L/usr/X11R6/lib to the Ghc-options. (after putting -lX11 back in and unaliasing ghc). If this doesn't work, file a bug. Stefan

On Sat, 30 Jun 2007 20:15:05 +0530
I wanted to install xmonad; the X11 package however does not build:
runhaskell Setup.hs build Preprocessing library X11-1.2.2... /usr/bin/ld: cannot find -lX11
collect2: ld returned 1 exit status linking Graphics/X11/Types_hsc_make.o failed command was: ghc -lX11 Graphics/X11/Types_hsc_make.o -o Graphics/X11/Types_hsc_make Setup.hs: got error code while preprocessing: Graphics.X11.Types
The buildinfo has this: -- X11.buildinfo. Generated from X11.buildinfo.in by configure. -- System-dependent values used by Distribution.Simple.defaultUserHooks -- buildable: True cc-options: -I/usr/X11R6/include ld-options: -L/usr/X11R6/lib
And they seem all right.
Can someone please help to get past this?
Regards, Madhu Rao
See http://xmonad.org/faq.html#x11 . Locate libX11.so on your system and add the path to extra-lib-dirs.
participants (3)
-
bgm-rao@ieee.org
-
Spencer Janssen
-
Stefan O'Rear