diff --git a/cmake/python_binding.cmake b/cmake/python_binding.cmake index 1a54539..d04c9f9 100644 --- a/cmake/python_binding.cmake +++ b/cmake/python_binding.cmake @@ -9,6 +9,7 @@ find_package (SWIG 3 REQUIRED) #find_package (Python REQUIRED COMPONENTS Interpreter Development) # Rem : Python3 a la priorité => inutilisé car empêche l'accès à Python2 if (USE_PYTHON_3) message (STATUS "========================================= UTILISATION DE PYTHON 3 =========================================") + set (Python3_FIND_STRATEGY LOCATION) # Nécessaire pour python >= 3.10 find_package (Python3 REQUIRED COMPONENTS Interpreter Development) set (Python_INCLUDE_DIRS ${Python3_INCLUDE_DIRS}) set (Python_EXECUTABLE ${Python3_EXECUTABLE}) @@ -45,7 +46,12 @@ macro (_set_from_python outvar python_code) endif ( ) endmacro ( ) -_set_from_python (_GET_PYTHON_SITEARCH "import sys; from distutils import sysconfig; sys.stdout.write (sysconfig.get_python_lib (plat_specific=True, standard_lib=False, prefix=''))") +if (USE_PYTHON_3) # ATTENTION, ne marche peut être pas pour 3.0 <= python < 3.12. Le cas échéant la commande du else doit convenir. + _set_from_python (_GET_PYTHON_SITEARCH "import os, sys, sysconfig; sitepackages=os.path.relpath (sysconfig.get_path('platlib'), sys.base_prefix); sys.stdout.write (sitepackages)") +else (USE_PYTHON_3) + _set_from_python (_GET_PYTHON_SITEARCH "import sys; from distutils import sysconfig; sys.stdout.write (sysconfig.get_python_lib (plat_specific=True, standard_lib=False, prefix=''))") +endif (USE_PYTHON_3) + set (PYTHON_BINDING_DIR ${_GET_PYTHON_SITEARCH}) set (CMAKE_PYTHON_RPATH_DIR ${CMAKE_INSTALL_PREFIX}/${_GET_PYTHON_SITEARCH}) diff --git a/cmake/version.cmake b/cmake/version.cmake index 732cfba..53f6f90 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -4,7 +4,7 @@ set (LIMA_MAJOR_VERSION "7") set (LIMA_MINOR_VERSION "10") -set (LIMA_RELEASE_VERSION "1") +set (LIMA_RELEASE_VERSION "2") set (LIMA_VERSION ${LIMA_MAJOR_VERSION}.${LIMA_MINOR_VERSION}.${LIMA_RELEASE_VERSION}) diff --git a/installation.txt b/installation.txt index b8f6f61..a71cd04 100644 --- a/installation.txt +++ b/installation.txt @@ -20,7 +20,7 @@ cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_ -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_XLMLIMA=ON -DBUILD_TESTS:BOOL=ON -DBUILD_SCRIPTING:BOOL=ON -DMACHINE_TYPES:BOOL=OFF -DSUMESH:BOOL=OFF -DFORMAT_MLI:BOOL=OFF -DFORMAT_MLI2:BOOL=ON -DFORMAT_MLI2:BOOL=ON \ -DBUILD_SHARED_LIBS:BOOL=ON -DINT_8:BOOL=ON -DREAL_8:BOOL=ON \ -DSWIG_EXECUTABLE=/opt/swig/4.1.1/bin/swig -DPython2_ROOT_DIR=/usr/lib/python2.7 -DHDF5_ROOT=/opt/HDF5/1.12.0 \ - -B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.10.0 + -B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.10.2 cmake --build /tmp/lima_build_dir cmake --install /tmp/lima_build_dir @@ -30,7 +30,7 @@ cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_ -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_XLMLIMA=ON -DBUILD_TESTS:BOOL=ON -DBUILD_SCRIPTING:BOOL=ON -DMACHINE_TYPES:BOOL=ON -DSUMESH:BOOL=ON -DFORMAT_MLI:BOOL=ON -DFORMAT_MLI2:BOOL=ON \ -DBUILD_SHARED_LIBS:BOOL=ON -DINT_8:BOOL=ON -DREAL_8:BOOL=ON \ -DSWIG_EXECUTABLE=/opt/swig/4.1.1/bin/swig -DPython2_ROOT_DIR=/usr/lib/python2.7 -DHDF5_ROOT=/opt/HDF5/1.12.0 -DHDF145_INCLUDE_DIR=/opt/hdf145/1.3.0/include -DHDF145CPP_LIBRARY=/opt/hdf145/1.3.0/lib/libhdf145_cpp.so -DHDF145_LIBRARY=/opt/hdf145/1.3.0/lib/libhdf145.so \ - -B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.10.0 + -B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.10.2 cmake --build /tmp/lima_build_dir cmake --install /tmp/lima_build_dir diff --git a/src/Lima/malipp2.cpp b/src/Lima/malipp2.cpp index 14d6b1c..4808daf 100644 --- a/src/Lima/malipp2.cpp +++ b/src/Lima/malipp2.cpp @@ -2041,7 +2041,7 @@ static size_t computeChunkSize (size_t count, size_t elementSize) MaliPPWriter2::MaliPPWriter2 (const IN_STD string& nom_fichier, size_type num) -: m_fileName(nom_fichier), m_meshNum(num), +: m_fileName(nom_fichier), m_meshNum(num), m_meshGroup ( ), m_hdfFile ( ), m_dim(D3), m_unilo(1.), m_unia(1.), @@ -2049,19 +2049,33 @@ MaliPPWriter2::MaliPPWriter2 (const IN_STD string& nom_fichier, size_type num) m_tycoo(CARTESIEN), m_titre(""), m_date(""), + m_nbMeshAttributes (0), + m_meshAttributesGroup ( ), m_nodesIsContiguous(false), m_nodeIndexCurrent(0), m_nbNodes(0), + m_nbNodeSet (0), + m_nbNodeAttributes (0), + m_nbNodeSetsAttributes (0), m_edgesIsContiguous(false), m_edgeIndexCurrent(0), m_nbEdges(0), + m_nbEdgeSet (0), + m_nbEdgeAttributes (0), + m_nbEdgeSetsAttributes (0), m_facesIsContiguous(false), m_faceIndexCurrent(0), m_nbFaces(0), + m_nbFaceSet (0), + m_nbFaceAttributes (0), + m_nbFaceSetsAttributes (0), m_nbNodesPerFaceIndexCurrent(0), m_regionsIsContiguous(false), m_regionIndexCurrent(0), m_nbRegions(0), + m_nbRegionSet (0), + m_nbRegionAttributes (0), + m_nbRegionSetsAttributes (0), m_nbNodesPerRegionIndexCurrent(0) { @@ -2384,10 +2398,46 @@ void MaliPPWriter2::close ( ) writeComposition (m_regionSetCompo[igrp], CELL3D_COMPOSITION_DATASET_NAME, m_regionSetGroups[igrp]); } - m_meshGroup = Group ( ); - m_hdfFile->flush(H5F_SCOPE_LOCAL); - m_hdfFile->close(); - m_hdfFile.reset (0); + m_meshGroup = Group ( ); + m_meshAttributesGroup = Group ( ); + m_nodeGroup = Group ( ); + m_nodeZCoordDataSet = DataSet ( ); + m_nodeYCoordDataSet = DataSet ( ); + m_nodeXCoordDataSet = DataSet ( ); + m_nodeIdsDataSet = DataSet ( ); + m_nodeSetGroup = Group ( ); + m_nodeSetGroups.clear ( ); + m_nodeSetIdsDataSet.clear ( ); + m_nodeAttributesGroup = Group ( ); + m_nodeSetsAttributesGroup = Group ( ); + m_edgeGroup = Group ( ); + m_edge2nodeIdsDataSet = DataSet ( ); + m_edgeIdsDataSet = DataSet ( ); + m_edgeSetGroup = Group ( ); + m_edgeSetGroups.clear ( ); + m_edgeSetIdsDataSet.clear ( ); + m_edgeAttributesGroup = Group ( ); + m_edgeSetsAttributesGroup = Group ( ); + m_faceGroup = Group ( ); + m_face2nodeIdsDataSet = DataSet ( ); + m_nbNodesPerFaceDataSet = DataSet ( ); + m_faceIdsDataSet = DataSet ( ); + m_faceSetGroup = Group ( ); + m_faceSetGroups.clear ( ); + m_faceSetIdsDataSet.clear ( ); + m_faceAttributesGroup = Group ( ); + m_faceSetsAttributesGroup = Group ( ); + m_regionGroup = Group ( ); + m_region2nodeIdsDataSet = DataSet ( ); + m_nbNodesPerRegionDataSet = DataSet ( ); + m_regionIdsDataSet = DataSet ( ); + m_regionSetGroup = Group ( ); + m_regionSetGroups.clear ( ); + m_regionSetIdsDataSet.clear ( ); + m_regionAttributesGroup = Group ( ); + m_regionSetsAttributesGroup = Group ( ); + + m_hdfFile.reset (0); // CP : invoque close ( ) COMPLETE_TRY_CATCH_BLOCK if (throwExc) {