Local installation: macOS and Linux
Everything installs under .bsat_local/ inside the repository folder, or under the folder named by the BSAT_LOCAL_DIR environment variable if it is set. Nothing touches system directories, shell configuration files or package managers; PATH changes are made inside each script and discarded when it exits.
Disk space: about 4 to 6 GB. First run: 10 to 30 minutes, depending on network speed.
Prerequisites
- macOS 12 or later, or a current Linux distribution (x86_64 or aarch64).
bash,curlandtaron yourPATH(pre-installed on macOS and most Linux distributions).- No administrator or
sudorights.
Step 1: get the repository
git clone https://github.com/BSAT-team/BSAT.git
cd bsatIf you downloaded BSAT as a ZIP file instead (the green “Code” button on the repository page, then “Download ZIP”), unpack it, open your terminal application (macOS: Applications > Utilities > Terminal, or search “Terminal” in Spotlight; Linux: your usual terminal application) and cd into the unpacked folder. If the execute bit was stripped from the scripts:
chmod +x scripts/*.shStep 2: bootstrap
From the repository root:
scripts/bootstrap_unix.shThe script:
- Detects the platform (Linux x86_64, Linux aarch64, macOS Intel, macOS Apple Silicon).
- Downloads micromamba 2.8.1 to
.bsat_local/bin/. - Creates the
bsatconda environment at.bsat_local/envs/bsatfromsetup/environment.yml(R 4.5 and the pipeline’s R packages). Required. An existing environment with another R version is recreated. - Downloads Julia 1.12.1 to
.bsat_local/julia/. - Runs
Pkg.instantiate()andPkg.precompile()forcode/model/Project.toml(JuMP, PATHSolver, CSV, DataFrames and the rest of the manifest). - Creates the
bsat-dashboardconda environment at.bsat_local/envs/bsat-dashboardfromsetup/environment-dashboard.yml(Python 3.11, pandas, numpy, altair, streamlit). Optional: it is only needed to run the dashboard locally.
The two conda environments are separate on purpose. The model and the pipeline never needed Python; Streamlit pulls in pyarrow and libarrow, a large dependency tree that failed to extract on a locked-down Windows laptop. The bootstrap therefore creates the dashboard environment last, reports a failure there as a warning rather than an error, and finishes with “Bootstrap complete” either way. The hosted dashboard at https://huggingface.co/spaces/bsat-team/BSAT_Viz is the default way to view results, so the environment can be skipped:
scripts/bootstrap_unix.sh --no-dashboardEach environment is created in a fresh folder (a partial environment from an interrupted run is removed first). If creation fails, the script clears the package cache (micromamba clean -a and .bsat_local/mamba/pkgs) and tries once more. An environment counts as already present when conda-meta/history exists in its folder.
To install somewhere other than .bsat_local/, set BSAT_LOCAL_DIR before the bootstrap and before every run script:
export BSAT_LOCAL_DIR=$HOME/bsat_local
scripts/bootstrap_unix.shRe-running the script is safe: completed steps are skipped. Do not move or rename the repository folder afterwards; the environment records absolute paths (see Troubleshooting).
Step 3: add the PATH solver license
The PATH solver needs a free license string at run time.
Open https://pages.cs.wisc.edu/~ferris/path/LICENSE and copy the string in the “Variable value” field.
Create the license file from the template:
cp code/model/path_license.txt.example code/model/path_license.txtEdit
code/model/path_license.txtand replace the placeholder line with the string. Lines starting with#and blank lines are ignored; the first other line is the license. Do not add quotes or extra spaces.
The runner reads this file at every start. It stops with a message if the file is missing, holds only comments, or still contains the placeholder.
Step 4: run the model
scripts/run_model_unix.shThe script checks that Julia and the license file exist, creates the output folder, and runs code/model/run_model.jl on data/packages/baseline_2025_Input.zip for 2025 to 2034, writing output/baseline_Output.zip. It uses the portable Julia under .bsat_local/ when present and otherwise the julia on your PATH.
Arguments, all optional and positional:
scripts/run_model_unix.sh [Input.zip] [Output.zip] [years]
scripts/run_model_unix.sh output/my_case_Input.zip output/my_case_Output.zip 2025:2034Progress and the PATH solver log print to the terminal and are also stored in SCENARIO_SOLVER_LOG.txt inside the output package. A ten-year run takes about two minutes.
Step 5: rebuild the inputs (optional)
scripts/run_r_pipeline_unix.shRuns Rscript main.R from code/processing/ inside the bsat environment. The pipeline rebuilds data/processed/*.csv and data/packages/baseline_2025_Input.zip from data/raw/. Two raw files are too large for the repository; see Raw data sources and scripts/fetch_large_raw_data.sh.
Step 6: run the dashboard locally (optional)
The dashboard is hosted online (Dashboard), which needs nothing installed. The hosted copy is the recommended way to view results and accepts output packages produced locally just as it does any other. The script below is only for running the dashboard server on your own computer; it needs the bsat-dashboard environment (bootstrap without --no-dashboard):
scripts/run_dashboard_unix.shThis runs streamlit run app.py from code/visualization/ inside the bsat-dashboard environment (.bsat_local/envs/bsat-dashboard, then $BSAT_DASHBOARD_ENV, then /opt/envs/bsat-dashboard in the container). Open http://localhost:8501 and upload one or two output packages. If the environment is absent, the script says so and prints the hosted URL; rerun the bootstrap to create it.
Notes
- The scripts derive the repository path from their own location, so they can be run from any working directory.
- All scripts honor
BSAT_LOCAL_DIR; when it is unset they use.bsat_local/inside the repository. - To reset the environment completely, delete
.bsat_local/(or theBSAT_LOCAL_DIRfolder) and rerunscripts/bootstrap_unix.sh. This does not affect your code, data orpath_license.txt. - To verify the installation end to end, run the model regression test (about four minutes):
julia --project=code/model code/model/test/runtests.jl.