]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
spns #42014: add mmgplugin
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Thu, 23 May 2024 19:36:37 +0000 (21:36 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 27 May 2024 11:53:32 +0000 (13:53 +0200)
applications/SALOME-master-native.pyconf
applications/SALOME-master-windows.pyconf
applications/SALOME-master.pyconf
products/compil_scripts/mmg-5.6.0.bat [new file with mode: 0644]
products/compil_scripts/mmg-5.6.0.sh [new file with mode: 0755]
products/env_scripts/mmg.py [new file with mode: 0644]
products/env_scripts/mmgplugin.py [new file with mode: 0644]
products/mmg.pyconf [new file with mode: 0644]
products/mmgplugin.pyconf [new file with mode: 0644]
products/patches/mmgplugin-4ea7299-p01_windows.patch [new file with mode: 0644]

index 7ad84e826eaeb553ebf2ec124a359ab95deae557..64d6d156f2cc25c58272a660586e6aef0af935f2 100644 (file)
@@ -84,6 +84,8 @@ APPLICATION :
         meshio: '5.3.5'
         metis : 'native'
         mpi4py: 'native'
+        mmg : '5.6.0'
+        mmgplugin: '4ea7299'
         netgen : '5.3.1_with_CAS_7.8'
         # comment out line above and uncomment the line below to use Netgen 6.
         #netgen : '6.2.2101'
index 59360662051821815cb72b6d5806fdcd85b44abe..5a84f5291d9ed9a7e56a5ad7d5bf893f4fba386e 100644 (file)
@@ -89,6 +89,8 @@ APPLICATION :
         MeshGems : '2.15-1'
         meshio: '5.3.5'
         metis : '5.1.0'
+        mmg : '5.6.0'
+        mmgplugin: '4ea7299'
         msvc : '2017'
         netcdf : '4.6.2'
         netCDF4: '1.6.5'
index d2cb721373813320df3aff1aea6c89e102f6ee19..d67c11c1281024abb4f3fb7cc9310b895abc660c 100644 (file)
@@ -66,6 +66,8 @@ APPLICATION :
         gcc  :  '8.5.0'
         mpc : 'native'
         gmp : 'native'
+        mmg : '5.6.0'
+        mmgplugin: '4ea7299'
         mpfr : 'native'
         gdal : '2.4.0'
         gmsh : '4.10.3_with_CAS_7.8'
diff --git a/products/compil_scripts/mmg-5.6.0.bat b/products/compil_scripts/mmg-5.6.0.bat
new file mode 100644 (file)
index 0000000..478ed7d
--- /dev/null
@@ -0,0 +1,18 @@
+@echo off
+
+echo ##########################################################################
+echo mmg %VERSION%
+echo ##########################################################################
+
+if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL%
+mkdir %PRODUCT_INSTALL%\bin
+
+cd %SOURCE_DIR%
+xcopy %SOURCE_DIR%\*.exe %PRODUCT_INSTALL%\bin /E /I /Q
+if NOT %ERRORLEVEL% == 0 (
+    echo ERROR on xcopy
+    exit 1
+)
+
+echo.
+echo ########## END
diff --git a/products/compil_scripts/mmg-5.6.0.sh b/products/compil_scripts/mmg-5.6.0.sh
new file mode 100755 (executable)
index 0000000..893fe87
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+echo "##########################################################################"
+echo "mmg " $VERSION
+echo "##########################################################################"
+
+echo "Installing binary version"
+if [ ! -d $PRODUCT_INSTALL ]; then
+    mkdir -p $PRODUCT_INSTALL
+fi
+ls $SOURCE_DIR -ltr
+mkdir -p $PRODUCT_INSTALL/bin
+cp -r $SOURCE_DIR/* $PRODUCT_INSTALL/bin
+
+for f in $(ls $PRODUCT_INSTALL/bin); do
+    chmod 755 $PRODUCT_INSTALL/bin/$f
+done
+
+echo
+echo "########## END"
+
diff --git a/products/env_scripts/mmg.py b/products/env_scripts/mmg.py
new file mode 100644 (file)
index 0000000..207cadb
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+#-*- coding:utf-8 -*-
+
+import os.path
+import platform
+
+def set_env(env, prereq_dir, version):
+  env.set('MMG_ROOT_DIR', prereq_dir)
+  env.prepend('PATH', os.path.join(prereq_dir, 'bin'))
+
+def set_nativ_env(env):
+  pass
diff --git a/products/env_scripts/mmgplugin.py b/products/env_scripts/mmgplugin.py
new file mode 100644 (file)
index 0000000..cdff61a
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+#-*- coding:utf-8 -*-
+
+import os.path
+import platform
+
+def set_env(env, prereq_dir, version):
+  env.set('MMGPLUGIN_ROOT_DIR', prereq_dir)
+  env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'plugins'))
+
+def set_nativ_env(env):
+  pass
diff --git a/products/mmg.pyconf b/products/mmg.pyconf
new file mode 100644 (file)
index 0000000..3150693
--- /dev/null
@@ -0,0 +1,48 @@
+default :
+{
+    name : "mmg"
+    build_source : "script"
+    compil_script : "mmg" + $VARS.scriptExtension
+    get_source : "archive"
+    environ :
+    {
+       env_script : $name + ".py"
+    }
+    depend : ["SMESH"]
+    build_depend : ["cmake"]
+    patches : []
+    source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
+    build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name
+    install_dir : "base"
+    properties:
+    {
+      incremental : "yes"
+    }
+} 
+
+default_win:
+{
+    properties :
+    {
+      incremental : "yes"
+      single_install_dir : "yes" # aimed to solve sat #18914
+    }
+}
+
+version_5_6_0 :
+{
+   compil_script : "mmg-5.6.0.sh"
+   archive_info : {archive_name : "mmg-5.6.0-Linux-4.4.0-170-generic-appli.tar.gz"}
+}
+
+
+version_5_6_0_win :
+{
+   compil_script : "mmg-5.6.0.bat"
+   archive_info : {archive_name : "mmg-5.6.0-Windows-10.0.19042-appli.tar.gz"}
+    properties :
+    {
+      incremental : "yes"
+      single_install_dir : "yes" # aimed to solve sat #18914
+    }
+}
diff --git a/products/mmgplugin.pyconf b/products/mmgplugin.pyconf
new file mode 100644 (file)
index 0000000..8ff49ae
--- /dev/null
@@ -0,0 +1,49 @@
+default :
+{
+    name : "mmgplugin"
+    build_source : "cmake"
+    cmake_options : ""
+    get_source : "git"
+    git_info:
+    {
+      repositories :
+      {
+        github : $PROJECTS.projects.salome.git_info.git_server.github.url + "mmgplugin.git"
+      }
+    }
+    patches : []
+    system_info : 
+    {
+        rpm : []
+        rpm_dev : []
+        apt : []
+        apt_dev : []
+    }
+    environ :
+    {
+       env_script : $name + ".py"
+    }
+    depend : ["SMESH",
+              "mmg",
+              "PyQt",
+              "Python",
+              "numpy"
+             ]
+    build_depend : ["cmake", "cppunit"]
+    opt_depend : []
+    source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
+    build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name
+    install_dir : 'base'
+    properties :
+    {
+      incremental : "yes"
+      single_install_dir : "no"
+    }
+}
+
+version_4ea7299:
+{
+  get_source : "archive"
+  archive_info: {archive_name: 'mmgplugin-4ea7299.tar.gz'}
+  patches : ['mmgplugin-4ea7299-p01_windows.patch']
+}
diff --git a/products/patches/mmgplugin-4ea7299-p01_windows.patch b/products/patches/mmgplugin-4ea7299-p01_windows.patch
new file mode 100644 (file)
index 0000000..fc333ef
--- /dev/null
@@ -0,0 +1,30 @@
+diff --git a/myMmgPlugDialog.py b/myMmgPlugDialog.py
+index e03a576..4418d15 100644
+--- a/myMmgPlugDialog.py
++++ b/myMmgPlugDialog.py
+@@ -25,6 +25,7 @@ import os, subprocess
+ import tempfile
+ import re
+ import sys
++import platform
+ from mmgplugin.MyPlugDialog_ui import Ui_MyPlugDialog
+ from mmgplugin.myViewText import MyViewText
+ from qtsalome import *
+@@ -608,13 +609,13 @@ Default Values' button.
+     self.commande=""
+     selected_index = self.COB_Remesher.currentIndex()
+     if selected_index == REMESHER_DICT['MMGS']:
+-      self.commande = "mmgs_O3"
++        self.commande = "mmgs_O3" if platform.system() != "Windows" else  "mmgs.exe"
+     elif selected_index == REMESHER_DICT['MMG2D']:
+-      self.commande = "mmg2d_O3"
++      self.commande = "mmg2d_O3" if platform.system() != "Windows" else  "mmg2d.exe"
+     elif selected_index == REMESHER_DICT['MMG3D']:
+-      self.commande = "mmg3d_O3"
++      self.commande = "mmg3d_O3" if platform.system() != "Windows" else  "mmg3d.exe"
+     else:
+-      self.commande = "mmgs_O3"
++      self.commande = "mmgs_O3" if platform.system() != "Windows" else  "mmgs.exe"
+     deb=os.path.splitext(self.fichierIn)
+     self.fichierOut=deb[0] + "_output.mesh"