Skip to content

Commit

Permalink
link to all libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjrobins committed Nov 12, 2023
1 parent 3b26b0c commit 6ccb742
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
13 changes: 10 additions & 3 deletions src/codegen/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,16 @@ impl Compiler {
"Sundials_solve",
];
let mut linked_files = vec![
"libdiffeq_runtime_lib_wasm.a",
"libsundials_idas_wasm.a",
"libargparse_wasm.a",
"libdiffeq_runtime_lib.a",
"libsundials_idas.a",
"libsundials_sunlinsolklu.a",
"libklu.a",
"libamd.a",
"libcolamd.a",
"libbtf.a",
"libsuitesparseconfig.a",
"libsundials_sunmatrixsparse.a",
"libargparse.a",
];
if standalone {
linked_files.push("libdiffeq_runtime_wasm.a");
Expand Down
9 changes: 6 additions & 3 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ pub fn find_executable<'a>(varients: &[&'a str]) -> Result<&'a str> {


pub fn find_runtime_path(libraries: &[&str] ) -> Result<String> {
let library_paths_env = env::var("LIBRARY_PATH").unwrap_or("".to_owned());
let library_paths = library_paths_env.split(":").collect::<Vec<_>>();
for path in library_paths {
// search in EMSDK lib dir and LIBRARY_PATH env variable
let emsdk_lib = env::var("EMSDK").unwrap_or("".to_owned()) + "/upstream/emscripten/cache/sysroot/lib";
let emsdk_lib_paths = vec![emsdk_lib.as_str()];
let lib_path_env = env::var("LIBRARY_PATH").unwrap_or("".to_owned());
let library_paths = lib_path_env.split(":").collect::<Vec<_>>();
for path in emsdk_lib_paths.into_iter().chain(library_paths.into_iter()) {
// check if all librarys are in the path
let mut found = true;
for library in libraries {
Expand Down

0 comments on commit 6ccb742

Please sign in to comment.