A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://kokkos.github.io/kokkos-core-wiki/get-started/building-from-source.html below:

Building From Source - Kokkos documentation

Toggle table of contents sidebar

Building From Source Getting the Kokkos Source Code

This section describes how to obtain the Kokkos source code. We recommend downloading a tagged release for most users, as these releases undergo extensive testing and are generally more stable. Development versions are also available for advanced users who need the latest features and are comfortable with potentially less stable code.

Downloading a Release Archive (Recommended)

The recommended approach for most users is to download a release archive from GitHub.

  1. Find the Latest Release: Go to the Kokkos releases page and find the latest release (or a specific version you need).

  2. Download the Archive and Checksum: Download both the kokkos-X.Y.Z.tar.gz archive and the corresponding kokkos-X.Y.Z-SHA-256.txt checksum file. It’s crucial to verify the integrity of the downloaded archive using the checksum.

  3. Verify the Archive Integrity (Important): Use the following commands (adjust the version number as needed) to verify the downloaded archive:

    export KOKKOS_VERSION=4.5.01  # Replace with the actual version
    export KOKKOS_DOWNLOAD_URL=https://github.com/kokkos/kokkos/releases/download/${KOKKOS_VERSION}
    curl -sLO ${KOKKOS_DOWNLOAD_URL}/kokkos-${KOKKOS_VERSION}.tar.gz
    curl -sLO ${KOKKOS_DOWNLOAD_URL}/kokkos-${KOKKOS_VERSION}-SHA-256.txt
    grep kokkos-${KOKKOS_VERSION}.tar.gz kokkos-${KOKKOS_VERSION}-SHA-256.txt | shasum -c
    

    The output should be kokkos-4.5.01.tar.gz: OK (or similar, depending on the version). If the checksum doesn’t match, do not use the downloaded archive as it may be corrupted or tampered with.

  4. Extract the Archive: Once you’ve verified the checksum, extract the archive:

    tar -xzvf kokkos-${KOKKOS_VERSION}.tar.gz
    
Cloning the Git Repository (For Development Versions)

If you need the latest features or want to contribute to Kokkos, you can clone the Git repository.

  1. Clone the Repository:

    git clone https://github.com/kokkos/kokkos.git
    

    This will clone the repository into a directory named kokkos.

  2. Check Out a Release Tag (Recommended for Development): While the develop branch is generally kept stable, it’s still under active development. For more predictable behavior, check out a specific release tag:

    cd kokkos
    git checkout 4.5.01  # Replace with the desired version tag
    

    To see available tags:

    Or, to stay on the bleeding edge (use with caution):

Which Method Should I Use?

No matter which method you choose, always verify the integrity of the downloaded source code. This is a crucial security practice.

Configuring and Building Kokkos

This section describes how to configure and build Kokkos. We assume you are in the root directory of the Kokkos source code (or the project embedding Kokkos).

Configuring Kokkos

Use the following command to configure Kokkos:

cmake -B builddir [<options...>]

-B builddir creates a builddir directory named build (you can choose a different name if you prefer). Kokkos requires out-of-source builds. The [<options...>] part is where you specify the configuration options.

Common CMake Options

These options are generally useful for any CMake project:

Important Kokkos-specific options:

Example Configuration

cmake -B builddir \
    -DCMAKE_CXX_COMPILER=g++ \
    -DCMAKE_BUILD_TYPE=Release \
    -DKokkos_ENABLE_OPENMP=ON \
    -DKokkos_ARCH_NATIVE=ON \
    -DKokkos_ENABLE_DEPRECATED_CODE_4=OFF
Building Kokkos

After configuring, build Kokkos using:

This compiles Kokkos. You can add -j<N> to use multiple cores for faster compilation (replace <N> with the number of cores).

Example: cmake --build builddir -j8

Installing Kokkos

To install Kokkos (header files and libraries), use:

cmake --install builddir [--prefix <prefix>]

The --prefix <prefix> option specifies the installation directory. If omitted, Kokkos will be installed to a default location, often /usr/local (not recommended).

Optional: Testing your Kokkos Build

To verify your Kokkos build and ensure everything is working as expected, you can configure and run the internal test suite.

To do this, configure with -DKokkos_ENABLE_TESTS=ON, build, and then run the tests with:

ctest --test-dir builddir --output-on-failure
Advanced: Configuring Against the Build Directory

(For experts only) You can configure your project directly against the <builddir>/cmake_packages/ directory in the out-of-tree build, similar to using an install tree. This can be useful for development purposes.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4