Build 0.17 on Debian Testing (Stretch)

Having trouble installing or compiling FreeCAD? Get help here.
mlampert
Posts: 292
Joined: Fri Sep 16, 2016 9:28 pm

Build 0.17 on Debian Testing (Stretch)

Postby mlampert » Fri Sep 16, 2016 9:38 pm

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
Posts: 292
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Postby mlampert » Sat Sep 17, 2016 8:09 am

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
Posts: 292
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Postby mlampert » Wed Oct 12, 2016 1:35 am

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: 211
Joined: Fri Apr 25, 2014 1:59 am

Re: Build 0.17 on Debian Testing (Stretch)

Postby CharlieMAC » Mon Nov 28, 2016 9:05 pm

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
Posts: 292
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Postby mlampert » Mon Nov 28, 2016 9:44 pm

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: 5
Joined: Tue Nov 01, 2016 1:07 pm

Re: Build 0.17 on Debian Testing (Stretch)

Postby tokiop » Sun Dec 04, 2016 2:04 pm

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
Posts: 292
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Postby mlampert » Wed Dec 28, 2016 9:50 pm

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
Site Admin
Posts: 11352
Joined: Thu Feb 19, 2009 10:32 am

Re: Build 0.17 on Debian Testing (Stretch)

Postby wmayer » Thu Dec 29, 2016 8:30 am

@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
Posts: 292
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Postby mlampert » Thu Dec 29, 2016 7:53 pm

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
Posts: 292
Joined: Fri Sep 16, 2016 9:28 pm

Re: Build 0.17 on Debian Testing (Stretch)

Postby mlampert » Thu Dec 29, 2016 7:58 pm

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