Added script for build environment preparation [#METRIQA-1369].

This commit is contained in:
Alexey Milovidov 2017-07-26 09:21:01 +03:00
parent 7744b24658
commit 9a1207be87
4 changed files with 38 additions and 3 deletions

View File

@ -18,7 +18,7 @@ Install Git and CMake
.. code-block:: bash
sudo apt-get install git cmake
sudo apt-get install git cmake3
Detect number of threads

View File

@ -18,7 +18,7 @@ Install Git and CMake
.. code-block:: bash
sudo apt-get install git cmake
sudo apt-get install git cmake3
Detect number of threads

View File

@ -8,7 +8,7 @@ BRANCH=trunk
THREADS=$(grep -c ^processor /proc/cpuinfo)
cd ~
sudo apt-get install subversion
sudo apt-get install -y subversion cmake3
mkdir llvm
cd llvm
svn co "http://llvm.org/svn/llvm-project/llvm/${BRANCH}" llvm

View File

@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -e
sudo apt-get install -y curl
VERSION=$(curl -sSL https://ftpmirror.gnu.org/gcc/ | grep -oE 'gcc-[0-9]+(\.[0-9]+)+' | sort -Vr | head -n1) #'
#VERSION=gcc-7.1.0
VERSION_SHORT=$(echo "$VERSION" | grep -oE '[0-9]')
echo "Will download ${VERSION} (short version: $VERSION_SHORT)."
THREADS=$(grep -c ^processor /proc/cpuinfo)
cd ~
wget https://ftpmirror.gnu.org/gcc/${VERSION}/${VERSION}.tar.bz2
tar xf ${VERSION}.tar.bz2
cd ${VERSION}
./contrib/download_prerequisites
cd ..
mkdir gcc-build
cd gcc-build
../${VERSION}/configure --enable-languages=c,c++
make -j $THREADS
sudo make install
sudo ln -s /usr/local/bin/gcc /usr/local/bin/gcc-${VERSION_SHORT}
sudo ln -s /usr/local/bin/g++ /usr/local/bin/g++-${VERSION_SHORT}
sudo ln -s /usr/local/bin/gcc /usr/local/bin/cc
sudo ln -s /usr/local/bin/g++ /usr/local/bin/c++
hash gcc g++
gcc --version