From 274e688012dde7e9704106fb0bf6187deda3ad3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20R=C3=B6hling?= Date: Tue, 14 Sep 2021 00:21:14 +0200 Subject: [PATCH] Update patches - Drop Compile_with_FILE_OFFSET_BITS_64_on_32-bit_Linux.patch (accepted by upstream) - Drop disable_fileapi_json_extra_test.patch (no longer needed) - New patch Fix-cross-compilation-with-MPI.patch (Closes: #943312) Gbp-Dch: full --- .../0001-Fix-cross-compilation-with-MPI.patch | 62 +++++++++++++++++++ ..._FILE_OFFSET_BITS_64_on_32-bit_Linux.patch | 34 ---------- .../disable_fileapi_json_extra_test.patch | 46 -------------- debian/patches/series | 3 +- 4 files changed, 63 insertions(+), 82 deletions(-) create mode 100644 debian/patches/0001-Fix-cross-compilation-with-MPI.patch delete mode 100644 debian/patches/Compile_with_FILE_OFFSET_BITS_64_on_32-bit_Linux.patch delete mode 100644 debian/patches/disable_fileapi_json_extra_test.patch diff --git a/debian/patches/0001-Fix-cross-compilation-with-MPI.patch b/debian/patches/0001-Fix-cross-compilation-with-MPI.patch new file mode 100644 index 000000000..453d42350 --- /dev/null +++ b/debian/patches/0001-Fix-cross-compilation-with-MPI.patch @@ -0,0 +1,62 @@ +From: =?utf-8?q?Timo_R=C3=B6hling?= +Date: Tue, 14 Sep 2021 17:04:48 +0200 +Subject: Fix cross compilation with MPI + +--- + Modules/FindMPI.cmake | 36 +++++++++++++++++++++++++++++++++++- + 1 file changed, 35 insertions(+), 1 deletion(-) + +diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake +index d8f0334..f7faa54 100644 +--- a/Modules/FindMPI.cmake ++++ b/Modules/FindMPI.cmake +@@ -267,6 +267,7 @@ cmake_policy(PUSH) + cmake_policy(SET CMP0057 NEW) # if IN_LIST + + include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) ++include(${CMAKE_CURRENT_LIST_DIR}/FindPkgConfig.cmake) + + # Generic compiler names + set(_MPI_C_GENERIC_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) +@@ -1523,7 +1524,40 @@ foreach(LANG IN ITEMS C CXX Fortran) + if(NOT MPI_PINNED_COMPILER AND NOT MPI_${LANG}_WRAPPER_FOUND) + # If MPI_PINNED_COMPILER wasn't given, and the MPI compiler we potentially found didn't work, we withdraw it. + set(MPI_${LANG}_COMPILER "MPI_${LANG}_COMPILER-NOTFOUND" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) +- if(NOT MPI_SKIP_GUESSING) ++ ++ if(LANG STREQUAL "C") ++ set(_MPI_PKG "mpi-c") ++ elseif(LANG STREQUAL "CXX") ++ set(_MPI_PKG "mpi-cxx") ++ elseif(LANG STREQUAL "Fortran") ++ set(_MPI_PKG "mpi-fort") ++ else() ++ set(_MPI_PKG "") ++ endif() ++ if(_MPI_PKG) ++ pkg_check_modules("MPI_${LANG}_PKG" "${_MPI_PKG}") ++ if("${MPI_${LANG}_PKG_FOUND}") ++ set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_${LANG}_PKG_CFLAGS} CACHE STRING "MPI ${LANG} compilation options" FORCE) ++ set(MPI_${LANG}_INCLUDE_PATH ${MPI_${LANG}_PKG_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} include directories" FORCE) ++ set(MPI_${LANG}_LINK_FLAGS ${MPI_${LANG}_PKG_LDFLAGS} CACHE STRING "MPI ${LANG} linker flags" FORCE) ++ set(MPI_${LANG}_LIB_NAMES ${MPI_${LANG}_PKG_LIBRARIES} CACHE STRING "MPI ${LANG} libraries to link against" FORCE) ++ foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIB_NAMES) ++ if(_MPI_LIB) ++ get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) ++ get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) ++ get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) ++ find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY ++ NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" ++ HINTS ${_MPI_LIB_DIR} ++ DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" ++ ) ++ mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) ++ endif() ++ endforeach() ++ endif() ++ endif() ++ ++ if(NOT MPI_SKIP_GUESSING AND NOT "${MPI_${LANG}_PKG_FOUND}") + # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the + # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. + if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) diff --git a/debian/patches/Compile_with_FILE_OFFSET_BITS_64_on_32-bit_Linux.patch b/debian/patches/Compile_with_FILE_OFFSET_BITS_64_on_32-bit_Linux.patch deleted file mode 100644 index 71239a12d..000000000 --- a/debian/patches/Compile_with_FILE_OFFSET_BITS_64_on_32-bit_Linux.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 5b10f96793ab6f3a4ef446d67c09ea91b7898584 Mon Sep 17 00:00:00 2001 -From: Marc Chevrier -Date: Wed, 23 Sep 2020 18:06:35 +0200 -Subject: [PATCH] Linux: Compile with _FILE_OFFSET_BITS=64 on 32-bit Linux - -To avoid problems accessing filesystem, use 64-bit file offsets when -compilation model is 32-bit. This explicit definition is needed now -that KWSys does not provide LFS settings in its headers anymore. - -Fixes: #20568 ---- - CompileFlags.cmake | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/CompileFlags.cmake b/CompileFlags.cmake -index 053259f47c..1c5f1beca9 100644 ---- a/CompileFlags.cmake -+++ b/CompileFlags.cmake -@@ -53,6 +53,12 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc") - endif() - endif() - -+# Use 64-bit off_t on 32-bit Linux -+if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SIZEOF_VOID_P EQUAL 4) -+ # ensure 64bit offsets are used for filesystem accesses for 32bit compilation -+ add_definitions(-D_FILE_OFFSET_BITS=64) -+endif() -+ - # Workaround for TOC Overflow on ppc64 - set(bigTocFlag "") - if(CMAKE_SYSTEM_NAME STREQUAL "AIX" AND --- -GitLab - diff --git a/debian/patches/disable_fileapi_json_extra_test.patch b/debian/patches/disable_fileapi_json_extra_test.patch deleted file mode 100644 index 2c719ece0..000000000 --- a/debian/patches/disable_fileapi_json_extra_test.patch +++ /dev/null @@ -1,46 +0,0 @@ -Disable this specific test as it fails with libjsoncpp 1.7.4 (but works with 1.8.4). -This libjsoncpp version seems to accept this invalid json file. -While not ideal this doesn't seem critical and will be fixed once the new version -reaches Debian proper. - ---- a/Tests/RunCMake/FileAPI/ClientStateful-check.cmake -+++ b/Tests/RunCMake/FileAPI/ClientStateful-check.cmake -@@ -10,8 +10,6 @@ set(expect - query/client-json-bad-root/query.json - query/client-json-empty - query/client-json-empty/query.json -- query/client-json-extra -- query/client-json-extra/query.json - query/client-not-file - query/client-not-file/query.json - query/client-request-array-negative-major-version -diff --git a/Tests/RunCMake/FileAPI/ClientStateful-check.py b/Tests/RunCMake/FileAPI/ClientStateful-check.py ---- a/Tests/RunCMake/FileAPI/ClientStateful-check.py -+++ b/Tests/RunCMake/FileAPI/ClientStateful-check.py -@@ -8,7 +8,6 @@ def check_reply(q): - "client-empty-object", - "client-json-bad-root", - "client-json-empty", -- "client-json-extra", - "client-not-file", - "client-request-array-negative-major-version", - "client-request-array-negative-minor-version", -@@ -39,7 +38,6 @@ def check_reply(q): - (check_query_empty_object, "client-empty-object"), - (check_query_json_bad_root, "client-json-bad-root"), - (check_query_json_empty, "client-json-empty"), -- (check_query_json_extra, "client-json-extra"), - (check_query_not_file, "client-not-file"), - (check_query_requests_bad, "client-requests-bad"), - (check_query_requests_empty, "client-requests-empty"), -diff --git a/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake ---- a/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake -+++ b/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake -@@ -3,7 +3,6 @@ file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-empty-array/q - file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-empty-object/query.json" "{}") - file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-bad-root/query.json" [["invalid root"]]) - file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-empty/query.json" "") --file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-extra/query.json" "{}x") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-not-file/query.json") - - file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-bad/query.json" [[{ "requests": {} }]]) diff --git a/debian/patches/series b/debian/patches/series index 429444c88..4492477b2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1 @@ -disable_fileapi_json_extra_test.patch -Compile_with_FILE_OFFSET_BITS_64_on_32-bit_Linux.patch +0001-Fix-cross-compilation-with-MPI.patch