### OpenSSL Perftools Build and Run Commands Source: https://github.com/openssl/perftools/blob/main/source/CMakeLists.txt Instructions for compiling the performance tools and executing the generated binaries. ```APIDOC Build and Run Commands: Build in default (Debug) mode: cmake --build ./build Build in Release mode (for multi-configuration generators like Visual Studio): cmake --build ./build --config Release Running Executables: All compiled programs are located in the build directory (e.g., ./build/). Example: ./build/randbytes 10 This command would execute the 'randbytes' tool with an argument of '10'. ``` -------------------------------- ### OpenSSL CMake Configuration Modes Source: https://github.com/openssl/perftools/blob/main/source/CMakeLists.txt Guides on configuring CMake to find and use OpenSSL installations, detailing Module mode and Config mode with specific CMake variable settings. ```APIDOC OpenSSL CMake Configuration: This section outlines how to configure the build process to use your desired OpenSSL installation. 1. Module Mode: - Used by default when CMake's Find.cmake scripts are available. - To use system or /usr/local installations: No special variables needed. - To use custom installations (e.g., $HOME/.local): Set CMAKE_PREFIX_PATH or OPENSSL_ROOT_DIR. - Example (Linux/macOS): cmake -S . -B ./build -DCMAKE_PREFIX_PATH=$HOME/.local/opt/openssl-3.2 - Example (Linux/macOS): cmake -S . -B ./build -DOPENSSL_ROOT_DIR=$HOME/.local/opt/openssl-3.2 - Example (Windows): cmake -S . -B ./build -DOPENSSL_ROOT_DIR=c:\\Users\\your\\openssl.root 2. Config Mode: - Supported by OpenSSL 3.3+ and used when Module mode fails or is explicitly forced. - Requires setting OPENSSL_CONFIG_MODE to a true value (e.g., 1, YES). - CMAKE_PREFIX_PATH may still be needed for custom or uninstalled builds. - Example (System): cmake -S . -B ./build -DOPENSSL_CONFIG_MODE=1 - Example (Custom Install): cmake -S . -B ./build -DOPENSSL_CONFIG_MODE=1 -DCMAKE_PREFIX_PATH=$HOME/.local/opt/openssl-3.3 - Example (Uninstalled Build): cmake -S . -B ./build -DOPENSSL_CONFIG_MODE=1 -DCMAKE_PREFIX_PATH=$HOME/tmp/openssl-3.3-build 32-bit Builds on Windows: - Add -DCMAKE_GENERATOR_PLATFORM=Win32 to the CMake command line. - Ensure a 32-bit OpenSSL library is available at the specified OPENSSL_ROOT_DIR. ``` -------------------------------- ### OpenSSL Perftools CMake Configuration Source: https://github.com/openssl/perftools/blob/main/source/CMakeLists.txt This CMakeLists.txt file defines the build process for the OpenSSL perftools. It handles finding OpenSSL, linking libraries, and creating various executables. ```cmake cmake_minimum_required(VERSION 3.10) project(perf-tools) find_package(Threads) link_libraries(${CMAKE_THREAD_LIBS_INIT}) # OpenSSL 3.3 and on have config mode files. if(OPENSSL_CONFIG_MODE) set(OPENSSL_CONFIG_MODE CONFIG) else() unset(OPENSSL_CONFIG_MODE) endif() find_package(OpenSSL REQUIRED ${OPENSSL_CONFIG_MODE}) add_library(perf perflib/perfhelper.c perflib/perfsslhelper.c perflib/threads.c perflib/time.c) if (WIN32) target_sources(perf PRIVATE perflib/getopt.c perflib/basename.c) endif() target_include_directories(perf PUBLIC "${PROJECT_SOURCE_DIR}") target_link_libraries(perf PUBLIC OpenSSL::SSL OpenSSL::Crypto) if( OPENSSL_VERSION VERSION_GREATER_EQUAL 3 ) add_executable(evp_fetch evp_fetch.c) target_link_libraries(evp_fetch PRIVATE perf) add_executable(providerdoall providerdoall.c) target_link_libraries(providerdoall PRIVATE perf) endif() add_executable(randbytes randbytes.c) target_link_libraries(randbytes PRIVATE perf) add_executable(handshake handshake.c) target_link_libraries(handshake PRIVATE perf) add_executable(sslnew sslnew.c) target_link_libraries(sslnew PRIVATE perf) add_executable(newrawkey newrawkey.c) target_link_libraries(newrawkey PRIVATE perf) add_executable(rsasign rsasign.c) target_link_libraries(rsasign PRIVATE perf) add_executable(x509storeissuer x509storeissuer.c) target_link_libraries(x509storeissuer PRIVATE perf) add_executable(rwlocks rwlocks.c) target_link_libraries(rwlocks PRIVATE perf) add_executable(pkeyread pkeyread.c) target_link_libraries(pkeyread PRIVATE perf) add_executable(evp_setpeer evp_setpeer.c) target_link_libraries(evp_setpeer PRIVATE perf) add_executable(writeread writeread.c) target_link_libraries(writeread PRIVATE perf) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.