strobealign icon indicating copy to clipboard operation
strobealign copied to clipboard

Tweaks to integrate salib as a library via cmake

Open blinard-BIOINFO opened this issue 7 months ago • 2 comments

libisal

  • despite having installed libisal-dev and libisal2 debain package in defaulty debian (ubuntu) library directories, the library cannot be found by the current cmake recipe of strobealign.
  • this is strange, as calling for this library in another dummy recipes works (default search path modified in strobealign cmakelist?)
  • the README mention I-SAL, but not explicitly as a dependency
  • I resolved this by setting download option in my top cmakelist :
# strobealign source code access
set(ISAL "download")
FetchContent_Declare(
        strobealign
        GIT_REPOSITORY https://github.com/ksahlin/strobealign.git
        GIT_TAG        v0.16.1
)

zstr, statically loaded twice with different version

  • zstr is statically copied into one of strobealign's sub-directories and loaded statically.
  • This conflicts with my other cmakelists (including mine and those of graphaligner where it is also a dependency, but different versions)
  • Temporary fix is to use OVERRIDE_FIND_PACKAGE in fetch_content(). It will give priority to zstr search via strobalign recipe, and pass it to upper level recipes. This constrains to rely on strobealign fixed version (not a big issue so far).
# fix for zstr, in my particular setup
set(ISAL "download")
FetchContent_Declare(
        strobealign
        GIT_REPOSITORY https://github.com/ksahlin/strobealign.git
        GIT_TAG        v0.16.1
        OVERRIDE_FIND_PACKAGE   #ignore further zstr loads from GraphAligner
)

blinard-BIOINFO avatar Jun 13 '25 07:06 blinard-BIOINFO

Hi, so do I understand correctly that you use strobealign (i.e. link to salib) from your own project’s CMakeLists.txt?

What do you suggest we could change on our side to make this easier for you? I get that we should document the system vs download switch for ISAL.

marcelm avatar Jun 26 '25 12:06 marcelm

Indeed, I set your github project as library source via FetchContent, which then loads the cmakelist.txt of your repo to find salib, making it available to my compilation targets.

What might be improved :

  1. every dependency could be setup via your cmakelist. In particular zstr (currently statically linked to sources copies in your repo).
  2. libisal should just be stated as a dependancy in the docs. Moreover, for some reason cmake could not find it in my system, despite being installed with apt. So I had to add the cmake FetchContent mentionned above. You may setup this dep in your cmakelist in a similar way.

blinard-BIOINFO avatar Jul 02 '25 06:07 blinard-BIOINFO