[erlang-questions] Erlang doesn't like ubuntu 6.10
Romain Lenglet
rlenglet@REDACTED
Mon Nov 13 14:46:03 CET 2006
Daniel Luna wrote:
> I've had similar problems when upgrading to 6.10. The problem
> went away after downgrading gcc to 4.0.
>
> gcc --version
> gcc-4.1 (GCC) 4.1.2 20060928 (prerelease) (Ubuntu
> 4.1.1-13ubuntu5)
>
> # Don't worry it's just a symlink
> sudo rm /usr/bin/gcc
> sudo ln -s gcc-4.0 /usr/bin/gcc
You should NEVER modify package-managed directories and files by
hand!
Let's do it the right way. There are several cases.
1) If you have a problem with GCC 4.0 only when compiling Erlang,
then you don't need to modify your system.
In that case, as in any case, you can always specify the C
compiler as an argument to ./configure scripts generated using
GNU Autoconf:
./configure CC=/usr/bin/gcc-4.0 ...
It can also be set in the environment:
CC=/usr/bin/gcc-4.0 ./configure ...
Cf. Autoconf's AC_PROG_CC macro, which is used also by
Erlang/OTP.
2) You have problems with most of the software that you compile.
Therefore, you want to make GCC 4.0 the default, instead of GCC
4.1.
2.1) In that case, either you use /usr/bin/cc instead
of /usr/bin/gcc, and make profit from the fact that /usr/bin/cc
is already an alternative:
sudo update-alternatives --install \
/usr/bin/cc cc /usr/bin/gcc-4.0 100
sudo update-alternatives --set cc /usr/bin/gcc-4.0
And force ./configure to use /usr/bin/cc as the C compiler:
./configure CC=/usr/bin/cc
2.2) Or you can divert /usr/bin/gcc, and make it a new
alternative:
sudo dpkg-divert --divert /usr/bin/gcc-default \
--rename --add /usr/bin/gcc
sudo update-alternatives --install \
/usr/bin/gcc gcc /usr/bin/gcc-4.0 100
sudo update-alternatives --set gcc /usr/bin/gcc-4.0
And then let ./configure detect and use /usr/bin/gcc.
> gcc --version
> gcc (GCC) 4.0.4 20060630 (prerelease) (Ubuntu 4.0.3-4)
>
>
> You may have to install gcc-4.0. Not sure whether it's part of
> the normal install.
>
> HTH
>
> /Luna
--
Romain LENGLET
Pr. Chiba Shigeru Group
Dept. of Mathematical and Computing Sciences
Tokyo Institute of Technology
More information about the erlang-questions
mailing list