SMESH7

Merged, abandoned or rejected pull requests are moved here to clear the main Pull Requests forum.
ickby
Posts: 2918
Joined: Wed Oct 05, 2011 7:36 am

Re: SMESH7

Postby ickby » Wed Jun 01, 2016 5:33 am

But travis uses trusty and it works fine, so there should be everything available that we need. Maybe there is just a installed dependency missing?
wmayer
Site Admin
Posts: 14782
Joined: Thu Feb 19, 2009 10:32 am

Re: SMESH7

Postby wmayer » Wed Jun 01, 2016 11:22 am

So in addition to the win stuff we need a PPA package for libmed on Trusty.
http://packages.ubuntu.com/trusty/libmedc-dev
wmayer
Site Admin
Posts: 14782
Joined: Thu Feb 19, 2009 10:32 am

Re: SMESH7

Postby wmayer » Wed Jun 01, 2016 11:39 am

@wmayer
What options did you use in Cmake for hdf5. I used all the defaults less the tests. release and debug both compiled fine. Do we need the szip or zlib support? I'm using 1.8.17.
I think I have used the same settings. First I created a Makefile for NMake and this produced different output than creating a VS 20013 project. I nowhere had to specify zlib or szip. The version I use is 1.8.16
Linking against libhdf5.lib makes medC compile but I get linker errors trying to compile FreeCAD using ickby's SMESH branch.
I haven't tried this since I created the hdf5 and med libs. In order to build smesh7 the cmake file needs some adjustments to set the correct pre-processor macros to export the needed symbols. When I have some time I'll continue on this today evening.
And just to be sure, when you compiled OCCT7 and Netgen5.1 you used TCL/TK8.6?
For OCC I used tcl8.6 but I can't remember that I needed tcl for netgen 5.1.
User avatar
sgrogan
Posts: 5330
Joined: Wed Oct 22, 2014 5:02 pm

Re: SMESH7

Postby sgrogan » Fri Jun 03, 2016 12:24 am

Yup, that's the package I'm using. I've discovered I have both mpi and openmpi installed and both have mpi.h in there respective include sub-directories, looks like both are sim-linked, maybe that's the problem?
wmayer
Site Admin
Posts: 14782
Joined: Thu Feb 19, 2009 10:32 am

Re: SMESH7

Postby wmayer » Sat Jun 04, 2016 5:14 pm

Today I made a big step forward to get the smesh7 built under Windows. The code needs some adjustments to fix linking errors but also the netgen library needs some changes and must be rebuilt to get the needed symbols.
Here is a list of the changes you have to made for netgen. Add the DLL_HEADER to
  • global.hpp

    Code: Select all

    class DLL_HEADER multithreadt

    Code: Select all

    DLL_HEADER extern volatile multithreadt multithread;
  • occgeom.hpp

    Code: Select all

    class DLL_HEADER OCCParameters

    Code: Select all

    DLL_HEADER extern OCCParameters occparam;

    Code: Select all

    DLL_HEADER extern void OCCSetLocalMeshSize(OCCGeometry & geom, Mesh & mesh);

    Code: Select all

    DLL_HEADER extern void OCCMeshSurface (OCCGeometry & geom, Mesh & mesh, int perfstepsend);

    Code: Select all

    DLL_HEADER extern void OCCFindEdges (OCCGeometry & geom, Mesh & mesh);
  • meshclass.hpp

    Code: Select all

    DLL_HEADER int GetNDomains() const;

    Code: Select all

    DLL_HEADER void SetMinimalH (double h);

    Code: Select all

    DLL_HEADER double GetH (const Point3d & p) const;
  • template.hpp

    Code: Select all

    DLL_HEADER extern ostream * mycout;

    Code: Select all

    DLL_HEADER extern ostream * myerr;
  • meshtype.hpp (in class Element)

    Code: Select all

    DLL_HEADER virtual void Print (ostream & ost) const;
  • occgenmesh.cpp

    Code: Select all

    DLL_HEADER bool merge_solids = 1;
wmayer
Site Admin
Posts: 14782
Joined: Thu Feb 19, 2009 10:32 am

Re: SMESH7

Postby wmayer » Sat Jun 04, 2016 5:25 pm

There are a few changes I had to make on the smesh sources. There is one nasty build error I don't know how to fix properly. But it worked to comment out the whole template class class MEDWRAPPER_EXPORT SharedPtr<TWrapper>
The error msvc reports is:
DriverMED_Family.cpp
C:\Projects\FreeCADLibs_11.3_x64_VC12\include\boost/smart_ptr/shared_ptr.hpp(663) : error C2562: 'boost::shared_ptr<MED::TWrapper>::operator []' : 'void' function returning a value
C:\Projects\FreeCADLibs_11.3_x64_VC12\include\boost/smart_ptr/shared_ptr.hpp(658) : see declaration of 'boost::shared_ptr<MED::TWrapper>::operator []'
C:\Projects\FreeCADLibs_11.3_x64_VC12\include\boost/smart_ptr/shared_ptr.hpp(659) : while compiling class template member function 'boost::detail::sp_array_access<T>::type boost::shared_ptr<T>::operator [](ptrdiff_t) const'
with
[
T=MED::TWrapper
]
c:\projects\freecad-git\src\3rdparty\salomesmesh\inc\MED_Wrapper.hxx(994) : see reference to class template instantiation 'boost::shared_ptr<MED::TWrapper>' being compiled
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~3.0\VC\BIN\X86_AM~1\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
Any idea what is wrong with this?
wmayer
Site Admin
Posts: 14782
Joined: Thu Feb 19, 2009 10:32 am

Re: SMESH7

Postby wmayer » Sat Jun 04, 2016 5:45 pm

Then I also experienced a crash. When I create a shape, go to Mesh workbench and create a mesh from a shape then it works the first time. But the second time I always get a crash.
vejmarie
Posts: 551
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: SMESH7

Postby vejmarie » Sat Jun 04, 2016 9:22 pm

wmayer wrote:Then I also experienced a crash. When I create a shape, go to Mesh workbench and create a mesh from a shape then it works the first time. But the second time I always get a crash.
Any idea from where the crash comes ? (I think I got the DLLHEADER stuff into the PR i pushed a few weeks ago) ? Do you have a back trace of it ? ickby and I have seen that the mesh stack needed some adjustment on the generator side, which should be global to the code instead per mesh. We changed a few things in this area, and I am not sure that we tested with 2 meshes generation. Let me check if I can reproduce the issue on MacOS
wmayer
Site Admin
Posts: 14782
Joined: Thu Feb 19, 2009 10:32 am

Re: SMESH7

Postby wmayer » Sat Jun 04, 2016 10:24 pm

wmayer
Site Admin
Posts: 14782
Joined: Thu Feb 19, 2009 10:32 am

Re: SMESH7

Postby wmayer » Sat Jun 04, 2016 10:29 pm

The crash doesn't happen when using FEM but Mesh module. The stack trace is:
1 std::_Tree<std::_Tmap_traits<int,studyContextStruct * __ptr64,std::less<int>,std::allocator<std::pair<int const ,studyContextStruct * __ptr64>>,0>>::_Lbound xtree 2106 0x7fed96cf04d
2 std::_Tree<std::_Tmap_traits<int,studyContextStruct * __ptr64,std::less<int>,std::allocator<std::pair<int const ,studyContextStruct * __ptr64>>,0>>::lower_bound xtree 1575 0x7fed96d6bef
3 std::_Tree<std::_Tmap_traits<int,studyContextStruct * __ptr64,std::less<int>,std::allocator<std::pair<int const ,studyContextStruct * __ptr64>>,0>>::find xtree 1549 0x7fed96d66cf
4 SMESH_Gen::GetStudyContext SMESH_Gen.cpp 1152 0x7fed96b3c66
5 SMESH_Gen::CreateMesh SMESH_Gen.cpp 118 0x7fed96b1029
6 MeshPart::Mesher::createMesh Mesher.cpp 125 0x7fed4bb0ca8
7 MeshPart::Module::meshFromShape AppMeshPartPy.cpp 253 0x7fed4b865e4
8 Py::ExtensionModule<MeshPart::Module>::invoke_method_keyword ExtensionModule.hxx 191 0x7fed4b84937
9 method_keyword_call_handler cxx_extensions.cxx 1751 0x7feeef317bb
10 PyCFunction_Call methodobject.c 85 0x1e17dd35
11 do_call ceval.c 4250 0x1e21cfef
12 call_function ceval.c 4058 0x1e21ca26
13 PyEval_EvalFrameEx ceval.c 2681 0x1e21a2ca
14 PyEval_EvalCodeEx ceval.c 3265 0x1e214dff
15 PyEval_EvalCode ceval.c 679 0x1e2144a9
16 run_mod pythonrun.c 1377 0x1e278ed9
17 PyRun_StringFlags pythonrun.c 1340 0x1e27655d
18 Base::InterpreterSingleton::runString Interpreter.cpp 196 0x7feeefbd4b5
19 Gui::Command::doCommand Command.cpp 453 0x7feeb905ab0
20 MeshPartGui::Tessellation::accept Tessellation.cpp 322 0x7fed4c2d1e5
... <More>