Installation on MacOS
For Mac OS X, we provide a 64-bit binary
.dmg installer for Maverick (10.9) or above and also support build and installation from source.
The rest of this section explains how to install BornAgain using
BornAgain graphical user interface doesn't require any additional libraries to be installed on the system. You can start using BornAgain application right after the installation. However, to use the framework via scripting you have to have Python framework installed and configured as explained in the following sections.
To install and run BornAgain for the first time proceed with the following steps:
BornAgain installer can be downloaded from here. After downloading the installer, double click
.dmg file to mount it, accept the license agreement and then drag the BornAgain icon onto the Applications shortcut icon.
Depending on your system's security settings you might not be able to open BornAgain directly from the launchpad. In this case you will have to proceed first with the instruction Open an app from an unidentified developer.
To be able to use BornAgain framework via Python scripting
python-2.7, matplotlib, numpy must be installed on the system. This set of packages is known as SciPy stack and for most users the easiest way to install it, is to download one of free Python distributions, which includes all the key packages. The list of possible options is given on SciPy installation site. We have tested Anaconda Python Distribution and suggest to use it if you do not have any other preferences.
For Homebrew users:
$ brew install homebrew/python/matplotlib numpy
For MacPorts users:
$ sudo port install py27-matplotlib py27-numpy $ sudo port select --set python python27
To make your Python installation aware of BornAgain API you have to install the BornAgain core libraries into
site-packages of your Python. This should be done by running the
bornagain_install_python.py script from application bundle. Assuming that BornAgain is installed in the
/Applications/BornAgain.app folder, launch the Terminal application and run the following command
$ python /Applications/BornAgain.app/Contents/libexec/BornAgain-1.9/bornagain_python_install.py
The install script will install the BornAgain core libraries into site-packages of given Python interpreter. Check that the installation went successfully by typing
$ python -c "import bornagain"
If your prefer to install the BornAgain core libraries not to the site-packages folder of your Python interpreter, but to a custom folder, check the following instruction.
Run Graphical User Interface.
Use BornAgain icon from launchpad to start GUI.
Run Python Example.
Run an example from BornAgain installation directory by typing in the terminal
$ python /Applications/BornAgain.app/Contents/share/BornAgain-1.9/Examples/python/simulation/ex01_BasicParticles/CylindersAndPrisms.py
You should immediately see a scattering image appearing on the screen.