Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Statically linking arrayfire #192
Comments
|
There is one major problem with doing that I think. Rust crates can't go beyond a certain size. ArrayFire binaries are big right now, definitely not in the range of crate size, the last time I checked it was 10MB |
|
Whether you use static or dynamic binaries of ArrayFire, the size can't go to 10MB for sure. |
|
Looks like per crate limits were added but I don't know yet if it's released. |
|
Also, I am not really sure if it's good idea to club binary along with crate using static linking. Because right now there is an advantage : user can install/modify ArrayFire installation independent of crate version and as long as crate <major.minor> version matches ArrayFire's <major.minor> version, it is ready for use. |
|
A feature could be added to enable dynamic linking as well. By default it could be statically linked, but for deployment it could then be dynamically linked by enabling the feature. |
|
@vadixidav I have no experience doing such packaging(involving static linking but handling all OSes) in rust crates. Can you please point to another crate that does this. |
|
@9prady9 Sure, I actually just did this for the Rust flann bindings here. Check the |
|
I am concerned by build times of ArrayFire - it takes too much time to be honest. Let me check flann-sys. Sure, give it a try and feel free to contact on slack for quick response if you face problems during static build. |
Right now arrayfire has to be used by linking to the DLL. Since the only parts of arrayfire that are included in the Rust bindings are BSD 3-clause, there should be no problem statically linking arrayfire. Is it possible that we could choose whether or not arrayfire is statically linked to ease distribution? Also, is there any downside to just always statically linking arrayfire? I feel like that would be more in-line with what the Rust community expects: adding a crate to your
Cargo.tomlshould "just work".