Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM Support: Install burn without installing libsqlite3 #1257

Closed
mfranzs opened this issue Feb 4, 2024 · 2 comments
Closed

WASM Support: Install burn without installing libsqlite3 #1257

mfranzs opened this issue Feb 4, 2024 · 2 comments

Comments

@mfranzs
Copy link

mfranzs commented Feb 4, 2024

Describe the bug
Attempting to bundle burn into a WASM rust library results in a compile-time failure because libsqlite3 is included

CleanShot 2024-02-04 at 13 04 54@2x

To Reproduce
Installing burn with this snippet (attempting to disable the sqlite flag) causes the failure.

[dependencies.burn]
version = "0.12.1"
default-features = false
features = ["std", "train", "ndarray"]

[dev-dependencies.burn]
version = "0.12.1"
default-features = false
features = ["std", "train", "ndarray"]

Expected behavior
Disabling the sqlite feature should not attempt to install libsqlite3.

Looking at the dependency tree, this is coming from:
burn-core => burn-dataset => r2d2_sqlite => rusqlite => libsqlite3-sys

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: N/A - All WASM
  • Version: 0.12.1

Additional context
I see an example repo that seems to be avoiding this issue, but I'm not sure how. Thanks in advance!

@AlexErrant
Copy link
Contributor

AlexErrant commented Feb 4, 2024

In the above PR I change burn-train's Cargo.toml default featureset to

default = ["metrics", "tui", "burn-core/default", "burn-core/dataset"]

while simultaneously doing

burn-core = { path = "../burn-core", version = "0.12.0", default-features = false }

This removes the hard burn-dataset dependency from burn-core. Perhaps this is enough to build to wasm.

@antimora
Copy link
Collaborator

antimora commented Feb 4, 2024

Train in wasm is not supported. You should build with default features disabled, which would force you the library be no-std compatible.

@antimora antimora closed this as completed Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants