trelau / smesh Goto Github PK
View Code? Open in Web Editor NEWMesh module from the Salome Platform
License: GNU Lesser General Public License v2.1
Mesh module from the Salome Platform
License: GNU Lesser General Public License v2.1
I'm in the process of porting FreeCAD to OpenBSD and I'm not sure whether it makes sense to package SMESH from this fork (as it has been done in Fedora for example) or use official sources (or the one included in the FreeCAD sources). From an difficulty-to-port perspective I think this fork is the way to go, but I'd first like to make sure that it will remain active and updated. With that said, I'd like to ask the following:
What is the status of this fork? Is it still maintained?
Any plans to keep up with upstream?
From the FreeCAD perspective, does it make sense to follow the latest SMESH releases?
would be nice to add the patch for the exception again.
$PREFIX/include/smesh/SMESH/SMESH_Gen.hxx:70:5: error: ISO C++17 does not allow dynamic exception specifications
70 | throw(SALOME_Exception);
| ^~~~~
In file included from ../src/Mod/MeshPart/App/Mesher.cpp:49:
$PREFIX/include/smesh/StdMeshers/StdMeshers_MaxLength.hxx:38:33: error: ISO C++17 does not allow dynamic exception specifications
38 | void SetLength(double length) throw(SALOME_Exception);
| ^~~~~
In file included from ../src/Mod/MeshPart/App/Mesher.cpp:50:
$PREFIX/include/smesh/SMESH/SMESH_Mesh.hxx:136:5: error: ISO C++17 does not allow dynamic exception specifications
136 | throw(SALOME_Exception);
| ^~~~~
(Provide a short description, state the expected behavior and what actually happens.)
(The code should be minimal, have no external dependencies, isolate the function(s) that cause breakage. Submit matched and complete snippets that can be easily compiled and run to diagnose the issue.)
n file included from /builddir/build/BUILD/SMESH-8.3.0.3/src/DriverMED/DriverMED_Family.cxx:28:
/builddir/build/BUILD/SMESH-8.3.0.3/inc/DriverMED_Family.h:37:10: fatal error: MED_Common.hxx: No such file or directory
37 | #include "MED_Common.hxx"
| ^~~~~~~~~~~~~~~~
MED_Common.hxx does not exist in med 4.0.0, at least in the archive. I don't suppose it could be a generated header?
I wonder if there is some possibility to build smesh as a library without VTK if one does not need visualization (assuming VTK isn't somehow needed for the core meshing functionality). As it is not it seems VTK is a hard coded requirement, but I wonder if there is some way to build it without going through all sources to eliminate VTK dependencies manually?
I'm working on packaging this fork of smesh for Fedora as a dependency for freecad.
The submodules should be in the posted archives to be useful for distro packaging.
A new Salome Platform release includes new SMESH items https://files.salome-platform.org/Salome/Salome9.7.0/SALOME_9_7_0_Release_Notes.pdf
Notably:
Hi, I'm trying to build SMESH on Debian Unstable. I simply do:
cmake -DOpenCASCADE_DIR=/usr/lib/cmake/occt ../repo && make -j8
However, I get some failures that look like this:
In file included from /usr/include/c++/8/map:60,
from /home/kurt/Desktop/Packages/smesh/repo/inc/SMESH_Algo.hxx:43,
from /home/kurt/Desktop/Packages/smesh/repo/inc/StdMeshers_Projection_2D.hxx:32,
from /home/kurt/Desktop/Packages/smesh/repo/inc/StdMeshers_Projection_1D2D.hxx:29,
from /home/kurt/Desktop/Packages/smesh/repo/src/StdMeshers/StdMeshers_Projection_1D2D.cxx:26:
/usr/include/c++/8/bits/stl_tree.h: In instantiation of ‘class std::_Rb_tree<const SMDS_MeshNode*, std::pair<const SMDS_MeshNode* const, const
SMDS_MeshNode*>, std::_Select1st<std::pair<const SMDS_MeshNode* const, const SMDS_MeshNode*> >, TIDCompare, std::allocator<std::pair<const SMDS
_MeshNode* const, const SMDS_MeshNode*> > >’:
/usr/include/c++/8/bits/stl_map.h:151:17: required from ‘class std::map<const SMDS_MeshNode*, const SMDS_MeshNode*, TIDCompare>’
/home/kurt/Desktop/Packages/smesh/repo/inc/StdMeshers_Projection_2D.hxx:68:44: required from here
/usr/include/c++/8/bits/stl_tree.h:452:21: error: static assertion failed: comparison object must be invocable with two arguments of key type
static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{},
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Got any ideas on how to address this?
Version 9.8 is available which looks like it includes proper support for Netgen 6.2.
Note that Salome still uses a patched version of OCCT 7.5, so unclear how feasible upgrading OCCT version will be...
I use "mesh->ExportMED "and" mesh->MEDToMesh "exports the mesh and it does not react, even in Pyocct7.4 using" mesh. MEDToMesh"
Everything is clear on UNIX, but building on windows fails due to PTHREADS. The description in README only states that PTHREAD_INCLUDE_DIR has to be set manually. However, it is unclear where to get it. Tried many things on web, but did not get any further. Would be very helpful to update README
Occt7.4 is available and it seems like their mesh libraries changed a lot. So this version of smesh doesn't seem to be compatible anymore and we should update to the latest salome smesh.
Building with conda:
conda-forge/smesh-feedstock#27
I wonder if this can be done in an automated way. This fork seems to be not compatible with upstream anymore but I guess directly building upstream is also no option. So some how the projects need to merge. Is there any good strategy to do so?
One could see the CMakeLists.txt file, but figuring out the dependencies and build steps especially for Windows is difficult, A brief build instruction would be great.
Summary:
Cc @looooo
Building with -std=c++17 is not yet working:
eg.:
FAILED: CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh0DElement.cxx.o
$BUILD_PREFIX/bin/x86_64-conda_cos6-linux-gnu-c++ -DCSFDB -DHAVE_CONFIG_H -DHAVE_FREEIMAGE -DHAVE_LIMITS_H -DHAVE_TBB -DLIN -DOCC_CONVERT_SIGNALS -DSMDS_EXPORTS -I$PREFIX/include/opencascade -I$PREFIX/include -I$PREFIX/include/freetype2 -I$PREFIX/include/python3.7m -I$PREFIX/include/libxml2 -I$PREFIX/include/netgen -I$PREFIX/include/netgen/occ -I$PREFIX/include/netgen/meshing -I$PREFIX/include/netgen/general -I$PREFIX/include/netgen/linalg -I$PREFIX/include/netgen/csg -I$PREFIX/include/netgen/geom2d -I$PREFIX/include/netgen/gprim -I$PREFIX/include/netgen/include -I$PREFIX/include/netgen/stlgeom -I../inc -isystem $PREFIX/include/vtk-8.1 -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -I$PREFIX/include -fdebug-prefix-map==/usr/local/src/conda/- -fdebug-prefix-map==/usr/local/src/conda-prefix -O3 -DNDEBUG -fPIC -std=gnu++1z -MD -MT CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh0DElement.cxx.o -MF CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh0DElement.cxx.o.d -o CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh0DElement.cxx.o -c ../src/SMDS/SMDS_Mesh0DElement.cxx
In file included from ../src/SMDS/SMDS_Mesh0DElement.cxx:31:0:
../inc/SMDS_Mesh.hxx:698:55: error: ISO C++1z does not allow dynamic exception specifications
static int CheckMemory(const bool doNotRaise=false) throw (std::bad_alloc);
conda-forge boost now is build with c++17. Somehow this introduce some incompatibilities for packages linked against boost and not build with c++17.
branch 'int_32_test' set up to track 'origin/int_32_test'.
Traceback (most recent call last):
File "/Users/lo/mambaforge/conda-bld/smesh_1657122221167/work/SMESH/prepare.py", line 185, in <module>
prepare_netgen()
File "/Users/lo/mambaforge/conda-bld/smesh_1657122221167/work/SMESH/prepare.py", line 20, in prepare_netgen
pset = patch.fromfile('external/NETGENPlugin/src/NETGEN/netgen62ForSalome.patch')
File "/Users/lo/mambaforge/conda-bld/smesh_1657122221167/_build_env/lib/python3.9/site-packages/patch.py", line 167, in fromfile
fp = open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'external/NETGENPlugin/src/NETGEN/netgen62ForSalome.patch'
Traceback (most recent call last):
File "/Users/lo/mambaforge/bin/conda-build", line 11, in <module>
sys.exit(main())
File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/cli/main_build.py", line 488, in main
execute(sys.argv[1:])
File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/cli/main_build.py", line 477, in execute
outputs = api.build(args.recipe, post=args.post, test_run_post=args.test_run_post,
File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/api.py", line 186, in build
return build_tree(
File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/build.py", line 3088, in build_tree
packages_from_this = build(metadata, stats,
File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/build.py", line 2211, in build
utils.check_call_env(cmd, env=env, rewrite_stdout_env=rewrite_env,
File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/utils.py", line 411, in check_call_env
return _func_defaulting_env_to_os_environ('call', *popenargs, **kwargs)
File "/Users/lo/mambaforge/lib/python3.10/site-packages/conda_build/utils.py", line 391, in _func_defaulting_env_to_os_environ
raise subprocess.CalledProcessError(proc.returncode, _args)
not sure what I did wrong. Can we do a ci-run to see if everything is still working? @trelau
Trying to run python prepare.py from current git master on Fedora rawhide:
$ python prepare.py
Traceback (most recent call last):
File "/home/orion/fedora/smesh/SMESH-ab0f4357a2fc8c250102bbf9ff2e057a9ca6a1aa/prepare.py", line 119, in <module>
prepare_netgen()
File "/home/orion/fedora/smesh/SMESH-ab0f4357a2fc8c250102bbf9ff2e057a9ca6a1aa/prepare.py", line 21, in prepare_netgen
pset = patch.fromfile('external/NETGENPlugin/src/NETGEN/netgen53ForSalome.patch')
AttributeError: module 'patch' has no attribute 'fromfile'
Fedora Rawhide has updated to gcc 12 and several packages are failing to build including SMESH which has the following error:
/builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx: In member function 'void SMESH_MeshEditor::sweepElement(const SMDS_MeshElement*, const std::vector<std::_Rb_tree_iterator<std::pair<const SMDS_MeshNode* const, std::__cxx11::list<const SMDS_MeshNode*> > > >&, std::__cxx11::list<const SMDS_MeshElement*>&, size_t, SMESH_SequenceOfElemPtr&)':
/builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx:4310:18: error: no matching function for call to 'swap(std::vector<bool>::reference, std::vector<bool>::reference)'
4310 | std::swap( isSingleNode[0], isSingleNode[1] );
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12/bits/exception_ptr.h:43,
from /usr/include/c++/12/exception:168,
from /usr/include/boost/smart_ptr/bad_weak_ptr.hpp:21,
from /usr/include/boost/smart_ptr/detail/shared_count.hpp:25,
from /usr/include/boost/smart_ptr/shared_ptr.hpp:17,
from /usr/include/boost/shared_ptr.hpp:17,
from /builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESHDS/SMESH_Controls.hxx:32,
from /builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.hxx:33,
from /builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx:27:
/usr/include/c++/12/bits/move.h:196:5: note: candidate: 'std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = _Bit_reference; _Require<__not_<__is_tuple_like<_Tp> >, is_move_constructible<_Tp>, is_move_assignable<_Tp> > = void]' (near match)
196 | swap(_Tp& __a, _Tp& __b)
| ^~~~
/usr/include/c++/12/bits/move.h:196:5: note: conversion of argument 2 would be ill-formed:
/builddir/build/BUILD/smesh-9.7.0.1/src/SMESH/src/SMESH/SMESH_MeshEditor.cxx:4310:51: error: cannot bind non-const lvalue reference of type 'std::_Bit_reference&' to an rvalue of type 'std::vector<bool>::reference'
4310 | std::swap( isSingleNode[0], isSingleNode[1] );
| ~~~~~~~~~~~~~~^
/usr/include/c++/12/bits/move.h:220:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> std::__enable_if_t<std::__is_swappable<_Tp>::value> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])'
220 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
| ^~~~
May I ask a naive question:
What is the difference from this https://github.com/trelau/SMESH and https://github.com/tpaviot/smesh ?
Cheers
Reminder to cut a new release for 9.6.0 when ready.
@looooo I see smesh-feedstock is now on 9.6.0. Seems safe to cut a release for this repo, right?
I don't know how to compile it yet. What configuration is needed? Cmake compilation prompt is missing opencasacde, vtk, etc.
FreeCAD relies on smesh. In earlier versions of smesh SALOME_USE_64BIT_IDS was not set and therefor 32bit ids were used.
To solve this FreeCAD needs to know if smesh was compiled with SALOME_USE_64BIT_IDS set or not. So somehow this information must be passed to the Freecad-build process.
In extra/MEFISTO2/trte.c, these lines: 1925 and 1968 don't seem to match the original source, trte.f line 1297. I believe this is a mistake, because, as far as I can tell, it looks like the upstream developers mean to invoke this version of the function defined in aptrte.cxx which returns a value as opposed to modifying an out-parameter. They seem to also be relying on undefined behavior, passing extra parameters that are not in the declaration.
Building with netgen 6.2.2004 I see this error:
../src/NETGENPlugin/NETGENPlugin_Mesher.cxx:3058:17: error: 'OCCRefinementSurfaces' is not a member of 'netgen'
netgen::OCCRefinementSurfaces ref (occgeo);
^~~~~~~~~~~~~~~~~~~~~
../src/NETGENPlugin/NETGENPlugin_Mesher.cxx:3058:17: note: suggested alternative: 'OCCOptimizeSurface'
netgen::OCCRefinementSurfaces ref (occgeo);
we need to apply these changes to make smesh work with vtk9:
wwmayer/FreeCAD@bb9bcbd
But as we use newer smesh sources we cannot apply this commit directly.
hi
I am beginner to compiling.
I am facing the same problem but i want to compile smesh without conda. I downloaded the source core of occt and tried to put it in src and external but did not work. i also tried to search for the variable CMAKE_MODULE_PATH in the file CMakeLists.txt but did not find it.
i am using void linux and I was facing a lot of problems when tried to use salome so I thought that I can compile smesh because I only need smesh and geometry modules in salome.
i know that there is a similar issue #17 (comment)
but it is solved by using conda and I prefere not to use it. becouse I need a simple way of installing without the need to install a complete package manager just to install smesh
Hi, trelau, I have some urgent problems with smesh:
I am using mingw on msys2.
I create a makefile with cmake, and there are too many errors during build.
I can build it by modifying it one by one, but I don't know if this is correct.
smesh is officially support mingw?
gcc.exe (Rev1, Built by MSYS2 project) 12.1.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.