Compiling GHC 7.2+ on Linux with libc version <2.7

I would like to install GHC 7.2.2 on the Redhat x86_64 (RHEL v5) server Redhat x86_64 (RHEL v5) at work (in my user account. I do not have root access). I downloaded the Linux x86_64 shared binary from the GHC download page. But when I run configure , it throws a glibc version exception for ghc-pwd , since the Linux version of glibc is 2.6. The required version of glibc is 2.7.

I googled around, but did not find any pre-configured GHC binaries for Redhat 5. I would appreciate how to work with the glibc version problem if someone figured it out for RHEL 5 (or any Linux flavor if the workaround is common ) Alternatively, if there are zipped files available somewhere for Redhat x86_64 , I can download and unzip them if you tell me them. Otherwise, it looks like I'm stuck with GHC 6.12 at work.

+6
source share
4 answers

I had a similar problem, so I compile ghc myself. Doing this is nontrivial because you need the new binutils and gcc. But t can be done (everything in the user zone).

+3
source

I built ghc 7.4.1 on the RHEL 5.3 exchange, starting with a binary build of ghc 6.6 or 6.8 (forget which one), which works fine on the platform. I then used this to build ghc 6.12 from the source, and then used 6.12 to build 7.4.1 from the source code. You have to use gcc 4.3 to build 7.4.1, but that's fine, since gcc 4.3 is available on RHEL 5.3.

This is not much work, just enough time to complete all builds.

+4
source

GHC needs a binary GHC available for compilation. There are precompiled GHC binaries, but they were created against new versions of glibc

RHEL 5 has glibc 2.5, so you can use GHC 6.8 and bootstrap. Typically, GHC can boot using $ VERSION-2 or later (the exact version is documented with the initial downloads ).

You will also need a newer version of gcc. @ alex-iliev assumes gcc 4.3 is enough, which is available on RHEL 5. Your alternative is to use Gentoo Prefix to install -date gcc.

Download and install the precompiled 6.8 into the directory:

 wget http://www.haskell.org/ghc/dist/6.8.3/ghc-6.8.3-x86_64-unknown-linux.tar.bz2 bunzip2 ghc-6.8.3-x86_64-unknown-linux.tar.bz2 tar -xf ghc-6.8.3-x86_64-unknown-linux.tar cd ghc-6.8.3 mkdir ~/ghc_bootstrap_6_8 ./configure --prefix=/home/wilfred/ghc_bootstrap_6_8/ make install 

Compilation 6.12:

 wget http://www.haskell.org/ghc/dist/6.12.3/ghc-6.12.3-src.tar.bz2 bunzip2 ghc-6.12.3-src.tar.bz2 tar -xf ghc-6.12.3-src.tar cd ghc-6.12.3 mkdir ~/ghc_bootstrap_6_12 PATH=/home/wilfred/ghc_bootstrap_6_8/bin:$PATH ./configure --prefix=/home/wilfred/ghc_bootstrap_6_12/ make make install 

Compiling 7.2 and 7.6 is the same process as 6.12. Compilation can take several hours, so you can see fast builds (although you need a normal build for the final version of GHC).

If you go down from the root of Gentoo Prefix, just upload your path to GHC 7.2. You can then modify $EPREFIX/usr/portage/eclass/ghc-package.eclass to add the line:

 PATH=/home/wilfred/ghc_bootstrap_7_2/bin:$PATH 

just add ghcbootstrap to your USE flags and:

 emerge --nodeps ghc 
+3
source

Its ghc 6.8 to compile 6.12 from source

0
source

Source: https://habr.com/ru/post/903351/


All Articles