<commit_before># Installation
Binary packages can be found [here](../../releases).
### On Ubuntu
Download the Debian package and run `sudo dpkg -i hipacc_<version>_amd64.deb`.
### On Windows
Download and run the installer `Hipacc-<version>-win64.exe`.


# Run Samples
### On Ubuntu
Open a terminal and run:
```bash
cp -r /usr/local/hipacc/samples .
cd samples/1_Local_Operators/Box_Blur
# Compile and run
make
# Compile and run for CUDA
make cuda
```
### On Windows
###### With Visual Studio 2015 and 2017
Navigate to sample directory `%HIPACC_PATH%\samples\1_Local_Operators\Box_Blur`,
open the project `sample.vcxproj`, and run build.

###### With Visual C++ Build Tools 2015
To run the samples without Visual Studio, install the latest **Windows SDK** and
**VC++ 2015 toolset** provided by
[Build Tools for Visual Studio 2017](https://aka.ms/buildtools).
Open PowerShell and run:
```PowerShell
cp -r "$Env:HIPACC_PATH\samples" .
cd .\samples\1_Local_Operators\Box_Blur
# Compile and run
.\make.bat
# Compile and run for CUDA
.\make.bat cuda
```


# Build from Source
To build Hipacc from source, either the development packages of **Clang/LLVM**
and **libc++** are required, or the corresponding components from Clang/LLVM
have to be manually installed.

### Get the Sources
The revision to checkout `<rev>` can be found in
[dependencies.sh](dependencies.sh). In the following, all sources are cloned to
directory `<SRC>`:

```bash
cd <SRC>

# Get Hipacc
git clone https://github.com/hipacc/hipacc.git

# Get libc++
git clone --branch <rev> http://llvm.org/git/libcxx.git

# Get LLVM
git clone --branch <rev> http://llvm.org/git/llvm.git

# Get Clang
cd <SRC>/llvm/tools
git clone --branch <rev> http://llvm.org/git/clang.git

# Apply patches if present
cd <SRC>/llvm/tools/clang
git apply <SRC>/hipacc/patches/clang-<rev>.patch
```

### Compile the Sources
The build system of Hipacc uses **CMake** (3.1 or later) and requires
installation to an absolute path. To configure Hipacc, call `cmake` in the
root directory. A working installation of Clang/LLVM (and Polly) is required.
The `llvm-config` tool will be used to determine the configuration for Hipacc
and must be present in the environment.

The following variables can be set to configure the Hipacc installation:

Variable               | Meaning
-----------------------|----------------------------------------------------
`CMAKE_BUILD_TYPE`     | Build type (`Debug` or `Release`)
`CMAKE_INSTALL_PREFIX` | Installation prefix (this must be an absolute path)

For OpenCL, the installation location can be specified:

Variable         | Meaning
-----------------|-----------------------------------------------------
`OpenCL_INC_DIR` | OpenCL include path (e.g. `/usr/local/cuda/include`)
`OpenCL_LIB_DIR` | OpenCL library path (e.g. `/usr/lib64`)

The following options can be enabled or disabled:

Variable           | Meaning
-------------------|----------------------------------------------------------------------
`USE_POLLY`        | Use Polly for kernel analysis (e.g. `-DUSE_POLLY=ON`)
`USE_JIT_ESTIMATE` | Use JIT compilation to get resource estimates (unavailable for macOS)

In the following, all binaries will be installed to `<DST>`.
<commit_msg>Older versions (<2.7) do not have git remote get-url, which yields error during installation.<commit_after># Installation
Binary packages can be found [here](../../releases).
### On Ubuntu
Download the Debian package and run `sudo dpkg -i hipacc_<version>_amd64.deb`.
### On Windows
Download and run the installer `Hipacc-<version>-win64.exe`.


# Run Samples
### On Ubuntu
Open a terminal and run:
```bash
cp -r /usr/local/hipacc/samples .
cd samples/1_Local_Operators/Box_Blur
# Compile and run
make
# Compile and run for CUDA
make cuda
```
### On Windows
###### With Visual Studio 2015 and 2017
Navigate to sample directory `%HIPACC_PATH%\samples\1_Local_Operators\Box_Blur`,
open the project `sample.vcxproj`, and run build.

###### With Visual C++ Build Tools 2015
To run the samples without Visual Studio, install the latest **Windows SDK** and
**VC++ 2015 toolset** provided by
[Build Tools for Visual Studio 2017](https://aka.ms/buildtools).
Open PowerShell and run:
```PowerShell
cp -r "$Env:HIPACC_PATH\samples" .
cd .\samples\1_Local_Operators\Box_Blur
# Compile and run
.\make.bat
# Compile and run for CUDA
.\make.bat cuda
```


# Build from Source
To build Hipacc from source, either the development packages of **Clang/LLVM**
and **libc++** are required, or the corresponding components from Clang/LLVM
have to be manually installed.

### Get the Sources
The revision to checkout `<rev>` can be found in
[dependencies.sh](dependencies.sh). In the following, all sources are cloned to
directory `<SRC>`:

```bash
cd <SRC>

# Get Hipacc
git clone https://github.com/hipacc/hipacc.git

# Get libc++
git clone --branch <rev> http://llvm.org/git/libcxx.git

# Get LLVM
git clone --branch <rev> http://llvm.org/git/llvm.git

# Get Clang
cd <SRC>/llvm/tools
git clone --branch <rev> http://llvm.org/git/clang.git

# Apply patches if present
cd <SRC>/llvm/tools/clang
git apply <SRC>/hipacc/patches/clang-<rev>.patch
```

### Compile the Sources
The build system of Hipacc uses **CMake** (3.1 or later), **Git** (2.7 or later),
and requires installation to an absolute path. To configure Hipacc, call `cmake`
in the root directory. A working installation of Clang/LLVM (and Polly) is 
required. The `llvm-config` tool will be used to determine the configuration for
Hipacc and must be present in the environment.

The following variables can be set to configure the Hipacc installation:

Variable               | Meaning
-----------------------|----------------------------------------------------
`CMAKE_BUILD_TYPE`     | Build type (`Debug` or `Release`)
`CMAKE_INSTALL_PREFIX` | Installation prefix (this must be an absolute path)

For OpenCL, the installation location can be specified:

Variable         | Meaning
-----------------|-----------------------------------------------------
`OpenCL_INC_DIR` | OpenCL include path (e.g. `/usr/local/cuda/include`)
`OpenCL_LIB_DIR` | OpenCL library path (e.g. `/usr/lib64`)

The following options can be enabled or disabled:

Variable           | Meaning
-------------------|----------------------------------------------------------------------
`USE_POLLY`        | Use Polly for kernel analysis (e.g. `-DUSE_POLLY=ON`)
`USE_JIT_ESTIMATE` | Use JIT compilation to get resource estimates (unavailable for macOS)

In the following, all binaries will be installed to `<DST>`.

{'fraction_non_alphanumeric': 0.17643467643467645, 'fraction_numerical': 0.010073260073260074, 'mean_word_length': 2.99816961561928, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 29, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, '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': '3243843', 'n_tokens_mistral': 2034, 'n_tokens_neox': 1862, 'n_words': 743}