Utility to inspect OpenCascade models

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
triplus
Posts: 9431
Joined: Mon Dec 12, 2011 4:45 pm

Re: Utility to inspect OpenCascade models

Postby triplus » Sun Feb 02, 2020 2:25 pm

Hi @tanderson69

I will give it another try at the end of the following week. Will try on Ubuntu 20.04 and by installing as much dependencies from the default repositories as possible.

As for Meson vs. CMake. I have seen some projects migrating to Meson, but the main problem, for Meson, likely is CMake has in general been accepted as a good solution and this puts Meson in a difficult position.
User avatar
tanderson69
Posts: 1531
Joined: Thu Feb 18, 2010 1:07 am

Re: Utility to inspect OpenCascade models

Postby tanderson69 » Sun Feb 02, 2020 3:02 pm

wmayer wrote:
Sun Feb 02, 2020 9:30 am
Out of curiosity what are the issues you have with cmake and what's better with meson?
This is pretty subjective, so I will list what I can come up with right now but you should just try it on something. I have used meson on linux and mac, but can't speak to the windows experience. This is my priority:

meson syntax is better, it is python like. I find it easier to understand, and I have little experience with python.
meson doc is better. It is more like a tutorial instead of a reference manual.
I can debug meson a lot faster. You can alter meson.py with debug statements and find out what is really happening. When cmake fails, I struggle.
default eco-system is smooth. I like the separate responsibility of pkg-config. ninja is faster than make and defaults to using ccache.
combining git submodules with meson subprojects is a nice/clean way to add 'non-standard' dependencies.

It is not all roses. meson is not as mature as cmake and has some rough edges. I am concerned what meson on windows will be like.

If this subject is to continue, maybe we should fork it as not to hi-jack this thread?
wmayer
Site Admin
Posts: 15756
Joined: Thu Feb 19, 2009 10:32 am

Re: Utility to inspect OpenCascade models

Postby wmayer » Sun Feb 02, 2020 4:10 pm

tanderson69 wrote:
Sun Feb 02, 2020 3:02 pm
This is pretty subjective, so I will list what I can come up with right now but you should just try it on something. I have used meson on linux and mac, but can't speak to the windows experience. This is my priority:

meson syntax is better, it is python like. I find it easier to understand, and I have little experience with python.
meson doc is better. It is more like a tutorial instead of a reference manual.
I can debug meson a lot faster. You can alter meson.py with debug statements and find out what is really happening. When cmake fails, I struggle.
default eco-system is smooth. I like the separate responsibility of pkg-config. ninja is faster than make and defaults to using ccache.
combining git submodules with meson subprojects is a nice/clean way to add 'non-standard' dependencies.

It is not all roses. meson is not as mature as cmake and has some rough edges. I am concerned what meson on windows will be like.

If this subject is to continue, maybe we should fork it as not to hi-jack this thread?
Thanks! I recently read in a German tech forum too that meson has some advantages over cmake (basically the same points you mentioned) and since I have no experience with it I just wanted to know what they are.
User avatar
easyw-fc
Posts: 2840
Joined: Thu Jul 09, 2015 9:34 am

Re: Utility to inspect OpenCascade models

Postby easyw-fc » Mon Feb 03, 2020 6:34 am

tanderson69 wrote:
Sun Feb 02, 2020 2:14 pm
This has nothing to do with Qt. It has to do with meson and occt. You need Meson >= 0.51. Meson should have failed or at least warned you before that. The good news is, meson is a python script so you can just clone the github repo and run it from there.
thx, I'm going further now... I'll keep updated
triplus
Posts: 9431
Joined: Mon Dec 12, 2011 4:45 pm

Re: Utility to inspect OpenCascade models

Postby triplus » Mon Feb 10, 2020 8:41 am

tanderson69 wrote:
Sat Feb 01, 2020 11:55 pm
triplus wrote:
Wed Jan 29, 2020 1:29 am
Congratulations.

P.S. But now you will likely have to share build instructions. ;)
debian bullseye:
occt7.4 from source to default location /usr/local
vtk8.2 from source to default location /usr/local
all other dependencies installed with 'apt install'

Code: Select all

git clone --recursive https://gitlab.com/blobfish/AnalysisSitus.git
cd AnalysisSitus
mkdir -p build/release 
cd build/release
meson --buildtype=release ../..
ninja
sudo ninja install

//run program
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/x86_64-linux-gnu
asiExe

//uninstall 
sudo ninja uninstall
Right, with Ubuntu 20.04 and when working only with default set of packages from the repositories, i get to the step of detecting OCCT, where it fails to find the OCCT as a run-time dependency. Now i guess if people will use this procedure in the future, such things should get sorted out? In addition is there a problem with using lower version of OCCT (7.4) and VTK (8.2)? As if this are minimum requirements, people likely won't try for now anyway.
User avatar
easyw-fc
Posts: 2840
Joined: Thu Jul 09, 2015 9:34 am

Re: Utility to inspect OpenCascade models

Postby easyw-fc » Mon Feb 10, 2020 10:09 pm

triplus wrote:
Mon Feb 10, 2020 8:41 am
Right, with Ubuntu 20.04 and when working only with default set of packages from the repositories, i get to the step of detecting OCCT, where it fails to find the OCCT as a run-time dependency. Now i guess if people will use this procedure in the future, such things should get sorted out? In addition is there a problem with using lower version of OCCT (7.4) and VTK (8.2)? As if this are minimum requirements, people likely won't try for now anyway.
I'm on Mint 19.3 which is based on Ubuntu 18.04 LTS...
ATM I'm stacked on detecting OCCT:
meson.build:11:0: ERROR: Dependency "OpenCASCADE" not found, tried cmake
It would be great to have some more tips...
Thanks in advance
triplus
Posts: 9431
Joined: Mon Dec 12, 2011 4:45 pm

Re: Utility to inspect OpenCascade models

Postby triplus » Tue Feb 11, 2020 9:58 am

Hi @easyw-fc

If i look at:

https://gitlab.com/ssv/AnalysisSitus

I see that about a week back some Linux CMake additions were added. That is a step in the right direction, but likely we are just not there yet.
User avatar
Quaoar
Posts: 79
Joined: Thu Jul 27, 2017 11:56 am
Location: Nizhny Novgorod
Contact:

Re: Utility to inspect OpenCascade models

Postby Quaoar » Tue Feb 11, 2020 10:33 am

Guys, if you can kindly propose any cmake improvements to ease the process, I will follow. Personally, I just built OpenCascade from scratch, which is probably not something most of people want to do. Also, the current finder of OpenCascade simply looks for libs/includes, and it is not very conventional either. I did not look at Meson build system, all my experiments were limited with cmake so far.
FOSS CAD model inspection utility and prototyping framework: http://analysissitus.org
triplus
Posts: 9431
Joined: Mon Dec 12, 2011 4:45 pm

Re: Utility to inspect OpenCascade models

Postby triplus » Tue Feb 11, 2020 10:42 am

Quaoar wrote:
Tue Feb 11, 2020 10:33 am
current finder of OpenCascade simply looks for libs/includes
On Debian/Ubuntu likely adding this should do:

Code: Select all

/usr/lib/x86_64-linux-gnu
P.S. I would suggest for installing Debian or Ubuntu and to install the dependencies from the official repositories. Running the cmake step and patching as you go should be the easiest and fastest way to sort this out.
User avatar
tanderson69
Posts: 1531
Joined: Thu Feb 18, 2010 1:07 am

Re: Utility to inspect OpenCascade models

Postby tanderson69 » Tue Feb 11, 2020 11:09 am

easyw-fc wrote:
Mon Feb 10, 2020 10:09 pm
I'm on Mint 19.3 which is based on Ubuntu 18.04 LTS...
ATM I'm stacked on detecting OCCT:
What version of occt? Where is it installed? What are your results of these 3 commands?

Code: Select all

cmake --find-package -DNAME=OpenCASCADE -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST
cmake --find-package -DNAME=OpenCASCADE -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=COMPILE
cmake --find-package -DNAME=OpenCASCADE -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=LINK
Here is my output from those commands.
cmakeOut.png
cmakeOut.png (95.54 KiB) Viewed 96 times
You can also look for clues in the meson-log.txt file in your build directory.



Quaoar wrote:
Tue Feb 11, 2020 10:33 am
Guys, if you can kindly propose any cmake improvements to ease the process, I will follow. Personally, I just built OpenCascade from scratch, which is probably not something most of people want to do. Also, the current finder of OpenCascade simply looks for libs/includes, and it is not very conventional either. I did not look at Meson build system, all my experiments were limited with cmake so far.
I didn't mean to cause you any pain/frustration. We can split the meson experiment conversion to another thread, if you want.