<commit_before>***********************************************
Ubuntu 12.04 LTS (Precise) / 14.04 LTS (Trusty)
***********************************************

Install the prerequisites::

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install --no-install-recommends lsb-core python-software-properties wget
    sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
    wget -q -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -

    # Ubuntu 12.04 LTS (Precise)
    sudo add-apt-repository -y "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.7 main"
    sudo add-apt-repository -y ppa:kalakris/cmake

    # Ubuntu 14.04 LTS (Trusty)
    sudo add-apt-repository -y "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main"

    sudo apt-get update
    sudo apt-get install --no-install-recommends autoconf automake bison \
      ccache clang-3.7 cmake default-jdk doxygen flex freeglut3-dev \
      g++-multilib g++-4.9-multilib gfortran gfortran-4.9 git graphviz \
      libgtk2.0-dev libhtml-form-perl libjpeg-dev libmpfr-dev libwww-perl \
      libpng-dev libqt4-dev libqt4-opengl-dev libterm-readkey-perl libtool \
      libvtk-java libvtk5-dev libvtk5-qt4-dev make mpich2 perl pkg-config \
      python-dev python-gtk2 python-numpy python-pip python-vtk subversion \
      swig valgrind

    # Ubuntu 14.04 LTS (Trusty)
    sudo apt-get install cmake-curses-gui

    sudo pip install -U cpplint Sphinx

Download the external dependencies::

    cd drake-distro
    env CXX=g++-4.9 CC=gcc-4.9 make options
    # Use the GUI to choose which externals you want, then press 'c' twice to configure, then 'g' to generate makefiles and exit.
    env CXX=g++-4.9 CC=gcc-4.9 make download-all

The version of the standard C++ libraries that are shipped with the Linux distribution of MATLAB is severely outdated and can cause problems when running mex files that are built against a newer version of the standard.  The typical error message in this case reports "Invalid MEX-Files"

To work around this issue, the symbolic link for the standard C++ library provided by MATLAB must be redirected to point to a more up-to-date version.

Update the symbolic link in MATLAB to point to the version that was installed earlier into ``/usr/lib``.  An example for MATLAB R2015b is shown below::

    cd /usr/local/MATLAB/R2015b/sys/os/glnxa64
    sudo rm libstdc++.so.6
    sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.so libstdc++.so.6

You may wish to use `ccache` to speed up your (re)builds.
To do so, add `/usr/lib/ccache` to the front of your `$PATH`.

When you are done with these platform-specific steps, return to :doc:`from_source` to complete and test your installation.

Note that when you run drake commands from now on (including the
ones in the linked instructions, such as `make` or `make test`),
you must always precede them with
`env CXX=g++-4.9 CC=gcc-4.9 PATH=/usr/lib/ccache:$PATH`,
just like you did in the the `make options` step above).<commit_msg>Remove straggling ccache PATH reference.<commit_after>***********************************************
Ubuntu 12.04 LTS (Precise) / 14.04 LTS (Trusty)
***********************************************

Install the prerequisites::

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install --no-install-recommends lsb-core python-software-properties wget
    sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
    wget -q -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -

    # Ubuntu 12.04 LTS (Precise)
    sudo add-apt-repository -y "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.7 main"
    sudo add-apt-repository -y ppa:kalakris/cmake

    # Ubuntu 14.04 LTS (Trusty)
    sudo add-apt-repository -y "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main"

    sudo apt-get update
    sudo apt-get install --no-install-recommends autoconf automake bison \
      ccache clang-3.7 cmake default-jdk doxygen flex freeglut3-dev \
      g++-multilib g++-4.9-multilib gfortran gfortran-4.9 git graphviz \
      libgtk2.0-dev libhtml-form-perl libjpeg-dev libmpfr-dev libwww-perl \
      libpng-dev libqt4-dev libqt4-opengl-dev libterm-readkey-perl libtool \
      libvtk-java libvtk5-dev libvtk5-qt4-dev make mpich2 perl pkg-config \
      python-dev python-gtk2 python-numpy python-pip python-vtk subversion \
      swig valgrind

    # Ubuntu 14.04 LTS (Trusty)
    sudo apt-get install cmake-curses-gui

    sudo pip install -U cpplint Sphinx

Download the external dependencies::

    cd drake-distro
    env CXX=g++-4.9 CC=gcc-4.9 make options
    # Use the GUI to choose which externals you want, then press 'c' twice to configure, then 'g' to generate makefiles and exit.
    env CXX=g++-4.9 CC=gcc-4.9 make download-all

The version of the standard C++ libraries that are shipped with the Linux distribution of MATLAB is severely outdated and can cause problems when running mex files that are built against a newer version of the standard.  The typical error message in this case reports "Invalid MEX-Files"

To work around this issue, the symbolic link for the standard C++ library provided by MATLAB must be redirected to point to a more up-to-date version.

Update the symbolic link in MATLAB to point to the version that was installed earlier into ``/usr/lib``.  An example for MATLAB R2015b is shown below::

    cd /usr/local/MATLAB/R2015b/sys/os/glnxa64
    sudo rm libstdc++.so.6
    sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.so libstdc++.so.6

You may wish to use `ccache` to speed up your (re)builds.
To do so, add `/usr/lib/ccache` to the front of your `$PATH`.

When you are done with these platform-specific steps, return to :doc:`from_source` to complete and test your installation.

Note that when you run drake commands from now on (including the
ones in the linked instructions, such as `make` or `make test`),
you must always precede them with `env CXX=g++-4.9 CC=gcc-4.9`,
just like you did in the the `make options` step above).
{'fraction_non_alphanumeric': 0.12115702479338843, 'fraction_numerical': 0.023140495867768594, 'mean_word_length': 3.403930131004367, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5483033', 'n_tokens_mistral': 2123, 'n_tokens_neox': 1934, 'n_words': 706}