Fast General Purpose Astronomical Database.
libadb provides a fast and efficient way to query and interact with various astronomical catalogs. The project includes a core C library (adb) and several example applications that demonstrate importing and querying specific astronomical datasets (like NGC, Sky2000, Tycho, GSC, and HyperLeda).
To build libadb, you will need the following dependencies:
- CMake (version 3.10 or higher)
- C Compiler (supporting C99 standard, e.g., GCC or Clang)
- zlib (
zlib1g-devon Debian/Ubuntu) - libftp (
ftplib-devon Debian/Ubuntu) - Standard Math Library (
libm, usually included with libc)
- AVX Support: A CPU and compiler that support Advanced Vector Extensions (
-mavx). - OpenMP: A compiler with OpenMP support (for multi-threading).
The CMake build system defines the following targets:
adb(Shared Library): The core library containing catalog parsing, spatial indexing (HTM/KD-Tree), and solving logic.- Examples (Executables):
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 (seeexamples/Readme.mdfor specific GSC 1.1 import instructions).
libadb uses CMake for its build system.
-
Configure the Project
Create a build directory and run CMake. You can enable optional features during this step.
# 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
-
Build the Project
Use CMake to compile the library and examples (using multiple CPU cores with
-j):cmake --build build -j
-
Install (Optional)
To install the
libadbshared library, headers, andpkg-configfile to your system (e.g.,/usr/local):sudo cmake --install build
-
Create Packages (Optional)
To build
.deband.rpmpackages for distribution, you can usecpackfrom within the build directory (after compiling):cd build cpack -G "DEB;RPM"
Alternatively, you can build the packages directly using
make: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