<commit_before># Building MAPS.ME

First, do not forget to initialize a cloned repository, see
[CONTRIBUTING.md](CONTRIBUTING.md).

## Desktop

You would need Clang, Boost and Qt 5. With that, just run `omim/tools/unix/build_omim.sh`.
It will build both debug and release versions to `omim/../omim-build-<target>`, as
well as OSRM backend for generating maps. Command-line switches are:

* `-r` to build a release version
* `-d` to build a debug version
* `-o` to build OSRM backend
* `-c` to delete target directories before building

To build a generator tool only, set `CONFIG=gtool` variable. To skip building tests,
use `CONFIG=no-tests`. If you have Qt installed in an unusual directory, use
`QMAKE` variable.

When using a lot of maps, increase open files limit, which is only 256 on Mac OS X.
Use `ulimit -n 2000`, put it into `~/.bash_profile` to apply it to all new sessions.
In OS X to increase this limit globally, add `limit maxfiles 2048 2048` to `/etc/launchd.conf`
and run

    echo 'ulimit -n 2048' | sudo tee -a /etc/profile

### Building Manually

The `build_omim.sh` script basically runs these commands:

    qmake omim.pro -spec linux-clang-libc++ CONFIG+=debug
    make -j <number_of_processes>

It will compile binaries to the `out` subdirectory of the current directory.
You might need to export `BOOST_INCLUDEDIR` variable with a path to Boost's
`include` directory.

To build the OSRM backend, create `omim/3party/osrm/osrm-backend/build`
directory, and from within it, run:

    cmake -DBOOST_ROOT=<where_is_your_Boost> ..
    make

### Ubuntu 14.04

Install Qt 5.5:

    sudo add-apt-repository ppa:beineri/opt-qt55-trusty
    sudo apt-get update
    sudo apt-get install qt55base
    source /opt/qt55/bin/qt55-env.sh

Do a git clone:

    git clone --depth=1 --recursive https://github.com/mapsme/omim.git
    cd omim
    echo | ./configure.sh

Then:

    sudo apt-get install clang-3.5 libc++-dev libboost-iostreams-dev libglu1-mesa-dev
    sudo ln -s /usr/lib/llvm-3.5/bin/clang /usr/bin/clang
    sudo ln -s /usr/lib/llvm-3.5/bin/clang++ /usr/bin/clang++
    tools/unix/build_omim.sh

Prepend with `CONFIG=gtool` if only generator_tool is needed. You would need 1.5 GB of memory
to compile `stats` module.

To build and run OSRM binaries:

    sudo apt-get install libtbb2 libluabind0.9.1 liblua50 libstxxl1
    sudo apt-get install libtbb-dev libluabind-dev libstxxl-dev libosmpbf-dev libprotobuf-dev
    tools/unix/build_omim.sh -o

### Windows

We haven't compiled MAPS.ME on Windows in a long time, though it is possible. It is likely
some make files should be updated. If you succeed, please submit a tutorial.
<commit_msg>PPA required for Ubuntu 14.04 installation.<commit_after># Building MAPS.ME

First, do not forget to initialize a cloned repository, see
[CONTRIBUTING.md](CONTRIBUTING.md).

## Desktop

You would need Clang, Boost and Qt 5. With that, just run `omim/tools/unix/build_omim.sh`.
It will build both debug and release versions to `omim/../omim-build-<target>`, as
well as OSRM backend for generating maps. Command-line switches are:

* `-r` to build a release version
* `-d` to build a debug version
* `-o` to build OSRM backend
* `-c` to delete target directories before building

To build a generator tool only, set `CONFIG=gtool` variable. To skip building tests,
use `CONFIG=no-tests`. If you have Qt installed in an unusual directory, use
`QMAKE` variable.

When using a lot of maps, increase open files limit, which is only 256 on Mac OS X.
Use `ulimit -n 2000`, put it into `~/.bash_profile` to apply it to all new sessions.
In OS X to increase this limit globally, add `limit maxfiles 2048 2048` to `/etc/launchd.conf`
and run

    echo 'ulimit -n 2048' | sudo tee -a /etc/profile

### Building Manually

The `build_omim.sh` script basically runs these commands:

    qmake omim.pro -spec linux-clang-libc++ CONFIG+=debug
    make -j <number_of_processes>

It will compile binaries to the `out` subdirectory of the current directory.
You might need to export `BOOST_INCLUDEDIR` variable with a path to Boost's
`include` directory.

To build the OSRM backend, create `omim/3party/osrm/osrm-backend/build`
directory, and from within it, run:

    cmake -DBOOST_ROOT=<where_is_your_Boost> ..
    make

### Ubuntu 14.04

Install Qt 5.5:

    sudo add-apt-repository ppa:beineri/opt-qt55-trusty
    sudo apt-get update
    sudo apt-get install qt55base
    source /opt/qt55/bin/qt55-env.sh

Do a git clone:

    git clone --depth=1 --recursive https://github.com/mapsme/omim.git
    cd omim
    echo | ./configure.sh

On Ubuntu 14.04, you'll need a PPA with an up-to-date version of libc++.
You shouldn't need this on newer versions.

    sudo add-apt-repository ppa:jhe/llvm-toolchain

Then:

    sudo apt-get install clang-3.5 libc++-dev libboost-iostreams-dev libglu1-mesa-dev
    sudo ln -s /usr/lib/llvm-3.5/bin/clang /usr/bin/clang
    sudo ln -s /usr/lib/llvm-3.5/bin/clang++ /usr/bin/clang++
    tools/unix/build_omim.sh

Prepend with `CONFIG=gtool` if only generator_tool is needed. You would need 1.5 GB of memory
to compile `stats` module.

To build and run OSRM binaries:

    sudo apt-get install libtbb2 libluabind0.9.1 liblua50 libstxxl1
    sudo apt-get install libtbb-dev libluabind-dev libstxxl-dev libosmpbf-dev libprotobuf-dev
    tools/unix/build_omim.sh -o

### Windows

We haven't compiled MAPS.ME on Windows in a long time, though it is possible. It is likely
some make files should be updated. If you succeed, please submit a tutorial.

{'fraction_non_alphanumeric': 0.09436696250679225, 'fraction_numerical': 0.020286180039847855, 'mean_word_length': 3.5336617405582924, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3573077', 'n_tokens_mistral': 1990, 'n_tokens_neox': 1824, 'n_words': 706}