Skip to content

Commit c8a2fe7

Browse files
Merge pull request #463 from qubic/develop (Release v1.249.0)
Release v1.249.0
2 parents ba8e9bb + 5b94dc8 commit c8a2fe7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+5159
-476
lines changed

CMakeLists.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14)
1+
cmake_minimum_required(VERSION 3.15)
22
project(qubic CXX)
33

44
# Set C++ standard
@@ -11,6 +11,7 @@ include(CompilerSetup)
1111

1212
# Build options
1313
option(BUILD_TESTS "Build the test suite" ON)
14+
option(BUILD_BENCHMARK "Build the EFI benchmark application" OFF)
1415
option(BUILD_EFI "Build the EFI application" ON)
1516
option(USE_SANITIZER "Build test with sanitizer support (clang only)" ON)
1617

@@ -24,27 +25,33 @@ endif()
2425
# Always include platform_common as it's needed for both application and tests
2526
add_subdirectory(lib/platform_common)
2627

27-
if(BUILD_EFI OR BUILD_TESTS)
28+
if(BUILD_EFI OR BUILD_BENCHMARK)
2829
add_subdirectory(lib/platform_efi)
2930
endif()
3031

3132
# Build the tests first. On fail, the build will fail completely
3233
if(BUILD_TESTS)
33-
message(STATUS "Building test suite")
34+
message(STATUS "--- Test suite ---")
3435
enable_testing()
3536
add_subdirectory(lib/platform_os)
36-
37+
3738
# If we're not building the application, we still need src for tests
3839
# but don't make it a default target
3940
if(NOT BUILD_EFI)
4041
add_subdirectory(src EXCLUDE_FROM_ALL)
4142
endif()
42-
43+
4344
add_subdirectory(test)
4445
endif()
4546

4647
# Build the application if requested
4748
if(BUILD_EFI)
48-
message(STATUS "Building EFI application")
49+
message(STATUS "--- EFI Core application ---")
4950
add_subdirectory(src)
5051
endif()
52+
53+
# Add the UEFI m256i benchmark
54+
if(BUILD_BENCHMARK)
55+
message(STATUS "-- EFI Benchmark ---")
56+
add_subdirectory(benchmark_uefi)
57+
endif()

Qubic.sln

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "platform_efi", "lib\platfor
1616
EndProject
1717
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "platform_os", "lib\platform_os\platform_os.vcxproj", "{88B4CDA8-8248-44D0-848E-0E938A2AAD6D}"
1818
EndProject
19+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "benchmark", "benchmark_uefi\benchmark.vcxproj", "{AD7B4795-A54D-631F-A159-B0324B09BE5E}"
20+
EndProject
1921
Global
2022
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2123
Debug|x64 = Debug|x64
@@ -53,6 +55,12 @@ Global
5355
{88B4CDA8-8248-44D0-848E-0E938A2AAD6D}.Release|x64.Build.0 = Release|x64
5456
{88B4CDA8-8248-44D0-848E-0E938A2AAD6D}.ReleaseAVX512|x64.ActiveCfg = Release|x64
5557
{88B4CDA8-8248-44D0-848E-0E938A2AAD6D}.ReleaseAVX512|x64.Build.0 = Release|x64
58+
{AD7B4795-A54D-631F-A159-B0324B09BE5E}.Debug|x64.ActiveCfg = Debug|x64
59+
{AD7B4795-A54D-631F-A159-B0324B09BE5E}.Debug|x64.Build.0 = Debug|x64
60+
{AD7B4795-A54D-631F-A159-B0324B09BE5E}.Release|x64.ActiveCfg = Release|x64
61+
{AD7B4795-A54D-631F-A159-B0324B09BE5E}.Release|x64.Build.0 = Release|x64
62+
{AD7B4795-A54D-631F-A159-B0324B09BE5E}.ReleaseAVX512|x64.ActiveCfg = ReleaseAVX512|x64
63+
{AD7B4795-A54D-631F-A159-B0324B09BE5E}.ReleaseAVX512|x64.Build.0 = ReleaseAVX512|x64
5664
EndGlobalSection
5765
GlobalSection(SolutionProperties) = preSolution
5866
HideSolutionNode = FALSE

README_CLANG.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ For a example compilation execute the following commands:
5151
* **Values:** `ON`, `OFF`
5252
* **Meaning:** `ON` builds the EFI file, `OFF` skips building EFI file. Currently this build is not working.
5353

54+
* **`-D BUILD_BENCHMARK=<ON|OFF>`**
55+
* **Values:** `ON`, `OFF`
56+
* **Meaning:** `ON` builds a EFI file that allows to run a benchmark directly in the uefi. `OFF` skips building this EFI Benchmark.
57+
5458
* **`-D CMAKE_BUILD_TYPE=<Type>`**
5559
* **Values:** `Debug`, `Release`, `RelWithDebInfo`, `MinSizeRel`
5660
* **Meaning:** Sets the build mode for optimization and debug info (e.g., `Debug` for debugging, `Release` for performance).
@@ -59,6 +63,10 @@ For a example compilation execute the following commands:
5963
* **Values:** `ON`, `OFF`
6064
* **Meaning:** `ON` enables code using AVX-512 CPU instructions (requires support), `OFF` disables it.
6165

66+
* **`-D USE_SANITIZER=<ON|OFF>`**
67+
* **Values:** `ON`, `OFF`
68+
* **Meaning:** `ON` enables linking to santizers when building with clang, `OFF` disables sanitizers.
69+
6270
4. **Build the Project:**
6371
Use the CMake `--build` command to invoke the underlying build tool (like `make` or `ninja`).
6472

@@ -85,9 +93,9 @@ Current state of the working tests:
8593
| Contract qVault | `contract_qvault.cpp` | Pending |
8694
| Contract qX | `contract_qx.cpp` | Pending |
8795
| KangarooTwelve | `kangaroo_twelve.cpp` | Pending |
88-
| M256 | `m256.cpp` | Pending |
96+
| M256 | `m256.cpp` | **Working** |
8997
| Math Lib | `math_lib.cpp` | **Working** |
90-
| Network Messages | `network_messages.cpp` | Pending |
98+
| Network Messages | `network_messages.cpp` | **Working** |
9199
| Platform | `platform.cpp` | Pending |
92100
| QPI Collection | `qpi_collection.cpp` | Pending |
93101
| QPI | `qpi.cpp` | Pending |
@@ -98,4 +106,4 @@ Current state of the working tests:
98106
| Stdlib Impl | `stdlib_impl.cpp` | Pending |
99107
| Tick Storage | `tick_storage.cpp` | Pending |
100108
| TX Status Request | `tx_status_request.cpp` | Pending |
101-
| Vote Counter | `vote_counter.cpp` | Pending |
109+
| Vote Counter | `vote_counter.cpp` | Pending |

benchmark_uefi/CMakeLists.txt

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
3+
project(M256UefiBenchmark CXX)
4+
5+
set(CMAKE_CXX_STANDARD 20)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
8+
add_executable(m256_uefi_benchmark benchmark_main.cpp)
9+
10+
apply_efi_compiler_flags(m256_uefi_benchmark)
11+
12+
13+
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
14+
include_directories(${CMAKE_SOURCE_DIR}/lib)
15+
include_directories(${CMAKE_SOURCE_DIR}/src)
16+
17+
# Add additional compiler-specific flags for the main application
18+
if(IS_CLANG)
19+
# Clang-specific flags
20+
target_compile_options(m256_uefi_benchmark PRIVATE
21+
-mrdrnd
22+
-target x86_64-unknown-windows
23+
$<$<BOOL:${CLANG_SYSROOT}>:--sysroot="${CLANG_SYSROOT}">
24+
-Werror
25+
-Wno-unused-parameter
26+
)
27+
elseif(IS_MSVC)
28+
# MSVC-specific flags
29+
target_compile_options(m256_uefi_benchmark PRIVATE)
30+
endif()
31+
32+
# Link with platform libraries
33+
# When building the application, link with platform_common and platform_efi
34+
target_link_libraries(m256_uefi_benchmark
35+
platform_common
36+
platform_efi
37+
)
38+
39+
# Configure linker settings based on compiler
40+
if(IS_MSVC)
41+
# MSVC-specific linker settings
42+
set_target_properties(m256_uefi_benchmark PROPERTIES SUFFIX ".efi")
43+
44+
elseif(IS_CLANG)
45+
# Clang-specific linker settings
46+
set(CMAKE_LINKER "lld")
47+
set(CMAKE_CXX_LINK_EXECUTABLE
48+
"${CMAKE_LINKER} -flavor link \
49+
-subsystem:efi_application \
50+
-entry:efi_main \
51+
<OBJECTS> \
52+
-out:<TARGET>"
53+
)
54+
55+
# Set output suffix to .efi
56+
set_target_properties(m256_uefi_benchmark PROPERTIES
57+
SUFFIX ".efi"
58+
)
59+
endif()

0 commit comments

Comments
 (0)