Git Product home page Git Product logo

minimap2-rs's Introduction

A rust FFI library for minimap2. In development! Feedback appreciated!

https://crates.io/crates/minimap2 https://docs.rs/minimap2/latest/minimap2/ CircleCI codecov

Structure

minimap2-sys is the library of the raw FFI bindings to minimap2. minimap2 is the more rusty version.

How to use

Requirements

minimap2 = "0.1.17+minimap2.2.27"

Also see Features

Tested with rustc 1.64.0 and nightly. So probably a good idea to upgrade before running. But let me know if you run into pain points with older versions and will try to fix!

Usage

Create an Aligner

let mut aligner = Aligner::builder()
    .map_ont()
    .with_threads(8)
    .with_cigar()
    .with_index("ReferenceFile.fasta", None)
    .expect("Unable to build index");

Align a sequence:

let seq: Vec<u8> = b"ACTGACTCACATCGACTACGACTACTAGACACTAGACTATCGACTACTGACATCGA";
let alignment = aligner
    .map(&seq, false, false, None, None)
    .expect("Unable to align");

Presets

All minimap2 presets should be available (see functions section):

let aligner = map_ont();
let aligner = asm20();

Customization

MapOpts and IdxOpts can be customized with Rust's struct pattern, as well as applying mapping settings. Inspired by bevy.

Aligner {
    mapopt: MapOpt {
        seed: 42,
        best_n: 1,
        ..Default::default()
    },
    idxopt: IdxOpt {
        k: 21,
        ..Default::default()
    },
    ..map_ont()
}

Working Example

There is a binary called "fakeminimap2" that I am using to test for memory leaks. You can follow the source code for an example. It also shows some helper functions for identifying compression types and FASTA vs FASTQ files. I used my own parsers as they are well fuzzed, but open to removing them or putting them behind a feature wall.

Alignment functions return a Mapping struct. The Alignment struct is only returned when the Aligner is created using .with_cigar().

A very simple example would be:

let mut file = std::fs::File::open(query_file);
let mut reader = BufReader::new(reader);
let mut fasta = Fasta::from_buffer(&mut reader)

for seq in reader {
    let seq = seq.unwrap();
    let alignment: Vec<Mapping> = aligner
        .map(&seq.sequence.unwrap(), false, false, None, None)
        .expect("Unable to align");
    println!("{:?}", alignment);
}

There is a map_file function that works on an entire file, but it is not-lazy and thus not suitable for large files. It may be removed in the future or moved to a separate lib.

let mappings: Result<Vec<Mapping>> = aligner.map_file("query.fa", false, false);

Multithreading

Multithreading is supported, for implementation example see fakeminimap2. Minimap2 also supports threading itself, and will use a minimum of 3 cores for building the index. Multithreading for mapping is left to the end-user.

let mut aligner = Aligner::builder()
    .map_ont()
    .with_index_threads(8);

Experimental Rayon support

This appears to work.

use rayon::prelude::*;

let results = sequences.par_iter().map(|seq| {
    aligner.map(seq.as_bytes(), false, false, None, None).unwrap()
}).collect::<Vec<_>>();

Features

The following crate features are available:

  • mm2-fast - Replace minimap2 with mm2-fast. This is likely not portable.
  • htslib - Support output of bam/sam files using htslib.
  • simde - Compile minimap2 / mm2-fast with simd-everywhere support.
  • map-file - Default - Convenience function for mapping an entire file. Caution, this is single-threaded.
  • sse2only - Compiles for SSE2 support only (Default is to try to compile for SSE4.1, SSE2 only is default on aarch64)

Map-file is a default feature and enabled unless otherwise specified.

Missing Features

Potentially more, but I'm using this to keep track. I'd expect those would get implemented over time, but if you have urgent need open a pull request or an issue! Thanks

Building for MUSL

Follow these instructions.

In brief, using bash shell:

docker pull messense/rust-musl-cross:x86_64-musl
alias rust-musl-builder='docker run --rm -it -v "$(pwd)":/home/rust/src messense/rust-musl-cross:x86_64-musl'
rust-musl-builder cargo build --release

Please note minimap2 is only tested for x86_64. Other platforms may work, please open an issue if minimap2 compiles but minimap2-rs does not.

Features tested with MUSL

  • mm2-fast - Fail
  • htslib - Success
  • simde - Success

Tools using this binding

  • Chopper - Long read trimming and filtering
  • mappy-rs - Drop-in multi-threaded replacement for python's mappy
  • HiFiHLA - HLA star-calling tool for PacBio HiFi data

Want feedback

  • Many fields are i32 / i8 to mimic the C environment, but would it make more sense to convert to u32 / u8 / usize?
  • Let me know pain points!

Next things todo

  • Print other tags so we can have an entire PAF format
  • -sys Compile with SSE2 / SSE4.1 (auto-detect, but also make with features)
  • Multi-thread guide (tokio async threads or use crossbeam queue and traditional threads?)
  • Iterator interface for map_file
  • MORE TESTS
  • -sys Get SSE working with "sse" feature (compiles and tests work in -sys crate, but not main crate)
  • -sys Possible to decouple from pthread?
  • -sys Enable Lisa-hash for mm2-fast? But must handle build arguments from the command-line.

Citation

You should cite the minimap2 papers if you use this in your work.

Li, H. (2018). Minimap2: pairwise alignment for nucleotide sequences. Bioinformatics, 34:3094-3100. [doi:10.1093/bioinformatics/bty191][doi]

and/or:

Li, H. (2021). New strategies to improve minimap2 alignment accuracy. Bioinformatics, 37:4572-4574. [doi:10.1093/bioinformatics/btab705][doi2]

Changelog

0.1.17 minimap2 2.27

  • Mark bam::Record objects as supplementary. #52 @PB-DB
  • Only use rust-htslib/curl when curl feature is enabled. #53 @PB-DB
  • Update to minimap2 v2.27 @jguhlin
  • Switch to needletail for reading fast files (features map-file) @jguhlin
  • Convert functions to take slices of vectors instead of refs to vecs &[Vec<u8>] instead of &Vec<Vec<u8>> @jguhlin
  • breaking Curl is no longer a default option for htslib, please re-enable it as needed with cargo.toml features
  • breaking Now using needletail for map-files, enabled by default. However, compression algorithms are disabled. Please enable with cargo.toml features
  • Experimental rayon support
  • aligner.with_cigar_clipping() to add soft clipping to the CIGAR vec (with_cigar() still adds to only the string, following the minimap2 outputs for PAF)
  • breaking .with_threads() is now .with_index_threads() to make it more clear

0.1.16 minimap2 2.26

  • Much better cross compilation support thanks to @Adoni5

0.1.15 minimap2 2.26

  • Compilation on aarch64 thanks to @leiste375
  • README corrections thanks to @wdecoster
  • Better support for static builds / linking
  • Update fffx to a version that uses bytelines without tokio. Drastically reduces compile times and dependency tree.

0.1.14 minimap2 2.26

  • Memory leak fixed by @Adoni5
  • Updated deps

0.1.13 minimap2 2.26

  • Add with_seq to support indexing a single sequence (as per mappy: https://github.com/lh3/minimap2/blob/master/python/mappy.pyx#L115)
  • minimap2-rs: update rust-htslib deps
  • simdutf8 now optional dependency requiring map-file feature to be enabled
  • Support soft-clipping string in CIGAR. WARNING: Does not support hard clipping. Please open an issue if you need this.
  • Update minimap to 2.26
  • Not convinced SSE41/SSE2 are working properly. Recommend simde.

0.1.11

  • HTS lib: add support for optional quality scores by @eharr

0.1.10

  • HTS lib support by @eharr
  • HTS lib: Output sam/bam files by @eharr
  • More tests by @eharr
  • Display impl for Strand thanks to @ahcm
  • Update minimap2-sys to latest version by @jguhlin
  • -sys crate mm2fast added as additional backend by @jguhlin
  • zlib dep changes by @jguhlin (hopefully now it is more portable and robust)
  • -sys crate now supports SIMDe

0.1.9

  • Thanks for @Adoni5 for switching to builder pattern, and @eharr for adding additional fields to alignment.
  • Do not require libclang for normal compilation.

0.1.8

  • Multithreading support (use less raw pointers, and treat more like rust Struct's)

0.1.7

  • use libc instead of std:ffi::c_int as well

0.1.6

  • Support slightly older versions of rustc by using libc:: rather than std::ffi for c_char (Thanks dwpeng!)
  • Use fffx module for fasta/q parsing

Funding

Genomics Aotearoa

minimap2-rs's People

Contributors

adoni5 avatar ahcm avatar eharr avatar jguhlin avatar leiste375 avatar pb-db avatar wdecoster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

minimap2-rs's Issues

Bug(s?): Soft clipping in cigar outputs

Hello,

I came across an issue with soft clipping results in the output. I think at least one of these is probably a bug, the other I'm not sure if I'm just missing an option to enable it. For context, I'm using minimap2 = "0.1.16" and mapping extracted reference sequences into a read (I can provide more details around how I'm calling .map() if needed).

Here are some example output Mappings where I saw the issue:

Mapping { query_name: None, query_len: Some(4000), query_start: 0, query_end: 2613, strand: Forward, target_name: Some("N/A"), target_len: 12338, target_start: 9728, target_end: 12338, match_len: 2604, block_len: 2613, mapq: 60, is_primary: true, alignment: Some(Alignment { nm: 9, cigar: Some([(1270, 0), (1, 1), (91, 0), (1, 1), (871, 0), (1, 1), (378, 0)]), cigar_str: Some("1270M1I91M1I871M1I378MS1387"), md: Some("186G817G13A2C17G6T1563"), cs: Some(":186*ga:817*ga:13*ag:2*ct:17*ga:6*tc:223+t:91+g:871+c:378") }) }
Mapping { query_name: None, query_len: Some(4290), query_start: 2407, query_end: 4288, strand: Forward, target_name: Some("N/A"), target_len: 11711, target_start: 0, target_end: 1903, match_len: 1762, block_len: 1925, mapq: 60, is_primary: true, alignment: Some(Alignment { nm: 163, cigar: Some([(31, 0), (1, 2), (42, 0), (1, 1), (279, 0), (1, 1), (163, 0), (5, 2), (36, 0), (2, 1), (13, 0), (21, 2), (55, 0), (9, 2), (6, 0), (6, 2), (48, 0), (5, 1), (13, 0), (8, 1), (77, 0), (1, 1), (11, 0), (1, 1), (275, 0), (1, 1), (39, 0), (1, 2), (528, 0), (1, 1), (89, 0), (1, 1), (67, 0), (1, 2), (87, 0)]), cigar_str: Some("2407S31M1D42M1I279M1I163M5D36M2I13M21D55M9D6M6D48M5I13M8I77M1I11M1I275M1I39M1D528M1I89M1I67M1D87MS2"), md: Some("31^G192G47A14T14C4G11A2A8A3A17A0T5C1C0T17G2T1T10T18T0G2T4C8T2G7A3C2T29G5G6G6C6G1C4^CGCCA12T0T0A5C3T13C10^ACCGGATTCCAGCTGGGAAAT2G0C7A4T0T5C3C1A5C6G9A2^CGTCACAAG3C2^CCTCGT2C2T0G3A8T0A14T6G26T5C6G6C2T2C1A3C2A9T0C0A0C9T10T1T17T25A7T4G0T7A16G12T9G130C85^C10C421C5T6A39G15C144G5T24C6^G39C30A0C15"), cs: Some(":31-g:42+c:150*gc:47*ag:14*tc:14*cg:4*gt:11*ac:2*ag:8*ac:3*ag:17+g*ag*tc:5*ca:1*ca*ta:17*ga:2*tc:1*tg:10*tg:18*tc*gt:2*tc:4*ca:8*tc:2*gc:7*ag:3*ct:2*tg:29*ga:5*gc:6*ga:6*ct:6*gc:1*ct:4-cgcca:12*tc*tc*ag:5*ct:3*tc:11+ca:2*cg:10-accggattccagctgggaaat:2*ga*ct:7*ag:4*tc*tc:5*ct:3*cg:1*ag:5*cg:6*ga:9*ac:2-cgtcacaag:3*ca:2-cctcgt:2*ca:2*tg*ga:3*ag:8*tc*ac:14*tc:6*ga:5+ctcag:13+ctttatct:8*tc:5*cg:6*ga:6*cg:2*tg:2*cg:1*at:3*ct:2*ag:9*tc*ct*ag*ct:9*tg:10+c*tg:1*tg:8+c:9*tc:25*ag:7*tc:4*gt*ta:7*ag:16*gc:12*tc:9*gt:130*ca:46+g:39-c:10*cg:421*ct:5*tc:6*ac:39*ga:15*ca:26+g:89+a:29*ga:5*tc:24*ct:6-g:39*ct:30*ag*cg:15") }) }

The key values of the cigar string and cigar Vec, I have extracted below:

cigar: Some([(1270, 0), (1, 1), (91, 0), (1, 1), (871, 0), (1, 1), (378, 0)]), 
cigar_str: Some("1270M1I91M1I871M1I378MS1387")
...
cigar: Some([(31, 0), (1, 2), (42, 0), (1, 1), (279, 0), (1, 1), (163, 0), (5, 2), (36, 0), (2, 1), (13, 0), (21, 2), (55, 0), (9, 2), (6, 0), (6, 2), (48, 0), (5, 1), (13, 0), (8, 1), (77, 0), (1, 1), (11, 0), (1, 1), (275, 0), (1, 1), (39, 0), (1, 2), (528, 0), (1, 1), (89, 0), (1, 1), (67, 0), (1, 2), (87, 0)]), 
cigar_str: Some("2407S31M1D42M1I279M1I163M5D36M2I13M21D55M9D6M6D48M5I13M8I77M1I11M1I275M1I39M1D528M1I89M1I67M1D87MS2")

There are two issues I noticed in these outputs:

  1. In the first example, the final cigar string sequence is "S1387", but I think it should be "1387S" to match the rest of the cigar. This is the one I think is likely a bug.
  2. In both examples, I don't see the soft-clipping values reflects in the cigar Vec. I'm not sure if this is a bug, or if I'm just missing an option to make them appear.

I found a workaround using the query_start and query_end fields to get these soft-clipping values. Are you able to confirm if these are bugs or if there's something I'm missing in the usage?

Thanks for maintaining this crate!
Matt

no output

Hi thank you for your work.

This example code gives me [] as output

use minimap2::Aligner;
use std::path::Path;

fn main() {
    let ref_path = "/home/thomas/NGS/ref/hg19.fa";

    let mut aligner = Aligner::builder()
        .map_ont()
        .with_threads(8)
        .with_cigar()
        .with_index(ref_path, None)
        .expect("Unable to build index");

    let seq: Vec<u8> = b"ACTGACTCACATCGACTACGACTACTAGACACTAGACTATCGACTACTGACATCGA".to_vec();
    let alignment = aligner
        .map(&seq, false, false, None, None)
        .expect("Unable to align");
    println!("{:?}", alignment);
}

my Toml configuration is :

[package]
name = "desc_seq_2"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
minimap2 = "0.1.16+minimap2.2.26"

cargo 1.74.0-nightly (d5336f813 2023-09-14)

md tag and cs tag default none?

Hello @jguhlin,

I am wondering whether the default tag for MD can be there because in many cases parsing the bam file will need those tags for calculating identity et.al.

Thanks,

Jianshu

rayon parallelization

hello @jguhlin,

I have a bunch of sequences, each sequence has some reference sequences to align against (different for each sequence), I saw the fakeminimap2 for parallelizing when sequences share the share reference. But in this case, they do not share the same references, how would you suggest to do parallelize, I have a million such sequences.

Thanks,

Jianshu

loss of S values in cigar string

Thanks again @jguhlin for making minimap2-rs. I think I may have found a problem with the cigar strings created by minimap2-rs.

Here is a molecule sequenced using Pacbio and aligned using minimap2 from the command line as follows:

minimap2 -a -L -cs --MD -x map-hifi align.fasta test.fastq.gz

molecule/87     0       DRB1|04:01:01:01        1       60      95S104M1D36M1I77M1D97M1D454M1D29M307S   *       0       0       TTTCTTATATGGGGGGGGGGTGGAGGGGGGCCATAGTTCTCCCTGATTGAGGACTTGCCTGCTGCTGTGACCACTGGTCTGTCCTCTTCTCCAGCATGGTGTGTCTGAAGCTCCCTGGAGGCTCCTGTATGGCAGCGCTGACAGTGACATTGACGGTGCTGAGCTCCCCACTGGCTTTGGCTGGGGACACCCAACCACGTTCTTGGAGCAGGCTAAGTGTGAGTGTCATTTCCTCAAATGGGACGGAGCGAGTGTGGAACCTGATCAGATACATCTATAACCAAGAGGAGTACGCGCGCTACAACAGTGACCTGGGGAGTACCAGGCGGTGACGGAGCTGGGGCGGCCTGACGCTGAGTACTGGAACAGCCAGAAGGACCTCCTGGAGCGGAGGCGGGCCGAGGTGGACACTACTGCAGATACAACTACGGGGTTGTGGAGAGCTTCACAGTGCAGCGGCGAGTCCAACCTAAGGTGACTGTGTATCCTTCAAAGACCCAGCCCCTGCAGCACCACAACCTCCTGGTCTGCTCTGTGAATGGTTTCTATCCAGGCAGCATTGAAGTCAGGTGGTTCCGGAACGGCCAGGAAGAGAAGGCTGGGGTGGTGTCCACAGGCCTGATCCAGAATGGAGACTGGACCTTCCAGACCCTGGTGATGCTGGAAACAGTTCCTCGGAGTGGAGAGGTTTACACCTGCCAAGTGGAGCATCCAAGCATGATGAGCCCTCTCACAGTGCAATGGAGTGCACGGTCTGAATCTGCACAGAGCAAGATGCTGAGTGGAGTCGGGGGCTTTGTGCTGGGCCTGCTCTTCCTTGGGACAGGGCTGTTCATCTACTTCAGGAATCAGAA
AGGACACTCTGACTTCAGCCAACAGGACTCTTGAGCTGAAGTGCAGATGACCACATTCAAGGAAGAACCTTCTGCCCAGCTTTGCAAGATGAAAAGCTTTCCCACTTGGCTCTTATTCTTCCACAAGAGCTTGTCAGGACCAGGTTGTTACTGGTTCAGCAACTCTGCAGAAAATGTCCTCCCTTGTGGCTTCCTTAGCTCCTGTTCTTGGCCTGAAGCCTCACAGCTTTGATGGCAGTGCCTCATCTTCAACTTTTGTGCTTCCCTTTACCTAAACTGTCCTGCCTCCCGTGCATCTGTACTCCCCTTGTGCCACACATTGCATATTAAATGTTTCTCAAACATT

When using an minimap2-rs aligner created like this:

    let aligner = Aligner::builder()
        .map_hifi()
        .with_threads(1)
        .with_cigar()
        .with_index("data/align.fasta", None)
        .expect("Unable to build index");

and then mapping a record sequence like this:

        let mapping = aligner
            .map(&record.seq().as_bytes(), false, false, None, None)
            .expect("Unable to align");
        eprintln!("{:?}", &mapping);

I get this:

Mapping { query_name: None, query_len: Some(1200), query_start: 95, query_end: 893, strand: Forward, target_name: Some("DRB1|04:01:01:01"), target_len: 801, target_start: 0, target_end: 801, match_len: 748, block_len: 802, mapq: 60, is_primary: true, alignment: Some(Alignment { nm: 54, cigar: Some([(104, 0), (1, 2), (36, 0), (1, 1), (77, 0), (1, 2), (97, 0), (1, 2), (454, 0), (1, 2), (29, 0)]), cigar_str: `Some("104M1D36M1I77M1D97M1D454M1D29M"),` md: None, cs: None }) }

`

You can see that the cigar doesn't contain the 95S in the front and the 307S in the back. This becomes an issue when trying to create a bam file from the output because the cigar length does not match the seq length.

Thanks for taking a look!

Multi-threaded implementation

Hi Joseph,

Thanks for the great work on this crate!

Just like #2, I am hitting the issue of Send/Sync not being implemented on the bindgen generated Structs which are fields on the Aligner. Unlike in #2, I was attempted to create a simple multi threaded example using the ThreadPool crate.

Simply something along the lines of:

for seq in seqs {
    pool.execute(|| {
        // Channel transmitter
        let tx = tx.clone()
        // The map function is altered to transmit the mapping back at the end instead of returning it
        self.map(
            tx,
            seq.as_bytes(),
            self.idx
            ....
        )
    })
}

pool.join()
re.try_iter().collect()

I have tried to mark mm_idx_t as Sync/Send - as you can't implement traits for Structs defined in other crates, I created a Type struct that wraps the fields for mm_idx_t, however I get no mappings back. I'm going to have another crack at this this afternoon and will get back to you here if there is any progress to report!

Many Thanks,
Rory

Linking issues for static build

Hi @jguhlin,

Thanks for building this wrapper to minimap2 it's been extremely useful. We (@jrharting) are trying to get a static build working for our project, but hitting linking errors in linux. We traced the problem back to minimap2-rs. Do you have any suggestions?

cargo --version
cargo 1.68.2 (6feb7c9cf 2023-03-26)
export RUSTFLAGS="cargo build --release --target x86_64-unknown-linux-gnu"
cargo build --release --target x86_64-unknown-linux-gnu

I reproduced the error just in the minimap2-rs repo by doing the following:

export RUSTFLAGS="cargo build --release --target x86_64-unknown-linux-gnu"
cargo test --release --target x86_64-unknown-linux-gnu


  = note: /mnt/software/g/gcc/gcctoolchain/gcctoolchain-release_10.2.0.125178/gcc/gcc_10.3.0.pbi01/build-libc_2.17/target-libc_2.17/binnowrap/x86_64-libc_2.17-linux-gnu-ld.bfd: /mnt/software/r/rust/1.68.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-bc6b80525d6b1f3b.rlib(std-bc6b80525d6b1f3b.std.3431a86c-cgu.0.rcgu.o): in function `std::sys::unix::os::home_dir::fallback':
          /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys/unix/os.rs:626: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
          /mnt/software/g/gcc/gcctoolchain/gcctoolchain-release_10.2.0.125178/gcc/gcc_10.3.0.pbi01/build-libc_2.17/target-libc_2.17/binnowrap/x86_64-libc_2.17-linux-gnu-ld.bfd: /mnt/software/r/rust/1.68.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-bc6b80525d6b1f3b.rlib(std-bc6b80525d6b1f3b.std.3431a86c-cgu.0.rcgu.o): in function `<std::sys_common::net::LookupHost as core::convert::TryFrom<(&str,u16)>>::try_from::{{closure}}':
          /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys_common/net.rs:206: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
          /mnt/software/g/gcc/gcctoolchain/gcctoolchain-release_10.2.0.125178/gcc/gcc_10.3.0.pbi01/build-libc_2.17/target-libc_2.17/binnowrap/x86_64-libc_2.17-linux-gnu-ld.bfd: attempted static link of dynamic object `/mnt/software/g/gcc/gcctoolchain/gcctoolchain-release_10.2.0.125178/gcc/gcc_10.3.0.pbi01/build-libc_2.17/target-libc_2.17/binnowrap/../x86_64-libc_2.17-linux-gnu/sysroot/usr/lib/../lib64/libm.so'
          /mnt/software/g/gcc/gcctoolchain/gcctoolchain-release_10.2.0.125178/gcc/gcc_10.3.0.pbi01/build-libc_2.17/target-libc_2.17/binnowrap/x86_64-libc_2.17-linux-gnu-ld.bfd: attempted static link of dynamic object `/mnt/software/g/gcc/gcctoolchain/gcctoolchain-release_10.2.0.125178/gcc/gcc_10.3.0.pbi01/build-libc_2.17/target-libc_2.17/binnowrap/../x86_64-libc_2.17-linux-gnu/sysroot/lib64/libpthread.so.0'
          /mnt/software/g/gcc/gcctoolchain/gcctoolchain-release_10.2.0.125178/gcc/gcc_10.3.0.pbi01/build-libc_2.17/target-libc_2.17/binnowrap/x86_64-libc_2.17-linux-gnu-ld.bfd: attempted static link of dynamic object `/mnt/software/z/zlib/1.2.11/lib/libz.so'
          /mnt/software/g/gcc/gcctoolchain/gcctoolchain-release_10.2.0.125178/gcc/gcc_10.3.0.pbi01/build-libc_2.17/target-libc_2.17/binnowrap/x86_64-libc_2.17-linux-gnu-ld.bfd: attempted static link of dynamic object `/mnt/software/z/zlib/1.2.11/lib/libz.so'
          /mnt/software/g/gcc/gcctoolchain/gcctoolchain-release_10.2.0.125178/gcc/gcc_10.3.0.pbi01/build-libc_2.17/target-libc_2.17/binnowrap/x86_64-libc_2.17-linux-gnu-ld.bfd: /mnt/software/r/rust/1.68.2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest-dfbb7690b1f6faf1.rlib(test-dfbb7690b1f6faf1.test.ee13aa5d-cgu.0.rcgu.o): undefined reference to symbol '__tls_get_addr@@GLIBC_2.3'
          /mnt/software/g/gcc/gcctoolchain/gcctoolchain-release_10.2.0.125178/gcc/gcc_10.3.0.pbi01/build-libc_2.17/target-libc_2.17/binnowrap/x86_64-libc_2.17-linux-gnu-ld.bfd: /mnt/software/g/gcc/gcctoolchain/gcctoolchain-release_10.2.0.125178/gcc/gcc_10.3.0.pbi01/build-libc_2.17/target-libc_2.17/binnowrap/../x86_64-libc_2.17-linux-gnu/sysroot/lib64/ld-linux-x86-64.so.2: error adding symbols: DSO missing from command line
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

warning: `minimap2` (lib test) generated 6 warnings (3 duplicates)
error: could not compile `minimap2` due to previous error; 6 warnings emitted

Using Aligner instance with rayon threads

Hi,

Great work here - finally had the chance to start testing. I haven't been using Rust for long enough to fully understand the problem I'm about to describe. In my setup I create an Aligner instance, and then use rayon to test reads from a fastq file in parallel. I would prefer to create the Aligner only once, and then have it be used in each thread, but the compiler tells me:

error[E0277]: `*mut minimap2_sys::mm_idx_t` cannot be sent between threads safely
   --> src/main.rs:71:10
    |
71  |         .for_each(|record| {
    |          ^^^^^^^^ -------- within this `[closure@src/main.rs:71:19: 71:27]`
    |          |
    |          `*mut minimap2_sys::mm_idx_t` cannot be sent between threads safely
    |
    = help: within `[closure@src/main.rs:71:19: 71:27]`, the trait `Send` is not implemented for `*mut minimap2_sys::mm_idx_t`

Implementing Send goes beyond what I can do in Rust (for now). Is this a problem that is easy to solve or would there be a better way around this?

Trying a musl build

Hi,

For my project that uses minimap2 I am trying to make musl binaries (cargo build --release --target=x86_64-unknown-linux-musl) to support older hardware too. I don't know if the solution to the error below is obvious, but do you have any suggestions?

   Compiling minimap2-sys v0.1.6
error: failed to run custom build command for `minimap2-sys v0.1.6`

Caused by:
  process didn't exit successfully: `/home/wdecoster/wsl-repos/nanofiltrs/target/release/build/minimap2-sys-486e5a878d273372/build-script-build` (exit status: 101)
  --- stdout
  "/home/wdecoster/wsl-repos/nanofiltrs/target/x86_64-unknown-linux-musl/release/build/minimap2-sys-d37dc23034f6f450/out"
  cargo:rerun-if-changed=minimap2/*.c
  cargo:rerun-if-env-changed=ZLIB_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64-unknown-linux-musl
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64_unknown_linux_musl
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-musl
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_musl
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-musl
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_musl
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: pkg-config has not been configured to support cross-compilation.

  Install a sysroot for the target platform and configure it via
  PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a
  cross-compiling wrapper for pkg-config and set it via
  PKG_CONFIG environment variable.', /home/wdecoster/.cargo/registry/src/github.com-1ecc6299db9ec823/minimap2-sys-0.1.6/build.rs:18:49

compiling on macOS

Hi @jguhlin,

Thanks for all your work on minimap2-rs! I am working on a rust project that would be ideal for minimap2 bindings. I have successfully integrated into my project in a linux environment, but compiling fails on a Mac. I suspect that it is related to SSE4 code that I need to disable when successfully building minimap2 on a Mac using make sse2only=1. I see you have related tasks in your todo list. Have you gotten minimap2-rs to specifically compile on an ARM Mac? Could you share the trick? :) Or do you think something else is causing compilation failure?

Thanks for looking!!

I have output the compilation errors when running cargo build --release below:

Compiling minimap2-sys v0.1.10
Compiling seq_io v0.3.1
Compiling csv v1.2.1
Compiling itertools v0.10.5
Compiling toml v0.5.11
The following warnings were emitted during compilation:

warning: clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
warning: clang: warning: -lpthread: 'linker' input unused [-Wunused-command-line-argument]
warning: In file included from minimap2/ksw2_ll_sse.c:9:
warning: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/emmintrin.h:13:
warning: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/xmmintrin.h:13:
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:50:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:129:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:159:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:189:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:216:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:239:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:260:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:287:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:310:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:331:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:352:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:373:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:394:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:416:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:439:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:461:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_paddusb((__v8qi)__m1, (__v8qi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:483:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_paddusw((__v4hi)__m1, (__v4hi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:504:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_psubb((__v8qi)__m1, (__v8qi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include/mmintrin.h:525:12: error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
warning: return (__m64)__builtin_ia32_psubw((__v4hi)__m1, (__v4hi)__m2);
warning: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: fatal error: too many errors emitted, stopping now [-ferror-limit=]
warning: 20 errors generated.

error: failed to run custom build command for minimap2-sys v0.1.10

Test crashes with strlen out of bounds

https://asan.saethlin.dev/ub?crate=minimap2&version=0.1.14%2Bminimap2.2.26

==15122==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55f1867e33ba at pc 0x55f184e15219 bp 0x7feb520f2f60 sp 0x7feb520f2728
READ of size 283 at 0x55f1867e33ba thread T31
    #0 0x55f184e15218 in strlen /rustc/llvm/src/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:390:5
    #1 0x55f18614e561 in mm_gen_cs_or_MD /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/minimap2-sys-0.1.16+minimap2.2.26/minimap2/format.c:257:12
    #2 0x55f18614e5f8 in mm_gen_cs /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/minimap2-sys-0.1.16+minimap2.2.26/minimap2/format.c:267:9
    #3 0x55f184edf3a6 in minimap2::Aligner::map::_$u7b$$u7b$closure$u7d$$u7d$::h3879092ea6376982 /build/src/lib.rs:855:47
    #4 0x55f184fc20ae in std::thread::local::LocalKey$LT$T$GT$::try_with::h7ea5e2dc25eae48b /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:270:16
    #5 0x55f184fc1898 in std::thread::local::LocalKey$LT$T$GT$::with::h459cc2834367141f /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:246:9
    #6 0x55f184edaff8 in minimap2::Aligner::map::h940d1c1cad537840 /build/src/lib.rs:730:24
    #7 0x55f184f0ae02 in minimap2::tests::test_with_seq::h31259bedac3a1160 /build/src/lib.rs:1447:26
    #8 0x55f184f07302 in minimap2::tests::test_with_seq::_$u7b$$u7b$closure$u7d$$u7d$::h55458511ac88f5d2 /build/src/lib.rs:1390:23
0x55f1867e33ba is located 0 bytes after global variable 'alloc_7a0bf1e77a764740263fa9b06d2613ae' defined in 'minimap2.c8f59fa16f813271-cgu.03' (0x55f1867e32a0) of size 282
SUMMARY: AddressSanitizer: global-buffer-overflow /rustc/llvm/src/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:390:5 in strlen
Shadow bytes around the buggy address:
  0x55f1867e3100: 00 00 00 00 00 00 00 00 00 00 00 01 f9 f9 f9 f9
  0x55f1867e3180: 00 f9 f9 f9 00 00 00 01 f9 f9 f9 f9 00 00 00 00
  0x55f1867e3200: 01 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 00 00 00 05
  0x55f1867e3280: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x55f1867e3300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x55f1867e3380: 00 00 00 00 00 00 00[02]f9 f9 f9 f9 f9 f9 f9 f9
  0x55f1867e3400: 04 f9 f9 f9 00 f9 f9 f9 00 00 00 05 f9 f9 f9 f9
  0x55f1867e3480: 00 00 03 f9 f9 f9 f9 f9 00 00 02 f9 f9 f9 f9 f9
  0x55f1867e3500: 00 05 f9 f9 00 00 00 f9 f9 f9 f9 f9 00 07 f9 f9
  0x55f1867e3580: 00 04 f9 f9 00 00 07 f9 f9 f9 f9 f9 00 01 f9 f9
  0x55f1867e3600: 00 06 f9 f9 00 00 00 01 f9 f9 f9 f9 00 00 00 07
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
Thread T31 created by T0 here:
    #0 0x55f184e7139d in pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:237:3
...
    #5 0x55f185049e23 in test::run_tests::he583ee2920920d88 /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/test/src/lib.rs:387:31
    #6 0x55f18520ec7e in test::console::run_tests_console::ha1474cb5b5e5b63c /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/test/src/console.rs:329:5
    #7 0x55f1850442df in test::test_main::he18bcb9d69a13aae /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/test/src/lib.rs:143:15
    #8 0x55f18504626c in test::test_main_static::h1f6363b0368f7808 /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/test/src/lib.rs:162:5
    #9 0x55f184ee86e2 in minimap2::main::he4d6d65aca247990 /build/src/lib.rs:1:1

not compiling

Hello Team,

Does it compile on Linux or MacOS, I cannot compile both by runnning cargo build --release after clone minimap2 under minimap2-sys folder:

The following warnings were emitted during compilation:

warning: minimap2/hit.c: In function 'mm_gen_regs':
warning: minimap2/hit.c:74:18: warning: argument 1 range [18446744071562067968, 18446744073709551615] exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
warning: 74 | r = (mm_reg1_t*)calloc(n_u, sizeof(mm_reg1_t));
warning: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: In file included from /usr/include/bits/string2.h:1296,
warning: from /usr/include/string.h:633,
warning: from minimap2/hit.c:1:
warning: /usr/include/stdlib.h:467:14: note: in a call to allocation function 'calloc' declared here
warning: 467 | extern void *calloc (size_t __nmemb, size_t __size)
warning: | ^~~~~~

error: failed to run custom build command for minimap2-sys v0.1.6

Caused by:
process didn't exit successfully: /storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-81c7d28179994891/build-script-build (exit status: 101)
--- stdout
"/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out"
cargo:rerun-if-changed=minimap2/.c
cargo:rerun-if-env-changed=ZLIB_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=ZLIB_STATIC
cargo:rerun-if-env-changed=ZLIB_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=SYSROOT
cargo:rerun-if-env-changed=ZLIB_STATIC
cargo:rerun-if-env-changed=ZLIB_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rustc-link-search=native=/usr/lib64
cargo:rustc-link-lib=z
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=ZLIB_STATIC
cargo:rerun-if-env-changed=ZLIB_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
cargo:rustc-link-lib=m
cargo:rustc-link-lib=pthread
Compiling...
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-unknown-linux-gnu")
cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
CC_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
CC_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_CC
HOST_CC = None
cargo:rerun-if-env-changed=CC
CC = Some("/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc")
cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
CFLAGS_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
CFLAGS_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_CFLAGS
HOST_CFLAGS = None
cargo:rerun-if-env-changed=CFLAGS
CFLAGS = None
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/align.o" "-c" "minimap2/align.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/bseq.o" "-c" "minimap2/bseq.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/esterr.o" "-c" "minimap2/esterr.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/format.o" "-c" "minimap2/format.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/hit.o" "-c" "minimap2/hit.c"
cargo:warning=minimap2/hit.c: In function 'mm_gen_regs':
cargo:warning=minimap2/hit.c:74:18: warning: argument 1 range [18446744071562067968, 18446744073709551615] exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
cargo:warning= 74 | r = (mm_reg1_t
)calloc(n_u, sizeof(mm_reg1_t));
cargo:warning= | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cargo:warning=In file included from /usr/include/bits/string2.h:1296,
cargo:warning= from /usr/include/string.h:633,
cargo:warning= from minimap2/hit.c:1:
cargo:warning=/usr/include/stdlib.h:467:14: note: in a call to allocation function 'calloc' declared here
cargo:warning= 467 | extern void *calloc (size_t __nmemb, size_t __size)
cargo:warning= | ^~~~~~
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/index.o" "-c" "minimap2/index.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/kalloc.o" "-c" "minimap2/kalloc.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/ksw2_dispatch.o" "-c" "minimap2/ksw2_dispatch.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/ksw2_extd2_sse.o" "-c" "minimap2/ksw2_extd2_sse.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/ksw2_exts2_sse.o" "-c" "minimap2/ksw2_exts2_sse.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/ksw2_extz2_sse.o" "-c" "minimap2/ksw2_extz2_sse.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/ksw2_ll_sse.o" "-c" "minimap2/ksw2_ll_sse.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/kthread.o" "-c" "minimap2/kthread.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/lchain.o" "-c" "minimap2/lchain.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/map.o" "-c" "minimap2/map.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/misc.o" "-c" "minimap2/misc.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/options.o" "-c" "minimap2/options.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/pe.o" "-c" "minimap2/pe.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/sdust.o" "-c" "minimap2/sdust.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/seed.o" "-c" "minimap2/seed.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/sketch.o" "-c" "minimap2/sketch.c"
exit status: 0
running: "/usr/local/pace-apps/spack/packages/linux-rhel7-x86_64/gcc-4.8.5/gcc-10.3.0-o57x6h2gubo7bzh7evmy4mvibdqrlghr/bin/gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-static" "-I" "minimap2" "-DHAVE_KALLOC" "-O2" "-lm" "-lz" "-lpthread" "-o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/splitidx.o" "-c" "minimap2/splitidx.c"
exit status: 0
cargo:rerun-if-env-changed=AR_x86_64-unknown-linux-gnu
AR_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=AR_x86_64_unknown_linux_gnu
AR_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_AR
HOST_AR = None
cargo:rerun-if-env-changed=AR
AR = None
running: "ar" "cq" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/liblibminimap.a" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/align.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/bseq.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/esterr.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/format.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/hit.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/index.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/kalloc.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/ksw2_dispatch.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/ksw2_extd2_sse.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/ksw2_exts2_sse.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/ksw2_extz2_sse.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/ksw2_ll_sse.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/kthread.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/lchain.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/map.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/misc.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/options.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/pe.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/sdust.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/seed.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/sketch.o" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/minimap2/splitidx.o"
exit status: 0
running: "ar" "s" "/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out/liblibminimap.a"
exit status: 0
cargo:rustc-link-lib=static=libminimap
cargo:rustc-link-search=native=/storage/coda1/p-ktk3/0/jzhao399/rich_project_bio-konstantinidis/apps/minimap2-rs/target/release/build/minimap2-sys-a98d8c2a6b240956/out
Compiled!

--- stderr
thread 'main' panicked at 'Unable to find libclang: "the libclang shared library at /usr/lib64/clang-private/libclang.so.7 could not be opened: libclangAST.so.7: cannot open shared object file: No such file or directory"', /storage/home/hcoda1/4/jzhao399/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.61.0/./lib.rs:2276:31
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Thanks,

Jianshu

Compiling for aarch64?

Hi,

Someone is asking for an aarch64 version of chopper (wdecoster/chopper#22). It is the first time I have to compile something for that system, so bear with me :) I am running this on a WSL Ubuntu.

For chopper, cargo build --target aarch64-unknown-linux-gnu results in

warning: aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-msse2’

error: failed to run custom build command for `minimap2-sys v0.1.15+minimap2.2.26`

(let me know if the entire error is of interest)

I noticed you have some feature to select for aarch64 (or at least, I think that is what it means), so I tried for a clone of the minimap2-rs repo:
cargo build --target aarch64-unknown-linux-gnu --features sse2only
However, this result in the error below. Do you have an idea on how to fix this?

   Compiling minimap2-sys v0.1.16+minimap2.2.26
The following warnings were emitted during compilation:

warning: aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mno-sse4.1’

error: failed to run custom build command for `minimap2-sys v0.1.16+minimap2.2.26`

Caused by:
  process didn't exit successfully: `/home/wdecoster/wsl-repos/minimap2-rs/target/debug/build/minimap2-sys-81b1bf1b67e72476/build-script-build` (exit status: 1)
  --- stdout
  aarch64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:rustc-link-lib=m
  cargo:rustc-link-lib=pthread
  cargo:rerun-if-changed=minimap2/*.c
  cargo:rerun-if-env-changed=ZLIB_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64_unknown_linux_gnu
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_aarch64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_aarch64_unknown_linux_gnu
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64_unknown_linux_gnu
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  TARGET = Some("aarch64-unknown-linux-gnu")
  HOST = Some("x86_64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_aarch64-unknown-linux-gnu
  CC_aarch64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CC_aarch64_unknown_linux_gnu
  CC_aarch64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  RUSTC_LINKER = None
  cargo:rerun-if-env-changed=CROSS_COMPILE
  CROSS_COMPILE = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-unknown-linux-gnu
  CFLAGS_aarch64-unknown-linux-gnu = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_unknown_linux_gnu
  CFLAGS_aarch64_unknown_linux_gnu = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "aarch64-linux-gnu-gcc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-I" "minimap2" "-I" "minimap2/" "-I" "minimap2/sse2neon/" "-I" "/home/wdecoster/wsl-repos/minimap2-rs/target/aarch64-unknown-linux-gnu/debug/build/libz-sys-e9163c495f1107f6/out/include" "-Wc++-compat" "-DKSW_SSE2_ONLY" "-mno-sse4.1" "-DKSW_SSE2_ONLY" "-D_FILE_OFFSET_BITS=64" "-fsigned-char" "-Isse2neon" "-D__SSE2__" "-DHAVE_KALLOC" "-lm" "-lpthread" "-o" "/home/wdecoster/wsl-repos/minimap2-rs/target/aarch64-unknown-linux-gnu/debug/build/minimap2-sys-7f36ee3d7b468824/out/minimap2/sdust.o" "-c" "minimap2/sdust.c"
  cargo:warning=aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mno-sse4.1’

  exit status: 1

  --- stderr


  error occurred: Command "aarch64-linux-gnu-gcc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-I" "minimap2" "-I" "minimap2/" "-I" "minimap2/sse2neon/" "-I" "/home/wdecoster/wsl-repos/minimap2-rs/target/aarch64-unknown-linux-gnu/debug/build/libz-sys-e9163c495f1107f6/out/include" "-Wc++-compat" "-DKSW_SSE2_ONLY" "-mno-sse4.1" "-DKSW_SSE2_ONLY" "-D_FILE_OFFSET_BITS=64" "-fsigned-char" "-Isse2neon" "-D__SSE2__" "-DHAVE_KALLOC" "-lm" "-lpthread" "-o" "/home/wdecoster/wsl-repos/minimap2-rs/target/aarch64-unknown-linux-gnu/debug/build/minimap2-sys-7f36ee3d7b468824/out/minimap2/sdust.o" "-c" "minimap2/sdust.c" with args "aarch64-linux-gnu-gcc" did not execute successfully (status code exit status: 1).

c_int and c_char type not found.

while compling minimap-sys, I got a error.

Error

Compiling minimap2-sys v0.1.5
   Compiling minimap2 v0.1.5
error[E0412]: cannot find type `c_char` in module `std::ffi`
   --> /root/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/minimap2-0.1.5/src/lib.rs:619:63
    |
619 | ...                   let mut cs_string: *mut std::ffi::c_char = std::ptr::null_mut();
    |                                                         ^^^^^^ not found in `std::ffi`
    |
help: consider importing one of these items
    |
1   | use core::ffi::c_char;
    |
1   | use libc::c_char;
    |
1   | use std::os::raw::c_char;
    |
help: if you import `c_char`, refer to it directly
    |
619 -                             let mut cs_string: *mut std::ffi::c_char = std::ptr::null_mut();
619 +                             let mut cs_string: *mut c_char = std::ptr::null_mut();
    |

error[E0412]: cannot find type `c_int` in module `std::ffi`
   --> /root/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/minimap2-0.1.5/src/lib.rs:620:60
    |
620 | ...                   let mut m_cs_string: std::ffi::c_int = 0i32;
    |                                                      ^^^^^ not found in `std::ffi`
    |
help: consider importing one of these items
    |
1   | use core::ffi::c_int;
    |
1   | use libc::c_int;
    |
1   | use std::os::raw::c_int;
    |
help: if you import `c_int`, refer to it directly
    |
620 -                             let mut m_cs_string: std::ffi::c_int = 0i32;
620 +                             let mut m_cs_string: c_int = 0i32;
    |

For more information about this error, try `rustc --explain E0412`.
error: could not compile `minimap2` due to 2 previous errors
// main.rs
use minimap2::*;
fn main(){
  let mut aligner = Aligner {
          threads: 8,
          ..map10k()
      }
      .with_cigar()
      .with_index("test.fa", Some("ret.sam"))
      .expect("Unable to build index");
  
      let seq: Vec<u8> = b"ACTGACTCACATCGACTACGACTACTAGACACTAGACTATCGACTACTGACATCGA";
      let alignment = aligner
          .map(&seq, false, false, None, None)
          .expect("Unable to align");
  
  }
}
// Cargo.toml
[package]
name = "roa"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
bio = "1.0.0"
minimap2 = "0.1.5"
uuid = { version = "1.2.1", features = ["v4", "fast-rng", "macro-diagnostics"] }

FIX IT

I chenged std::ffi::* to libc::*, and I complied successfully.

- let mut cs_string: *mut std::ffi::c_char = std::ptr::null_mut();
+  let mut cs_string: *mut libc::c_char = std::ptr::null_mut();
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.