Enable build for Linux.

This commit is contained in:
Seunghoon Lee 2024-02-18 23:38:55 +09:00
parent 8f59c750ac
commit d325f6a43c
No known key found for this signature in database
GPG key ID: 436E38F4E70BD152
6 changed files with 40 additions and 16 deletions

View file

@ -3,8 +3,12 @@ use std::{env, path::PathBuf};
fn main() -> Result<(), VarError> {
println!("cargo:rustc-link-lib=dylib=hipfft");
let mut path = PathBuf::from(env::var("HIP_PATH")?);
path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
if cfg!(windows) {
let mut path = PathBuf::from(env::var("HIP_PATH")?);
path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
} else {
println!("cargo:rustc-link-search=native=/opt/rocm/lib/");
}
Ok(())
}

View file

@ -3,8 +3,12 @@ use std::{env, path::PathBuf};
fn main() -> Result<(), VarError> {
println!("cargo:rustc-link-lib=dylib=MIOpen");
let mut path = PathBuf::from(env::var("MIOPEN_PATH")?);
path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
if cfg!(windows) {
let mut path = PathBuf::from(env::var("MIOPEN_PATH")?);
path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
} else {
println!("cargo:rustc-link-search=native=/opt/rocm/lib/");
}
Ok(())
}

View file

@ -3,8 +3,12 @@ use std::{env, path::PathBuf};
fn main() -> Result<(), VarError> {
println!("cargo:rustc-link-lib=dylib=rocblas");
let mut path = PathBuf::from(env::var("HIP_PATH")?);
path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
if cfg!(windows) {
let mut path = PathBuf::from(env::var("HIP_PATH")?);
path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
} else {
println!("cargo:rustc-link-search=native=/opt/rocm/lib/");
}
Ok(())
}

View file

@ -3,8 +3,12 @@ use std::{env, path::PathBuf};
fn main() -> Result<(), VarError> {
println!("cargo:rustc-link-lib=dylib=rocsolver");
let mut path = PathBuf::from(env::var("HIP_PATH")?);
path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
if cfg!(windows) {
let mut path = PathBuf::from(env::var("HIP_PATH")?);
path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
} else {
println!("cargo:rustc-link-search=native=/opt/rocm/lib/");
}
Ok(())
}

View file

@ -3,8 +3,12 @@ use std::{env, path::PathBuf};
fn main() -> Result<(), VarError> {
println!("cargo:rustc-link-lib=dylib=rocsparse");
let mut path = PathBuf::from(env::var("HIP_PATH")?);
path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
if cfg!(windows) {
let mut path = PathBuf::from(env::var("HIP_PATH")?);
path.push("lib");
println!("cargo:rustc-link-search=native={}", path.display());
} else {
println!("cargo:rustc-link-search=native=/opt/rocm/lib/");
}
Ok(())
}

View file

@ -6,7 +6,11 @@ pub use cublas::*;
use cuda_types::*;
use rocblas_sys::*;
use rocsolver_sys::{
rocsolver_cgetrf_batched, rocsolver_cgetri_batched, rocsolver_cgetri_outofplace_batched, rocsolver_sgetrs_batched, rocsolver_zgetrf_batched, rocsolver_zgetri_batched, rocsolver_zgetri_outofplace_batched
rocsolver_cgetrf_batched,
rocsolver_cgetri_outofplace_batched,
rocsolver_sgetrs_batched,
rocsolver_zgetrf_batched,
rocsolver_zgetri_outofplace_batched,
};
use std::{mem, ptr};