Fast General Purpose Astronomical Database.
libastrodb provides a fast and efficient way to query and interact with various astronomical catalogs. The project includes a core C library (astrodb) and several example applications that demonstrate importing and querying specific astronomical datasets (like NGC, Sky2000, Tycho, GSC, and HyperLeda).
To build libastrodb, you will need the following dependencies:
zlib1g-dev on Debian/Ubuntu)ftplib-dev on Debian/Ubuntu)libm, usually included with libc)-mavx).The CMake build system defines the following targets:
astrodb (Shared Library): The core library containing catalog parsing, spatial indexing (HTM/KD-Tree), and solving logic.sky2k: Example for the Sky2000 catalog.ngc: Example for the NGC catalog.hyperleda: Example for the HyperLeda catalog.tycho: Example for the Tycho catalog.gsc: Example for the Guide Star Catalog (see examples/Readme.md for specific GSC 1.1 import instructions).libastrodb uses CMake for its build system.
Create a build directory and run CMake. You can enable optional features during this step.
```bash
# Basic configuration
cmake -B build -S .
# Configuration with debug symbols and hardware acceleration enabled
cmake -B build -S . -DENABLE_DEBUG=ON -DENABLE_AVX=ON -DENABLE_OPENMP=ON
```
Use CMake to compile the library and examples (using multiple CPU cores with -j):
bash
cmake --build build -j
To install the libastrodb shared library, headers, and pkg-config file to your system (e.g., /usr/local):
bash
sudo cmake --install build
To build .deb and .rpm packages for distribution, you can use cpack from within the build directory (after compiling):
bash
cd build
cpack -G "DEB;RPM"
Alternatively, you can build the packages directly using make:
bash
make package
After building, you can find the compiled shared library in build/src/ and the example executables in build/examples/.
For instance, to run the NGC example:
./build/examples/ngc