PhoSim Tutorial 1: How to Get and Download PhoSim

Getting the Code

To obtain the PhoSim package, download a tarball from https://bitbucket.org/phosim/phosim_release/downloads?tag=tags. These are the stable versions. Generally, choose the most recent one. The major releases (twice a year) are labelled vX.Y and the intermediate patches and bug fixes are labelled vX.Y.Z. Unpack the tarball in the usual manner, e.g. 


tar xzf phosim-phosim_release-XXXX.tar.gz


[Alternatively, you can download the entire git tree and use git commands as normal (only recommended if you are familiar with git). The master branch is configured to be the most recent stable version (git checkout master) of the major releases. To get a particular version, you can use git checkout vX.Y.Z. You will want to use git pull and git pull --tags routinely. Generally, the revisions between the tags are not stable or tested, so it is probably simpler just to stick to the method above, but if you are very comfortable with git, this is an option.]


Installing PhoSim

PhoSim can be installed on virtually any operating system. It is routinely tested on both Mac OS (BSD Linux) and many different Linux installations. It can even be installed on Windows systems via CygWin. Given the large user base and its lightweight design philosophy, PhoSim should be able to work on any system with minimal effort. Please file a ticket, if there is any problem.

Once the directory hierarchy is in place, the package is installed via:


./configure


The configure script provides an option of installing cfitsio and fftw. This is the recommended option.  Alternatively, you can provide paths to existing installations for PhoSim to point to a specific installation.  Additionally, you may need to install tkinter in order for the GUI to function, but the GUI is optional and not required.



The output should look something like this:



-------------------------------

Welcome to the Photon Simulator

-------------------------------

 

Operating system: Darwin

local: /usr/local /usr


 

Setting up python.

 

The photon simulator requires the installation of cfitsio and fftw3.

If you use existing installations, they should be reasonably up to date to ensure compatibility.

Would you like to have this script: (a) install these from source, (b) look for existing installations, or (c) specify the paths by hand? 


Then to compile, PhoSim simply do:


make


Generally, there should be minimal warnings and a successful compilation with the message "The Photon Simulator has been compiled successfully!". PhoSim does require a somewhat recent c++ compiler that has support for c++14 (usually e.g. g++ > 5.0). At runtime PhoSim will also require python >= 2.6 for the multiprocessing module.


Generally, there should be minimal warnings and a successful compilation should end with something like this:


The Photon Simulator has been compiled successfully!

 

Type "phosim_gui" or "phosim" to begin!


If your installation is successful, please proceed to another tutorial to begin using PhoSim!