Build 0.17 on Debian Testing (Stretch)

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Build 0.17 on Debian Testing (Stretch)

Post by mlampert »

Finally got 0.17 built to go through. In addition to the compile instructions for Linux I had to:

* /usr/lib/cmake/vtk-6.3
Grep for vtkRenderingPythonTkWidgets and comment out or delete
all references to it.
* <cmake>/src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/link.txt
After ..../libhdf5.so add the following libraries:
- /usr/lib/openmpi/lib/libmpi_cxx.so
- /usr/lib/openmpi/lib/libmpi.so

I don't know anything about cmake, so I could not figure out how to properly fix the missing libraries for linking SMESH.
Other projects have run into the issue with VTK's cmake file - if I read the comments in diverse bug reports correctly this might not get fixed.

Thought this might help others on Stretch who don't want to install a Ubuntu VM .... ;)
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Post by mlampert »

Repeating the build on a more vanilla installation turns out I forgot some steps:
* installation of libvtk6-dev
* ln -s /usr/bin/vtk6 /usr/bin/vtk
* installation of libmed-dev
* installation of libmedc-dev
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Post by mlampert »

Follow up:
The issue with link.txt turns out to be another mis-configuration of vtk6's cmake files. I added "/usr/lib/libmpi_cxx.so" before libmpi.so in the files:
/usr/lib/cmake/vtk-6.3/VTKTargets-none.cmake
/usr/lib/cmake/vtk-6.3/Modules/vtkhdf5.cmake
and that seems to do the trick. Don't know if both are required.
CharlieMAC
Posts: 228
Joined: Fri Apr 25, 2014 1:59 am

Re: Build 0.17 on Debian Testing (Stretch)

Post by CharlieMAC »

mlampert wrote:Finally got 0.17 built to go through. In addition to the compile instructions for Linux I had to:

* /usr/lib/cmake/vtk-6.3
Grep for vtkRenderingPythonTkWidgets and comment out or delete
all references to it.
* <cmake>/src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/link.txt
After ..../libhdf5.so add the following libraries:
- /usr/lib/openmpi/lib/libmpi_cxx.so
- /usr/lib/openmpi/lib/libmpi.so


I don't know anything about cmake, so I could not figure out how to properly fix the missing libraries for linking SMESH.
Other projects have run into the issue with VTK's cmake file - if I read the comments in diverse bug reports correctly this might not get fixed.

Thought this might help others on Stretch who don't want to install a Ubuntu VM .... ;)
I'm trying to compile 0.17 in debian testing, but the instructions I marked in bold are pretty confusing. Can you please specify in a better way what to do?
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Post by mlampert »

CharlieMAC wrote:I'm trying to compile 0.17 in debian testing, but the instructions I marked in bold are pretty confusing. Can you please specify in a better way what to do?
Sorry for being too terse. These are the steps I do each time I upgrade Debian testing:
*

Code: Select all

cd /usr/lib/cmake/vtk-6.3
*

Code: Select all

vim $(grep -rlw vtkRenderingPythonTkWidgets )
- insert a "#" at the beginning of each block that references vtkRenderingPythonTkWidgets
* also you have

Code: Select all

vim $(grep -rlw libmip)
, you'll find 2 references and you'll have to insert "/usr/lib/libmip_cxx.so;" before /usr/lib/libmpi.so
tokiop
Posts: 9
Joined: Tue Nov 01, 2016 1:07 pm

Re: Build 0.17 on Debian Testing (Stretch)

Post by tokiop »

Hi,

thanks a lot mlampert, I managed to compile 0.17 with the infos you shared. This is the gist of a successful out-of-source build on my system (Debian Testing "Stretch" @ 2016/12/02) :

Code: Select all

# Get the source code
$ git clone https://github.com/FreeCAD/FreeCAD.git freecad-code
$ mkdir freecad-build && cd freecad-build

# Install missing deps
$ sudo apt install build-essential cmake python python-matplotlib libtool libsoqt4-dev libxerces-c-dev libboost-dev libboost-filesystem-dev libboost-regex-dev libboost-program-options-dev libboost-signals-dev libboost-thread-dev libboost-python-dev libqt4-dev libqt4-opengl-dev qt4-dev-tools python-dev python-pyside pyside-tools libpyside-dev libode-dev swig libzipios++-dev libfreetype6 libfreetype6-dev libmedc-dev libcoin80-dev libqtwebkit-dev libxerces-c-dev liboce*-dev oce-draw libvtk6-dev libshiboken-dev

# Manualy remove references to vtkRenderingPythonTkWidgets by deleting or commenting with "#" at the start of the lines
$ sudo gedit /usr/lib/cmake/vtk-6.3/VTKTargets-none.cmake
$ sudo gedit /usr/lib/cmake/vtk-6.3/VTKTargets.cmake

$ cmake ../freecad-code

# Append missing libraries in salomesmesh CMakeFiles (need to escape slash in paths)
$ ex -sc 's/$/ \/usr\/lib\/openmpi\/lib\/libmpi_cxx.so \/usr\/lib\/openmpi\/lib\/libmpi.so/|w|q' src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/link.txt

# Cross fingers :P
$ make

$ cd bin && ./FreeCAD
Cheers ! Thanks all for this great software and community !

Victor
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Post by mlampert »

With the latest update from debian testing the openmpi packaging changed. The libraries are now (modify all in /usr/cmake/vtk-6.3)
/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so
/usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so

Additionally the header files moved
* edit /usr/lib/cmake/vtk-6.3/Modules/vtkhdf5.cmake
* add ";/usr/include/mpi" at the end of the line starting with "set(vtkhdf5_INCLUDE_DIRS" (make sure to add it before the terminal \")
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Build 0.17 on Debian Testing (Stretch)

Post by wmayer »

@mlampert what exactly does this mean? Do you have to adjust some variables in the cmake GUI to get everything built? Especially vtkhdf5_INCLUDE_DIRS isn't this automatically detected and set by vtk's cmake handling?
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Post by mlampert »

It means the cmake files that come with vtk-6.3 are broken and need to be edited.

The Debian maintainer says it's an upstream problem with vtk and it needs to be fixed there. The end result is that the installed cmake files in /usr/lib/cmake/vtk-6.3 are referencing libraries that don't exist (vtkRenderingPythonTkWidgets), don't include the C++ binding for openmpi (libmpi_cxx.so) and now also look for the openmpi libraries and include files in the wrong directories.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Post by mlampert »

the package which brings in the cmake files is libvtk6-dev
Post Reply