Problem installing gcc 4.5 on ubuntu

I tried installing gcc 4.5 on ubuntu 10.04 but could not. Here is a compilation that I don't know how to solve it. Has anyone successfully installed the latest version of gcc on ubuntu? Below are my steps and error message, I would like to know where the problem is ....

Step1: download these files:

gcc-core-4.5.0.tar.gz gcc-g++-4.5.0.tar.gz gmp-4.3.2.tar.bz2 mpc-0.8.1.tar.gz mpfr-2.4.2.tar.gz 

Step2: unzip the files above

Step 3: move gmp, mpc, mpfr to the gcc-4.5.0 / directory.

 mv gmp-4.3.2 gcc-4.5.0/gmp mv mpc-0.8.1 gcc-4.5.0/mpc mv mpfr-2.4.2 gcc-4.5.0/mpfr 

Step4: go to the gcc-4.5.0 directory and configure:

 sudo ./configure 

Step 5: compile and install

 sudo make sudo make install 

The first 4 steps are fine, I can configure it successfully. However, when I try to compile it, an error message appears, I can not understand what the problem is. Should I change the name from "gcc 4.5" to "gcc" ?? It's a little strange that we need to do this ourselves. Is there something I missed during installation?

 xxx@xxx-laptop :/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0$ sudo make [sudo] password for xxx: [ -f stage_final ] || echo stage3 > stage_final /bin/bash: line 2: test: /media/Data/Tool/linux/gcc: binary operator expected /bin/bash: /media/Data/Tool/linux/gcc: No such file or directory make[1]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0' make[2]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0' make[3]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0' rm -f stage_current make[3]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0' make[2]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0' make[2]: Entering directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0' Configuring stage 1 in host-x86_64-unknown-linux-gnu/intl /bin/bash: /media/Data/Tool/linux/gcc: No such file or directory make[2]: *** [configure-stage1-intl] Error 127 make[2]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory `/media/Data/Tool/linux/gcc 4.5/gcc-4.5.0' make: *** [all] Error 2 
+4
source share
1 answer

It may not be a good idea to have a place in your path - this is rare and can easily ruin shell scripts that are not specifically designed to deal with it (which is a bad combination!)

Another potential problem is that you run configure inside the gcc source directory - this is not recommended (and did not work for me at least for one version of gcc 4 ). Instead, create an empty assembly directory parallel to the source directory, so you have something like:

 gcc 4.5 <- but might want to avoid the space gcc-4.5.0 ... build 

Then cd in build and run

 ../gcc-4.5.0/configure 

You may also need to start with a recently unpacked source directory, as a previous failed build may break it.

+4
source

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


All Articles