RagnarGrootKoerkamp / astar-pairwise-aligner

A pairwise sequence aligner written in Rust
Mozilla Public License 2.0
117 stars 11 forks source link

SDL2 linker error #19

Closed valentynbez closed 1 year ago

valentynbez commented 1 year ago

Hi, I was trying to test your library and got the following error:

binutils/2.37/bin/ld.gold: error: cannot find -lSDL2
binutils/2.37/bin/ld.gold: error: cannot find -lSDL2_ttf

Tried to install SDL2 library and add it to LD_LIBRARY_PATH - no effect. I am not a Rust-savvy person, how can I point the compiler to a required file?

RagnarGrootKoerkamp commented 1 year ago

You should be able to compile with --no-default-features, which disabled the visualization part of the code and hence should not need SDL2 as a dependency.

RagnarGrootKoerkamp commented 1 year ago

Otherwise, I know other people had no issues after installing the system-wide SDL2 package via their package manager.

Also, feel free to reach out on matrix if you want to discuss your usecase: https://matrix.to/#/@curious_coding:matrix.org

valentynbez commented 1 year ago

Figured it out. Unfortunately, I wasn't able to do a system-wide install of SDL2, because I was working on cluster, where I don't have permissions to modify stuff inside /usr/ :( I added a build.rs in pa-vis with following content:

fn main () {
    #[cfg(target_os="linux")]
    println!("cargo:rustc-link-search=/link/to/libraries")
}

Leaving it as solution if anyone gets lost :)

RagnarGrootKoerkamp commented 1 year ago

Ah, that is a nice workaround :) But still, if you don't need the visualizations it should work fine without SDL2 at all ;)