Tehforsch / diman

Define rust compile time unit systems using const generics
52 stars 2 forks source link

restore no_std after diman_lib was split out #77

Closed jedbrown closed 1 week ago

jedbrown commented 1 month ago

When we added no_std (https://github.com/Tehforsch/diman/pull/60), crates/diman_lib did not yet exist. It's now missing the no_std annotation, which has allowed tests to pass (since the tests are all running for architectures that support std). Rust does not prevent no_std crates from calling crates that use std (this is confusing).

Adding no_std to diman_lib moves the dependency on num-traits into diman_lib and we drop the ratio module when we don't have either std or num-traits-libm (since we need powf for it to work).

I've tested this with --target=nvptx64-nvidia-cuda.

Tehforsch commented 4 weeks ago

I've fixed a few minor problems that came up and added a no_std build on nvptx64-nvidia-cuda to the CI, to hopefully prevent myself from causing problems like this in the future. Could you just quickly confirm that the new version of this PR works for you? If so I'll merge it and release 0.5.1 containing this and a few other small fixes.

Tehforsch commented 1 week ago

Looks good, thanks. And sorry about the issues in the first version and taking a while to circle back.

No worries!