Dear all,
I wrote this from several posts:
http://www.trevorpounds.com/blog/?p=111
http://whowhywhathow.blogspot.com/20...ntu-10041.html
http://misspent.wordpress.com/2011/0...natty-narwhal/
Code:
sudo apt-get install g++ ia32-libs libc6-dev-i386 m4 flex bison libmpfr-dev libmpc-dev
- Obtain and untar gcc-4.2.3
Code:
wget ftp://ftp.uvsq.fr/pub/gcc/releases/gcc-4.2.3/gcc-4.2.3.tar.gz
tar -xvf gcc-4.2.3.tar.gz
- Obtain and untar gmp-5.0.2
Code:
wget ftp://ftp.gmplib.org/pub/gmp-5.0.2/gmp-5.0.2.tar.gz
tar -xvf gmp-5.0.2.tar.gz
mkdir gcc-4.2.3/gmp
mv gmp-5.0.2 gcc-4.2.3/gmp
- Obtain and untar mpfr-3.0.1
Code:
wget http://www.mpfr.org/mpfr-current/mpfr-3.0.1.tar.gz
tar -xvf mpfr-3.0.1.tar.gz
mkdir gcc-4.2.3/mpfr
mv mpfr-3.0.1 gcc-4.2.3/mpfr
- Modify a file to make multilib looking for the correct libs
Code:
cd gcc-4.2.3
sed 's/MULTILIB_OSDIRNAMES = \.\.\/lib64 \.\.\/lib/MULTILIB_OSDIRNAMES = ..\/lib ..\/lib32/g' ./gcc/config/i386/t-linux64 > ./gcc/config/i386/t-linux64_2
mv ./gcc/config/i386/t-linux64_2 ./gcc/config/i386/t-linux64
- Create directory for compiled gcc :
Code:
mkdir ../gcc
cd ../gcc
Code:
../gcc-4.2.3/configure --program-suffix=-4.2 --enable-threads --enable-languages=c,c++ --enable-bootstrap --with-gmp=../gcc-4.2.3/gmp --with-mpfr=../gcc-4.2.3/mpfr
It may be necessary to change the --host option if you are on a mac or other...
- Make using 2 cores (update depending on yours)
I just tried it on a Ubuntu 11.04 64bits fresh install so it should work !
- To get newer versions of GCC to work with matlab just do the following:
Code:
cd /dir/to/matlab/folder/sys/os/glnxa64 # change glnxa64 to glnx86 for 32 bits
sudo mkdir old
sudo mv libstdc++.* libg2c.* libgcc_s* old
export LD_LIBRARY_PATH=/usr/lib32:/usr/lib:$LD_LIBRARY_PATH
Hope this helps,
Rufus
Bookmarks