rust-GSL icon indicating copy to clipboard operation
rust-GSL copied to clipboard

Feature request: add static linking option

Open hombit opened this issue 3 years ago • 6 comments

It would be nice if the crate supports static linking with the GSL via a Cargo feature flag. The most of scientific crates with bindings provide such an option, e.g. ndarray-linalg, fftw, netcdf and hdf5

hombit avatar Aug 08 '21 05:08 hombit

So basically doing that: https://github.com/rust-math/fftw/blob/master/fftw-sys/src/lib.rs#L13-L16? If so, feel free to send a PR. :)

GuillaumeGomez avatar Aug 12 '21 12:08 GuillaumeGomez

I mean something like this: https://github.com/rust-math/fftw/blob/master/fftw-sys/src/lib.rs#L3-L4 and this: https://github.com/rust-math/fftw/tree/master/fftw-src

I thing it would require creating gsl-src crate which will be dedicated to hold sources for the current GSL release and compile it to a static library. While we have it we could add a feature to gsl and gsl-sys saying if we use statically compiled GSL.

Would you accept PR doing something like this?

hombit avatar Aug 12 '21 13:08 hombit

Oh I see, then no. I don't want to embed the sources of the C library and handle its compilation myself.

GuillaumeGomez avatar Aug 12 '21 13:08 GuillaumeGomez

Thank you for the answer

hombit avatar Aug 12 '21 13:08 hombit

Sorry, I probably miss-understood you. Would it be acceptable to introduce a Cargo feature forcing static links against a locally installed static GSL?

hombit avatar Aug 14 '21 17:08 hombit

If it doesn't need to run a C compiler to do so, then I'm fine with it.

GuillaumeGomez avatar Aug 14 '21 17:08 GuillaumeGomez