#toolkit #bindings #naif #documentation #spice #cspice

sys cspice-sys

Unsafe bindings to the NAIF CSPICE toolkit

4 releases (stable)

1.0.4 Dec 17, 2023
1.0.3 Jul 27, 2022
1.0.0 Jul 10, 2022
0.0.1 Jan 18, 2021

#2 in #naif

Download history 3/week @ 2024-07-22 66/week @ 2024-07-29 202/week @ 2024-08-05 197/week @ 2024-08-12 145/week @ 2024-08-19 146/week @ 2024-08-26 187/week @ 2024-09-02 96/week @ 2024-09-09 102/week @ 2024-09-16 137/week @ 2024-09-23 98/week @ 2024-09-30 130/week @ 2024-10-07 199/week @ 2024-10-14 68/week @ 2024-10-21 35/week @ 2024-10-28 120/week @ 2024-11-04

435 downloads per month
Used in 6 crates (2 directly)

LGPL-3.0

140KB
174 lines

cspice-sys

Build crates.io docs.rs

Unsafe bindings to the NAIF SPICE Toolkit.

Read the official CSPICE documentation online

Please note this is a complete replacement of the 0.x version of the crate, under a new maintainer

Installation

Firstly, you must have Clang installed and on your PATH to be able to generate the bindings.

If you're on a Unix-like system and have CSPICE installed in the standard paths (libcspice.a in /usr/lib and headers in /usr/include), that version will be used by default.

Alternatively, you can enable the downloadcspice feature on the crate to automatically download CSPICE from NAIF servers when this crate is built. Be aware that this will increase build time and require an internet connection on every clean build.

You can also download CSPICE and tell this crate about where to find it manually: First install the CSPICE toolkit by downloading and extracting the appropriate archive from here.

Then, set the CSPICE_DIR environment variable to point to the extracted cspice directory (which should contain the include and lib directories).

WARNING: On Unix like systems you will likely need to rename lib/cspice.a to lib/libcspice.a so that it can be successfully linked.

Also see the GitHub workflow for examples on how to set this up.

Cross Compilation

You can use the CSPICE_CLANG_TARGET environment variable to override the --target parameter for Clang (when generating bindings).

You can use the CSPICE_CLANG_ROOT environment variable to override the --sysroot parameter for Clang (when generating bindings).

No runtime deps

~0–3.5MB
~49K SLoC