BIMSBbioinfo / VoltRon

Spatial omic analysis toolbox for multi-resolution and multi-omic integration using image registration
http://bioinformatics.mdc-berlin.de/VoltRon/
Other
41 stars 10 forks source link

installation support for Linux-based OS #72

Closed matt-sd-watson closed 10 months ago

matt-sd-watson commented 11 months ago

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’
Artur-man commented 11 months ago

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 11 months ago

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.

Artur-man commented 11 months ago

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 ...

Artur-man commented 10 months ago

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