Create Getting AUSAlib authored by Erik Asbjørn Mikkelsen Jensen's avatar Erik Asbjørn Mikkelsen Jensen
# Stkernfys
If you are working on stkernfys.phys.au.dk then all tools are already installed.
# Supported operating systems
This guide assumes that you are using Ubuntu or OSx.
* __Ubuntu__: On Ubuntu we use the standard `apt-get` package manager.
* __OSX__: We have tested the installation using [homebrew](https://brew.sh). To install run the following command:
`/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
# Installation of AUSAlib
Linux/OSX
-----------------------
For OSX there is a simpler way below.
1. Install ``git``
It is most likely already installed. Run `git --version` to check. If it is not installed, run
* __Ubuntu__:`sudo apt-get install git cmake`
* __OSX__:`brew install git`
2. Get CMake
* __Ubuntu__:`sudo apt-get install cmake`
* __OSX__:`brew install cmake`
3. Add your ssh key to you gitlab profile
1. (if you already have a ssh key skip this)
`ssh-keygen -t rsa -C "<your_email>"`
2. Copy the output from
`cat ~/.ssh/id_rsa.pub`
3. Insert it here
https://gitlab.au.dk/profile/keys
4. In the parent directory to where you want AUSAlib
`git clone git@gitlab.au.dk:ausa/ausalib.git`
5. cd into ausalib
`cd ausalib`
6. switch to latest edition
`git checkout master`
7. Build a makefile for AUSAlib
- Without Python bindings: `cmake ./`
- With `cmake ./ -DPYTHON_BINDINGS=ON`
8. Build AUSAlib.
`make -j 4`
You will now have a libAUSA.a
9. You install AUSAlib two ways
* __System wide install:__ If you want the headers copied to `/usr/local/include` and the library to `/usr/local/lib` i.e. where to compiler normally looks for this `sudo make install`
* __Local install:__ Here you must define the two environment variables `AUSALIB_INC_DIR` the AUSAlib include directory and `AUSALIB_LIB_DIR` to the location of `libAUSA.a`. A convenient way to do this is to add the following lines to you `~/.bashrc` or `~/.profile`
```
export AUSALIB_INC_DIR=<path to ausalib>/ausalib/include
export AUSALIB_LIB_DIR=<path to ausalib>/ausalib/build
```
__OSX__: OSX users should add it to `~/.profile` and NOT to `~/.bashrc`
10. Export the resource directory environment variable, `AUSALIB_RES_DIR`. This can also conveniently be added to `~/.bashrc` or `~/.profile`:
```export AUSALIB_RES_DIR=<path to ausalib>/ausalib/res```
**OBS: When you pull AUSAlib remember to cmake ./**
OSX
--------------------
Here we will install AUSAlib using our homebrew formula. You will however __not__ have the actual code available so if you need to develop on AUSAlib you should use the method above.
0. Add the science tap (collection of scientific programs)
`brew tap homebrew/science`
1. Add the AUSA tap (collection of formulas to you homebrew)
`brew tap AarhusSubatom/tap`
2. Install AUSAlib
* ROOT 5: `brew install ausalib`
* ROOT 6: `brew install ausalib --with-root-6`
* If you have installed ROOT by other means than homebrew, then you need to specify `--ignore-dependencies`.
3. Done
\ No newline at end of file