MRTKLIB is a modern, thread-safe C11 GNSS positioning library built on RTKLIB, covering the open PPP / PPP-RTK correction services — QZSS CLAS and MADOCA-PPP, Galileo HAS, and IGS products and real-time streams — in a single code base, for both post-processing (mrtk post) and real-time processing (mrtk run).
In the spirit of RTKLIB, it aims to be both a readable reference for how each service is applied and practical software for day-to-day and production use. The CLAS and MADOCA-PPP engines are regression-tested for parity with the official CLASLIB / MADOCALIB, and absolute accuracy is checked against independent truth (e.g. IGS SINEX). Standard positioning (SPP, RTK) is maintained alongside, with selected algorithm improvements from demo5 RTKLIB.
MRTKLIB is not just another fork; it is a ground-up architectural redesign aimed at modern software engineering standards:
- Thread-Safe Design: Introduced the
mrtk_ctx_tcontext structure to encapsulate states, error handling, and logging on a per-instance basis, replacing legacy global variables in the major processing pipelines and enabling parallel processing (e.g., handling multiple streams in a single server). - POSIX & C11 Pure: Purged all Win32 API and legacy
#ifdefmacros. The core library is purely POSIX/C11 compliant, ensuring perfect portability across Linux, macOS (Apple Silicon), and embedded ARM/RISC-V devices. - Modern Build System (CMake): Replaced scattered Makefiles with a unified, clean CMake build system. It natively supports standard
find_package(LAPACK)for hardware-accelerated matrix operations (replacing bundled proprietary Intel MKL binaries). - Domain-Driven Directory Structure: Flat source files have been beautifully categorized into specific domains (
src/core/,src/pos/,src/rtcm/,src/models/, etc.) for high maintainability.
| Service | Delivery | Positioning modes | Post (mrtk post) |
Real-time (mrtk run) |
|---|---|---|---|---|
| QZSS CLAS | L6D (CSSR) | PPP-RTK; VRS-RTK (mrtk cssr2rtcm3 for a real-time RTCM3 VRS stream) |
✅ 1ch / 2ch | ✅ 1ch / 2ch |
| QZSS MADOCA-PPP | L6E (SSR) + L6D wide-area ionosphere (PRN 200/201) | PPP, PPP-AR, PPP-AR + iono | ✅ | ✅ |
| Galileo HAS | E6-B C/NAV | Float PPP | ✅ | ✅ |
| IGS products | SP3 / CLK / Bias-SINEX files | Float PPP, integer PPP-AR (OSB phase biases) | ✅ | — |
| IGS-RTS | RT 8000 CM-SSR over NTRIP | Float PPP | ✅ (recorded stream) | ✅ |
| BeiDou PPP-B2b | BDS-3 GEO B2b-I | Float PPP (BeiDou) | ✅ | ✅ |
| SouthPAN PVS | SouthPAN SBAS GEO | PPP | planned (v0.7.17) | planned |
The service is selected with the correction configuration axis; see the configuration guide and the per-service quick starts under docs/guide/. The CLAS engine also handles single-band configurations (single-frequency signal sets and the Galileo E1/E5b mismatch of u-blox ZED-F9P-class receivers); see docs/design/sf-ppp-rtk.md.
Standard positioning — SPP (C/N0 weighting, IGG-III robust estimation, TDCP) and RTK (demo5 back-ports) — is supported in both post-processing and real time.
MRTKLIB began by unifying the QZSS augmentation libraries into one conflict-free code base on a modernized RTKLIB core; that integration is complete:
| Component | Version | Description | Status |
|---|---|---|---|
| MALIB | feature/1.2.0 (f006a34) |
MADOCA-PPP structural base (directory layout, threading, streams), by JAXA and TOSHIBA | Integrated |
| MADOCALIB | ver.2.0 (8091004) |
PPP/PPP-AR engine, L6E SSR decoder, L6D ionospheric decoder | Integrated |
| CLASLIB | ver.0.8.2 (9e714b9) |
Centimeter Level Augmentation Service (PPP-RTK, VRS-RTK, CSSR decoder) | Integrated |
MRTKLIB was the first open-source implementation of real-time CLAS PPP-RTK positioning. Later releases extended it beyond QZSS to Galileo HAS and IGS corrections.
MRTKLIB's positioning engines have been progressively modernized across releases (community-fork back-ports, new correction sources, tooling). Per-version detail is in the CHANGELOG and release notes:
| Era | Theme |
|---|---|
| v0.4.x | demo5 RTK / PPP-RTK algorithm port (PAR, detslp_dop / detslp_code, full-constellation varerr, false-fix fixes); real-time CLAS PPP-RTK (1ch / 2ch) |
| v0.5.x | TOML configuration; code-quality sweeps (clang-format, mandatory braces); signals restructuring; RINEX 4.00 CNAV; convbin / str2str ports |
| v0.6.x | Unified mrtk CLI; NTRIP v2; mrtk cssr2rtcm3 (CSSR→RTCM3); IGS-products float / RTS / integer PPP-AR (the correction axis); SPP accuracy; formatter CI gate; GSDC smartphone benchmark; real-time MADOCA-PPP multi-GNSS signal selection |
| v0.7.x | Global SSR correction services: Galileo HAS (E6-B C/NAV) float PPP; two-receiver QZSS L6 (mosaic-CLAS / mosaic-G5) with single-SBF MADOCA-PPP; CLAS PPP-RTK accuracy/robustness fixes and an upstream-identical CSSR dump (mrtk dump --parse); real-time MADOCA-PPP PPP-AR/IONO (L6D wide-area ionosphere); CLAS PPP-RTK claslib parity closing the storm-day fix-rate gap; TOML configuration redesign with deprecation aliases; CLAS dual-channel transmit-pattern merge in post-processing and real-time; kinematic-RTK slip-detection regression fix; rtcm_t memory-footprint refactor (lazy lclblock_t: ~1.2 GB → tens of MB per real-time solver); RTCM3 MSM BDS-3 B2b observation support (decoder + encoder); build-independent MADOCA regression tests with absolute checks; QZSS L6 service routing by frame header with QZSS L6 handover regression tests; MADOCALIB 2.2 sync with configurable BDS-2 / BDS-3 classification for the April 2026 BeiDou PRN reassignment; real-time CLAS robustness to L6 frame losses, phase-bias discontinuities and degraded L6 channels, in the two-channel merge and in mrtk cssr2rtcm3; BeiDou PPP-B2b float PPP (post and real time) — SouthPAN PVS planned next |
Latest — v0.7.16: BeiDou PPP-B2b. correction = "bds-b2b" runs BeiDou-only float PPP with the PPP-B2b corrections of the four BDS-3 GEOs, in mrtk post and mrtk run (#417). The GEOs moved to C01–C04 with the April 2026 PRN reassignment (C59–C62 before) and are configured by the new [positioning] bds_geo_sats. In real time the B-CNAV1 ephemeris the corrections refer to comes from SBF BDSCNav1 (4251), and the decoder takes one GEO stream at a time, because C01–C03 and C04 send different IOD SSR. On a 2 h live capture in Tokyo after 60 min: static 1.8 cm 2D / 3.9 cm U rms, kinematic 15.8 / 10.8 cm, real-time replay 14.8 / 10.7 cm. Two contributed fixes: the single-frequency NavIC L5 group delay in SPP (#384) and the NTRIP v2 source handshake, which sent a raw stream after advertising chunked transfer (#385). New dataset g5p3_296u-v1. ABI changes in prcopt_t, raw_t, rtksvr_t. See the Quick Start: BeiDou PPP-B2b and the release notes.
v0.7.15: CLAS real-time robustness, part 2: phase-bias discontinuities, L6 channel management and partial-AR integrity. PPP-RTK now honours the CSSR phase discontinuity indicator: when CLAS steps the phase biases, the phase-bias states of the affected signals are re-initialized instead of every phase residual being rejected, which was the leading cause of Single epochs in 5.9 days of live data (#393). With l6_merge, a channel resuming across a GPS week rollover no longer stops the corrections until restart (fix rate 38.85 % → 98.95 % on the 5.9-day replay, #436), and a channel whose PRN has gone silent no longer counts as a correction source (#443). A single-channel L6 lock moves from a degraded PRN to a clean one (#414). Partial AR restores a satellite as it was before a trial exclusion (#413) and VRS-RTK partial AR no longer writes before rtk->ssat[] (#412). MADOCA-PPP L6E / L6D-iono messages are no longer decoded across a lost L6 frame (#363). mrtk cssr2rtcm3 bridges a lost correction set with the last good one and outputs the latest receiver epoch instead of stepping behind after input gaps; it now takes SBF input only (-in sbf://…; raw L6 input, -2ch and -pos are removed) (#442). The NMEA GGA station id names the CLAS L6 source of the solution. claslib post-processing and VRS outputs are byte-identical or within 0.1 mm. Several CLAS / MADOCA structures gain fields (ABI change). RT replay tests run concurrently: the full suite takes ~8 min instead of ~37 min on 8 cores (#448). The regression suite is 196 / 196.
v0.7.14: CLAS real-time robustness: L6 frame losses and the two-channel merge. Four real-time CLAS PPP-RTK faults found on live mosaic-G5 data are fixed. Losing subframe 1 of a CLAS frame no longer costs ~17 s of Single: the code bias of the next frame is used, as the consistency check allows (#406). An L6 frame lost inside a subframe (a 1–2 s input loss or an RS failure) is detected from the receiver frame time (SBF / UBX), and the rest of the subframe is discarded instead of being decoded from shifted bits; those garbage corrections drove metre-level Float, false fixes and the reset loop of #381 (#363). For this the ST1 mask width check was fixed: it counted from the wrong bits, as upstream claslib has since 0.8.0. Losing the top-of-hour ST1 no longer dates the following messages one hour old (#392), and with l6_merge an epoch in which one channel already has the new clock no longer drops to Single (#380). On live replays the fix rate rises by up to 6 points (92.2 % → 98.4 % on the worst hour) and Float errors of tens of metres disappear; claslib post-processing is byte-identical. New RT regression on a live capture with frame losses (dataset clas_l6gap-v1). raw_t and clas_l6buf_t gain fields (ABI change); new API clas_set_l6tag(). The regression suite is 191 / 191.
Next: SouthPAN PVS (v0.7.17) as the next v0.7.x correction service (#418); GPS with PPP-B2b without broadcast GPS code biases; phase-bias discontinuities signalled to the RTK engine as MSM lock-time resets in mrtk cssr2rtcm3 (#453); real-time CLAS fix loss after a handover and wrong ambiguity sets after a reset (#389, #394); extend the CLAS-style CSSR dump to MADOCA / Galileo HAS / BeiDou B2b (#229); investigate the HAS absolute-accuracy offset (#215)
Note
demo5 algorithm improvements are adapted from demo5 RTKLIB by Tim Everett (rtklibexplorer). Benchmark results use the PPC-Dataset (Taro Suzuki, Chiba Institute of Technology) for kinematic positioning and the Google Smartphone Decimeter Challenge 2023 dataset for smartphone SPP.
| Mode | L6E (SSR) | L6D (CLAS) | Notes |
|---|---|---|---|
Post-processing (mrtk post) |
Multiple .l6 files |
Dual-channel | Full PPP/PPP-AR/PPP-AR+iono/PPP-RTK |
Real-time (mrtk run) |
Single stream (inpstr3) |
Dual-channel (inpstr2 + inpstr3) |
PPP/PPP-AR/PPP-AR+iono, PPP-RTK with 1ch or 2ch CLAS L6D |
- Real-time CLAS L6D: Dual-channel support uses stream 3 for L6 ch1 and stream 2 (base slot, unused in PPP-RTK) for L6 ch2.
- Real-time L6E: The rtksvr provides a single correction input (
inpstr3). Multiple QZSS L6E channels (e.g., QZS-3 and QZS-4) are supported when the receiver multiplexes them into one SBF stream.
Real-time CLAS PPP-RTK positioning performance can be monitored on a public Grafana dashboard:
The dashboard shows fix rate, ENU accuracy, satellite visibility, and correction age
streamed from an active mrtk run session.
Ready-to-use packages for trying MRTKLIB without building it from source:
| Project | Description |
|---|---|
| mrtklib-docker-ui | Web UI for MRTKLIB in a Docker container — post-processing (mrtk post) and real-time positioning (mrtk run) from the browser, with TOML import / export and result visualization. No compilation required: docker compose up. |
| mrtklib-quickstart (docs, 日本語 / English) | One-script quickstart for real-time MADOCA-PPP with a Septentrio mosaic-G5 receiver — configures the receiver, launches the Docker web UI, and includes teaching material for Windows / macOS / Linux. |
- CMake (>= 3.15)
- C11 compatible compiler (GCC, Clang)
- LAPACK/BLAS (Optional but recommended for fast matrix operations. e.g.,
liblapack-devon Ubuntu, Accelerate framework on macOS) — requires the LP64 (32-bit integer) interface; ILP64 providers are not supported (for example, avoid OpenBLAS built withINTERFACE64=1). On CMake ≥ 3.22, MRTKLIB requests a 32-bit integer BLAS/LAPACK interface by settingBLA_SIZEOF_INTEGER=4. This is a CMake selection hint, not a complete ABI verifier for all BLAS/LAPACK package layouts: ifFindBLAS/FindLAPACKstill resolves an ILP64 provider (e.g. an ILP64 OpenBLAS published as plainlibopenblas.sowith no64-suffixed name), make an LP64 BLAS/LAPACK provider visible to CMake explicitly. On older CMake, install an LP64 build of your BLAS/LAPACK provider (the default for most distributions).
MRTKLIB uses standard CMake workflow. Out-of-source builds are strictly recommended.
# Clone the repository
git clone https://github.com/h-shiono/MRTKLIB.git
cd MRTKLIB
# Configure the project
cmake -B build -DCMAKE_BUILD_TYPE=Release
# Build the library and apps
cmake --build build -jThe unified mrtk binary will be located in the build/ directory.
Configuration files (TOML) are stored in the conf/ directory.
Test data and regression datasets are available in tests/data/.
# Example: Running post-processing analysis
./build/mrtk post -k conf/malib/rnx2rtkp.toml tests/data/rtklib/rinex/xxxx.obs ...
# Example: Real-time positioning
./build/mrtk run -s -o conf/claslib/rtkrcv.tomlMRTKLIB is developed using an AI-assisted workflow. Algorithm porting, test authoring, and code migration are performed with Claude Code (Anthropic). Architecture, implementation strategy, and final review are directed by the project author; porting strategy design is also supported by Gemini Pro (Google).
All commits, test results, and architectural decisions remain under human authorship and review.
MRTKLIB includes both robust unit tests (utest) and regression tests to ensure core stability when merging complex GNSS algorithms.
cd build
ctest --output-on-failureThe codebase is fully documented using Doxygen. To generate the API reference and call graphs:
cmake --build build --target docDocumentation will be generated in build/doc/html/index.html.
If you use MRTKLIB in your research or product, please cite it via its archived
release on Zenodo. You can cite all versions by using
the concept DOI 10.5281/zenodo.20373746; Zenodo also mints a version-specific
DOI for each individual release.
@software{mrtklib,
author = {Shiono, Hayato},
title = {{MRTKLIB: Modernized RTKLIB for Next-Generation GNSS}},
publisher = {Zenodo},
doi = {10.5281/zenodo.20373746},
url = {https://doi.org/10.5281/zenodo.20373746}
}MRTKLIB is distributed under the BSD 2-Clause License.
This project stands on the shoulders of giants:
| Contributor | Role |
|---|---|
| Tomoji Takasu | RTKLIB — the foundational GNSS positioning library |
| Taro Suzuki | RTKLIB — u-blox receiver decoder |
| Tim Everett (rtklibexplorer) | demo5 RTKLIB — kinematic RTK algorithm improvements (PAR, detslp_dop/code, varerr) |
| Geospatial Information Authority of Japan | GSILIB v1.0.3 — CLAS grid correction algorithms |
| Mitsubishi Electric Corp. | CLASLIB — CLAS PPP-RTK / VRS-RTK engine |
| Japan Aerospace Exploration Agency | MALIB — MADOCA-PPP structural base |
| TOSHIBA ELECTRONIC TECHNOLOGIES | MALIB + MADOCALIB — MADOCA-PPP engine and L6E/L6D decoder |
| Cabinet Office, Japan | MADOCALIB — PPP/PPP-AR positioning algorithms |
| Lighthouse Technology & Consulting | MADOCALIB — system integration and L6E/L6D decoder |
For detailed licensing information, please refer to LICENSE.
Kinematic (geodetic). The PPC-Dataset (Precise Positioning Challenge 2024), kindly released as open data by:
Taro Suzuki, Chiba Institute of Technology https://github.com/taroz/PPC-Dataset
Smartphone (SPP). The Google Smartphone Decimeter Challenge 2023 (GSDC-2023), released on Kaggle by Google for the ION GNSS+ conference and used here under the Kaggle competition rules:
https://www.kaggle.com/competitions/smartphone-decimeter-2023
See docs/reference/benchmark.md (kinematic) and docs/reference/benchmark-gsdc.md (smartphone) for usage instructions.