0

Possible Duplicate:
How do I install gcc-4.3?

How can I compile (or just install) gcc 4.3.4 on my Ubuntu 11.10 ?

I've tried to download and compile it with these instructions: http://whowhywhathow.blogspot.com/2011/01/compile-gcc-from-souce-on-ubuntu-10041.html

But it just end up with an error during the compilation:

http://pastebin.ca/2092965

Hope someone here can help me

2
  • You are going to compile gcc with flags to add libraries that are giving faults or are not existent. Did you download GMP and MPFR as said on the other site? Are they inside the gcc source code folder? Are you sure they are not inside a different or extra folder? Nov 8, 2011 at 12:33
  • 1
    Note: It is not recommend practice to re-compile software with a gcc version other than the one that the code was developed and tested on. Some instances (wrap code with MATLAB for '.mex' files, OLDER driver code, cross-compilers, etc.) may cause subtle errors.
    – david6
    Dec 3, 2011 at 2:37

4 Answers 4

1

I think this should install everything you need, and a few other bits besides.

apt-get build-dep gcc-4.6

You might find that some of the tools are too new to build gcc 4.3 though (autoconf, automake, perhaps?) but I doubt there's any packages for that old stuff anyway.

2
  • 1
    Note: It is not recommend practice to re-compile software with a gcc version other than the one that the code was developed and tested on. Some instances (wrap code with MATLAB for '.mex' files, OLDER driver code, cross-compilers, etc.) may cause subtle errors.
    – david6
    Dec 3, 2011 at 2:36
  • @david6 So just say so. What's with the downvote? Did my answer not solve the specific question that was asked? Martin is permitted to build whatever he likes, and he's permitted to ask for help installing the dependencies. Ok, +1 for finding the duplicate question, but don't punish me for not being psychic.
    – ams
    Dec 3, 2011 at 9:47
0

Hey GCC requires a number of other softwares for installation such as bison etc. First please make sure if you got got all the required softwares pre installed.

2
  • How do I do that? I installed the "build-essential", but that's more or less it. Nov 8, 2011 at 9:44
  • That's exactly what my answer takes care of ... albeit there's no specific option for 4.3, so I had to suggest 4.6.
    – ams
    Dec 3, 2011 at 9:41
0

There is definitely no need to use gcc-4.3.

Of course you always get the warning message during mex-files creating:

Warning: You are using gcc version "4.6.x.x)". The version currently supported with MEX is "4.3.4". For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release/

but this is a warning - the MEX function will still compile!!!

The only thing to change is new link on libc.so.6 library

So for 64 bit: Remove old link

sudo rm /lib64/libc.so.6

(Be careful when removing the old link. It is essential for Linux to boot. So if you reboot before replacing the link with the new version then it'll be time to dig out a live disk. If you're paranoid then you can copy libc.so.6 to something like libc.so.6.backup first

cp /lib64/libc.so.6 /lib64/libc.so.6.backup

Replace with new link

sudo ln -s /lib/x86_64-linux-gnu/libc-2.13.so /lib64/libc.so.6

For 32 bit: (I have not tested this as I only run x64 systems, but from the comments I think it should work)

Remove old link (again be careful with this command)

sudo rm /lib32/libc.so.6

Replace with new link

sudo ln -s /lib/i386-linux-gnu/libc-2.13.so /lib/libc.so.6

Of course if this is a fresh Ubuntu install then you probably wont need the rm (remove) command.

0

The relevant error is ../../.././mpfr/src/mulders.c:208:3: error: unknown type name 'gmp_pi1_t'. I'd guess you don't have the GMP development libraries installed.

Why do you need gcc 4.3.4 again? Anyway, the simplest thing to do would be to download Ubuntu sources for 4.3.4 (if necessary from an earlier version of Ubuntu) and rebuild on your system, making sure you have the build dependencies installed first, naturally. This should be straightforward to do.

I can add more details if you need them.

Not the answer you're looking for? Browse other questions tagged .