... for Kokkos (or "my-project" for short) is a ...
The best way is to use CMake.
Get the library in your project:
git clone https://github.com/org/my_project.git path/to/my_projectIn your main CMake file:
add_subdirectory(path/to/my_project)
target_link_libraries(
my-lib
PRIVATE
MyProject::my-project
)In your main CMake file:
include(FetchContent)
FetchContent_Declare(
my_project
GIT_REPOSITORY https://github.com/org/my_project.git
GIT_TAG master
)
FetchContent_MakeAvailable(my_project)
target_link_libraries(
my-lib
PRIVATE
MyProject::my-project
)Get, then install the project:
git clone https://github.com/org/my_project.git
cd my_project
cmake -B build -DCMAKE_INSTALL_PREFIX=path/to/install -DCMAKE_BUILD_TYPE=Release # other Kokkos options here if needed
cmake --install buildIn your main CMake file:
find_package(MyProject REQUIRED)
target_link_libraries(
my-lib
PRIVATE
MyProject::my-project
)Alternatively, you can also copy include/my_project in your project and start using it.
You can build tests with the CMake option MY_PROJECT_ENABLE_TESTS, and run them with ctest.
If you don't have a GPU available when compiling with a GPU backend activated, you have to disable the option MY_PROJECT_ENABLE_GTEST_DISCOVER_TESTS.
You can build examples with the CMake option MY_PROJECT_ENABLE_EXAMPLES.
They should be run individually.
Benchmarks are built with the CMake option MY_PROJECT_ENABLE_BENCHMARKS.
They should be run individually.
Benchmarks to monitor compilation time are built with the CMake option MY_PROJECT_ENABLE_COMPILE_BENCHMARKS.
Please refer to the proper documentation for how to use them.
The API documentation is handled by Doxygen (1.9.1 or newer) and is built with the CMake option MY_PROJECT_ENABLE_DOCUMENTATION.
The private API is not included by default and is added with the option MY_PROJECT_ENABLE_DOCUMENTATION_DEVMODE.
The documentation is built with the target docs.
...