https://github.com/smithsonian/cspice-sharedlib
Script to build the NAIF CSPICE library and toolkit via a shared library
https://github.com/smithsonian/cspice-sharedlib
astronomy c-language c-programming-language ephemeris shared-library
Last synced: over 1 year ago
JSON representation
Script to build the NAIF CSPICE library and toolkit via a shared library
- Host: GitHub
- URL: https://github.com/smithsonian/cspice-sharedlib
- Owner: Smithsonian
- License: unlicense
- Created: 2024-11-09T14:12:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-10T10:53:28.000Z (over 1 year ago)
- Last Synced: 2025-03-02T01:15:33.443Z (over 1 year ago)
- Topics: astronomy, c-language, c-programming-language, ephemeris, shared-library
- Language: Shell
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

# cspice-sharedlib
Shell script to build the [NAIF CSPICE Toolkit](https://naif.jpl.nasa.gov/naif/toolkit.html) as
a shared library (`libcspice.so[.1]`) and dynamically linked executables instead of the normal
static libraries and static linking used by the the upstream distribution.
Author: Attila Kovacs ``
Version: 0.9
## Prerequisites
You can get the CSPICE toolkit from https://naif.jpl.nasa.gov/naif/toolkit_C.html. Just grab
`cspice.tar.Z` for any of the platforms (these contain pre-built binaries, which we will not use
anyway). Then unpack it in a location of choice:
```bash
$ tar xf /cspice.tar.Z
```
(Note that the `tar.Z` extension indicates a compressed archive, but it is not in fact compressed,
hence no decompression flags for the `tar` command).
## Advanced Setup
The build uses the standard `CPPFLAGS`, `CFLAGS`, and `LDFLAGS` options for the precompiler,
compiler, and linker, respectively. So, you can define these in the shell prior to running the
build to further customize the build for your need. E.g.:
```bash
$ export CFLAGS="-O2 -g"
```
## Build
To use, simply run this script from the parent directory of the unpacked `cspice` package. E.g.:
```bash
$ /cspice-sharedlib.sh
```
## Install
After a successful build, you can install the shared libraries and executables into their final
locations (e.g. `/usr/lib` and `/usr/bin` respectively). Simply copy the contents of `cspice/lib/`
to the designated location for the `.so` library files (and make sure that location is included in
the `LD_LIBRARY_PATH` environment variable), then copy the executables under `cspice/exe/` into
the location of choice.
--------------------------------------------------------------------------------------------------
Copyright (C)2024 Attila Kovacs