For Mac OS X, we provide a 64-bit binary .dmg installer, and also support build and installation from source. To build BornAgain from source by yourself follow the build instructions for Unix section.
The rest of this section explains how to install BornAgain using the
The BornAgain graphical user interface doesn’t require any additional libraries to be installed on the system. You can start using the BornAgain application right after the installation. However, to use the framework via scripting you have to have a 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:
The BornAgain installer can be downloaded from https://bornagainproject.org/ext/files/latest/BornAgain-1.19.0-python3.9-macosx.dmg.
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, search Apple help pages for something like “Open a Mac app from an unidentified developer”.
At this point you can can already start working with the BornAgain GUI. The rest of tutorial explains how to setup BornAgain for Python.
The current version of BornAgain requires
python, matplotlib, numpy to be installed on the system. This set of packages is known as the SciPy stack and for most users the easiest way to install it is to download one of the free Python distributions, which includes all the key packages. The list of possible options is given on the SciPy installation website. You can also directly install Python from their main website Python and then use
pip to install
numpy as detailed on the SciPy installation website.
For Homebrew users:
$ brew install python3 $ pip3 install matplotlib numpy
For MacPorts users (assuming Python version 3.6)
$ sudo port install py36-matplotlib py36-numpy $ sudo port select --set python python36
To make your Python installation aware of BornAgain, you have to install the BornAgain
libraries into the
site-packages of Python.
This can be done by using the Python package (‘wheel’) included in the application bundle.
Assuming that BornAgain is installed in the
/Applications/bornagain.app folder, launch
the Terminal application and run the following command (note that the location and name
of the wheel depends on the BornAgain and Python versions and the platform):
$ python3 -m pip install /Applications/bornagain.app/Contents/python/3.9/wheel/BornAgain.whl
For further options, see the official pip’s documentation.
Finally, verify that the installation by typing
$ python -c "import bornagain"
If no error is displayed, the installation was successful.
Use BornAgain icon from the Launchpad to start GUI.
Run an example from BornAgain installation directory by typing in the terminal.
$ python /Applications/BornAgain.app/Contents/share/BornAgain-git-main/Examples/scatter2d/CylindersAndPrisms.py
You should see a scattering image appearing on the screen.