Installation
Prerequisites
VegasAfterglow requires the following to build:
Note
If you install via pip (recommended), you generally do not need to install these C++ tools manually. This section is primarily for users building the C++ library directly or installing the Python package from the source code.
C++20 compatible compiler:
Linux: GCC 10+ or Clang 13+
macOS: Apple Clang 13+ (with Xcode 13+) or GCC 10+ (via Homebrew)
Windows: MSVC 19.29+ (Visual Studio 2019 16.10+) or MinGW-w64 with GCC 10+
CMake 3.15+:
Required for building the python package from source
Build tools:
Make (GNU Make 4.0+ recommended) [if you want to compile & run the C++ code]
Python Installation
From PyPI (Recommended)
The easiest way to install VegasAfterglow is via pip:
pip install VegasAfterglow
This installs the core physics engine (light curves, spectra, jet models). To also install MCMC fitting support:
pip install VegasAfterglow[mcmc]
VegasAfterglow requires Python 3.8 or higher.
From Source
To install from source, first clone the repository:
git clone https://github.com/YihanWangAstro/VegasAfterglow.git
cd VegasAfterglow
Then, build and install:
pip install .
GitHub Repository
The source code is available on GitHub:
C++ Installation
For advanced users who want to compile and use the C++ library directly:
Clone the repository (if you haven’t already):
git clone https://github.com/YihanWangAstro/VegasAfterglow.git cd VegasAfterglow
Compile the static library:
make libThis allows you to write your own C++ problem generator and use the provided VegasAfterglow interfaces.
(Optional) Compile and run tests:
make tests
Requirements
Python 3.8 or higher
C++20 compatible compiler (for building from source)
NumPy (automatically installed when using pip)
For MCMC fitting:
pip install VegasAfterglow[mcmc](installs bilby, emcee, dynesty)
Interactive Web Tool
The interactive web tool is deployed across multiple global regions for low latency. If none of the servers provide a satisfactory experience from your location, you can run it locally for the best responsiveness:
# terminal 1: backend
cd webtool/backend
python3 -m venv .venv
source .venv/bin/activate
pip install -e '../..[webtool]'
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# terminal 2: frontend
cd webtool/frontend
cp .env.local.example .env.local
npm install
npm run dev
Open http://localhost:3000. For detailed deployment options, see webtool/README.md and webtool/DEPLOY.md.