astrotypes  0.0
installation

Installation

Header Only Library

astrotypes is a header only library and so installation is a case of using #include directives and setting the -I option on your compiler to point to the astrotypes headers install location. Note that the dependencies will also need to be installed.

Example: including astrotypes using git subtrees

If you are using git to mamange your repository one of the many strategies available is called subtrees. Although we provide a subtree example we do not necessarily condone its use. Each stategy has its own merits and compromises and the user should satisfy themselves as to the most appropriate one for their project.

From the top level of your project, create a directory for putting in thirdparty dependencies.

1 mkdir thirdparty

Now use git subtrees to install astrotypes

1 git subtree add --prefix thirdparty/astrotypes https://github.com/PulsarSearchSoft/astrotypes.git master --squash

Any time you need to update the version of astrotypes you can use:

1 git subtree pull --prefix thirdparty/astrotypes https://github.com/PulsarSearchSoft/astrotypes.git master --squash

The only thing left to do is to update your build system so that your thirdparty directory, and the required dependencies are added to the include path.

Building the unit tests and examples: cmake

Cmake is a widely used, platform and toolchain agnostic build tool. One of the features of cmake is that it provides out of source builds so you don't mix up build products (libraries, binaries, etc) from the source code. This is very powerful in other ways, you may want to build the same source using different compilers and compare the results.

Configuring your build with cmake:

1 make

If you want to see whats going on under the hood you can run

1 make VERBOSE=1

Dependencies

Boost

Boost Website: https://www.boost.org

This project requires the boost_units library. You can use your local, or system installation of boost libs for this, however for convenience we also provide a packaged version of boost_units (and its dependencies) in the thirdparty directory of this repository.

By default the cmake for building the tests and examples will look for boost in the following order:

If you wish to force the use of the thridparty packaged version add the flag -DUSE_THIRDPARTY_BOOST=true to ignore any boost versions installed on the system. Note that boost units is a header-only library and does not need to be built.

Cmake Variable Description
USE_THIRDPARTY_BOOST Force the use of the packaged boost version, ignoring any installed boost versions (default: false)
Boost_LIBRARY_DIRS Explicitly specify a directory where the boost libraries reside
Boost_INCLUDE_DIRS Explicitly specify a directory where the boost header files reside
Boost_ROOT Explicitly specify a directory where the boost distiburion resides