From: Nabil Ghodbane Date: Thu, 20 Jun 2024 14:33:24 +0000 (+0200) Subject: spns #42158: Fix MEDCOUPLING V7_8_BR compilation on CO9 X-Git-Tag: V9_13_0rc2~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a4b3b8e689df4a3a5c2bcef23beec0a62459f54f;p=tools%2Fsat_salome.git spns #42158: Fix MEDCOUPLING V7_8_BR compilation on CO9 --- diff --git a/products/MEDCOUPLING.pyconf b/products/MEDCOUPLING.pyconf index 9aa0b98..c700e97 100644 --- a/products/MEDCOUPLING.pyconf +++ b/products/MEDCOUPLING.pyconf @@ -603,3 +603,23 @@ version_V7_8_0 : "lapack" ] } + +version_V7_8_0_CO9 : +{ + cmake_options : "-DMEDCOUPLING_ENABLE_PARTITIONER=OFF -DMEDCOUPLING_PARTITIONER_METIS=OFF -DMEDCOUPLING_PARTITIONER_SCOTCH=OFF -DCMAKE_CXX_STANDARD=14 " + depend : [ + "boost", + "Python", + "hdf5", + "medfile", + "libxml2", + "Sphinx", + "setuptools", + "numpy", + "scipy", + "lapack", + "CONFIGURATION" + ] + + patches: ['MEDCOUPLING-V7_8_BR-findXdr-CO9.patch'] +} diff --git a/products/patches/MEDCOUPLING-V7_8_BR-findXdr-CO9.patch b/products/patches/MEDCOUPLING-V7_8_BR-findXdr-CO9.patch new file mode 100644 index 0000000..92c8d7d --- /dev/null +++ b/products/patches/MEDCOUPLING-V7_8_BR-findXdr-CO9.patch @@ -0,0 +1,74 @@ +diff --git a/cmake_files/FindXDR.cmake b/cmake_files/FindXDR.cmake +index e8e86253..6e24b6fe 100644 +--- a/cmake_files/FindXDR.cmake ++++ b/cmake_files/FindXDR.cmake +@@ -1,4 +1,4 @@ +-# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE ++# Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE + # + # This library is free software; you can redistribute it and/or + # modify it under the terms of the GNU Lesser General Public +@@ -18,11 +18,11 @@ + # + + MESSAGE(STATUS "Check for XDR ...") +- +-FIND_PATH(XDR_INCLUDE_DIRS rpc/xdr.h) ++INCLUDE(FindPackageHandleStandardArgs) ++FIND_PATH(XDR_INCLUDE_DIRS rpc/xdr.h PATH_SUFFIXES tirpc) + IF(XDR_INCLUDE_DIRS) +- SET(XDR_DEFINITIONS "-DHAS_XDR") +-ENDIF() ++ SET(XDR_DEFINITIONS "-DHAS_XDR") ++ENDIF(XDR_INCLUDE_DIRS) + + IF(WIN32) + FIND_LIBRARY(XDR_LIBRARIES xdr) # To get the .lib file from XDR +@@ -34,7 +34,14 @@ IF(WIN32) + SET(XDR_INCLUDE_DIRS "${XDR_INCLUDE_DIRS2}") # Make the detection fail + ENDIF() + ENDIF() ++ FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDR REQUIRED_VARS XDR_INCLUDE_DIRS XDR_LIBRARIES) ++ELSE(WIN32) ++ FIND_LIBRARY(XDR_LIBRARY NAMES tirpc xdr) ++ IF(NOT XDR_LIBRARY) ++ MESSAGE(STATUS "Could not find XDR libraries ...") ++ ELSE() ++ MESSAGE(STATUS "Found XDR libraries ${XDR_LIBRARY} ...") ++ SET(XDR_LIBRARIES ${XDR_LIBRARY}) ++ ENDIF() ++ FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDR REQUIRED_VARS XDR_INCLUDE_DIRS) + ENDIF(WIN32) +- +-INCLUDE(FindPackageHandleStandardArgs) +-FIND_PACKAGE_HANDLE_STANDARD_ARGS(XDR REQUIRED_VARS XDR_INCLUDE_DIRS) +diff --git a/src/MEDCoupling_Swig/MEDCouplingMemArray.i b/src/MEDCoupling_Swig/MEDCouplingMemArray.i +index f2303876..1fa0d980 100644 +--- a/src/MEDCoupling_Swig/MEDCouplingMemArray.i ++++ b/src/MEDCoupling_Swig/MEDCouplingMemArray.i +@@ -2933,7 +2933,7 @@ namespace ParaMEDMEM + if(PyInt_Check(nbOfTuples)) + { + int nbOfTuples1=PyInt_AS_LONG(nbOfTuples); +- if(nbOfTuples<0) ++ if( (int) PyInt_AsLong(nbOfTuples) < 0) + throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !"); + if(nbOfComp) + { +diff --git a/src/MEDLoader/CMakeLists.txt b/src/MEDLoader/CMakeLists.txt +index 6d0ed57c..b6dae338 100644 +--- a/src/MEDLoader/CMakeLists.txt ++++ b/src/MEDLoader/CMakeLists.txt +@@ -38,10 +38,12 @@ IF(WIN32) + SET(MEDLOADER_XDR_LIBRARIES ${XDR_LIBRARIES}) + ENDIF(MEDCOUPLING_MEDLOADER_USE_XDR) + ELSE(WIN32) ++ SET(MEDLOADER_XDR_LIBRARIES ${XDR_LIBRARIES}) + SET(MEDLOADER_XDR_INCLUDE_DIRS ${XDR_INCLUDE_DIRS}) + ENDIF(WIN32) + + INCLUDE_DIRECTORIES( ++ ${XDR_INCLUDE_DIR} + ${MEDFILE_INCLUDE_DIRS} + ${HDF5_INCLUDE_DIRS} + ${MEDLOADER_XDR_INCLUDE_DIRS}