From 6b9450454dab448670707038980a9582e3bca2f3 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Wed, 1 Dec 2021 10:56:43 +0100 Subject: [PATCH] add GMSH+GMSHPLUGIN windows --- applications/SALOME-9.8.0-windows.pyconf | 4 +- products/compil_scripts/gmsh-4.8.4.bat | 115 +++++++++++++++++++ products/gmsh.pyconf | 9 +- products/patches/GMSHPlugin_Mesher-ctx.patch | 12 +- products/patches/gmsh-4.8.4-windows.patch | 11 ++ 5 files changed, 143 insertions(+), 8 deletions(-) create mode 100644 products/compil_scripts/gmsh-4.8.4.bat create mode 100644 products/patches/gmsh-4.8.4-windows.patch diff --git a/applications/SALOME-9.8.0-windows.pyconf b/applications/SALOME-9.8.0-windows.pyconf index 4c60a68..8a9d0fd 100644 --- a/applications/SALOME-9.8.0-windows.pyconf +++ b/applications/SALOME-9.8.0-windows.pyconf @@ -55,7 +55,7 @@ APPLICATION : f2c : '1.0.0' freeimage : '3.18.0' freetype : '2.9.1' - #gmsh : '4.1.4' + gmsh : '4.8.4' graphviz : '2.44.1' hdf5 : '1.10.3' idna : '2.8' @@ -143,7 +143,7 @@ APPLICATION : 'GHS3DPLUGIN' 'HYBRIDPLUGIN' 'HexoticPLUGIN' - #'GMSHPLUGIN' + 'GMSHPLUGIN' 'HEXABLOCK' 'HEXABLOCKPLUGIN' #'HOMARD' diff --git a/products/compil_scripts/gmsh-4.8.4.bat b/products/compil_scripts/gmsh-4.8.4.bat new file mode 100644 index 0000000..c27db8e --- /dev/null +++ b/products/compil_scripts/gmsh-4.8.4.bat @@ -0,0 +1,115 @@ +@echo off + +echo ########################################################################## +echo gmsh %VERSION% +echo ########################################################################## + + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% +if NOT exist "%PRODUCT_INSTALL%\include" mkdir %PRODUCT_INSTALL%\include +if NOT exist "%PRODUCT_INSTALL%\bin" mkdir %PRODUCT_INSTALL%\bin + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +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% -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 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_PARSER=ON +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% -DENABLE_TESTS=OFF +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_PLUGINS=OFF +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_GENERATOR:STRING="Visual Studio 15 2017 Win64" +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DENABLE_BLAS_LAPACK=OFF +set MSBUILDDISABLENODEREUSE=1 + +echo. +echo ********************************************************************* +echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% +echo ********************************************************************* +echo. + +%CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% +if NOT %ERRORLEVEL% == 0 ( + echo "ERROR on cmake" + exit 1 +) + +echo. +echo ********************************************************************* +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=Release /p:Platform=x64 ALL_BUILD.vcxproj +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=Release /p:Platform=x64 ALL_BUILD.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild gmsh.vcxproj + exit 2 +) + +echo. +echo ********************************************************************* +echo *** installation... +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=Release /p:Platform=x64 INSTALL.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild INSTALL.vcxproj + exit 3 +) + +echo. +echo ********************************************************************* +echo *** installation Headers... +echo ********************************************************************* +echo. +msbuild /p:Configuration=Release /p:Platform=x64 /p:BuildProjectReferences=false get_headers.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild get_headers.vcxproj + exit 4 +) + +copy /Y /B %BUILD_DIR%\Release\gmsh.lib %PRODUCT_INSTALL%\bin\gmsh.lib +copy /Y /B %BUILD_DIR%\Release\gmsh.exp %PRODUCT_INSTALL%\bin\gmsh.exp + +SETLOCAL ENABLEDELAYEDEXPANSION +FOR %%f IN (gmsh.h gmsh.h_cwrap gmshc.h) do ( + set X=%%f + copy /Y %SOURCE_DIR%\api\%%f %PRODUCT_INSTALL%\include\%X% +) +ENDLOCAL + +cd %BUILD_DIR%\Headers\gmsh +SETLOCAL ENABLEDELAYEDEXPANSION +FOR %%f IN (*.h) do ( + set X=%%f + copy /Y %SOURCE_DIR%\api\%%f %PRODUCT_INSTALL%\include\%X% +) +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 diff --git a/products/gmsh.pyconf b/products/gmsh.pyconf index 54f30fd..2f81ed6 100644 --- a/products/gmsh.pyconf +++ b/products/gmsh.pyconf @@ -18,11 +18,12 @@ default : { incremental : "yes" } + patches: [] } default_win: { - depend : ["CAS"] + depend : ["CAS", "pthreads"] } version_4_8_4: @@ -30,6 +31,12 @@ version_4_8_4: compil_script : "gmsh-4.8.4.sh" } +version_4_8_4_win: +{ + compil_script : "gmsh-4.8.4.bat" + patches: ['gmsh-4.8.4-windows.patch'] +} + version_4_1_4: { } diff --git a/products/patches/GMSHPlugin_Mesher-ctx.patch b/products/patches/GMSHPlugin_Mesher-ctx.patch index 017c0f0..814b2fe 100644 --- a/products/patches/GMSHPlugin_Mesher-ctx.patch +++ b/products/patches/GMSHPlugin_Mesher-ctx.patch @@ -1,13 +1,15 @@ ---- GMSHPLUGIN_ref/src/GMSHPlugin/GMSHPlugin_Mesher.cxx 2020-12-29 09:19:07.932776533 +0100 -+++ GMSHPLUGIN/src/GMSHPlugin/GMSHPlugin_Mesher.cxx 2020-12-29 09:17:14.885840621 +0100 -@@ -938,7 +938,10 @@ void GMSHPlugin_Mesher::mymsg::operator +diff --git a/src/GMSHPlugin/GMSHPlugin_Mesher.cxx b/src/GMSHPlugin/GMSHPlugin_Mesher.cxx +index 8ac85b5..3a5c1ad 100644 +--- a/src/GMSHPlugin/GMSHPlugin_Mesher.cxx ++++ b/src/GMSHPlugin/GMSHPlugin_Mesher.cxx +@@ -1028,8 +1028,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(); ++#endif } else + printf("%s\n", oss.str().c_str()); diff --git a/products/patches/gmsh-4.8.4-windows.patch b/products/patches/gmsh-4.8.4-windows.patch new file mode 100644 index 0000000..ecc81c9 --- /dev/null +++ b/products/patches/gmsh-4.8.4-windows.patch @@ -0,0 +1,11 @@ +diff -Naur gmsh_ref/CMakeLists.txt gmsh_new/CMakeLists.txt +--- gmsh_ref/CMakeLists.txt 2021-04-28 09:09:29.000000000 +0200 ++++ gmsh_new/CMakeLists.txt 2021-12-01 00:25:02.000000000 +0100 +@@ -1357,7 +1357,6 @@ + endif() + if(WIN32) + list(APPEND EXTERNAL_LIBRARIES "winspool") +- add_definitions(-DOCC_CONVERT_SIGNALS) + elseif(MSVC) + add_definitions(-DWNT) + endif() -- 2.39.2