I’m a first-time snapcrafter. My application, called ‘stalefish’, is written in C++, uses the cmake build system and is hosted as a github repository (it’s private right now, we’ll publish it open source to coincide with an academic paper on the algorithms which it implements).
The application contains two main binaries, one of which (stalefish) has the dependencies OpenCV, HDF5, libarmadillo, libjsoncpp and their sub-dependencies. The second binary (sfview) has the same dependencies plus libglfw3, libfreetype6 and OpenGL.
After some trial and error, I got the snapcraft build process to create for me a stalefish*.snap which I can snap install.
When I then try to run /snap/usr/bin/stalefish, I get this error:
[seb@minimonster 10:34:27 Stalefish]$ /snap/bin/stalefish /snap/stalefish/x1/usr/bin/stalefish: error while loading shared libraries: libblas.so.3: cannot open shared object file: No such file or directory
even though libblas.so.3 can be found in the mounted snap:
[seb@minimonster 10:35:59 Stalefish]$ find /snap/stalefish/x1|grep libblas /snap/stalefish/x1/usr/lib/x86_64-linux-gnu/blas/libblas.so.3 /snap/stalefish/x1/usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 /snap/stalefish/x1/usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 /snap/stalefish/x1/usr/share/doc/libblas3 /snap/stalefish/x1/usr/share/doc/libblas3/changelog.Debian.gz /snap/stalefish/x1/usr/share/doc/libblas3/copyright /snap/stalefish/x1/usr/share/lintian/overrides/libblas3
At this point, I feel stuck. Can anyone suggest how I can debug/fix this problem? I note that libblas is part of Debian/Ubuntu’s ‘alternatives’ scheme - perhaps this is something I have to pay attention to in my snapcraft.yaml file?
Thanks in advance for any help!
Here’s my snapcraft.yaml file for reference:
name: stalefish title: Stalefish version: git summary: Neuroscience tool description: | Stalefish is a tool to analyse gene expression. From your brain slice images you can build 3D expression surfaces and then convert these into 2D expression maps. For more details see... grade: stable confinement: devmode base: core20 parts: stalefish: plugin: cmake cmake-parameters: - -DCMAKE_INSTALL_PREFIX=/usr source-type: git source: https://github.com/ABRG-Models/Stalefish build-packages: - build-essential - cmake - wget - freeglut3-dev - libglu1-mesa-dev - libxmu-dev - libxi-dev - liblapack-dev - libopencv-dev - libarmadillo-dev - libjsoncpp-dev - libglfw3-dev - libhdf5-dev - libfreetype-dev - libpopt-dev - libopengl-dev stage-packages: - libglu1-mesa - libxmu6 - libxi6 - liblapack3 - libopencv-core4.2 - libopencv-highgui4.2 - libopencv-imgcodecs4.2 - libopencv-imgproc4.2 - libarmadillo9 - libjsoncpp1 - libglfw3 - libhdf5-103 - libfreetype6 - libpopt0 - libopengl0 - libblas3 - libopenblas0-pthread apps: stalefish: command: usr/bin/stalefish sfview: command: usr/bin/sfview