14 Commits
Author SHA1 Message Date
Magne Sjaastad 3052d3d554 Select RHEL8 vcpkg-configuration.json via CMake instead of renaming the tracked file
* Select RHEL8 vcpkg-configuration.json via CMake instead of renaming the tracked file

RHEL8 CI jobs previously ran 'cp vcpkg-configuration-rhel8.json vcpkg-configuration.json'
before configuring, temporarily overwriting the tracked default configuration
in the checkout. The vcpkg toolchain file only defaults VCPKG_MANIFEST_DIR to
CMAKE_SOURCE_DIR when it is not already defined, and reads it while processing
project(), so setting VCPKG_MANIFEST_DIR earlier -- before project() -- lets
vcpkg read a different vcpkg-configuration.json without ever touching the
tracked file.

Add a RESINSIGHT_VCPKG_PROFILE cache variable, implemented in the new
cmake/ResInsightVcpkgProfile.cmake (included from the root CMakeLists.txt
before project(), which is required for VCPKG_MANIFEST_DIR to take effect).
When set (e.g. to 'rhel8'), it copies vcpkg.json and
vcpkg-configuration-<profile>.json into a profile-specific directory under
the build tree and points VCPKG_MANIFEST_DIR there. The copy is regenerated on
every configure, so it can never drift from the root vcpkg.json.

overlay-ports/overlay-triplets entries (e.g. 'ThirdParty/vcpkg-overlay-ports')
are resolved by vcpkg relative to the directory vcpkg-configuration.json lives
in, so repo-relative 'ThirdParty/...' paths are rewritten to absolute paths
right after the copy is generated, keeping them valid from the new location.

Update the RHEL8 workflows and Dockerfile.rhel8 build-warmup stage to pass
-DRESINSIGHT_VCPKG_PROFILE=rhel8 instead of the cp step, and update
vcpkg-readme.md to describe the new mechanism.

* #14733 Use x64-linux-release vcpkg triplet explicitly in RHEL8 CI

The RHEL8 CI workflows and the Docker image's warmup/vcpkg-cache stages
did not set VCPKG_TARGET_TRIPLET/VCPKG_HOST_TRIPLET, so vcpkg fell back
to its plain x64-linux default triplet, which builds both debug and
release variants of every dependency even though the CI build is
Release-only. Set both to x64-linux-release consistently across the
image's vcpkg install, the warmup CMake configure, and the two
consuming workflows so the baked binary cache and the CI configure use
matching ABI hashes and skip the unused debug builds.
2026-09-11 22:49:16 +02:00
magnesj 3f7aee5972 #14720 Probe std::stacktrace by linking instead of trusting the feature macro
libstdc++ defines __cpp_lib_stacktrace from GCC 13 on, but the implementation
lives in libstdc++exp, which some distributions do not ship (Red Hat's
gcc-toolset among them). The header-only feature test then reports the feature
as present and the link fails with undefined references to
std::__stacktrace_impl::_S_current.

Add cmake/StdStacktrace.cmake, which probes the feature by actually linking:
first with no extra library, then with stdc++exp. The result selects the link
library through RESINSIGHT_STACKTRACE_LIBRARIES, or defines
RIA_HAS_STD_STACKTRACE=0 project-wide when neither links, so the crash handler
compiles out its stack-trace capture and logs the signal only.

RiaMainTools.cpp and RiaOpenTelemetryManager.h now honour a
RIA_HAS_STD_STACKTRACE definition from the build system and only include
<stacktrace> when the feature is enabled.

Follow-up to #14045.
2026-09-10 08:33:38 -04:00
Kristian Bendiksen 7e1c38bf99 Do not treat GCC free-nonheap-object warning as error
GCC's -Wfree-nonheap-object false-positives on inlined std::vector copies
(GCC PR 104475), breaking -Werror builds with GCC 15 on Ubuntu 26.04. Keep
the warning visible but do not let it fail the build.
2026-09-01 07:44:52 +02:00
Magne Sjaastad 21bd5730f5 Move warnings as errors config and use in geomech libs 2025-06-17 14:43:47 +02:00
Magne Sjaastad 1e07b239d1 Simplify configuration and use of vcpkg
* Simplify configuration and use of vcpkg
* Use 22.04
* Set and use BUILD_TYPE = Release
* Use -DVCPKG_BUILD_TYPE=release
2024-05-31 08:56:29 +02:00
Magne Sjaastad 638f926429 cmake-format: Allow dangling parenthesis 2021-09-01 08:13:16 +02:00
Eirik Marthinsen 697da887c4 AutoVcpkg: Copy bootstrap file from cmake folder
AutoVcpkg assumed that the bootstrap file was in the root project
folder, and not in a cmake subfolder.

Note: It is not correct to use ${CMAKE_CURRENT_LIST_DIR} since this is
inside a function and whould still refer to the folder of the calling
file. The more elegant solution would be to use
${CMAKE_CURRENT_FUNCTION_LIST_DIR}, but that is not available until
CMake 3.17.
2021-08-30 19:40:35 +02:00
Gaute LindkvistandRuben Thoms 787dae4044 Automatic installation of vcpkg dependencies (#6848)
* Added AutoVcpkg files to cmake directory.
* Add auto install of vcpkg packages
* Add grpc install to GrpcInterface module
* Set VCPKG_ROOT in GitHub actions

Co-authored-by: Ruben Thoms <ruben.thoms@ceetronsolutions.com>
2020-10-30 12:29:57 +01:00
Gaute Lindkvist 3cd3b319d4 Add a github action and config file for running CMake-format (#6849)
* Add a github action and config file for running CMake-format
2020-10-30 11:51:13 +01:00
Magne Sjaastad 2901ad2c54 #6398 System : Remove cotire 2020-08-29 10:30:56 +02:00
Magne Sjaastad 288ee59587 #4066 System : Improve cmake macros for cotire 2019-02-11 07:13:08 +01:00
Magne Sjaastad 8bb13f4e15 #4020 System : Add ri_apply_cotire() and make available for targets 2019-02-01 06:55:44 +01:00
Magne Sjaastad 53ef8dbed9 #3932 System : Add FindOctave 2019-01-07 12:44:36 +01:00
Magne Sjaastad 4fd8e2503c Added cotire to speed up build times 2016-06-06 09:56:45 +02:00