Software Engineering

Cmake

The following is our general build script for the examples:

 1cmake_minimum_required(VERSION 3.14...3.23)
 2
 3project(
 4        unoapi_dpcpp_examples
 5        VERSION 0.1
 6        DESCRIPTION "oneAPI sample projects with CMake"
 7        LANGUAGES CXX
 8)
 9
10set(CMAKE_CXX_STANDARD 17)
11set(CMAKE_CXX_STANDARD_REQUIRED ON)
12set(CMAKE_CXX_EXTENSIONS OFF)
13
14set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
15
16include(FetchContent)
17
18FetchContent_Declare(
19        fmt
20        GIT_REPOSITORY https://github.com/fmtlib/fmt.git
21        GIT_TAG        8.1.1
22)
23FetchContent_MakeAvailable(fmt)
24
25# Lots of compilation errors without this setting
26option(SPDLOG_FMT_EXTERNAL "Use external fmt library instead of bundled" ON)
27FetchContent_Declare(
28        spdlog
29        GIT_REPOSITORY https://github.com/gabime/spdlog.git
30        GIT_TAG        v1.9.2
31)
32FetchContent_MakeAvailable(spdlog)
33
34FetchContent_Declare(
35        scnlib
36        GIT_REPOSITORY https://github.com/eliaskosunen/scnlib.git
37        GIT_TAG        v1.1.2
38)
39FetchContent_MakeAvailable(scnlib)
40
41FetchContent_Declare(
42        cli11
43        GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git
44        GIT_TAG        v2.1.2
45)
46FetchContent_MakeAvailable(cli11)
47
48FetchContent_Declare(
49        googletest
50        GIT_REPOSITORY https://github.com/google/googletest.git
51        GIT_TAG        release-1.11.0
52)
53FetchContent_MakeAvailable(googletest)
54
55add_subdirectory(integration)
56add_subdirectory(matrix_mul)
57add_subdirectory(montecarlo)
58add_subdirectory(wordcloud)
59add_subdirectory(technical_analysis)

Basic organization of CMake

Variables that affect working with DPC++ tooling

Separating build from source (viewpathed building)

Fetching external dependencies

Important external dependencies for C++ 17, 20, and beyond

Unit Testing with GoogleTest

Continuous Integration

GitHub Actions

GitLab?