Skip to content

Commit

Permalink
Minimap2-sys 0.1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
jguhlin committed Mar 16, 2024
1 parent 29c6da8 commit fa8f8e8
Show file tree
Hide file tree
Showing 6 changed files with 9,531 additions and 65 deletions.
2 changes: 1 addition & 1 deletion minimap2-sys/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions minimap2-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "minimap2-sys"
version = "0.1.17+minimap2.2.27"
version = "0.1.18+minimap2.2.27"
edition = "2021"
links = "libminimap2"
authors = ["Joseph Guhlin <[email protected]>"]
Expand Down Expand Up @@ -50,7 +50,6 @@ version = "1.0.90"
[features]
default = ["libz-sys/libc"]
vendored = ["bindgen"]
mm2-fast = []
sse2only = []
simde = []
noopt = []
Expand Down
8 changes: 8 additions & 0 deletions minimap2-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Use this if you need lower-level bindings for minimap2. Also works with mm2-fast
# Minimap2 Version
Sync'd to minimap2 2.27

## Breaking Changes
### 0.0.18
mm2-fast and minimap2 have diverged. At this point mm2-fast is no longer supported. Please use a previous crate version.

## Features
* vendored - Regenerate the bindings from the vendored minimap2 source. Requires llvm installed. Useful to update the bindings to a different version of minimap2.
* mm2-fast - Use [mm2-fast](https://github.com/bwa-mem2/mm2-fast) as the backend rather than minimap2 itself.
Expand All @@ -14,6 +18,10 @@ Sync'd to minimap2 2.27
* Can we decouple from pthread? This would allow Windows and (possibly) WASM compilation.

## Changelog
### 0.1.18 minimap2.2.27
* Regenerated bindings
* mm2-fast and minimap2 have diverged

### 0.1.17 minimap2.2.27
* Updated to newest version of minimap2 @jguhlin
* mm2-fast also received some updates
Expand Down
62 changes: 1 addition & 61 deletions minimap2-sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,63 +1,7 @@
use std::env;
use std::path::PathBuf;

// Configure for mm2-fast
#[cfg(feature = "mm2-fast")]
fn configure(mut cc: &mut cc::Build) {
println!("cargo:rerun-if-changed=mm2-fast/*.c");

// mm2-fast is compiled with c++
cc.cpp(true);
cc.include("mm2-fast");
cc.include("mm2-fast/ext/TAL/src/chaining/");
cc.include("mm2-fast/ext/TAL/src/");
cc.include("ext/TAL/src/chaining/");
cc.target("native");
cc.flag("-march=native");
cc.flag("-DPARALLEL_CHAINING");
cc.flag("-DALIGN_AVX");
cc.flag("-DAPPLY_AVX2");
cc.opt_level(3);

#[cfg(feature = "simde")]
simde(&mut cc);

let files: Vec<_> = std::fs::read_dir("mm2-fast")
.unwrap()
.map(|f| f.unwrap().path())
.collect();

assert!(files.len() != 0, "No files found in mm2-fast directory -- Make sure to clone recursively. git submodule init --recursive");

cc.file("mm2-fast/map.c");

cc.file("mm2_fast_glue.c");

for file in files {
// Skip "main.c" and "example.c"
// For mm2fast also skip map.c...
if file.file_name().unwrap() == "example.c"
|| file.file_name().unwrap() == "main.c"
|| file.file_name().unwrap() == "map.c"
{
continue;
}

// Ignore all "neon"
if file.file_name().unwrap().to_str().unwrap().contains("neon") {
continue;
}

if let Some(x) = file.extension() {
if x == "c" {
cc.file(file);
}
}
}
}

// Configure for minimap2
#[cfg(not(feature = "mm2-fast"))] // mm2-fast not defined
fn configure(mut cc: &mut cc::Build) {
println!("cargo:rerun-if-changed=minimap2/*.c");

Expand Down Expand Up @@ -236,12 +180,8 @@ fn gen_bindings() {
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.rustfmt_bindings(true);

#[cfg(not(feature = "mm2-fast"))]
let mut bindgen = bindgen.header("mm2-fast.h");

#[cfg(feature = "mm2-fast")]
let mut bindgen = bindgen.header("minimap2.h");

bindgen
.generate_cstr(true)
.generate()
Expand Down
1 change: 0 additions & 1 deletion minimap2-sys/mm2-fast
Submodule mm2-fast deleted from 88d096
Loading

0 comments on commit fa8f8e8

Please sign in to comment.