sempr-tk / sempr

SEMPR - Semantic Environment Mapping, Processing and Reasoning
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

qt upgrade #28

Closed niniemann closed 6 years ago

niniemann commented 6 years ago

libsoprano-dev currently introduces a dependency to qt4, but qt4 is really old... and creates some trouble when trying to use sempr with qt, vtk and ros (since ros uses vtk6, and vtk6 has only qt5 support).

So lets migrate to qt5. The changes needed in soprano seem to be quite small, and a "qt5"-commit already exists in the KDE-repositiory.

What what to do?

  1. remove all traces of libsoprano4, libsoprano-dev and soprano-daemon (which installes the backends, which again link against qt4)
  2. make sure you have qt5 installed. pkg-config --libs Qt5Core
  3. get soprano
    git clone https://github.com/KDE/soprano.git
    cd soprano
  4. apply patches to fix some stuff:
    • soprano-plugin-export.patch found here
    • adjust pkg-config file to Require: Qt5Core if build with QT5_BUILD=true (TODO)
  5. build with qt5 -- read next step first
    mkdir build && cd build
    cmake .. -DQT5_BUILD=true -DCMAKE_INSTALL_PREFIX=/usr
    make -j8
  6. install -- TODO: where? Didn't work out when I tried a custom CMAKE_INSTALL_PREFIX, I think everything needs to go to /usr/ (for qt to find the backend plugins)
    sudo make install
  7. verify: pkg-config --libs soprano should contain Qt5Core, as well as ldd /usr/lib/libsoprano.so
  8. use the qt5-branch in sempr which fixes a bit in the cmake script, e.g. sets -fPIC which is needed by qt5.

TODO: How does the qt5-plugin-stuff work? where does it search for xml-metadata, where for libraries? (e.g. /usr/lib/soprano/libsoprano_redlandbackend.so)

Note: When no plugin, no backend is found, a call to Soprano::createModel() returns null, which in turn lead to access violations for trying to deref a nullptr in the test cases.

Interesting for: @y0urself

y0urself commented 6 years ago

I think Qt5 stores all the libraries in an own directory. I have installed it from the official Qt Download page: https://www.qt.io/download and thus qt seamed to create an directory /usr/lib/x86_64-linux-gnu/ where the soprano libs are stored.

niniemann commented 6 years ago

I've noticed that in the output of cmake .. -DQT5_BUILD (for soprano) it says:

-- The following features have been disabled:

 * Redland storage backend , STRONGLY RECOMMENDED: The redland backend is required to build Nepomuk.

#[...]
-- The following RECOMMENDED packages have not been found:

 * Rasqal , Rasqal RDF Query Library , <http://librdf.org/rasqal>
   Needed to build the Raptor parser and Redland backend
 * Raptor (required version >= 2.0.0) , Raptor RDF Syntax Library , <http://librdf.org/raptor>
   Needed to build the Raptor parser and Redland backend
 * Redland (required version >= 1.0.5) , Support for the Resource Description Framework (RDF) , <http://librdf.org>
   Needed to build the Raptor parser and Redland backend

Installing librdf0 (redland) etc. is no problem -- these libs were already installed, I think as a dependency of libsoprano4. But the libraptor2-dev relies on libcurl4-gnutls-dev, which conflicts with libcurl4-openssl-dev, which is a dependency of ros... Curiously, libraptor2-0 (for which apt shows the same version number, 2.0.14-1) depends on libcurl3-gnutls

So, to compile soprano with qt5 support we need to...

I'm confused by this strange libcurl3/4-dependency...

y0urself commented 6 years ago

Reinstalling libcurl4-openssl-dev leads to

The following packages will be REMOVED:
  libcurl4-gnutls-dev libraptor2-dev librasqal3-dev librdf0-dev

But regardless soprano seems to be working in sempr?

It is really strange that libraptor2-0 depends on libcurl3-gnutls but libraptor2-dev on libcurl4-gnutls-dev - maybe because there is no libcurl3-gnutls-dev?

niniemann commented 6 years ago

How did you even install libraptor2-dev without removing ROS? :D

Soprano is working since it doesn't need the -dev packages. It only needs libsoprano-dev, which in turn just installs the soprano-headers and libs which are linked to libraptor-2-0 etc. And it is no problem to install libcurl3 in parallel to libcurl4-openssl-dev, it seems.

I guess manually installing libraptor2-dev without the libcurl4-gnutls-dev dependency should work. I'll try...

y0urself commented 6 years ago

On this system at home I haven't installed ROS now. So this was no problem for me ...

But sempr & soprano are working find when installed with Qt5. :)

*** No errors detected :)

niniemann commented 6 years ago

Have you installed librdf0-dev before compiling soprano with qt5-support? And what is the output of pkg-config --libs sempr-core?

y0urself commented 6 years ago

Yes. I have installed: unixodbc, unixodbc-dev (for sql.h), default-jdk (I hadn't installd java ...), librdf0-dev, librasqal3-dev (with dependecies libraptor2-dev)

jaspar@y0urself:~/Bachelor/soprano/build$ pkg-config --libs sempr-core
-L/usr/local/lib/sempr -L/usr/local/lib -lsempr_core -lgdal -lodb -lodb-boost -lodb-sqlite -lsoprano -lQt5Core
niniemann commented 6 years ago

Ah nice. Nevertheless it'd be nice to install sempr with qt5 next to ROS, and I think I've found a way to do so. I'll commit some instructions when I'm done.

niniemann commented 6 years ago

I've added a description to the wiki: https://github.com/sempr-tk/sempr/wiki/soprano_qt5

The patches for soprano are also uploaded there, and linked in the description. The workaround to not having to uninstall an existing ros-installation due to a libcurl4-openssl/gnutls-dev-conflict is really hacky, but can be reversed with a simple apt-get remove after compiling soprano - so I guess it's kind of "okay". :wink:

niniemann commented 6 years ago

Added note to wiki and updated CMakeLists in #29 .