From 5ecc7caa2392a739c34adc050ac00d852c51c19d Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 15 Aug 2023 10:50:49 +0200 Subject: [PATCH 1/2] Make CMake fail on non-64bit systems. Running simulations on those does not make sense as it seriously limits the time span that can be simulated. In addition the OPM code neglects 32bit issues at various places as it was written at a time where 64bit was already ubiquitous. Currently, we would fail in some regression tests on 32bit systems. With this change CMake will already check whether it is run on a 64bit system and already fail if this is not the case. --- cmake/Modules/OpmInit.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/Modules/OpmInit.cmake b/cmake/Modules/OpmInit.cmake index 612aad930..bc2318800 100644 --- a/cmake/Modules/OpmInit.cmake +++ b/cmake/Modules/OpmInit.cmake @@ -110,6 +110,10 @@ macro (OpmInitDirVars) endif (COMMAND dir_hook) endmacro () +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") + message(FATAL_ERROR "OPM will only work correctly on 64bit systems!") +endif() + OpmInitProjVars () OpmInitDirVars () From 223e8c6877e2f9a6dd795fe13922db501e683433 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Wed, 25 Oct 2023 08:17:20 +0200 Subject: [PATCH 2/2] Use LESS comparison to test if system is at least 64bit. Indeed this is clearer and better. --- cmake/Modules/OpmInit.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/OpmInit.cmake b/cmake/Modules/OpmInit.cmake index bc2318800..76770ce91 100644 --- a/cmake/Modules/OpmInit.cmake +++ b/cmake/Modules/OpmInit.cmake @@ -110,8 +110,8 @@ macro (OpmInitDirVars) endif (COMMAND dir_hook) endmacro () -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") - message(FATAL_ERROR "OPM will only work correctly on 64bit systems!") +if("${CMAKE_SIZEOF_VOID_P}" LESS 8) + message(FATAL_ERROR "OPM will only work correctly on 64bit (or higher) systems!") endif() OpmInitProjVars ()