Bmad toolkit (library) for the simulation of charged particles and X-rays in accelerators and storage rings. This is the primary repository for the various libraries and programs that comprise the Bmad ecosystem. For details, see the Bmad website at https://www.classe.cornell.edu/bmad/.
- Bmad manual
- Tao manual
- Bmad & Tao tutorial
- Long_term_tracking program manual
- Manuals for other Bmad-based programs
Bmad can be installed pre-compiled or from source. Detailed unstructions at https://wiki.classe.cornell.edu/ACC/ACL/OffsiteDoc.
The simplest way to install Bmad is from conda-forge. For the regular Bmad (OpenMP enabled), install the latest version using:
conda install -c conda-forge bmad
For the MPI-enabled code, install the latest version using:
conda install -c conda-forge bmad="*=mpi_openmpi*"
This will add all of the appropriate executables to the environment's PATH.
If you want to compile Bmad directly, download a Release (or click on link on right hand side of this page and download the bmad_dist.tar.gz file. ignore the source code files)) and follow the setup instructions at https://wiki.classe.cornell.edu/ACC/ACL/OffsiteDoc.
Developers should clone this repository, as well as the external packages repository:
git clone https://github.com/bmad-sim/bmad-ecosystem.git
git clone https://github.com/bmad-sim/bmad-external-packages.git
The external packages repository is simply a set of libraries needed by Bmad.
cd bmad-ecosystem
rm ../bmad-external-packages/README.md # Do not copy this file
cp -r ../bmad-external-packages/* .
If this is the first time, follow the setup instructions at https://wiki.classe.cornell.edu/ACC/ACL/OffsiteDoc. Otherwise if the environment has been setup, to build do:
cd bmad-ecosystem
source util/dist_source_me
util/dist_build_production
In order to build Bmad without building each dependency one-by-one, you can use conda to create an environment with all of the necessary build tools and dependencies.
First, create a build environment:
conda create -n bmad-build -f .github/bmad-build-env.yaml
conda activate bmad-build
This is the same environment used in GitHub Actions continuous integration.
Next, in util/dist_prefs
:
- Set
ACC_CONDA_BUILD
toY
- Set
ACC_CONDA_PATH
to$CONDA_PREFIX
- Set
ACC_PLOT_PACKAGE
topgplot
(ornone
if desirable) - For PyTao usage, ensure
ACC_ENABLE_SHARED
is set toY
(if applicable)
Then:
source util/dist_source_me
util/dist_build_production
# or util/dist_build_debug
What is a Pull Request? A Pull Request (PR) is a mechanism for requesting that changes that you have made to a copy of this repository (bmad-sim/bmad-ecosystem) are integrated (merged) into this repository.
The main branch of bmad-ecosystem is the central branch where all changes are merged into.
Pull Requests start with changes you have made to a branch that is not main. The PR is then a request for the changes you have made to be merged with main.
Your copy of the bmad-ecosystem repository can be a fork or simply a clone. Note: The procedure for creating a PR when using a fork is somewhat different than when using a clone.