nanoporetech / vbz_compression

VBZ compression plugin for nanopore signal data
https://nanoporetech.com/
Mozilla Public License 2.0
39 stars 10 forks source link

Feature request: Work with external streamvbyte install #13

Open outpaddling opened 3 years ago

outpaddling commented 3 years ago

Good morning,

Would you consider adding a check or user-controlled option for separately installed streamvbyte as an alternative to the bundled build? This would facilitate creation of vbc_compression packages in various package managers, where using bundled libraries is strongly discouraged:

https://fedoraproject.org/wiki/Bundled_Libraries?rd=Packaging:Bundled_Libraries https://www.debian.org/doc/debian-policy/ch-source.html#s-embeddedfiles https://wiki.gentoo.org/wiki/Why_not_bundle_dependencies https://docs.freebsd.org/en/books/porters-handbook/special/#bundled-libs

It appears that one need only set STREAMVBYTE_INSTALL_DIR and STREAMVBYTE_STATIC_LIB to point to the streamvbyte installation. I was able to build by removing the cmake code for the streamvbyte build and running cmake with the following flags:

CMAKE_ARGS=     -DENABLE_CONAN=OFF \
                -DENABLE_PERF_TESTING=OFF \
                -DENABLE_PYTHON=OFF \
                -DSTREAMVBYTE_INSTALL_DIR=${LOCALBASE} \
                -DSTREAMVBYTE_STATIC_LIB=${LOCALBASE}/lib/libstreamvbyte_static.a

Best,

 Jason
0x55555555 commented 3 years ago

Hi Jason,

Interesting - we could certainly add support for that, we will consider it for future releases. In the mean time, we would certainly accept a patch to do this?

Thanks,

outpaddling commented 3 years ago

I can try and find some time to take a crack at it, though I don't know much about cmake programming. I can muddle through someone's existing code, but I've never created a cmake project of my own.

What I imagine as the simplest solution is just checking if STREAMVBYTE_INSTALL_DIR and STREAMVBYTE_STATIC_LIB are set and run the existing code to download and build a bundled lib only if they're empty.

0x55555555 commented 3 years ago

Certainly sounds like a sensible approach to me