Deployment for Mac Os X » History » Version 7

« Previous - Version 7/15 (diff) - Next » - Current version
pospelov, 29 Jan 2015 15:15


Deployment for Mac Os X

Structure of the Mac Os X bundle.

For mac os x users BornAgain can be distributed as a mac os x bundle packed into the dmg package. Mac os x bundle for BornAgain has the following structure:

BornAgain.app
|-- Contents
|---- Frameworks
|     > Qt libraries
|---- MacOs
|     > BornAgain GUI (executable)
|---- Resources
|     > Application icon
|---- PlugIns
|     > Qt plugins
|---- bin
|     > links to executable scripts
|---- include
|     |-- BornAgain-0.9
|         > all our headers
|---- lib
|     |-- BornAgain-0.9
|     |   > libBornAgainCore, libBornAgainFit
|     |-- ThirdParty
|     |   > boost and Co
|     |-- LibPython
|         > libpython2.7.dylib
|---- libexec
|     |-- BornAgain-0.9
|         > executable modules
|---- share
|     |-- BornAgain-0.9
|         > examples, icons

How to install BornAgain from dmg package

Step 1: double click on the dmg package to unpack it.
Step 2: accept the license agreement.
Step 3: drag the BornAgain app to the Applications folder (or any other folder where do you like to have it)
Step 4: double click on the BornAgain app to run it.

You may also skip the step 3 and run BornAgain app directly from the package.

How to install libBornAgainCore, LibBornAgainFit libraries into your Python

It is possible now to install libraries which came with BornAgain.app bundle into site-packages of your Python.

To do it run

sudo python /Applications/BornAgain.app/Contents/libexec/BornAgain-0.9/bornagain_python_install.py

and follow the instructions. 'sudo' is necessary if you want to place BornAgain libraries in python located in /opt/local.
If it is Anaconda Python, which resides normally in /Users/yourname/anaconda, the command will be

~/anaconda/bin/python /Applications/BornAgain.app/Contents/libexec/BornAgain-0.9/bornagain_python_install.py

How to create dmg package

1. Before you build BornAgain, ensure that you do not have the 'library ambiguity'. If you have installed BornAgain libraries, they should not be in the DYLD_LIBRARY_PATH.
2. run cmake with an option -DBORNAGAIN_APPLE_BUNDLE=ON

cmake -DROOT_SUPPORT=OFF -DBORNAGAIN_GUI=ON -DCMAKE_PREFIX_PATH=/opt/bornagain -DBORNAGAIN_APPLE_BUNDLE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../installed ../source

3. make -j4
4. cpack or cpack -V (if you want it verbose)
5. Rename: mv BornAgain-1.0.0-macosx64.dmg into BornAgain-1.0.0-macosx64-10.9+.dmg

cpack calls fixup_bundle utility which copies libraries to the bundle and calls install_name_tool to fix the path coded inside the library file.

dmg package created on Maverics will work only on mavericks. To deploy for other target system is also possible, but in this case all the libraries on which BornAgain depends must be recompiled.