]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
bos 32536:
authorasozinov <alexey.sozinov@opencascade.com>
Wed, 2 Nov 2022 10:55:25 +0000 (13:55 +0300)
committerasozinov <alexey.sozinov@opencascade.com>
Tue, 8 Nov 2022 08:23:18 +0000 (11:23 +0300)
update config file for netgen
added patches for netgen 6.2.2204 with fix and revert OCC find procedure

applications/SALOME-master-native.pyconf
applications/SALOME-master-windows.pyconf
products/netgen.pyconf
products/patches/netgen-6.2.2204-for-SALOME-OCC_find.patch [new file with mode: 0644]
products/patches/netgen-6.2.2204-for-SALOME.patch [new file with mode: 0644]

index fb9064247982a2d1068bb1d3bda97127fb87013c..9c9883bd24da858405d0b29a999048802bcc4dd2 100644 (file)
@@ -79,9 +79,9 @@ APPLICATION :
         MeshGems : '2.14-4'
         metis : 'native'
         mpi4py: 'native'
-        netgen : '5.3.1_with_CAS_7.2'
+        #netgen : '5.3.1_with_CAS_7.2'
         # comment out line above and uncomment the line below to use Netgen 6.
-        #netgen : '6.2.2101'
+        netgen : '6.2.2204'
         netcdf : 'native'
         nlopt : '2.4.2'
         nose: 'native'
@@ -148,8 +148,8 @@ APPLICATION :
         'MEDCOUPLING' : {tag:'master', base: 'no', section: 'default_MPI', hpc: 'yes'}
         'GUI'
         'GEOM'
-        'SMESH'
-        'NETGENPLUGIN'
+        'SMESH' : 'V9_10_0a2'
+        'NETGENPLUGIN' : 'asozinov/32536'
         'BLSURFPLUGIN'
         'GHS3DPLUGIN'
         'GHS3DPRLPLUGIN'
index eaba41128aa0d03d1d35832e5958c235f1d13a41..52bf30ae56f786f5723d887be6cadf14e4b9ab81 100644 (file)
@@ -79,9 +79,10 @@ APPLICATION :
         MeshGems : '2.14-4'
         metis : '5.1.0'
         msvc : '2017'
-        netgen : '5.3.1_with_CAS_7.2'
+        #netgen : '5.3.1_with_CAS_7.2'
         # comment out line above and uncomment the line below to use Netgen 6.
         #netgen : '6.2.2101'
+        netgen : '6.2.2204'
         nlopt : '2.5.0'
         numpy : '1.16.4'
         omniORB : '4.2.3'
@@ -143,8 +144,8 @@ APPLICATION :
         'MEDCOUPLING'
         'GUI'
         'GEOM'
-        'SMESH'
-        'NETGENPLUGIN'
+        'SMESH' : 'V9_10_0a2'
+        'NETGENPLUGIN' : 'asozinov/32536'
         'BLSURFPLUGIN'
         'GHS3DPLUGIN'
         'HYBRIDPLUGIN'
index 05e01d166e7a9918306d19c81421041c0a477fff..6905cf474e33ccd71f469de81f3827bcac639dca 100644 (file)
@@ -24,6 +24,18 @@ default_win:
    depend : ['CAS','zlib','tcltk']
 }
 
+version_6_2_2204 :
+{
+   build_source : "cmake"
+   cmake_options : " -DUSE_GUI=OFF -DUSE_PYTHON=OFF -DUSE_MPI=OFF -DUSE_OCC=ON -DUSE_INTERNAL_TCL=OFF -DBUILD_STUB_FILES=OFF -DOCC_INCLUDE_DIR=$CAS_ROOT_DIR/include/opencascade -DOCC_LIBRARY_DIR=$CAS_ROOT_DIR/lib -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_CXX_STANDARD=17  -DUSE_NATIVE_ARCH=OFF "
+   patches : ['netgen-6.2.2204-for-SALOME.patch', 'netgen-6.2.2204-for-SALOME-OCC_find.patch']
+   properties :
+   {
+     incremental : "yes"
+     single_install_dir : "yes"
+   }
+}
+
 version_6_2_2101 :
 {
    build_source : "cmake"
diff --git a/products/patches/netgen-6.2.2204-for-SALOME-OCC_find.patch b/products/patches/netgen-6.2.2204-for-SALOME-OCC_find.patch
new file mode 100644 (file)
index 0000000..b479e26
--- /dev/null
@@ -0,0 +1,190 @@
+ CMakeLists.txt                            |  64 +-----------------
+ cmake/cmake_modules/FindOpenCasCade.cmake | 105 ++++++++++++++++++++++++++++++
+ 2 files changed, 108 insertions(+), 61 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0a05ebb1..d55dc03c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -349,67 +349,9 @@ install(TARGETS netgen_mpi netgen_metis ${NG_INSTALL_DIR})
+ #######################################################################
+ if (USE_OCC)
+-    find_package(OpenCascade NAMES OpenCASCADE opencascade REQUIRED CMAKE_FIND_ROOT_PATH_BOTH)
+-    add_definitions(-DOCCGEOMETRY)
+-    set(OCC_LIBRARIES
+-      TKBO
+-      TKBRep
+-      TKBool
+-      TKCAF
+-      TKCDF
+-      TKFillet
+-      TKG2d
+-      TKG3d
+-      TKGeomAlgo
+-      TKGeomBase
+-      TKHLR
+-      TKIGES
+-      TKLCAF
+-      TKMath
+-      TKMesh
+-      TKOffset
+-      TKPrim
+-      TKSTEP
+-      TKSTEP209
+-      TKSTEPAttr
+-      TKSTEPBase
+-      TKSTL
+-      TKService
+-      TKShHealing
+-      TKTopAlgo
+-      TKV3d
+-      TKVCAF
+-      TKXCAF
+-      TKXDEIGES
+-      TKXDESTEP
+-      TKXSBase
+-      TKernel
+-    )
+-    include_directories(${OpenCASCADE_INCLUDE_DIR})
+-    if(NOT OpenCASCADE_BUILD_SHARED_LIBS)
+-      if(OpenCASCADE_WITH_FREETYPE)
+-        find_library( FREETYPE NAMES freetype HINTS ${OpenCASCADE_INSTALL_PREFIX}/lib)
+-        list(APPEND OCC_LIBRARIES ${FREETYPE})
+-        if(UNIX AND NOT APPLE)
+-          find_package(Fontconfig REQUIRED)
+-          list(APPEND OCC_LIBRARIES ${Fontconfig_LIBRARIES})
+-        endif()
+-      endif(OpenCASCADE_WITH_FREETYPE)
+-      if(UNIX AND NOT APPLE)
+-        set(THREADS_PREFER_PTHREAD_FLAG ON)
+-        find_package(Threads REQUIRED)
+-        list(APPEND OCC_LIBRARIES Threads::Threads)
+-        list(PREPEND OCC_LIBRARIES -Wl,--start-group)
+-        list(APPEND OCC_LIBRARIES -Wl,--end-group)
+-      endif()
+-      if(WIN32)
+-          list(APPEND OCC_LIBRARIES Ws2_32.lib)
+-      endif()
+-    endif()
+-    message(STATUS "OCC DIRS ${OpenCASCADE_INCLUDE_DIR}")
+-    if(WIN32 AND USE_GUI)
+-      target_link_libraries(nggui PRIVATE ${OCC_LIBRARIES})
+-    endif(WIN32 AND USE_GUI)
++    find_package(OpenCasCade REQUIRED)
++    add_definitions(-DOCCGEOMETRY -D_OCC64)
++    include_directories(${OCC_INCLUDE_DIR})
+ endif (USE_OCC)
+ #######################################################################
+diff --git a/cmake/cmake_modules/FindOpenCasCade.cmake b/cmake/cmake_modules/FindOpenCasCade.cmake
+new file mode 100644
+index 00000000..870e8ed5
+--- /dev/null
++++ b/cmake/cmake_modules/FindOpenCasCade.cmake
+@@ -0,0 +1,105 @@
++# Try to find OCC
++# Once done this will define
++#
++# OCC_FOUND          - system has OCC - OpenCASCADE
++# OCC_INCLUDE_DIR    - where the OCC include directory can be found
++# OCC_LIBRARY_DIR    - where the OCC library directory can be found
++# OCC_LIBRARIES      - Link this to use OCC
++
++if(WIN32)
++    find_path(OCC_INCLUDE_DIR Standard_Version.hxx PATH_SUFFIXES inc ../inc)
++    find_library(OCC_LIBRARY TKernel)
++else(WIN32)
++    find_path(OCC_INCLUDE_DIR Standard_Version.hxx
++      /usr/include/opencascade
++      /usr/local/include/opencascade
++      /usr/include/oce
++      /usr/local/include/oce
++      /opt/opencascade/include
++      /opt/opencascade/inc
++    )
++    find_library(OCC_LIBRARY TKernel
++      /usr/lib
++      /usr/local/lib
++      /opt/opencascade/lib
++    )
++endif(WIN32)
++
++if(OCC_LIBRARY AND NOT OCC_LIBRARY_DIR)
++    get_filename_component(OCC_LIBRARY_DIR ${OCC_LIBRARY} PATH)
++endif(OCC_LIBRARY AND NOT OCC_LIBRARY_DIR)
++
++if(OCC_INCLUDE_DIR)
++    file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAJOR
++      REGEX "#define OCC_VERSION_MAJOR.*"
++    )
++    string(REGEX MATCH "[0-9]+" OCC_MAJOR ${OCC_MAJOR})
++    file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MINOR
++      REGEX "#define OCC_VERSION_MINOR.*"
++    )
++    string(REGEX MATCH "[0-9]+" OCC_MINOR ${OCC_MINOR})
++    file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAINT
++      REGEX "#define OCC_VERSION_MAINTENANCE.*"
++    )
++    string(REGEX MATCH "[0-9]+" OCC_MAINT ${OCC_MAINT})
++
++    set(OCC_VERSION_STRING "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}")
++endif(OCC_INCLUDE_DIR)
++
++
++set(OCC_LIBRARY_NAMES
++    TKBO
++    TKBool
++    TKBRep
++    TKCAF
++    TKCDF
++    TKernel
++    TKG2d
++    TKG3d
++    TKGeomAlgo
++    TKGeomBase
++    TKHLR
++    TKIGES
++    TKLCAF
++    TKMath
++    TKMesh
++    TKOffset
++    TKPrim
++    TKService
++    TKShHealing
++    TKSTEP
++    TKSTEP209
++    TKSTEPAttr
++    TKSTEPBase
++    TKSTL
++    TKTopAlgo
++    TKV3d
++    TKXCAF
++    TKXDEIGES
++    TKXDESTEP
++    TKXSBase
++)
++
++if(OCC_LINK_FREETYPE)
++    set(OCC_LIBRARY_NAMES ${OCC_LIBRARY_NAMES} freetype)
++endif(OCC_LINK_FREETYPE)
++
++if(OCC_VERSION_STRING VERSION_GREATER_EQUAL "7.3.0")
++    set(OCC_LIBRARY_NAMES ${OCC_LIBRARY_NAMES} TKVCAF)
++endif()
++
++foreach( libname ${OCC_LIBRARY_NAMES} )
++    find_library( ${libname} ${libname} ${OCC_LIBRARY_DIR} NO_DEFAULT_PATH)
++    set(OCC_LIBRARIES ${OCC_LIBRARIES} ${${libname}})
++endforeach()
++
++include(FindPackageHandleStandardArgs)
++find_package_handle_standard_args(OCC REQUIRED_VARS OCC_INCLUDE_DIR VERSION_VAR OCC_VERSION_STRING ${OCC_LIBRARIY_NAMES})
++
++if(OCC_FOUND)
++    message(STATUS "-- Found OpenCASCADE version: ${OCC_VERSION_STRING}")
++    message(STATUS "-- OpenCASCADE include directory: ${OCC_INCLUDE_DIR}")
++    message(STATUS "-- OpenCASCADE shared libraries directory: ${OCC_LIBRARY_DIR}")
++    message(STATUS "-- OpenCASCADE shared libraries :\n ${OCC_LIBRARIES}")
++endif(OCC_FOUND)
++
diff --git a/products/patches/netgen-6.2.2204-for-SALOME.patch b/products/patches/netgen-6.2.2204-for-SALOME.patch
new file mode 100644 (file)
index 0000000..90e03eb
--- /dev/null
@@ -0,0 +1,121 @@
+ libsrc/core/version.hpp        |  7 ++++++-
+ libsrc/meshing/meshclass.cpp   |  6 +++---
+ libsrc/occ/occgenmesh.cpp      | 13 +++++++------
+ libsrc/stlgeom/stlgeom.hpp     |  2 +-
+ libsrc/stlgeom/stltopology.hpp |  2 +-
+ nglib/nglib.cpp                |  2 +-
+ 6 files changed, 19 insertions(+), 13 deletions(-)
+
+diff --git a/libsrc/core/version.hpp b/libsrc/core/version.hpp
+index 3048ce5b..81524b58 100644
+--- a/libsrc/core/version.hpp
++++ b/libsrc/core/version.hpp
+@@ -41,7 +41,12 @@ namespace ngcore
+               if(!vstring.empty())
+                 {
+                   dot = vstring.find('-');
+-                  patch = std::stoi(vstring.substr(0,dot));
++                  try {
++                    patch = std::stoi(vstring.substr(0,dot));
++                  }
++                  catch (const std::exception& e) {
++                    patch = 0;
++                  }
+                   if(dot == size_t(-1)) vstring = "";
+                   else vstring = vstring.substr(dot+1, vstring.size()-dot-1);
+                   if(!vstring.empty())
+diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp
+index c89064cb..a23b8889 100644
+--- a/libsrc/meshing/meshclass.cpp
++++ b/libsrc/meshing/meshclass.cpp
+@@ -281,8 +281,8 @@ namespace netgen
+     for(int i = 0; i < userdata_double.Size(); i++)
+       delete userdata_double[i];
+-    for (int i = 0; i < bcnames.Size(); i++ )
+-      delete bcnames[i];
++   // for (int i = 0; i < bcnames.Size(); i++ )
++   //   delete bcnames[i];
+     for (int i = 0; i < cd2names.Size(); i++)
+       delete cd2names[i];
+@@ -7087,7 +7087,7 @@ namespace netgen
+           bcnames[i] = new string("default");
+       }
+-    if ( bcnames[bcnr] ) delete bcnames[bcnr];
++    //if ( bcnames[bcnr] ) delete bcnames[bcnr];
+     bcnames[bcnr] = new string ( abcname );
+     for (auto & fd : facedecoding)
+diff --git a/libsrc/occ/occgenmesh.cpp b/libsrc/occ/occgenmesh.cpp
+index e0164177..884d6d1d 100644
+--- a/libsrc/occ/occgenmesh.cpp
++++ b/libsrc/occ/occgenmesh.cpp
+@@ -7,6 +7,7 @@
+ #include "occ_face.hpp"
+ #include "occmeshsurf.hpp"
++#include <BRepTools.hxx>
+ #include <BRepAdaptor_Curve.hxx>
+ #include <BRepGProp.hxx>
+ #include <BRepLProp_CLProps.hxx>
+@@ -653,13 +654,13 @@ namespace netgen
+                 for (int k = 1; k <=3; k++)
+                   {
+-                    // int n = triangulation->Triangles()(j)(k);
+-                    // p[k-1] = triangulation->Nodes()(n).Transformed(loc);
+-                    // par[k-1] = triangulation->UVNodes()(n);
++                    int n = triangulation->Triangles()(j)(k);
++                    p[k-1] = triangulation->Nodes()(n).Transformed(loc);
++                    par[k-1] = triangulation->UVNodes()(n);
+                     // fix for OCC7.6.0-dev
+-                    int n = triangulation->Triangle(j)(k);
+-                    p[k-1] = triangulation->Node(n).Transformed(loc);
+-                    par[k-1] = triangulation->UVNode(n);
++                    //int n = triangulation->Triangle(j)(k);
++                    //p[k-1] = triangulation->Node(n).Transformed(loc);
++                    //par[k-1] = triangulation->UVNode(n);
+                   }
+                 //double maxside = 0;
+diff --git a/libsrc/stlgeom/stlgeom.hpp b/libsrc/stlgeom/stlgeom.hpp
+index 8cc5739e..46bad1dc 100644
+--- a/libsrc/stlgeom/stlgeom.hpp
++++ b/libsrc/stlgeom/stlgeom.hpp
+@@ -68,7 +68,7 @@ namespace netgen
+     void Restore ();
+     void SetSize(int /* size */) { };
+-    void Clear() { };
++    DLL_HEADER void Clear() { };
+     int Size() const { return geom.GetNTE(); }
+     const STLTopEdge & Get(int i) const { return geom.GetTopEdge(i); }
+     STLTopEdge & Elem(int i) { return geom.GetTopEdge(i); }
+diff --git a/libsrc/stlgeom/stltopology.hpp b/libsrc/stlgeom/stltopology.hpp
+index 34c3c801..c5c868c4 100644
+--- a/libsrc/stlgeom/stltopology.hpp
++++ b/libsrc/stlgeom/stltopology.hpp
+@@ -350,7 +350,7 @@ public:
+   int GetNP() const { return points.Size(); }
+   int AddPoint(const Point<3> & p) { points.Append(p); return points.Size(); }
+   const Point<3> & GetPoint(STLPointId nr) const { return points[nr]; } // .Get(nr); }
+-  int GetPointNum (const Point<3> & p);
++  DLL_HEADER int GetPointNum (const Point<3> & p);
+   void SetPoint(STLPointId nr, const Point<3> & p) { points[nr] = p; } // { points.Elem(nr) = p; }
+   auto & GetPoints() const { return points; }
+diff --git a/nglib/nglib.cpp b/nglib/nglib.cpp
+index c72e067b..2d548ca6 100644
+--- a/nglib/nglib.cpp
++++ b/nglib/nglib.cpp
+@@ -542,7 +542,7 @@ namespace nglib
+    NgArray<STLReadTriangle> readtrias; //only before initstlgeometry
+-   NgArray<Point<3> > readedges; //only before init stlgeometry
++   DLL_HEADER NgArray<Point<3> > readedges; //only before init stlgeometry
+    // loads geometry from STL file
+    NGLIB_API Ng_STL_Geometry * Ng_STL_LoadGeometry (const char * filename, int binary)