GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Statically linking arrayfire · Issue #192 · arrayfire/arrayfire-rust

Statically linking arrayfire #192

New issue
Copy link
New issue
Copy link
Open
Open
Statically linking arrayfire#192
Copy link
Labels
Enhancement
Milestone
timeless

Description

@vadixidav
vadixidav
opened on Feb 28, 2019
Issue body actions

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.toml should "just work".

Reacted by Stuart Hunt, Elad Maimoni, Marius Cobzarenco and Oncelock

Activity

  1. 9prady9 commented on Feb 28, 2019

    @9prady9
    9prady9
    on Feb 28, 2019
    Member
    More actions

    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

  2. 9prady9 commented on Feb 28, 2019

    @9prady9
    9prady9
    on Feb 28, 2019
    Member
    More actions

    Whether you use static or dynamic binaries of ArrayFire, the size can't go to 10MB for sure.

  3. 9prady9 commented on Feb 28, 2019

    @9prady9
    9prady9
    on Feb 28, 2019
    Member
    More actions

    Looks like per crate limits were added but I don't know yet if it's released.

  4. 9prady9 commented on Feb 28, 2019

    @9prady9
    9prady9
    on Feb 28, 2019
    Member
    More actions

    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.

  5. vadixidav commented on Feb 28, 2019

    @vadixidav
    vadixidav
    on Feb 28, 2019
    ContributorAuthor
    More actions

    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.

  6. 9prady9
    added this to the timeless milestone on Mar 1, 2019
  7. 9prady9 commented on Mar 1, 2019

    @9prady9
    9prady9
    on Mar 1, 2019
    Member
    More actions

    @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.

  8. vadixidav commented on Mar 1, 2019

    @vadixidav
    vadixidav
    on Mar 1, 2019
    ContributorAuthor
    More actions

    @9prady9 Sure, I actually just did this for the Rust flann bindings here. Check the flann-sys directory. This was being built using CMake, which it looks like ArrayFire is as well. If you would like, I can attempt this myself. This would make it so that, by default, ArrayFire would be built by Cargo and statically linked, but if you enabled the special dynamic link flag then it would try to use the shared library. Does this sound fine?

  9. 9prady9 commented on Mar 1, 2019

    @9prady9
    9prady9
    on Mar 1, 2019
    Member
    More actions

    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.

  10. 9prady9
    added
    Enhancement
    on Mar 12, 2019
  11. 9prady9 commented on Mar 31, 2020

    @9prady9
    9prady9
    on Mar 31, 2020
    Member
    More actions

    arrayfire/arrayfire#313

  12. 9prady9 commented on May 9, 2022

    @9prady9
    9prady9
    on May 9, 2022
    Member
    More actions

    @umar456 Can you please share your findings w.r.t creating a static library of ArrayFire here.

  13. 9prady9 commented on May 9, 2022

    @9prady9
    9prady9
    on May 9, 2022
    Member
    More actions

    @vadixidav Did you get the chance to try it out ?

  14. vadixidav commented on May 9, 2022

    @vadixidav
    vadixidav
    on May 9, 2022
    ContributorAuthor
    More actions

    @vadixidav Did you get the chance to try it out ?

    I haven't, but I can give it a try when I get a chance.

    Reacted by Pradeep Garigipati
  15. 9prady9
    added this to arrayfire-rust boardon Sep 23, 2023
  16. 9prady9
    moved this to Features & Improvements in arrayfire-rust boardon Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement

    Type

    No type

    Projects

    • arrayfire-rust board
      Status
      Features & Improvements
      Show more project fields

    Milestone

    • timelessNo due date

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.