Skip to content

Commit

Permalink
More fixes to RELEASE builds and CMakePresets.json
Browse files Browse the repository at this point in the history
Signed-off-by: Vinícius Ferrão <[email protected]>
  • Loading branch information
viniciusferrao committed May 13, 2024
1 parent 3fd1afa commit d64a07f
Show file tree
Hide file tree
Showing 8 changed files with 271 additions and 160 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.26.5)

# This template attempts to be "fetch_content"-able
# so that it works well with tools like CPM or other
Expand All @@ -23,9 +23,9 @@ endif()
# Set a default build type if none was specified
# This is required for Conan 2.0 to work properly
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE
Debug
Release
CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui, ccmake
set_property(
Expand Down
311 changes: 192 additions & 119 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,122 +1,195 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 24,
"patch": 0
},
"configurePresets": [
{
"name": "conf-common",
"description": "General settings that apply to all configurations",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}"
},
{
"name": "conf-linux-common",
"description": "Linux OS settings for gcc and clang toolchains",
"hidden": true,
"inherits": "conf-common",
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": [
"Linux"
]
},
"vendor": {
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
}
}
},
{
"name": "linux-gcc-debug",
"displayName": "gcc Debug",
"description": "Target Linux OS with the gcc compiler, debug build type",
"inherits": "conf-linux-common",
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "linux-gcc-release",
"displayName": "gcc Release",
"description": "Target Linux OS with the gcc compiler, release build type",
"inherits": "conf-linux-common",
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "linux-clang-debug",
"displayName": "clang Debug",
"description": "Target Linux OS with the clang compiler, debug build type",
"inherits": "conf-linux-common",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "linux-clang-release",
"displayName": "clang Release",
"description": "Target Linux OS with the clang compiler, release build type",
"inherits": "conf-linux-common",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_BUILD_TYPE": "Release"
}
}
],
"testPresets": [
{
"name": "test-common",
"description": "Test CMake settings that apply to all configurations",
"hidden": true,
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": true
}
},
{
"name": "test-linux-gcc-debug",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "test-common",
"configurePreset": "linux-gcc-debug"
},
{
"name": "test-linux-gcc-release",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "test-common",
"configurePreset": "linux-gcc-release"
},
{
"name": "test-linux-clang-debug",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "test-common",
"configurePreset": "linux-clang-debug"
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 26,
"patch": 5
},
"configurePresets": [
{
"name": "conf-common",
"description": "General settings that apply to all configurations",
"hidden": true,
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}"
},
{
"name": "conf-linux-common",
"description": "Linux common settings",
"hidden": true,
"inherits": "conf-common",
"condition": {
"type": "inList",
"string": "${hostSystemName}",
"list": ["Linux"]
},
"vendor": {
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
},
{
"name": "test-linux-clang-release",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "test-common",
"configurePreset": "linux-clang-release"
"jetbrains.com/clion": {
"toolchain": "CloysterHPC RHEL9 Dev"
}
]
}
}
},
{
"name": "conf-linux-gcc-common",
"description": "Target Linux OS with the gcc compiler",
"hidden": true,
"inherits": "conf-linux-common",
"cacheVariables": {
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++"
}
},
{
"name": "rhel9-gcc-release",
"displayName": "RHEL9 GCC Release",
"description": "Target Red Hat Enterprise Linux 9 with the gcc compiler, release build type",
"inherits": "conf-linux-gcc-common",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "rhel9-gcc-debug",
"displayName": "RHEL9 GCC Debug",
"description": "Target Red Hat Enterprise Linux 9 with the gcc compiler, debug build type",
"inherits": "conf-linux-gcc-common",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "conf-linux-gcc-toolset-13-common",
"description": "Target Linux OS with the gcc toolset 13 compiler",
"hidden": true,
"inherits": "conf-linux-common",
"environment": {
"PATH": "/opt/rh/gcc-toolset-13/root/usr/bin:$penv{PATH}",
"MANPATH": "/opt/rh/gcc-toolset-13/root/usr/share/man:$penv{MANPATH}",
"INFOPATH": "/opt/rh/gcc-toolset-13/root/usr/share/info:$penv{INFOPATH}",
"PCP_DIR": "/opt/rh/gcc-toolset-13/root",
"LD_LIBRARY_PATH": "/opt/rh/gcc-toolset-13/root/usr/lib64:$penv{LD_LIBRARY_PATH}",
"PKG_CONFIG_PATH": "/opt/rh/gcc-toolset-13/root/usr/lib64/pkgconfig:$penv{PKG_CONFIG_PATH}",
"X_SCLS": "gcc-toolset-13"
},
"cacheVariables": {
"CMAKE_C_COMPILER": "/opt/rh/gcc-toolset-13/root/usr/bin/gcc",
"CMAKE_CXX_COMPILER": "/opt/rh/gcc-toolset-13/root/usr/bin/g++"
}
},
{
"name": "rhel9-gcc-toolset-13-release",
"displayName": "RHEL9 GCC 13 Release",
"description": "Target Red Hat Enterprise Linux 9 with the gcc toolset 13 compiler, release build type",
"inherits": "conf-linux-gcc-toolset-13-common",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "rhel9-gcc-toolset-13-debug",
"displayName": "RHEL9 GCC 13 Debug",
"description": "Target Red Hat Enterprise Linux 9 with the gcc toolset 13 compiler, debug build type",
"inherits": "conf-linux-gcc-toolset-13-common",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "conf-linux-clang-common",
"description": "Target Linux OS with the clang compiler",
"hidden": true,
"inherits": "conf-linux-common",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
}
},
{
"name": "linux-clang-release",
"displayName": "clang Release",
"description": "Target Linux OS with the clang compiler, release build type",
"hidden": true,
"inherits": "conf-linux-clang-common",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "linux-clang-debug",
"displayName": "clang Debug",
"description": "Target Linux OS with the clang compiler, debug build type",
"hidden": true,
"inherits": "conf-linux-clang-common",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
}
],
"buildPresets": [
{
"name": "rhel9-gcc-release",
"displayName": "gcc build release",
"configurePreset": "rhel9-gcc-release"
},
{
"name": "rhel9-gcc-debug",
"displayName": "gcc build debug",
"configurePreset": "rhel9-gcc-debug"
},
{
"name": "rhel9-gcc-toolset-13-release",
"displayName": "gcc toolset 13 build release",
"configurePreset": "rhel9-gcc-toolset-13-release"
},
{
"name": "rhel9-gcc-toolset-13-debug",
"displayName": "gcc toolset 13 build debug",
"configurePreset": "rhel9-gcc-toolset-13-debug"
}
],
"testPresets": [
{
"name": "test-common",
"description": "Test CMake settings that apply to all configurations",
"hidden": true,
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": true
}
},
{
"name": "test-linux-gcc-debug",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "test-common",
"configurePreset": "linux-gcc-debug"
},
{
"name": "test-linux-gcc-release",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "test-common",
"configurePreset": "linux-gcc-release"
},
{
"name": "test-linux-clang-debug",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "test-common",
"configurePreset": "linux-clang-debug"
},
{
"name": "test-linux-clang-release",
"displayName": "Strict",
"description": "Enable output and stop on failure",
"inherits": "test-common",
"configurePreset": "linux-clang-release"
}
]
}
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ nature and `root` execution requirements.

### Recommended VM settings

* EL8 based system with **minimal** package selection
* EL8.9 or EL9.4 and higher based system with **minimal** package selection
* Half of system CPU cores as vCPU
* At least 4GB of RAM
* 50GB of Disk
Expand All @@ -131,20 +131,18 @@ All dependencies should be installed after its execution and then follow
with standard [CMake](https://cmake.org) procedure.

All default [CMake](https://cmake.org) targets are supported. By default, it
builds a **Debug** target with sanitizers enabled that modifies the
running OS, so be **advised to run the code on a development system only**.
builds a **Release** target that modifies the running OS, so be **advised to
run the code on a development system only**.

Finally, to build the software just run the commands:

```
$ git submodule init
$ git submodule update
$ cmake -S . -B ./build
$ cmake --build ./build
```

Resulting binary will be available on `/build/src` directory in the root directory of
the project.
Resulting binary will be available on `/build/src` directory in the root
directory of the project.

As a final warning: running the software without **DUMMY** option will probably
damage the running OS if they run as **root**. Be advised.
Expand Down
1 change: 1 addition & 0 deletions include/cloysterhpc/mailsystem/postfix.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <optional>
#include <string>
#include <cstdint>

class Postfix {
public:
Expand Down
8 changes: 0 additions & 8 deletions rhel-gcc-toolset-12.sh

This file was deleted.

8 changes: 8 additions & 0 deletions rhel-gcc-toolset-13.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
#
# This file should be executed to enable the GCC 13 toolset on RHEL.
# It is meant to be sourced by the user's shell before any compilation,
# including Conan builds. If running from an IDE please remember to check this
# file as the environment.

source scl_source enable gcc-toolset-13
Loading

0 comments on commit d64a07f

Please sign in to comment.