compile FreeCAD 0.17 with occt 7.1.0 and netgen, script for Xenial and Jessie

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
NormandC
Posts: 12072
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: compile FreeCAD 0.17 with occt 7.0.0 and netgen, script for Xenial and Jessie

Postby NormandC » Mon Jan 30, 2017 2:37 am

If you guys don't know already (doubtful since I'm trumpeting it every chance I get ;)), I'm a GUI guy. Yes, I did take care of the Launchpad PPA for 4 years and doing so, I had to use the terminal. But I don't like it, and I'll never be comfortable with it.

When using such scripts that play in the system, I never know if I should run them with sudo or not. When running with sudo, all folders and files created in my home folder are owned by root and I can't delete them from the GUI using the Nautilus file manager and I hate that. :evil:

Out of curiosity I ran it without sudo permissions with bash, since that's apparently what Jee-Bee did.

I don't understand how it could create a FreeCAD0.17 folder in /opt/local/ without expressly asking for my password! Shouldn't this path require root access?!? :shock:

And at the same time, it failed to install system libraries such as libhdf5-dev.

And when ready to do sudo make install, it finally asked for my password!

So in the end, the compilation failed and I have a big mess with which I don't know what to do, as I'd prefer not to start from scratch.

Anyway. :roll:
User avatar
kkremitzki
Posts: 322
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: compile FreeCAD 0.17 with occt 7.0.0 and netgen, script for Xenial and Jessie

Postby kkremitzki » Mon Jan 30, 2017 3:15 am

I took the most recent discussions from the Porting to Python 3 discussion and modified Bernd's installation script to compile the current work in the Python 3 port. The script is here:

https://gist.github.com/kkremitzki/324f ... cad_all-sh

I tested it on a fresh Ubuntu 16.04 desktop VM. Let me know how it works!
User avatar
kkremitzki
Posts: 322
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: compile FreeCAD 0.17 with occt 7.0.0 and netgen, script for Xenial and Jessie

Postby kkremitzki » Mon Jan 30, 2017 3:27 am

NormandC wrote:If you guys don't know already (doubtful since I'm trumpeting it every chance I get ;)), I'm a GUI guy. Yes, I did take care of the Launchpad PPA for 4 years and doing so, I had to use the terminal. But I don't like it, and I'll never be comfortable with it.

When using such scripts that play in the system, I never know if I should run them with sudo or not. When running with sudo, all folders and files created in my home folder are owned by root and I can't delete them from the GUI using the Nautilus file manager and I hate that. :evil:

Out of curiosity I ran it without sudo permissions with bash, since that's apparently what Jee-Bee did.

I don't understand how it could create a FreeCAD0.17 folder in /opt/local/ without expressly asking for my password! Shouldn't this path require root access?!? :shock:

And at the same time, it failed to install system libraries such as libhdf5-dev.

And when ready to do sudo make install, it finally asked for my password!

So in the end, the compilation failed and I have a big mess with which I don't know what to do, as I'd prefer not to start from scratch.

Anyway. :roll:


That's quite odd! One thing that might have happened is this: if you recently did sudo something, Ubuntu by default won't ask again for 15 minutes. The script should be ran as your user, and it has several uses of sudo throughout, where necessary. Perhaps the first few actions were within 15 minutes of the last sudo and the later ones were after?

If you run ls -la /opt/local, you can verify whether your user can normally write that folder. Look for:

Code: Select all

drwxr-xr-x  3 root root 4.0K Jan 26 03:23 ./

That means that the user root has read, write, execute permissions, the group root has read and execution, and the same for everyone else. So, if I'm not root, I'm not writing anything in that dir. If your permissions are the same then my theory may be the explanation.

The script should normally go to your home directory, go into the Documents folder, and create a build_FreeCAD folder which has all the downloaded source code. But, if you run it again, it automatically deletes the build folder and grabs everything again before reinstalling into /opt/local.
User avatar
NormandC
Posts: 12072
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: compile FreeCAD 0.17 with occt 7.0.0 and netgen, script for Xenial and Jessie

Postby NormandC » Mon Jan 30, 2017 5:29 am

kkremitzki wrote:That's quite odd! One thing that might have happened is this: if you recently did sudo something, Ubuntu by default won't ask again for 15 minutes.

Possibly, but I just realized I had left Synaptic opened when I ran the script :roll: , which is probably the reason the installation of libhdf5-dev (which I don't have since I hadn't compiled for more than 9 months) failed, packages can't be installed from apt-get if a package manager is running.

kkremitzki wrote:If you run ls -la /opt/local

Yeah, I get the exact same permissions, so it must be that the terminal remembered the last sudo command I made.

kkremitzki wrote:But, if you run it again, it automatically deletes the build folder and grabs everything again before reinstalling into /opt/local.

That's exactly what I wish I could avoid. My build_FreeCAD folder takes up 2.1GB and downloading again OCCT, FreeCAD and the other stuff takes time, not to mention the whole compilation process...

I think I'll try to compile FreeCAD manually assuming compilation of OCCT, VTK and Netgen succeeded (which it seemed).

Thanks for the info.
User avatar
kkremitzki
Posts: 322
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: compile FreeCAD 0.17 with occt 7.0.0 and netgen, script for Xenial and Jessie

Postby kkremitzki » Mon Jan 30, 2017 5:32 am

My adapted script for the Python 3 build includes checks to prevent re-downloading those libraries, I'm sure we can get something "upstreamed" with Bernd's script.
User avatar
bernd
Posts: 3871
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile FreeCAD 0.17 with occt 7.0.0 and netgen, script for Xenial and Jessie

Postby bernd » Mon Jan 30, 2017 5:36 am

NormandC wrote:OCC 7.1.0 was published November 25th 2016. Is there a reason why your script uses 7.0.0 rather than the latest release?
Sure there is a special reason for this. I have'nt had the time trying to compile ooct 7.1. :)
User avatar
bernd
Posts: 3871
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile FreeCAD 0.17 with occt 7.0.0 and netgen, script for Xenial and Jessie

Postby bernd » Mon Jan 30, 2017 5:42 am

NormandC wrote:So in the end, the compilation failed and I have a big mess with which I don't know what to do, as I'd prefer not to start from scratch.
I made the script for my own. I use vagrant to test FreeCAD in a fresh installed Xenial or Jessie with fresh compiled FreeCAD. For setting up the environment I use this script. I fully understand your opinion.

bernd
User avatar
bernd
Posts: 3871
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile FreeCAD 0.17 with occt 7.0.0 and netgen, script for Xenial and Jessie

Postby bernd » Mon Jan 30, 2017 5:43 am

kkremitzki wrote:My adapted script for the Python 3 build includes checks to prevent re-downloading those libraries, I'm sure we can get something "upstreamed" with Bernd's script.
wow cool, since I haven't compiled FreeCAD with python3 so far I will give it a try for sure. I may udate my ones with your changes int the regard of re- downloading. But all this will take some days ...
User avatar
bernd
Posts: 3871
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: compile FreeCAD 0.17 with occt 7.0.0 and netgen, script for Xenial and Jessie

Postby bernd » Mon Jan 30, 2017 5:44 am

sodelo wrote:

Code: Select all

[ 13%] Built target FreeCADApp
[ 13%] Building CXX object src/Gui/CMakeFiles/FreeCADGui.dir/Application.cpp.o
/home/dominique/Documents/build_FreeCAD/freecad/FreeCAD/src/Gui/Application.cpp:41:22: fatal error: QGLFormat: Aucun fichier ou dossier de ce type
compilation terminated.
src/Gui/CMakeFiles/FreeCADGui.dir/build.make:1135 : la recette pour la cible « src/Gui/CMakeFiles/FreeCADGui.dir/Application.cpp.o » a échouée
make[2]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/Application.cpp.o] Erreur 1
CMakeFiles/Makefile2:4903 : la recette pour la cible « src/Gui/CMakeFiles/FreeCADGui.dir/all » a échouée
make[1]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/all] Erreur 2
Makefile:127 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2

Would you translate the french in english?
User avatar
NormandC
Posts: 12072
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: compile FreeCAD 0.17 with occt 7.0.0 and netgen, script for Xenial and Jessie

Postby NormandC » Mon Jan 30, 2017 5:57 am

Code: Select all

/home/dominique/Documents/build_FreeCAD/freecad/FreeCAD/src/Gui/Application.cpp:41:22: fatal error: QGLFormat: Aucun fichier ou dossier de ce type

No file or folder with this name

Code: Select all

src/Gui/CMakeFiles/FreeCADGui.dir/build.make:1135 : la recette pour la cible « src/Gui/CMakeFiles/FreeCADGui.dir/Application.cpp.o » a échouée

recipe for target "src/.../Application.cpp.o" failed

Code: Select all

Erreur 1

That one's easy enough to understand... Error 1

Code: Select all

CMakeFiles/Makefile2:4903 : la recette pour la cible « src/Gui/CMakeFiles/FreeCADGui.dir/all » a échouée

recipe for target "src/.../all" failed

Code: Select all

Makefile:127 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2

Makefile:127 : recipe for target "all" failed
make: *** [all] Error 2