Download
Because it is now possible to install the GAMERA python package with pip, a direct download is only required if you want to use the C++ library, or to develope the code.
GAMERA is available on github. There, you can download a zip archive with the source code or clone it with git via
$ git clone https://github.com/libgamera/GAMERA.git
Installation
Dependencies
Apart from a C++ compiler (e.g. using
g++ on Linux or clang on Mac) and cmake, you need to install the following dependencies:
- the GNU scientific library
gsl - python (including the headers) for
GAPPA pkg-config
On many systems these packages are already installed by default, otherwise they can be installed in the following way:
On Linux:
$ sudo apt install libgsl-dev pkg-config cmake g++
On later versions of the operating system, it might be necessary to additionally install, e.g.,
libgsl2 or libgsl23.
On MacOS:
many repositories provide gsl, for example homebrew:
$ brew install gsl
It might also be required to install pkg-config. Installation instructions can be found e.g. here.
Building: python
Compilation
The python package (GAPPA) can now easily be installed via pip, without the need to download anything beforehand:
$ pip install git+https://github.com/libgamera/GAMERA
Usage
In your python script, just import the gappa package, for example like this:
import gappa as gp
Building: C++
Compilation
To build the C++ library, you first need to download the source code, as described on the Download-section above.
Then, go to the base GAMERA directory and run
$ cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local/gamera
$ cmake --build build
$ cmake --install build
This will create the shared object build/lib/libgamera.so which can be used in C++ programs.
Usage
If you are using cmake in your project, you simply can use the command find_package(GAMERA) in your
CMakeList.txt file.
Otherwise, to use the library in you program, compile like e.g.:
$ g++ -o yourProgram yourProgramSource.C -lgamera -L~/.local/gamera/lib -I~/.local/gamera/include
Also, it might be necessary to export the lib directory to LD_LIBRARY_PATH, e.g.:
$ export LD_LIBRARY_PATH=~/.local/gamera/lib:$LD_LIBRARY_PATH