biocpp/biocpp-core

Core setup in documentation missing some requirements.

Opened this issue · 3 comments

Hello! I'm using biocpp core/io for a new project and realized some setup steps seem to be missing/unclear.

  1. If I only need the IO module (biocpp-io), I still need to have biocpp-core as well, right?
  2. Do both of them need to be added as submodules separately? It gives a weird directory structure as a result (project/submodule/biocpp-io/include/biocpp/io/ and project/submodule/biocpp-core/include/biocpp/alphabet etc/). If biocpp-core is a requirement of biocpp-io, why not just have them in the same project?
  3. I realized while following the core-setup, I need the fmt library. I added it as another submodule and then added it into my CMakeLists.txt file, but this wasn't explicitly mentioned anywhere. Is it a necessary submodule?

Thanks for your help!

h-2 commented

Hey!

If I only need the IO module (biocpp-io), I still need to have biocpp-core as well, right?

Yes, the core library is required by the io-library. This should be documented in the README (https://github.com/biocpp/biocpp-io/blob/main/README.md#dependencies)! The IO-library hasn't had a release, yet, so it's not in the doxygen, but I hope to get a release done in the next week or two.

Do both of them need to be added as submodules separately?

Yes, they are separate repositories.

It gives a weird directory structure as a result (project/submodule/biocpp-io/include/biocpp/io/ and project/submodule/biocpp-core/include/biocpp/alphabet etc/).

You can have them "beside" each other in your project, they don't need to be nested within each other!

If biocpp-core is a requirement of biocpp-io, why not just have them in the same project?

The core-library is aiming for a stable release fairly soon and will then receive mostly bug-fixes and small improvements; it will follow a more conservative approach (no API breaks, more stringent code-reviews...).
The IO-library, on the other hand, will have a more lively development. And more libraries are planned that would make use of core but not IO. That's why they are separate.

I realized while following the core-setup, I need the fmt library. I added it as another submodule and then added it into my CMakeLists.txt file, but this wasn't explicitly mentioned anywhere. Is it a necessary submodule?

It's not required, but it is recommended. The core-setup tutorial is unfortunately not fully up-to-date :( But it is mentioned in the README: https://github.com/biocpp/biocpp-core#easy-to-use

Here is an example of a project of mine that uses the libraries:
https://github.com/h-2/decovar/
This is all you need in the CMake for biocpp-core, biocpp-io, sharg-parser and fmt:

find_package (biocpp REQUIRED COMPONENTS core io
              HINTS "${CMAKE_SOURCE_DIR}/submodules/biocpp-core/build_system")
find_package (sharg REQUIRED
              HINTS "${CMAKE_SOURCE_DIR}/submodules/sharg-parser/build_system")

set(FMT_DOC OFF)
set(FMT_INSTALL OFF)
set(FMT_TEST OFF)
add_subdirectory(submodules/fmt)

For BioC++, it is enough to add the core-library's CMake-stuff and tell it the COMPONENTS you want. As long as the other components (in this case io) are either "beside" the core-library (biocpp-io is in same folder as biocpp-core) or within biocpp-core/submodules it should "just work". Actually, it should also work, if biocpp-core is in biocpp-io/submodules/, but then you have to do find_package(biocpp_io) and not find_package(biocpp COMPONENTS io)...

h-2 commented

P.S: You are very invited to submit a PR for core-setup tutorial 😇

h-2 commented

Instead of having the modules include each other as submodules, the plan is to have a biocpp/biocpp meta repository that includes the other ones and also fmt. Then, you can just clone from that and get everything. But I haven't set it up, yet.