My apologies for posting it here. Glasgow-haskell-users mailing list seems more relevant for this question. So, I am going to send it there instead, with a note about this cross-posting.<br><br><div class="gmail_quote">On Tue, Jan 3, 2012 at 4:26 PM, Sanket Agrawal <span dir="ltr">&lt;<a href="mailto:sanket.agrawal@gmail.com">sanket.agrawal@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5"><div bgcolor="#FFFFFF"><div><br><br><span>I am getting the compilation error below when building GHC 7.0.4 on RHEL5 (x86_64) Ė I configured make to point to ncurses and libgmp. I will appreciated pointers on how to work around the issue below. I donít have root privileges. My apologies
 if this has already been discussed in this forum. I searched for the issue but could find only the GHC bug ticket below.</span></div><div><span><br></span></div><div><span>GHC bug ticket: <a href="http://hackage.haskell.org/trac/ghc/ticket/4374" target="_blank">
http://hackage.haskell.org/trac/ghc/ticket/4374</a></span><span> - it doesnít have description on how to work around the bug.</span></div><div><span><br></span></div><div><span>Compilation error:</span></div><div><span>-----------------------</span></div>
<div><span>$ C_INCLUDE_PATH=/efs/dist/fsf/ncurses/5.6/common/include/ncurses:/home/saagrawa/scripts/misc/libgmp/include LIBRARY_PATH=/efs/dist/fsf/ncurses/5.6/exec/lib:/home/saagrawa/scripts/misc/libgmp/lib make</span></div>
<div><span>===--- updating makefiles phase 0</span></div><div><span>make -r --no-print-directory -f <a href="http://ghc.mk" target="_blank">ghc.mk</a> phase=0 just-makefiles</span></div><div><span>===--- updating makefiles phase 1</span></div>
<div><span>make -r --no-print-directory -f <a href="http://ghc.mk" target="_blank">ghc.mk</a> phase=1 just-makefiles</span><br></div><div><span><br></span></div><div><span>===--- updating makefiles phase 2</span></div><div>
<span>make -r --no-print-directory -f <a href="http://ghc.mk" target="_blank">ghc.mk</a> phase=2 just-makefiles</span></div><div><span>===--- updating makefiles phase 3</span></div><div><span>make -r --no-print-directory -f <a href="http://ghc.mk" target="_blank">ghc.mk</a> phase=3 just-makefiles</span></div>
<div><span>===--- finished updating makefiles</span></div><div><span>make -r --no-print-directory -f <a href="http://ghc.mk" target="_blank">ghc.mk</a> all</span></div><div><span>&quot;inplace/bin/ghc-stage1&quot; libraries/integer-gmp/dist-install/build/GHC/Integer.dyn_o libraries/integer-gmp/dist-install/build/GHC/Integer/GMP/Internals.dyn_o libraries/integer-gmp/dist-install/build/GHC/Integer/Type.dyn_o libraries/integer-gmp/dist-install/build/cbits/gmp-wrappers.dyn_o†
 libraries/integer-gmp/dist-install/build/cbits/cbits.dyn_o††† libraries/integer-gmp/gmp/objs/*.o `/usr/bin/find libraries/integer-gmp/dist-install/build -name &quot;*_stub.dyn_o&quot; -print` -shared -dynamic -dynload deploy -dylib-install-name /home/saagrawa/scripts/misc/ghc/7.0.4/lib/ghc-7.0.4/`basename
 &quot;libraries/integer-gmp/dist-install/build/<a href="http://libHSinteger-gmp-0.2.0.3-ghc7.0.4.so" target="_blank">libHSinteger-gmp-0.2.0.3-ghc7.0.4.so</a>&quot; | sed &#39;s/^libHS//;s/[-]ghc.*//&#39;`/`basename &quot;libraries/integer-gmp/dist-install/build/<a href="http://libHSinteger-gmp-0.2.0.3-ghc7.0.4.so" target="_blank">libHSinteger-gmp-0.2.0.3-ghc7.0.4.so</a>&quot;` -no-auto-link-packages -package ghc-prim-0.2.0.0 -o
 libraries/integer-gmp/dist-install/build/<a href="http://libHSinteger-gmp-0.2.0.3-ghc7.0.4.so" target="_blank">libHSinteger-gmp-0.2.0.3-ghc7.0.4.so</a></span></div><div><span>/efs/dist/fsf/gcc/4.4.3-build004/.exec/x86-64.rhel.5/libexec/gcc/x86_64-unknown-linux-gnu/4.4.3/ld: libraries/integer-gmp/gmp/objs/aors.o: relocation R_X86_64_32 against `__gmpz_sub&#39; can not be used when making a shared object; recompile
 with -fPIC</span></div><div><span>libraries/integer-gmp/gmp/objs/aors.o: could not read symbols: Bad value</span></div><div><span>collect2</span><span>: ld returned 1 exit status</span></div><div><span>make[1]: *** [libraries/integer-gmp/dist-install/build/<a href="http://libHSinteger-gmp-0.2.0.3-ghc7.0.4.so" target="_blank">libHSinteger-gmp-0.2.0.3-ghc7.0.4.so</a>] Error 1</span></div>
<div><span>make: *** [all] Error 2</span></div><div><span><br></span></div><div><span>$ ll /home/saagrawa/scripts/misc/libgmp/lib|awk &#39;{print $9,$10,$11}&#39; ### the libgmp lib folder has dynamic libraries</span></div>
<div><span><u></u><br><u></u></span></div><div><span>libgmp</span><span>.so.3.5.2*</span></div><div><span>libgmp.so.3 -&gt; libgmp.so.3.5.2*</span></div><div><span>libgmp.so -&gt; libgmp.so.3.5.2*</span></div><div><span><a href="http://libgmp.la" target="_blank">libgmp.la</a>*</span></div>
<div><span>libgmp.a</span></div></div></div></div></blockquote></div><br>