Skip to content

A template for c++ projects which import obscura and libphysica, set up with cmake, travis CI, googletest, and codecov.

License

Notifications You must be signed in to change notification settings

temken/template_cpp_cmake_obscura

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status codecov License: MIT

SOFTWARETITLE

A template for C++ projects using obscura.

General notes

Repository content

The included folders are:

  • bin/: This folder contains the executable after successful installation together with the configuration files.
  • data/: Contains additional data necessary for the simulations, e.g. the solar model tables.
  • external/: This folder will only be created and filled during the build with CMake and will contain the obscura library necessary for all direct detection computations.
  • include/: All header files of SOFTWARETITLE can be found here.
  • results/: Each run of SOFTWARETITLE generates result files in a dedicated sub-folder named after the run's simulation ID string, which is specified in the configuration file.
  • src/: Here you find the source code of SOFTWARETITLE.
  • tests/: All code and executable files of the unit tests are stored here.

Getting started

1. Dependencies

Before we can install SOFTWARENAME, we need to make sure that a few dependencies are taken care of.

  • CMake: SOFTWARENAME as well as the libraries libphysica and obscura are built with CMake.
  • boost: For numerical integration (used by libphysica).
  • libconfig: For the configuration files, SOFTWARENAME uses the libconfig library (required version at least 1.6). This will be installed by libphysica, if it is not already installed.
  • libphysica: Automatically downloaded to /external/obscura/external/, compiled, and linked by CMake.
  • obscura: Automatically downloaded to /external/, compiled, and linked by CMake.
Installation of boost

>brew install boost

or alternatively with APT:

>sudo apt-get install libboost-all-dev

Installation of libconfig

This installation is optional, since `libphysica` will install it automatically, if it is not available.

On Macs, it can be on installed using homebrew

>brew install libconfig

or using APT on Linux machines

>sudo apt-get update -y
>sudo apt-get install -y libconfig-dev

Alternatively, it can be built from the source files via

>wget https://hyperrealm.github.io/libconfig/dist/libconfig-1.7.2.tar.gz
>tar -xvzf libconfig-1.7.2.tar.gz
>pushd libconfig-1.7.2
>./configure
>make
>sudo make install
>popd

2. Downlad & Installation

The SOFTWARENAME source code can be downloaded by cloning this git repository:

>git clone https://github.com/temken/SOFTWARENAME.git 
>cd SOFTWARENAME

The code is compiled and the executable is created using CMake.

>cmake -E make_directory build
>cd build
>cmake -DCMAKE_BUILD_TYPE=Release -DCODE_COVERAGE=OFF ..
>cmake --build . --config Release
>cmake --install .

If everything worked well, there should be the executable SOFTWARENAME in the /bin/ folder.

3. Usage

Once SOFTWARENAME is installed, it can run by running the following command from the */bin/* folder:

>./SOFTWARENAME config.cfg

Version History

  • xx.xx.20xx: Release of version 0.1.0

Everything else

Citing SOFTWARENAME

If you decide to use this code, please cite the latest archived version,

Emken, T., 20xx, SOFTWARENAME [Code, v0.1.0], Astrophysics Source Code Library, record [ascl:xxxx.xxx], [DOI:10.5281/zenodo.xxxxxxx]

Bibtex entry:

@software{SOFTWARENAME,
  author = {Emken, Timon},
  title = {{SOFTWARENAME [Code, v0.1.0]}},
  year         = {20xx},
  publisher    = {Zenodo},
  version      = {v0.1.0},
  doi          = {DOI:10.5281/zenodo.xxxxxxx},
  url          = {https://doi.org/10.5281/zenodo.xxxxxxx},
  howpublished={Astrophysics Source Code Library record \href{https://ascl.net/xxxx.xxx}{[ascl:xxxx.xxx]}. The code can be found under \url{https://github.com/temken/SOFTWARENAME}. Version 0.1.1 is archived as \href{https://doi.org/10.5281/zenodo.xxxxxxx}{DOI:10.5281/zenodo.5957388}}
}

Author & Contact

The author of SOFTWARENAME is Timon Emken.

For questions, bug reports or other suggestions please open an issue.

License

This project is licensed under the MIT License - see the LICENSE file.

About

A template for c++ projects which import obscura and libphysica, set up with cmake, travis CI, googletest, and codecov.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published