BIMSBbioinfo/VoltRon

installation support for Linux-based OS

matt-sd-watson opened this issue · 4 comments

Do you have documentation or installation support for Linux OS? The installation of opencv requirements appear to be non-trivial and may require compilation from source as well as installation of opencv_contrib. I receive the following installation error when attempting to install using the default opencv package for Python 3:

devtools::install_github("BIMSBbioinfo/VoltRon")
automated_registration.cpp:3:10: fatal error: opencv2/xfeatures2d.hpp: No such file or directory
    3 | #include "opencv2/xfeatures2d.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/usr/lib/R/etc/Makeconf:200: automated_registration.o] Error 1
ERROR: compilation failed for package ‘VoltRon’

Dear Matthew,

Thank you so much for trying out the package.

Is it ok if you can share the full log so we can see whats going on.
Also that would be really nice if we know more about your OS, distribution, version etc.

Best,
Artür

rekado commented

Voltron uses OpenCV by building some C++ components. Building these files requires not only the OpenCV library (configured with the expected features) to be present but also the OpenCV headers. Notably, it requires the opencv2/xfeatures2d.hpp header. The configure script checks for the presence of this header, but we forgot to make it abort when the header isn't found.

Depending on what GNU+Linux distribution you're using, there are different ways of obtaining those headers. On Debian/Ubuntu you need to install libopencv-dev, on Fedora/RHEL you install opencv-devel.


Note that with GNU Guix, the reproducible package manager, you can install Voltron on any GNU+Linux system. It takes care of getting the appropriate OpenCV and all other dependencies as well.

Thanks so much for bringing this to our attention Matthew,

You are right, indeed you need an opencv build with the xfeatures2d module from the opencv_contrib which is not available in the libopencv-dev debian at the moment, although the versions we use for mac and win includes them (and perhaps Fedora) do have xfeatures2d.

Working on this now to determine the best way to explain how to acquire xfeatures2d for linux distributions such as yours. We packaged this configuration nicely using Guix (like Ricardo suggested) so we might as well provide instructions through GNU Guix soon.

Stay tuned ...

We provided some instructions in README for those who might also like to preinstall OpenCV for Ubuntu and other debian-like distros.

git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git

mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON  -D OPENCV_GENERATE_PKGCONFIG=ON -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules/  -D BUILD_opencv_xfeatures2d=ON ../opencv/

make -j5
make install

sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
ldconfig