How can I install gcc6.4, g++6.4 and cmake3 on Ubuntu 14.04? I want to rewrite below lines that run on Linux to be run on Ubuntu
$ yum install gcc64-c++ libcurl-devel
$ export CC=gcc64
$ export CXX=g++64
$ yum install cmake3
I tried below commands on ubuntu
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt update
$ sudo apt install -y g++-6
$ sudo apt install -y gcc-6
$ gcc --version
$ g++ --version
$ export CC=gcc6
$ export CXX=g++6
$ gcc --version
$ g++ --version
But version returned is
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4
and
g++ (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4
Although I expect to be 6.4
And when I tried to install cmake3
$ sudo apt-get update
$ sudo apt purge cmake*
$ wget http://www.cmake.org/files/v3.5/cmake-3.5.1.tar.gz
$ tar xf cmake-3.5.1.tar.gz
$ cd cmake-3.5.1
$ ./configure
$ make
$ sudo make install
$ cmake --version
It gave me an error in ./configure
CMake 3.5.1, Copyright 2000-2016 Kitware, Inc.
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C compiler on this system.
Please specify one using environment variable CC.
sudo apt install g++
– Elias Apr 10 '19 at 23:09gcc-6
andg++-6
and you should be able to run these commands (gcc-6
andg++-6
literally). The system-default version wasn’t replaced as you might have expected. Related: https://askubuntu.com/questions/26498/how-to-choose-the-default-gcc-and-g-version BTW, a terminology notice: “lines that run on Linux to be run on Ubuntu” Ubuntu is Linux, too. – Melebius Apr 11 '19 at 07:38cmake3
using APT on Ubuntu 14.04. – Melebius Apr 11 '19 at 09:03export CC=gcc6
andexport CXX=g++6
should beexport CC=gcc-6
andexport CXX=g++-6
(check the actual names usingls /usr/bin/gcc*
) – steeldriver Apr 11 '19 at 11:16sudo apt install cmake3
to get CMake 3.5.1. – Melebius Apr 11 '19 at 11:30