]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
bos #18709 [CEA][Windows] Adding GMSH/GMSHPLUGIN to SALOME
authornghodban <Nabil.Ghodbane@c-s.fr>
Mon, 28 Dec 2020 11:38:03 +0000 (12:38 +0100)
committernghodban <Nabil.Ghodbane@c-s.fr>
Mon, 28 Dec 2020 11:38:07 +0000 (12:38 +0100)
products/GMSHPLUGIN.pyconf
products/compil_scripts/gmsh.bat
products/gmsh.pyconf
products/patches/GMSHPlugin_Mesher-ctx.patch [new file with mode: 0644]
products/patches/gmsh_4_1_4-win.patch [new file with mode: 0644]

index eef7865c36762179580e7e9a4427f16f2ba63df0..09d06f12436b927c50229a5ef95d0ffd709a7627 100644 (file)
@@ -27,9 +27,15 @@ default :
     properties:
     {
         is_SALOME_module : "yes"
+        incremental : "yes"
     }
+    patches: []
 }
 
+default_win :
+{
+   patches : ['patches/GMSHPlugin_Mesher-ctx.patch']
+}
 
 version_8_1_0_to_9_1_0 :
 {
index e47cb4bcafbcc44b24454737ff8feb4a5e3a020e..d277401e275389f46d75bddabb586306a54418b9 100644 (file)
@@ -13,12 +13,13 @@ REM clean BUILD directory
 if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR%
 mkdir %BUILD_DIR%
 
-SET BLAS_LAPACK_LIBRARIES="%LAPACK_ROOT_DIR%\lib\libblas.dll.a;%LAPACK_ROOT_DIR%\lib\libcblas.dll.a;%LAPACK_ROOT_DIR%\lib\liblapack.dll.a;%LAPACK_ROOT_DIR%\lib\liblapacke.dll.a"
+REM SET BLAS_LAPACK_LIBRARIES="%LAPACK_ROOT_DIR%\lib\libblas.dll.a;%LAPACK_ROOT_DIR%\lib\libcblas.dll.a;%LAPACK_ROOT_DIR%\lib\liblapack.dll.a;%LAPACK_ROOT_DIR%\lib\liblapacke.dll.a"
 cd %BUILD_DIR%
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/%
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE=Release
-set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBUILD_LIB=ON
-set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBUILD_SHARED=ON
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_BUILD_LIB=ON
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_BUILD_SHARED=ON
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_BUILD_DYNAMIC=ON
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_ACIS=OFF 
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_FLTK=OFF
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_ONELAB_METAMODEL=OFF
@@ -27,9 +28,11 @@ set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_PETSC=OFF
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_PRIVATE_API=ON
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_CGNS=OFF
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_HXT=OFF 
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_SOLVER=ON
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_GMM=ON
 set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_GENERATOR:STRING="Visual Studio 15 2017 Win64"
-set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBLAS_LAPACK_LIBRARIES:STRING=%BLAS_LAPACK_LIBRARIES%
-
+set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_BLAS_LAPACK=OFF
+REM Set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBLAS_LAPACK_LIBRARIES:STRING=%BLAS_LAPACK_LIBRARIES%
 set MSBUILDDISABLENODEREUSE=1
 
 echo.
@@ -97,5 +100,16 @@ FOR %%f IN (*.h) do (
 )
 ENDLOCAL
 
+cd %PRODUCT_INSTALL%\include\gmsh
+SETLOCAL ENABLEDELAYEDEXPANSION
+FOR %%f IN (*.h) do (
+   set X=%%f
+   copy /Y %PRODUCT_INSTALL%\include\gmsh\%%f %PRODUCT_INSTALL%\include\%X%
+)
+ENDLOCAL
+
+REM these two files need to be moved to bin, adding bin directory to PATH does not help.
+cp %PRODUCT_INSTALL%\lib\gmsh.py %PRODUCT_INSTALL%\bin\gmsh.py
+cp %PRODUCT_INSTALL%\lib\gmsh.dll %PRODUCT_INSTALL%\bin\gmsh.dll
 echo.
 echo ########## END
\ No newline at end of file
index c75f8f754253322fa62d69b2e1c37dfbde542f3b..22619a9ca04294b2170493a1816306dbed60ce1d 100644 (file)
@@ -19,3 +19,17 @@ default :
       incremental : "yes"
     }
 } 
+
+default_win:
+{
+    depend : ["CAS"]
+}
+
+version_4_1_4:
+{
+}
+
+version_4_1_4_win:
+{
+   patches : ['gmsh_4_1_4-win.patch"]
+}
\ No newline at end of file
diff --git a/products/patches/GMSHPlugin_Mesher-ctx.patch b/products/patches/GMSHPlugin_Mesher-ctx.patch
new file mode 100644 (file)
index 0000000..f0d2ff9
--- /dev/null
@@ -0,0 +1,15 @@
+diff --git a/src/GMSHPlugin/GMSHPlugin_Mesher.cxx b/src/GMSHPlugin/GMSHPlugin_Mesher.cxx
+index 282551b..c935857 100644
+--- a/src/GMSHPlugin/GMSHPlugin_Mesher.cxx
++++ b/src/GMSHPlugin/GMSHPlugin_Mesher.cxx
+@@ -938,7 +938,10 @@ void  GMSHPlugin_Mesher::mymsg::operator()(std::string level, std::string msg)
+     }
+     if (level == "Fatal")
+     {
++#ifndef WIN32
+         CTX::instance()->lock = 0;
++#endif
++
+         throw oss.str();
+     }
+     else
diff --git a/products/patches/gmsh_4_1_4-win.patch b/products/patches/gmsh_4_1_4-win.patch
new file mode 100644 (file)
index 0000000..f849d3a
--- /dev/null
@@ -0,0 +1,15 @@
+--- gmsh_ref/api/gmsh.h        2019-02-02 13:03:46.000000000 +0100
++++ gmsh/api/gmsh.h    2020-12-26 15:00:16.000000000 +0100
+@@ -34,6 +34,12 @@
+ #define GMSH_API
+ #endif
++#ifdef WIN32
++#if !defined(M_PI)
++  #define M_PI 3.14159265358979323846264338327950
++#endif // M_PI
++#endif
++
+ namespace gmsh {
+   // A geometrical entity in the Gmsh API is represented by two integers: its