IRBEM is built from Fortran source using a standardDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/PRBEM/IRBEM/llms.txt
Use this file to discover all available pages before exploring further.
make-based workflow. The process produces a shared library (libirbem.so on Linux/macOS, libirbem.dll on Windows) that any language interface can load, plus a static archive (liboneradesp.a) for direct Fortran/C linking. The steps below cover all three major platforms.
Prerequisites
Install gfortran from https://fortran-lang.org/learn/os_setup/install_gfortran or via your system package manager (apt, brew, etc.). Confirm the installation with:
git to clone the repository and make to drive the build.
Build and Install
- Linux
- macOS
- Windows
These instructions target a 64-bit Linux system using gfortran.
Compile the library
Run
make with the OS=linux64 and ENV=gfortran64 variables. This compiles all Fortran and C sources in the source/ directory and writes the resulting objects and library files to bin/.Install the library
The install step copies the compiled shared object and any wrapper support files to the expected locations within the IRBEM tree (including the To install to a custom directory, append Run
matlab/ directory).INSTALLDIR=/path/to/destination:make install.help to see all available install-time variables.After a successful build you will find
libirbem.so (shared) and liboneradesp.a (static) in the root of the IRBEM directory.Python Wrapper
The Python wrapper (python/IRBEM/IRBEM.py) uses ctypes to call the compiled shared library. Install it after completing the platform build above.
Install dependencies
The Python wrapper requires
numpy, scipy, and dateutil. Install them with your package manager or virtual environment tooling before proceeding.Install the IRBEM Python package
Change into the Use
python/ subdirectory of the cloned repository and install with pip:pip install --user -e . instead of -e . for a user-only install that does not require root privileges. This installs the IRBEM package (containing the MagFields and Coords classes) into your active Python environment.TS07d Optional Data Files
The Tsyganenko 2007 (TS07d / T07) magnetic field model requires a large set of external coefficient files (~8.5 GB, covering 2007–2016) that are not included in the repository.IRBEM will compile and run without the TS07d files. Only calls that explicitly select the T07 model (
kext=13) will be affected. If the tail parameter files are absent, the library returns bad-data fill values (-1e31) rather than raising a hard error.Set the data path environment variable
Choose a directory with at least 8.5 GB of free space and set:Add this line to your shell profile (e.g.,
~/.bashrc) to make it permanent.Run the setup script
From the root of the IRBEM directory, execute:This script downloads the coefficient archives (
all.tgz) and tail parameter file (TAIL_PAR.zip) from the JHU APL server, then unpacks them into the correct subdirectory structure under TS07_DATA_PATH.Cleaning the Build
To remove all compiled objects, library files, and executables from thesource/ and bin/ directories without affecting installed files: