- (C++) C++ Compiler ( g++ or clang++ )
- (C++) cmake (optional but recommended)
- (Python) Python 3.0+
- (Python) pytest
Python packages can be easily and conveniently installed using pip
via the command line like so:
$ python3 -m pip install {package_name}
In the case of algos
, all Python dependencies can be installed in one command using the requirements.txt file as so:
$ python3 -m pip install -r requirements.txt
This repository can be built as a cmake
project or can be used with the standalone C++ scripts.
The following are the steps to compile the C++ portion of this repostiory with cmake
(starting from the base of the repository):
$ mkdir build
$ cd build
$ cmake ../src/
$ make
The last 2 commands can be optionally run with the -j
flag for multithreading. For example:
$ make -j4
If you are unfamiliar with / don't want to use cmake
, there are standalone C++ scripts that can be quickly compiled and run with a simple call to g++ or clang++. These scripts can be found at: src/cpp/standalone
.
Each standalone script is accompanied by a bash
script that:
- Calls g++ to compile standalone and implementation scripts
- Calls executable
- Deletes executable
One can replace "g++" with "clang++" in the bash
scripts if desired.
These bash
scripts use an environment variable ALGOS
that points to the src
directory of this repository. This variable can be easily set with the export
command. For example:
$ export ALGOS=/home/alfonso/pub/algos/src
Once the ALGOS
environment variable is set, one can run the bash scripts from any directory. For example, from the base of this repository:
$ ./src/cpp/standalone/reverse_string_run.sh
13
astrodynamics
scimanydortsa
Both the C++ and Python portions of this repository have unit tests implemented. The C++ portion uses GoogleTest and the Python portion uses pytest
.
After compiling, one can simply run the unit tests with the ctest
command (with optional flags)
$ ctest -j4 -V # V for verbose output, if desired
The Python unit tests in this repository can be run exactly the same as in the Astrodynamics with Python repository:
$ python3 -m pytest src/py/ -vv
$ pytest src/py/ -vv