CosmoBox
Development environments with recent gfortran (gcc 6/7/8), MPI, OpenBLAS, python, key python modules and LaTeX
New: updated December 2019


CosmoBox is a configured virtual development environment, with everything you need to use latex and build and debug in Fortran 2008/2013, for use with CAMB, CosmoMC, and many other programs. Files that you work on are stored on your local machine, so you can use your local editor, download large data files, etc, without having to put them inside the virtual environment. There are three main flavours of CosmoBox depending on what you want

CosmoBox Desktop

A tool called
Vagrant can be used to quickly run virtual machines boxes, with your local directory visible inside ready for compilation and running. CosmoBox is supplied as a Vagrant image that can be downloaded and run using standard Vagrant methods. To get started You can then use the terminal to compile and run, run the CodeBlocks IDE by clicking on the icon, or running other graphical interfaces like the GetDist GUI from your local path (e.g. assuming your ran "vagrant up" from the cosmomc directory on your local machine, run "python /vagrant/python/GetDistGUI.py").

For further help with Vagrant see Getting Started (for example you may want to change the default memory/CPU configuration by editing the produced Vagrantfile).

Alternatively, you can Download the CosmoBox virtual machine image and load it in VirtualBox directly. This is convenient if you want to make customizations or store data in the virtual machine, but you'll have to set up your own shared folders as needed to access you local machine (and access them from ubuntu under /media/).

Configuration

Current configuration is based on

The password and username is ubuntu. For full details, the Packer scripts for building the virtual machine are available on GitHub.

CosmoBox Docker

Docker is a way of quickly download and running virtual environments, with a simple automated build system for new images. The CosmoBox Docker image has a recent source build of gcc 7, plus other useful dependencies and tools for running cosmology programs. On Linux, Docker does not require running a virtual machine, as it uses the same kernel. On Windows and Mac, in practice it uses VirtualBox. To install and get running: At the command line, make a virtual environment and command line for building and compiling simply by running
docker run -v /local/code/source:/virtual_path -i -t cmbant/cosmobox /bin/bash
In the virtual shell you can "cd /virtual_path", and you should see your host system files under /local/code/source, and you can then run "make" etc to build and run them. On Windows you may need to use -v /c/Users:/c/Users, and then find your files in docker under /c/Users/.

It works well with OpenMP and MPI for testing (depending on how many cores you have on your machine). Additional data files that you want to install and access from within the docker container should be installed on your machine somewhere under /local/code/source.

See Docker CosmoBox on Docker Hub for the configuration of the machine. You could easily make your own images based off cmbant/cosmobox (or the small cmbant/docker-gcc-build) if you want to make a customized environment with other things pre-installed.

To run stable gcc6 version rather than latest gcc7, use cmbant/cosmobox:gcc6, or try gcc8 and devel for more recent versions. If you also want astropy, healpy, camb and jupyter installed, get cmbant/cosmologist, which adds a couple of layers on top of CosmoBox.

CosmoBox AMI and CosmoCluster

These are a bit less up to date. Amazon Web Services (EWS) provides a way to run virtual machines in the cloud; see What is EC2 for an introduction. By using a CosmoBox image you can easily compile and test code on a free micro instance, or fire up a production cluster as large as you like by using StarCluster. To get started