[Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
Kunda1
Posts: 5806
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby Kunda1 » Thu May 25, 2017 7:10 am

Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby abdullah » Thu May 25, 2017 7:31 am

Kunda1 wrote:Can we have 2 column output?
https://gist.github.com/luzpaz/a8bb373b ... 071eaf6181
Yes we can. At least I have nothing against it.

I would need to see if there is a way to do it nicely with STL, as I do not want to be coding tab separate strings to produce columns (and I do not know of another way to do this ATM)...

In any case, I think this is for later on. From this thread and the bug tracker, I understand that sometimes there is a suspicion that OCC may be at the source of a problem and then having extra information is very important for testing, bug confirmation, bug reporting. I am trying to support sgrogan to get there (while simultaneously fixing bugs).
User avatar
sgrogan
Posts: 5425
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby sgrogan » Thu May 25, 2017 8:45 pm

abdullah wrote:I am trying to support sgrogan to get there
And Thanks for that :D
I'm compiling master now, I added HAVE_TBB manually in the CMake gui.
How can I check for sure that FreeCAD is using this?
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby abdullah » Thu May 25, 2017 8:56 pm

sgrogan wrote:
abdullah wrote:I am trying to support sgrogan to get there
And Thanks for that :D
I'm compiling master now, I added HAVE_TBB manually in the CMake gui.
How can I check for sure that FreeCAD is using this?
Welcome!!!!! ;)

If you added a:
set(HAVE_TBB ON)

it should not work (I would be surprised if it does), you have to add a definition (a preprocesor macro that will be passed to c++). The one above should only be a cmake environment variable.

Checking: Go to your favourite c++ file, for example App/Document.cpp

And insert in any function:

#ifdef HAVE_TBB
ThisIsMyNonExistingFunction()
#endif

If compilation fails it is taking it, if it does not fail, well, the macro is not defined during compilation.
User avatar
sgrogan
Posts: 5425
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby sgrogan » Thu May 25, 2017 9:03 pm

abdullah wrote:it should not work (I would be surprised if it does), you have to add a definition (a preprocesor macro that will be passed to c++). The one above should only be a cmake environment variable.
I thought that is what CMake did?
See Here: https://forum.freecadweb.org/viewtopic. ... 60#p156942
This thread is also where the OCAF problem originates.
abdullah wrote:#ifdef HAVE_TBB
ThisIsMyNonExistingFunction()
#endif

If compilation fails it is taking it, if it does not fail, well, the macro is not defined during compilation.
I will try this next. Thanks for all the help.
EDIT: Compilation didn't fail. I'll add this https://github.com/abdullahtahiriyo/Fre ... 543fdcbdc0 and try again.
Last edited by sgrogan on Thu May 25, 2017 9:43 pm, edited 1 time in total.
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby abdullah » Thu May 25, 2017 9:22 pm

sgrogan wrote:
abdullah wrote:it should not work (I would be surprised if it does), you have to add a definition (a preprocesor macro that will be passed to c++). The one above should only be a cmake environment variable.
I thought that is what CMake did?
See Here: https://forum.freecadweb.org/viewtopic. ... 60#p156942
This thread is also where the OCAF problem originates.
abdullah wrote:#ifdef HAVE_TBB
ThisIsMyNonExistingFunction()
#endif

If compilation fails it is taking it, if it does not fail, well, the macro is not defined during compilation.
I will try this next. Thanks for all the help.
I am not an expert in CMake, so whatever the test says is the reality. The non-existing function should help you determine what is really happen. Let me know ;)

It is my pleasure to help you (you are always helping around) and in any case I am interested in whatever helps filter/improve the quality of bug reports and for sure early detection of potential library conflicts. Those get difficult to see in a debugger...
User avatar
sgrogan
Posts: 5425
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby sgrogan » Thu May 25, 2017 9:49 pm

OK compilation is still ongoing but I'm getting your expected failures

Code: Select all

Error	1	error C2143: syntax error : missing ';' before 'for'	C:\Users\Chris\GitHub\FreeCAD\src\App\Document.cpp	2782	1	FreeCADApp
Error	2	error C3861: 'ThisIsMyNonExistingFunction': identifier not found	C:\Users\Chris\GitHub\FreeCAD\src\App\Document.cpp	2780	1	FreeCADApp
Error	3	error C1083: Cannot open include file: 'tbb/parallel_for.h': No such file or directory	C:\Users\Chris\GitHub\FreeCAD\src\Mod\Import\App\ImportOCAF.cpp	83	1	Import
So vejmarie does this

Code: Select all

add_definitions(-DHAVE_TBB)
somewhere else that made a difference in my previous tests?

EDIT: abdullah, do you think we should start a new thread? and maybe ask a mod to move our conversation there? I think we have determined it's not a PPA packaging issue but a FreeCAD issue.
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby abdullah » Thu May 25, 2017 11:05 pm

sgrogan wrote:OK compilation is still ongoing but I'm getting your expected failures
sgrogan wrote:EDIT: abdullah, do you think we should start a new thread? and maybe ask a mod to move our conversation there? I think we have determined it's not a PPA packaging issue but a FreeCAD issue.
This is with the "add_definitions" isn't it?

If so, no, it is not a OCC PPA packaging issue anymore, but a FC cmake problem. It may only come back to OCC PPA packaging if changes are necessary to the packaging to detect the OCC compilation flags. However I do not expect this.

With respect to the thread, I am ok with this or a new one. Just quote me when replying to this topic (in any thread), because I rely a lot on the notification mechanism and have a very bad memory ;)
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby abdullah » Thu May 25, 2017 11:10 pm

sgrogan wrote:OK compilation is still ongoing but I'm getting your expected failures

Code: Select all
Error 1 error C2143: syntax error : missing ';' before 'for' C:\Users\Chris\GitHub\FreeCAD\src\App\Document.cpp 2782 1 FreeCADApp
Error 2 error C3861: 'ThisIsMyNonExistingFunction': identifier not found C:\Users\Chris\GitHub\FreeCAD\src\App\Document.cpp 2780 1 FreeCADApp
Error 3 error C1083: Cannot open include file: 'tbb/parallel_for.h': No such file or directory C:\Users\Chris\GitHub\FreeCAD\src\Mod\Import\App\ImportOCAF.cpp 83 1 Import

So
BTW, the last error is the one I was mentioning about HAVE_TBB. I think it makes sense to rename the HAVE_TBB macro used for OCAF, as otherwise it will conflict with the HAVE_TBB from OCC that we are forced to use in that form because of OCC headers.
wmayer wrote: Werner...
Would you agree to renaming the OCAF HAVE_TBB macro to other name, like OCAF_HAVE_TBB for example?
User avatar
sgrogan
Posts: 5425
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] Transitioning to OCCT7, VTK7...

Postby sgrogan » Fri May 26, 2017 9:03 pm

abdullah wrote:
Thu May 25, 2017 11:10 pm
BTW, the last error is the one I was mentioning about HAVE_TBB. I think it makes sense to rename the HAVE_TBB macro used for OCAF, as otherwise it will conflict with the HAVE_TBB from OCC that we are forced to use in that form because of OCC headers.
I know that vejmarie was trying to get stuff into OCCT as part of his Step Reader improvements so at some point they may become re-aligned. I will try to get in touch with him this WE. Locally I will re-name to look at the CMake stuff.