diff --git a/src/codegen/compiler.rs b/src/codegen/compiler.rs index 08f401f..db47a79 100644 --- a/src/codegen/compiler.rs +++ b/src/codegen/compiler.rs @@ -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"); diff --git a/src/utils.rs b/src/utils.rs index 3064ee2..93a96f2 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -31,9 +31,12 @@ pub fn find_executable<'a>(varients: &[&'a str]) -> Result<&'a str> { pub fn find_runtime_path(libraries: &[&str] ) -> Result { - let library_paths_env = env::var("LIBRARY_PATH").unwrap_or("".to_owned()); - let library_paths = library_paths_env.split(":").collect::>(); - 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::>(); + 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 {