Skip to content

Commit

Permalink
Fix candle-flash-attn build on Windows (msvc) (#2734)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrebnov authored Jan 22, 2025
1 parent 77db839 commit e6cd499
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions candle-flash-attn/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ fn main() -> Result<()> {
.arg("--use_fast_math")
.arg("--verbose");

if let Ok(target) = std::env::var("TARGET") {
if target.contains("msvc") {
builder = builder.arg("-D_USE_MATH_DEFINES");
}
}

let out_file = build_dir.join("libflashattention.a");
builder.build_lib(out_file);

Expand Down

0 comments on commit e6cd499

Please sign in to comment.