531 Commits
Author SHA1 Message Date
Magne Sjaastad 54cfb5efa3 Remove standalone extract-projectfile-versions tool, superseded by GUI integration 2026-10-21 22:23:38 +02:00
Magne Sjaastad e217ffb5c6 Enable flow diagnostics for grids imported with opm-common
* Update flowdiag-app submodule with grid source abstraction
* Add opm-common grid source for flow diagnostics
* Enable flow diagnostics for grids imported with opm-common
* Test flow graph from opm-common matches resdata
* Test flow diagnostics results are equal for all grid readers
* Document EGrid constructor behavior in flow diagnostics grid source
2026-10-13 12:43:01 +02:00
Magne Sjaastad 92e269ef4d #14901: Guard against crashes from corrupt Eclipse files and incomplete frustum
- RifEclipseOutputFileTools::timeSteps: avoid integer division by zero when
  the restart file has no INTEHEAD
- libecl ecl_grid: return NULL when the main EGRID grid cannot be created,
  and skip NNCHEAD blocks that cannot be read
- libecl well_info: skip wells when the restart header cannot be read
- cvf::Frustum::isOutside: do not assert on an incomplete frustum, cull nothing

Fixes #14901.
2026-10-12 17:16:11 +02:00
Magne Sjaastad ab96c520bd #14895: Improve stability when importing malformed input files
* #14895: Fix null grid dereference when importing mismatching GRDECL
* #14895: Fix out-of-bounds read in perforation interval import
* #14895: Validate connectivity indices in VTK import
* #14895: Fix heap overflow for odd PORV count in dual porosity cases
* #14895: Update roffcpp to validate array lengths when parsing ROFF files
2026-10-12 09:40:23 +02:00
Magne Sjaastad b1efd7f450 Bump roffcpp submodule to pick up googletest v1.15.2
roffcpp main (36c20f8) bumps its googletest FetchContent pin from
release-1.11.0 to v1.15.2, matching the bump made here for opm-parser-tests, and
updates its own build matrix to supported GitHub runners.

This removes one of the two remaining release-1.11.0 pins that would break a
CMake 4.x configure if the FetchContent declaration order ever changed. The
openzgy pin is still outstanding (CeetronSolutions/openzgy#10).
2026-09-29 14:14:51 +02:00
Magne Sjaastad 02a5486f48 CMake: Bump googletest FetchContent pin to v1.15.2 in opm-parser-tests
googletest release-1.11.0 declares cmake_minimum_required(VERSION 2.8.12),
which CMake 4.x rejects, so configuring on the ubuntu-26.04 runners fails with
"Compatibility with CMake < 3.5 has been removed from CMake" at
build/_deps/googletest-src/CMakeLists.txt:4. This was previously masked: the
clang-tidy and clazy runs died earlier, during the vcpkg build.

All googletest consumers share one FetchContent declaration name, so the first
FetchContent_Declare wins and the later ones are inert. opm-parser-tests is
added at CMakeLists.txt:612, ahead of openzgy (675), roffcpp (785),
regression-analysis (794) and ApplicationLibCode (1230), so its pin is the one
that has been in effect for the whole build -- including the targets that
already ask for v1.15.2. Bumping it therefore both fixes the configure failure
and makes the build use the version the rest of the tree already declares.

None of the test directories use the *_TEST_CASE_* macros googletest removed in
1.13, so no test source changes are needed.

The remaining two release-1.11.0 pins live in the roffcpp and openzgy
submodules and cannot be changed from this repository; they are inert while the
declaration order above holds.
2026-09-29 14:14:51 +02:00
Magne Sjaastad edbb0a437b CI: Build vcpkg dependencies release-only in every workflow
vcpkg builds every port in both debug and release unless VCPKG_BUILD_TYPE says
otherwise, and that variable is only read from the triplet file. The workflows
that already pass -DVCPKG_TARGET_TRIPLET/-DVCPKG_HOST_TRIPLET pointing at a
*-release triplet (ResInsightWithCache, rhel8-unit-tests, rhel8-package,
Dockerfile.rhel8) therefore skip the debug half; the remaining three did not.

clang-tidy and clazy-report passed no triplet at all and so used the plain
x64-linux triplet, building every port twice. Both only need
compile_commands.json, so the debug half was pure cost -- and it was the debug
build that failed in the ubuntu-26.04 runs: the snappy error surfaced at
"Building x64-linux-dbg", before the release half was even attempted.

ResInsightMac passed -DVCPKG_BUILD_TYPE=release on the top-level CMake command
line, which has no effect on the ports vcpkg builds, so both macOS legs were
also building debug dependencies. Replace it with the triplet pair and add
x64-osx-release and arm64-osx-release, following the existing convention of
keeping a separate release triplet rather than folding VCPKG_BUILD_TYPE into
the shared overlay so local developer builds keep their debug dependencies.
The new triplets differ from x64-osx/arm64-osx only by
set(VCPKG_BUILD_TYPE release).

Verified that each of the seven cmake invocations using the vcpkg toolchain now
sets both triplet variables, that all four *-release triplets parse and resolve
to VCPKG_BUILD_TYPE=release, and that installing a port with x64-linux-release
builds only "x64-linux-release-rel" with no debug tree.

Also correct the overlay-ports path quoted in a Dockerfile.rhel8 comment, which
the previous commit narrowed to the thrift port directory.
2026-09-29 14:14:51 +02:00
Magne Sjaastad f6787a9ea1 vcpkg: Patch snappy for AVX-by-default toolchains via overlay port
snappy 1.2.2, a transitive dependency of arrow, includes <immintrin.h> only
when SNAPPY_HAVE_BMI2 or SNAPPY_HAVE_X86_CRC32 is set, but MemCopy64() selects
an AVX code path on a separate condition, `defined(__x86_64__) &&
defined(__AVX__)`. The vcpkg port passes -DSNAPPY_HAVE_BMI2=OFF and
-DSNAPPY_HAVE_X86_CRC32=OFF to keep the binaries portable, so on a toolchain
whose default target enables AVX that branch is compiled with no intrinsics
header and snappy.cc fails with "'__m256i' was not declared in this scope".

This broke the clang-tidy and clazy-report workflows the first night after they
moved to ubuntu-26.04. The runner switch also changed the vcpkg compiler hash,
so the binary cache went from "Restored 103 package(s)" to "Restored 0
package(s)" and every port was rebuilt from source, which is what exposed
snappy in the first place. The bug is not GCC 15 specific: microsoft/vcpkg#51047
reports it against GCC 14.3.1. It is still present in snappy 1.3.1 and main, and
vcpkg master still ships 1.2.2 with the SNAPPY_HAVE_* options off, so neither a
baseline bump nor a port update fixes it.

Vendor the port under ThirdParty/vcpkg-overlay-ports and add
avx-immintrin.patch, which includes <immintrin.h> for the __AVX__ branch as
well. The patch cannot change the ISA baseline of the result: it only supplies
a header on a path the compiler was already going to take. Verified by
reproducing the failure locally with an overlay triplet setting
-march=x86-64-v3, confirming the patched port builds both with and without that
flag, and checking that objdump finds no AVX instructions in the library built
with the stock toolchain.

Reference the two overlay ports by their individual directories rather than by
the parent directory. The two configurations resolve different versions of both
ports (default: snappy 1.2.2#1, thrift 0.22.0; rhel8: snappy 1.2.1,
thrift 0.20.0#1), so an overlay of the whole directory would downgrade thrift
for the default builds and bump snappy for RHEL8. Dry runs of both manifests
confirm each profile now picks up only its own overlay.

The bumped port-version misses the existing vcpkg binary caches, but those
caches are already cold for the ubuntu-26.04 workflows.
2026-09-29 14:14:51 +02:00
Kristian Bendiksen c87fff08d6 Revert "#14714 Add opt-in native window for 3D viewers"
This reverts commit aa3ec82e1c.
2026-09-11 08:15:21 -04:00
Kristian Bendiksen 7b70f7e0a3 #14708 Fix black docked views by updating ADS
Update Qt Advanced Docking System to the parent-preservation fix cherry-picked onto CeetronSolutions master. Keep inactive docks hidden under the dock manager instead of temporarily making them top-level windows, avoiding disruption of QOpenGLWidget composition without enabling native windows.

Related to #14714. ADS fix cherry-picked from kriben/Qt-Advanced-Docking-System commit 7d6f2e71e374b95d600467602b770a8c8cf85d07.
2026-09-11 08:15:21 -04:00
magnesj 8ff1515bf4 vcpkg: Patch thrift for GCC 15 via overlay port
thrift 0.20.0#1, a transitive dependency of arrow, declares int64_t in lib/cpp/src/thrift/concurrency/Mutex.h without including <cstdint>. libstdc++ in GCC 15 no longer provides that header transitively through <memory>, so the port fails to compile at TSSLServerSocket.cpp with gcc-toolset-15. gcc-toolset-14 and older are unaffected, which is why RHEL8 CI has been green: it pins gcc-toolset-14 and restores thrift from the prebuilt cache in the CI image.

Vendor the port under ThirdParty/vcpkg-overlay-ports and add gcc15-cstdint.patch. An overlay port is used rather than a port-scoped flag in the x64-linux-release triplet because triplet_abi is a hash of the triplet file contents and is identical for every port, so editing a triplet invalidates the whole dependency set and forces a cold-cache rebuild.

Register overlay-ports in vcpkg-configuration-rhel8.json, which the RHEL8 workflow and Dockerfile.rhel8 copy over vcpkg-configuration.json. The bumped port-version misses the vcpkg binary cache baked into the current CI image, so the RHEL8 image needs a rebuild to pick up thrift 0.20.0#2.
2026-09-11 07:36:34 -04:00
Magne Sjaastad de3996ee9e Fix four crashes found via automated stacktrace triage (#14702)
* Fail gracefully when exportSnapshots command has no main window
* Guard against unopened plot panels in selection change handler
* Guard ecl_rsthead_alloc against missing INTEHEAD_KW
* Guard against detached flow diag solution in solverInterface
* Never rewrite all crash-triage reports when updating registry
2026-09-08 11:16:38 +02:00
JJ 73783a3e0a Update to latest Qt Advanced Docking (#14652)
* Update to latest Qt Advanced Docking, simplifying cmake config and fixing some bugs.
2026-09-01 07:46:30 +02:00
Magne Sjaastad b16c29b2e8 CI: Build vcpkg ports release-only to cut cold-cache time
vcpkg only reads VCPKG_BUILD_TYPE from the triplet file, so the
-DVCPKG_BUILD_TYPE=release passed to the top-level CMake call never had any
effect and every port was built in both debug and release. On a cold cache
that is roughly half of an 85 minute vcpkg step.

Add release-only overlay triplets for x64-windows and x64-linux and select
them from the workflow matrix. They are separate triplets rather than an
override of the stock ones so local developer builds keep their debug
dependencies. VCPKG_HOST_TRIPLET is set alongside the target triplet,
otherwise the 12 host-tool ports (openssl and protobuf among them) would be
built a second time under the stock triplet.

The triplet is part of the vcpkg cache key since it changes every binary's
ABI hash.
2026-08-31 22:21:52 +02:00
Kristian Bendiksen 14a4aa0f62 #14621 Sector model export: Preserve include-only wrapper files
Include files containing only INCLUDE statements, such as a wrapper
collecting many lift curve (.ecl/.vfp) files, were dropped during
sector model export, and the includes for all leaf files were written
directly into the exported .DATA file.

Update the custom-opm-common submodule so FileDeck recreates
include-only files in the output directory and preserves the include
hierarchy at any nesting depth. Add a regression test exporting a deck
with a nested include-only wrapper and reloading the result.
2026-08-31 21:48:39 +02:00
Kristian Bendiksen fd35578463 #14620 Sector model export: limit deck lines to 132 characters
Table keywords such as PVTO and SGOF were rewritten by opm-common as one
unbounded line when saving the deck, exceeding the 132 character line
limit of Eclipse 100 and making exported sector models unusable there.

Update the custom-opm-common submodule so DeckOutput tracks the current
line width and wraps records at item boundaries before a line exceeds
132 characters. Quoted values are never split. Add a regression test
that round-trips a deck with a long rel. perm. table and a record of
quoted mnemonics.
2026-08-31 20:17:48 +02:00
jonjenssen 8f4061208e Use a copy of the OSDU OpenZGY code, not a submodule, due to server instabilities. 2026-08-27 13:46:51 +02:00
Magne Sjaastad f68c0fe2cb #14584 Fix Windows build race copying Qt DLLs into the build root
extract-projectfile-versions linked into the shared build root and copied
Qt6Core.dll and Qt6Sql.dll next to its executable as a POST_BUILD step. The
generated_classes.py edge runs ResInsight.exe out of that same directory with
those DLLs loaded, and nothing orders the two edges relative to each other, so
Ninja was free to schedule them concurrently. Overwriting a mapped DLL is a
sharing violation on Windows, which failed the copy and took the build down.

Give the target its own RUNTIME_OUTPUT_DIRECTORY. It is a standalone developer
tool with no reason to share the application output directory, so moving it
removes the conflict instead of narrowing it. Also switch the copy to
copy_if_different, matching the equivalent step in the unit test target.
2026-08-22 11:50:55 +02:00
Magne Sjaastad d6c0df228d Fix RHEL8 vcpkg build broken by the toolchain cross-compile check
The RHEL8 job pins its own older ports baseline in
vcpkg-configuration-rhel8.json for Rocky Linux 8 compatibility. At that
baseline arrow 18.1.0 passes -DCMAKE_SYSTEM_PROCESSOR=x64, which the
updated linux toolchain reads as a cross build and answers with a
nonexistent x64-linux-gnu-gcc. The January 2025 toolchain had no such
inference, so the mismatch used to be harmless.

Bump the vcpkg submodule to normalize the vcpkg triplet architecture to
the GNU processor name before the cross-compilation check.

The default baseline is unaffected: arrow 21.0.0 there no longer passes
the flag, upstream having removed it in microsoft/vcpkg#47958.
2026-08-14 12:51:26 +02:00
Magne Sjaastad fa0c45a24f Update vcpkg to the 2026.07.29 release
Rebase the fork-local patches onto microsoft/vcpkg tag 2026.07.29
(9e593bb18ea69cc5095e012465dcd675a822ed0d): drop /Z7 from the vcpkg
Windows toolchain, and set CMAKE_POLICY_VERSION_MINIMUM for the
x64-linux and x64-windows triplets.

The previous submodule commit was based on upstream from January 2025,
which pinned msys2-runtime-3.5.4-2. That distfile has been pruned from
all MSYS2 mirrors, so any Windows build with a cold vcpkg binary cache
failed with a 404 while rapidjson acquired pkgconf. The new base pins
msys2-runtime-3.6.5-1, which is still hosted.

The ports baseline in vcpkg-configuration.json is left unchanged.
2026-08-14 12:51:26 +02:00
Magne Sjaastad 3ba47253ad #14386 Update opm-common submodule to merged development-01 commit 2026-07-28 14:51:13 +02:00
Magne Sjaastad 2d761c1d99 #14386 Update opm-common submodule with ESmry summary file open fix 2026-07-28 14:51:13 +02:00
Magne Sjaastad 14a4b5ef53 #14381 Fail gracefully when reading truncated or corrupt SMSPEC file 2026-07-28 14:44:25 +02:00
Magne Sjaastad e35f9aa85e #14370 Guard against NULL base when selecting summary file lists 2026-07-28 11:26:18 +02:00
Magne Sjaastad 2ac1948abe #14245 Remove gsl functions and ThirdParty/gsl folder 2026-06-24 18:47:04 +02:00
Jon Jenssen 789f433d9d Support toggle titlebar on/off for plots and 3d viewers 2026-06-17 13:55:32 +02:00
Jon Jenssen 4e2310e424 Update docking to latest version to support wayland 2026-06-17 13:55:32 +02:00
Jon Jenssen 255576d53d Clean up delete 3d views and project close/open
Update to latest qtadv docking
2026-06-17 13:55:32 +02:00
Jon Jenssen 9823f9c5a3 Update to latest qt adv docking version
Make sure copied 3d or plot views get a unique id
2026-06-17 13:55:32 +02:00
Magne Sjaastad 3a3a53ff0f Add input guards to fortio_fread_buffer for parity with resdata PR #1189
Reject null buffers and negative buffer sizes up front, returning false instead of risking a null dereference or hitting util_abort. The buffer-overflow protection from the upstream fix is already present via #14144; these two input-validation guards are the remaining delta.
2026-06-11 22:26:07 +02:00
Magne Sjaastad d339a34910 #14149 Fix crash when reading corrupt or truncated Eclipse INIT keyword
ecl_kw_fread_alloc() returns NULL if a keyword cannot be read, e.g. when
the backing file is truncated or corrupt. ecl_file_kw_load_kw() then
called ecl_file_kw_assert_kw() unconditionally, which dereferenced the
NULL keyword and caused a SIGSEGV.

Guard the assert and inv-map registration so they only run when the read
succeeded. The NULL keyword is propagated to the calling scope, which
already handles a missing keyword gracefully.
2026-06-10 17:46:13 +02:00
Magne Sjaastad 668b844051 #14144 Guard against buffer overflow when reading corrupt well data records
A truncated or corrupt restart file could provide a Fortran record-length header larger than the destination buffer, causing fortio_fread_record to fread past the heap allocation and crash. Bound each record read to the remaining buffer capacity and treat an oversized record as a read failure, which propagates up as a normal failed read instead of a segfault.
2026-06-08 15:54:52 +02:00
Magne Sjaastad 022d77bef8 macOS: Initial Apple Silicon and x86_64 build support
* Refactor: add MACOSX_BUNDLE option to qt_add_executable in multiple CMakeLists.txt files
* #14045 macOS: Guard std::stacktrace usage and skip ucontext on Apple platforms
* #14045 macOS: Guard std::ispanstream with std::istringstream fallback
* #14045 macOS: Add vcpkg overlay triplets for osx and exclude grpc on osx
* #14045 macOS: CMake macOS build support and openzgy OpenMP-disable patch
* #14045 CI: Add macOS build workflow
* #14045 macOS: Use feature-test macros to detect <stacktrace> and <spanstream>
* #14045 macOS: Make MAX_STIMPLAN_LAYERS constexpr to fix arm64 link error
* #14045 CI: Ship README-macOS.txt with artifact to document Gatekeeper workaround
* #14045 CI: Pin macOS runner to macos-14 and set deployment target to 14.0
* #14045 CI: Move macOS runner to macos-15 and fix README step on configure failure
2026-06-01 12:38:55 +02:00
Magne Sjaastad 4e65583425 #14004 resdata: Backport robustness fixes from equinor/resdata#1166
Guard zero-length keywords in ecl_kw_max_min, increase grdecl buffer to 256 and bound sscanf widths, and validate dimensions and keyword sizes (COORD, ZCORN, MAPAXES, CORSNUM, ACTNUM) when loading GRDECL grids.
2026-05-19 07:58:37 +02:00
Magne Sjaastad 3efdbafa0c #14004 surfio: Update to 0.0.20 and link fast_float from vcpkg 2026-05-19 07:58:37 +02:00
Magne Sjaastad e6cc90a7b5 Update vcpkg to fix CMake 4 issues on Linux
Update the vcpkg submodule to resolve compatibility issues encountered when using CMake 4 on Linux.
2026-04-14 12:44:36 +02:00
Magne Sjaastad 60f2ede781 Fix crash in ecl_file_scan when UNRST file is locked or being written
Add NULL stream guards in fortio_ftell and fortio_fseek__ to prevent SIGSEGV when fortio->stream is NULL during ecl_file_scan. This mirrors
the defensive fix applied to ESmry::loadData for UNSMRY files.
2026-03-17 14:03:11 +01:00
Magne Sjaastad ec7470d1e6 Fix ESmry::loadData crash when UNSMRY file is locked or being written
Update custom-opm-common submodule with guards against crashes in ESmry::loadData(vectList) when ensemble summary files are incomplete or inaccessible during project load.
2026-03-17 14:03:11 +01:00
Magne Sjaastad 46b56a800c #12560 Surface: Add export to GRI format with UI dialog and context menu integration
CMake: Change mdspan link from PRIVATE to PUBLIC for surfio_lib
2026-03-16 14:00:07 +01:00
Kristian Bendiksen d9e331f560 Update regression-analysis (fixes missing assert.h include) 2026-03-13 12:45:13 +01:00
Jon Jenssen f7154a8146 Fix crash issue with empty blocks when removing block keywords from file deck 2026-03-13 11:41:20 +01:00
David Landa Marban 188a52cd1e Removing unused boost::system 2026-03-13 10:38:57 +01:00
Magne Sjaastad 56fc450543 opm-flowdiagnostics-applications: Improvements to relative perm curves
Integrate PR https://github.com/OPM/opm-flowdiagnostics-applications/pull/116 for testing
2026-03-09 14:43:21 +01:00
Magne Sjaastad ab1cd9bb22 #13603 Replace bool/errorText with std::expected in ExpressionParser
evaluate() and expandIfStatementsAndEvaluate() now return std::expected<void, QString>: the error message is always part of the return value rather than an optional out-parameter, making it impossible for callers to silently discard errors.

Update RimGridCalculation and RimSummaryCalculation to use evaluateResult.error() instead of a separate errorText variable.
2026-02-23 19:19:09 +01:00
copilot-swe-agent[bot] 8bbd0d2551 Improve support for aggregating functions
When aggregating functions (min, max, sum, avg) are applied to a single vector variable, they compute a scalar result over the whole vector. These must be pre-computed before the element-wise for loop, otherwise the variable gets replaced with its indexed version (e.g. min(b) -> min(b[i])) which changes the semantics: min(b[i]) returns b[i], not min of all b.

Add check for pattern: c := agg_func(if(condition, true_expr, false_expr)).  Computes a scalar aggregate of the element-wise if-result and assigns it as a constant to all elements of c.
2026-02-23 19:19:09 +01:00
Magne Sjaastad cb8a069ccd Add support for custom validation callbacks on fields
* Add support for custom validation callbacks on fields

Introduce setCustomValidationCallback to PdmFieldHandle, allowing custom validation logic via user-provided lambdas or functions. The validate() method now invokes this callback if set, in addition to built-in checks. Includes comprehensive unit tests for custom and combined validation scenarios. Backward compatible: default behavior unchanged if no callback is set.
2026-02-09 16:48:42 +01:00
Magne Sjaastad adc450ead8 Update opm-common submodule to latest commit 2026-02-03 17:14:45 +01:00
Kristian Bendiksen 116c3b83a5 #13530 Fix RMS well path import with spaces in well names
The RMS well parser now correctly handles well names containing spaces.
Previously, ReadNext<std::string>() stopped at the first whitespace,
causing parsing failures. The fix reads line 3 as a whole and parses
coordinates from the end, treating remaining tokens as the well name.
2026-02-02 14:26:19 +01:00
Magne Sjaastad f06bd7f129 Fix missing display of legends in Qt 6.9
Updates the Qwt subproject to the latest commit to incorporate necessary fixes and improvements for legend-related issues in Qt6.
2026-01-13 17:15:33 +01:00
Kristian BendiksenandMagne Sjaastad d80ada607f #11807 Upgrade to Clipper2
Replaces the deprecated Clipper library with the actively maintained Clipper2 library.

Removes the local copy of the Clipper library and uses vcpkg to manage the dependency.

Fixes #11807

Co-authored-by: Magne Sjaastad <magne.sjaastad@ceetronsolutions.com>
2026-01-07 16:07:09 +01:00