maickrau / GraphAligner

MIT License
260 stars 32 forks source link

Allow compilation with latest dependencies from conda-forge #92

Open shenker opened 1 year ago

shenker commented 1 year ago

Hi,

Putting this here in case it helps anyone.

When I run micromamba env create -f CondaEnvironment_linux.yml (adapted from the compilation instructions, using micromamba instead of conda), I get an error:

warning  libmamba Problem type not implemented SOLVER_RULE_STRICT_REPO_PRIORITY
error    libmamba Could not solve for environment specs
    The following package could not be installed
    └─ libboost 1.67.0 h46d08c1_4 is not installable because it conflicts with any installable versions previously reported.
critical libmamba Could not solve for environment specs

This turned out to be because I had channel_priority: strict in my ~/.condarc. Removing that fixed the issue. Alternatively, you can run micromamba env create -f CondaEnvironment_linux.yml --channel-priority flexible.

I found that I could get GraphAligner to compile only pinning three versions, using the following environment.yml:

name: GraphAligner
channels:
  - conda-forge
  - bioconda
  - anaconda
dependencies:
  - abseil-cpp
  - libboost=1.73.0=h28710b8_12
  - gxx=12.3
  - jemalloc=5.2.0
  - protobuf
  - libprotobuf-static
  - sdsl-lite
  - pkg-config
  - sparsehash
  - zlib

Eventually it would be nice to get GraphAligner to compile without these version pins. It should be relatively straightforward:

  1. To allow compilation with GCC 13, #include <cstdint> must be added, otherwise g++ gives me error: 'uint32_t' has not been declared.
  2. Convince the conda-forge boost maintainers to add a new libboost-static package or include static libraries in libboost-devel (https://github.com/conda-forge/boost-feedstock/issues/159). The above version pin uses libboost from the anaconda channel instead of conda-forge, which does include static libs.
  3. Contribute a (one-line?) PR to re-enable static libraries in the conda-forge jemalloc package (https://github.com/conda-forge/jemalloc-feedstock/issues/24).
ASLeonard commented 3 months ago

I didn't extensively test how much of this could be trimmed further, but I found I can drop abseil-cpp (which is only available as an older version compared to libabseil) when building this on mac. This allowed me to use a python3.12 env whereas the current GraphAligner conda_osx requirements can only go up to python3.9 it seems.

I got identical output when aligning some HiFi reads to a minigraph gfa from the conda installed version and the one I locally compiled with the updated deps, so presumably none of these changes affected anything.

dependencies:
  - clang_osx-64=18
  - jemalloc
  - libboost
  - libprotobuf-static
  - pkg-config
  - protobuf=4
  - python=3.12
  - sdsl-lite
  - sparsehash
  - zlib
  - boost
  - ca-certificates
  - openssl