Skip to content

Commit 920d807

Browse files
Merge pull request #6 from LIHPC-Computational-Geometry/warn_mli_obsolete
Version 7.9.3. Warning display in console during read/write operation…
2 parents c120818 + 08576fc commit 920d807

File tree

10 files changed

+39
-5
lines changed

10 files changed

+39
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ option (FORMAT_MLI2 "Format remplaçant le format MLI recommandé partout. Requi
2424
option (BUILD_SCRIPTING "Génération du wrapper swig/python pour utilisation scriptée de Lima." ON)
2525
option (BUILD_XLMLIMA "Utilitaire xlmlima (conversions, préparations de maillages), symetrise (symétrisation / x, y ou z)." ON)
2626
option (BUILD_TESTS "Création de l'utilitaire comparaison." OFF)
27+
option (DISABLE_MLI_WARNING "Désactivation de l'affichage d'un avertissement signalant que le format mli est obsolète et recommandant en remplacement l'usage du format mli2." OFF)
2728

2829
add_subdirectory (src)
2930
enable_testing ( )

cmake/version.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
set (LIMA_MAJOR_VERSION "7")
66
set (LIMA_MINOR_VERSION "9")
7-
set (LIMA_RELEASE_VERSION "2")
7+
set (LIMA_RELEASE_VERSION "3")
88
set (LIMA_VERSION ${LIMA_MAJOR_VERSION}.${LIMA_MINOR_VERSION}.${LIMA_RELEASE_VERSION})
99

1010

installation.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_
2020
-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 \
2121
-DBUILD_SHARED_LIBS:BOOL=ON -DINT_8:BOOL=ON -DREAL_8:BOOL=ON \
2222
-DSWIG_EXECUTABLE=/opt/swig/4.1.1/bin/swig -DPython2_ROOT_DIR=/usr/lib/python2.7 -DHDF5_ROOT=/opt/HDF5/1.12.0 \
23-
-B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.9.1
23+
-B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.9.3
2424
cmake --build /tmp/lima_build_dir
2525
cmake --install /tmp/lima_build_dir
2626

@@ -30,7 +30,7 @@ cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_
3030
-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 \
3131
-DBUILD_SHARED_LIBS:BOOL=ON -DINT_8:BOOL=ON -DREAL_8:BOOL=ON \
3232
-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 \
33-
-B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.9.1
33+
-B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.9.3
3434
cmake --build /tmp/lima_build_dir
3535
cmake --install /tmp/lima_build_dir
3636

src/Lima/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ target_compile_definitions (Lima PUBLIC ${LIMA_KERNEL_PUBLIC_FLAGS})
109109
target_compile_options (Lima PRIVATE ${LIMA_KERNEL_PRIVATE_FLAGS})
110110
target_compile_definitions (Lima PUBLIC ${ICEMCFD_FLAGS})
111111
target_compile_definitions (Lima PUBLIC ${EXTERNAL_LIBS_FLAGS})
112+
if (DISABLE_MLI_WARNING)
113+
target_compile_definitions (Lima PRIVATE "DISABLE_MLI_WARNING")
114+
endif (DISABLE_MLI_WARNING)
112115
# Threads::Threads : A ne pas mettre en PRIVATE car "référence au symbole non défini «sem_getvalue@@GLIBC_2.2.5»"
113116
target_link_libraries (Lima PUBLIC Threads::Threads)
114117

src/Lima/malipp.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,10 @@ Group MaliPPReader::groupe_attribut (ENTITE entite)
18041804

18051805
void MaliPPReader::lire_entete_maillage ( )
18061806
{
1807+
#ifndef DISABLE_MLI_WARNING
1808+
// Avertissement écrit en bleu puis restauration couleur par défaut.
1809+
cerr << "\033[34m" << "ATTENTION : le format mli est obsolète. Nous recommandons d'utiliser à la place le format mli2 qui reprend les mêmes caractéristiques." << "\033[39m" << endl;
1810+
#endif // DISABLE_MLI_WARNING
18071811
// Inactivation de l'affichage des messages d'erreur HDF sur le terminal :
18081812
HDFErrorHandlerManager errorHandlerManager;
18091813

@@ -2190,6 +2194,11 @@ void MaliPPWriter::writeVersionsInfos (H5Object& root)
21902194
//! Ecriture du header d'un maillage. Création si nécessaire.
21912195
void MaliPPWriter::writeMeshHeader ( )
21922196
{
2197+
#ifndef DISABLE_MLI_WARNING
2198+
// Avertissement écrit en bleu puis restauration couleur par défaut.
2199+
cerr << "\033[34m" << "ATTENTION : le format mli est obsolète. Nous recommandons d'utiliser à la place le format mli2 qui reprend les mêmes caractéristiques." << "\033[39m" << endl;
2200+
#endif // DISABLE_MLI_WARNING
2201+
21932202
BEGIN_TRY_CATCH_BLOCK("MaliPPWriter::writeMeshHeader ")
21942203

21952204
// Inactivation de l'affichage des messages d'erreur HDF sur le terminal :

src/Lima/public/Lima/malipp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,11 @@ struct HDFAttributeDescriptor
8484

8585

8686
/** Classe de lecture de fichiers au format mali++ (extensions mli, mliz).
87-
* L'usage des diverses fonctions membres de cette classe requiert que le
88-
* constructeur n'ait levé aucune exception.
87+
* L'usage des diverses fonctions membres de cette classe requiert que le constructeur n'ait levé aucune exception.
88+
* @deprecated
89+
* @warning Ce format de fichier est obsolète, la maintenance du lecteur/écrivain n'est pas garantie. Ce format
90+
* est remplacé par le format mli2, de structure analogue et reposant sur une version de HDF5 supérieure
91+
* ou égale à 1.10.0.
8992
*/
9093
class MaliPPReader
9194
{

src/Lima/public/LimaP/reader_malipp.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
/*!
1515
\file reader_malipp.h
1616
\brief Interface de lecture / ecriture pour les fichiers MALI++ (.mli/.mliz)
17+
\deprecated
18+
\warning Ce format de fichier est obsolète, la maintenance du lecteur/écrivain n'est pas garantie. Ce format
19+
est remplacé par le format mli2, de structure analogue et reposant sur une version de HDF5 supérieure
20+
ou égale à 1.10.0.
1721
*/
1822

1923
#ifndef _READER_MALIPP_H

src/Lima/reader_malipp.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,10 @@ void _WriterMalipp::ecrire ( )
19871987
//! Creation (si nécessaire) du header d'un fichier HDF5
19881988
void _WriterMalipp::createMainHeader ( )
19891989
{
1990+
#ifndef DISABLE_MLI_WARNING
1991+
// Avertissement écrit en bleu puis restauration couleur par défaut.
1992+
cerr << "\033[34m" << "ATTENTION : le format mli est obsolète. Nous recommandons d'utiliser à la place le format mli2 qui reprend les mêmes caractéristiques." << "\033[39m" << endl;
1993+
#endif // DISABLE_MLI_WARNING
19901994
hsize_t strDims [1];
19911995
hsize_t strMaxDims [1];
19921996

src/Xlmlima_exe/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ add_executable (xlmlima ${CPP_SOURCES})
99

1010
target_compile_definitions (xlmlima PRIVATE XLMLIMA_VERSION="${LIMA_VERSION}")
1111
target_compile_definitions (xlmlima PRIVATE ${LIMA_CFLAGS})
12+
if (DISABLE_MLI_WARNING)
13+
target_compile_definitions (xlmlima PRIVATE "DISABLE_MLI_WARNING")
14+
endif (DISABLE_MLI_WARNING)
1215
target_include_directories (xlmlima PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/protected)
1316
target_link_libraries (xlmlima PRIVATE Lima)
1417

src/Xlmlima_exe/XlmLimaFactory.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@ void XlmLimaFactory::syntax ( )
303303
message += string ("\n");
304304
message += string ("auto : format déterminé par l'extension du fichier.");
305305
message += string ("\n");
306+
#ifdef __INTERNE_MALIPP
307+
# ifndef DISABLE_MLI_WARNING
308+
// Avertissement écrit souligné puis restauration du style par défaut.
309+
message += string ("\033[4m") + string ("ATTENTION :") + string ("\033[24m") + string (" le format mli est obsolète. Nous recommandons d'utiliser à la place le format mli2 qui reprend les mêmes caractéristiques.");
310+
message += string ("\n");
311+
# endif // DISABLE_MLI_WARNING
312+
#endif // __INTERNE_MALIPP
306313
message += string ("Préparations :");
307314
message += string (" minimale maximale codeb codea mailleur2d codet");
308315
message += string (" partitionnement3d lissage3d codea-d3d noeuds");

0 commit comments

Comments
 (0)