Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for OCCT 7.6.0 #54

Closed
trelau opened this issue Nov 14, 2021 · 15 comments · Fixed by #64
Closed

Support for OCCT 7.6.0 #54

trelau opened this issue Nov 14, 2021 · 15 comments · Fixed by #64

Comments

@trelau
Copy link
Owner

trelau commented Nov 14, 2021

https://dev.opencascade.org/content/open-cascade-technology-760-released

@Tobias-Fischer
Copy link

+1 - the build currently fails on the conda-forge feedstock for occt 7.6: conda-forge/smesh-feedstock#52

@basnijholt
Copy link

This would be great!

Currently, it's blocking the building of FreeCAD too with the VTK 9.1.0, which is build with OCCT 7.6.0.

@trelau
Copy link
Owner Author

trelau commented Dec 10, 2021

thanks for feedback. i can probably get to this in the next week or so

@Tobias-Fischer
Copy link

Hi @trelau - did you have a chance to look at this? Many thanks in advance!

@trelau
Copy link
Owner Author

trelau commented Mar 5, 2022

@Tobias-Fischer not yet, unfortunately. the day job has been keeping me busy lately :)

@looooo
Copy link
Contributor

looooo commented Apr 1, 2022

here is the commit for freecad-internal smesh to work with occt7.6:
FreeCAD/FreeCAD@6f3b00d

@looooo
Copy link
Contributor

looooo commented Apr 1, 2022

I tried to work on this and applying some diff from the posted commit. But now I am stuck with this:

Building CXX object src/SMESH/CMakeFiles/Controls.dir/src/Controls/SMESH_Controls.cxx.o
FAILED: src/SMESH/CMakeFiles/Controls.dir/src/Controls/SMESH_Controls.cxx.o 
${PREFIX}/_build_env/bin/x86_64-conda-linux-gnu-c++ -DCSFDB -DControls_EXPORTS -DHAVE_FREEIMAGE -DHAVE_FREETYPE -DHAVE_LIMITS_H -DHAVE_OPENGL_EXT -DHAVE_RAPIDJSON -DHAVE_VTK -DHAVE_XLIB -DLIN -DOCC_CONVERT_SIGNALS -DVTK_OPENGL2_BACKEND -D_OCC64 -Dkiss_fft_scalar=double -I${PREFIX}/_h_env/include/opencascade -I${PREFIX}/work/SMESH/src/SMESH/src/Controls -I${PREFIX}/work/SMESH/src/Kernel/src/Basics -I${PREFIX}/work/SMESH/src/Kernel/src/SALOMELocalTrace -I${PREFIX}/work/SMESH/src/Kernel/src/Utils -I${PREFIX}/work/SMESH/src/Geom/src/GEOMUtils -I${PREFIX}/work/SMESH/src/SMESH/src/SMDS -I${PREFIX}/work/SMESH/src/SMESH/src/SMESHDS -I${PREFIX}/work/SMESH/src/SMESH/src/SMESHUtils -isystem ${PREFIX}/_h_env/include/vtk-9.1 -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem ${PREFIX}/_h_env/include -fdebug-prefix-map=${PREFIX}/work=/usr/local/src/conda/smesh-9.7.0.1 -fdebug-prefix-map=${PREFIX}/_h_env=/usr/local/src/conda-prefix -O3 -DNDEBUG -fPIC -Wno-deprecated -std=c++11 -MD -MT src/SMESH/CMakeFiles/Controls.dir/src/Controls/SMESH_Controls.cxx.o -MF src/SMESH/CMakeFiles/Controls.dir/src/Controls/SMESH_Controls.cxx.o.d -o src/SMESH/CMakeFiles/Controls.dir/src/Controls/SMESH_Controls.cxx.o -c ${PREFIX}/work/SMESH/src/SMESH/src/Controls/SMESH_Controls.cxx
In file included from ${PREFIX}/_build_env/x86_64-conda-linux-gnu/include/c++/9.4.0/memory:65,
                 from ${PREFIX}/_h_env/include/boost/smart_ptr/detail/sp_counted_impl.hpp:35,
                 from ${PREFIX}/_h_env/include/boost/smart_ptr/detail/shared_count.hpp:27,
                 from ${PREFIX}/_h_env/include/boost/smart_ptr/shared_ptr.hpp:17,
                 from ${PREFIX}/_h_env/include/boost/shared_ptr.hpp:17,
                 from ${PREFIX}/work/SMESH/src/SMESH/src/SMESHDS/SMESH_Controls.hxx:32,
                 from ${PREFIX}/work/SMESH/src/SMESH/src/Controls/SMESH_ControlsDef.hxx:26,
                 from ${PREFIX}/work/SMESH/src/SMESH/src/Controls/SMESH_Controls.cxx:23:
${PREFIX}/_build_env/x86_64-conda-linux-gnu/include/c++/9.4.0/bits/stl_uninitialized.h: In instantiation of '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator<SMESH::Controls::ElementsOnShape::Classifier*>; _ForwardIterator = SMESH::Controls::ElementsOnShape::Classifier*]':
${PREFIX}/_build_env/x86_64-conda-linux-gnu/include/c++/9.4.0/bits/stl_uninitialized.h:307:37:   required from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator<SMESH::Controls::ElementsOnShape::Classifier*>; _ForwardIterator = SMESH::Controls::ElementsOnShape::Classifier*; _Tp = SMESH::Controls::ElementsOnShape::Classifier]'
${PREFIX}/_build_env/x86_64-conda-linux-gnu/include/c++/9.4.0/bits/stl_uninitialized.h:329:2:   required from '_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = SMESH::Controls::ElementsOnShape::Classifier*; _ForwardIterator = SMESH::Controls::ElementsOnShape::Classifier*; _Allocator = std::allocator<SMESH::Controls::ElementsOnShape::Classifier>]'
${PREFIX}/_build_env/x86_64-conda-linux-gnu/include/c++/9.4.0/bits/vector.tcc:659:48:   required from 'void std::vector<_Tp, _Alloc>::_M_default_append(std::vector<_Tp, _Alloc>::size_type) [with _Tp = SMESH::Controls::ElementsOnShape::Classifier; _Alloc = std::allocator<SMESH::Controls::ElementsOnShape::Classifier>; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
${PREFIX}/_build_env/x86_64-conda-linux-gnu/include/c++/9.4.0/bits/stl_vector.h:937:4:   required from 'void std::vector<_Tp, _Alloc>::resize(std::vector<_Tp, _Alloc>::size_type) [with _Tp = SMESH::Controls::ElementsOnShape::Classifier; _Alloc = std::allocator<SMESH::Controls::ElementsOnShape::Classifier>; std::vector<_Tp, _Alloc>::size_type = long unsigned int]'
${PREFIX}/work/SMESH/src/SMESH/src/Controls/SMESH_Controls.cxx:4442:51:   required from here
${PREFIX}/_build_env/x86_64-conda-linux-gnu/include/c++/9.4.0/bits/stl_uninitialized.h:127:72: error: static assertion failed: result type must be constructible from value type of input range
  127 |       static_assert(is_constructible<_ValueType2, decltype(*__first)>::value,
      |                                                                        ^~~~~
[140/265] Building CXX object src/SMESH/CMakeFiles/SMDS.dir/src/SMDS/SMDS_Mesh.cxx.o
ninja: build stopped: subcommand failed.

@wwmayer do you run into the same issue when trying to port smesh to occt7.6?
@trelau

@wwmayer
Copy link
Contributor

wwmayer commented Apr 2, 2022

But now I am stuck with this:

Fails for me, too. The problem is the struct ElementsOnShape::Classifier in SMESH_Controls.cxx because it has a member variable of the type GeomAPI_ProjectPointOnSurf and that has a member of type Extrema_GenExtPS. For Extrema_GenExtPS the copy-constructor is disabled so that it's not possible to make a copy of GeomAPI_ProjectPointOnSurf and thus no copy of ElementsOnShape::Classifier.

But somewhere in SMESH_Controls.cxx this is requested and thus leads to the compiler error. The trick to solve the issue is a hand-written copy-constructor of ElementsOnShape::Classifier the omits the GeomAPI_ProjectPointOnSurf member.

@looooo
Copy link
Contributor

looooo commented Apr 2, 2022

Thanks, did you make these changes to the freecad internal smesh? If so can you share the commit?
@wwmayer

@wwmayer
Copy link
Contributor

wwmayer commented Apr 2, 2022

Thanks, did you make these changes to the freecad internal smesh? If so can you share the commit?

No, because it's too old and doesn't have that file. But I prepared a patch file with all my changes. It was a bit tricky to create the patch because for the build I didn't have to change the files that are under git control but a free copy.
port_occ76.patch.txt

@looooo
Copy link
Contributor

looooo commented Apr 2, 2022

Thanks a lot, I will have a look in the next days.

@looooo
Copy link
Contributor

looooo commented Apr 3, 2022

@trelau what is the best workflow to create the patches?

@trelau
Copy link
Owner Author

trelau commented Apr 23, 2022

been out of the loop for a bit now, but if i understand the question, i remember editing files, checking the patch difference in git GUI, then copy/pasting that into a patch file and trying it out locally (i think there is a python file that attempts to apply patch files). there is surely a better way to make patch files that is what i remember doing

@trelau
Copy link
Owner Author

trelau commented May 2, 2022

I got a chance to work on this project a bit and got updated to:

  • Salome 9.8.0
  • Netgen 6.2
  • OCCT 7.5.3

I have a local branch for OCCT 7.6 but I'm battling one last compiler error on windows. I'll share that branch in the next day or so.

@trelau
Copy link
Owner Author

trelau commented May 4, 2022

Branch is here https://github.com/trelau/SMESH/tree/occt76

But, failing due to one issue with "SMESH::Controls::ElementsOnShape::Classifier". one example here https://github.com/trelau/SMESH/runs/6290166835?check_suite_focus=true#step:8:737

@trelau trelau linked a pull request May 16, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants