Skip to content

Commit

Permalink
Unify READMEs and travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Ithanil committed Feb 24, 2019
1 parent 3c5d5af commit 20a5c45
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 9 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ before_install:
fi;
echo "CXX_COMPILER=${MYCXX}" >> config.sh;
echo "CXX_FLAGS=\"-O0 -g -Wall -Wno-unused-function ${configopt}\"" >> config.sh;
if [[ "$USE_GCOV" == "TRUE" ]]; then echo "USE_COVERAGE=1" >> config.sh;
if [[ "$USE_GCOV" == "TRUE" ]];
then echo "USE_COVERAGE=1" >> config.sh;
else
echo "USE_COVERAGE=0" >> config.sh;
fi;
Expand All @@ -64,15 +65,15 @@ script:
- |
if [[ "$USE_DOCKER" == "TRUE" ]]; then
if [[ "$USE_GCOV" == "TRUE" ]]; then
docker run -it -v $(pwd):/root/repo nnvmc/base /bin/bash -c "cd /root/repo/test && ./run.sh";
docker run -it -v $(pwd):/root/repo nnvmc/base /bin/bash -c "cd /root/repo/build && make test";
docker run -e TRAVIS=$TRAVIS -e TRAVIS_JOB_ID=$TRAVIS_JOB_ID -it -v $(pwd):/root/repo nnvmc/base /bin/bash -c "pip install cpp-coveralls && cd /root/repo/build && coveralls --verbose -b ./ -r ../ -i include -i src -x .cpp -x .hpp --gcov-options '\-lp'";
else
docker run -it -v $(pwd):/root/repo nnvmc/base /bin/bash -c "cd /root/repo/test && ./run.sh";
fi;
else
if [[ "$USE_GCOV" == "TRUE" ]]; then
cd build && make test && cd .. ;
pip install --user cpp-coveralls && cd build && coveralls --verbose -b ./ -r ../ -i include -i src -x .cpp -x .hpp --gcov-options '\-lp';
cd build && make test;
sudo pip install cpp-coveralls && coveralls --verbose -b ./ -r ../ -i include -i src -x .cpp -x .hpp --gcov-options '\-lp' && cd .. ;
else
cd test && ./run.sh && cd .. ;
fi;
Expand Down
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,37 @@

C++ Library for minimising noisy functions, such as integrals computed with the Monte Carlo method.

In `doc/` there is a user manual in pdf.
In `doc/` there is a user manual in pdf and a config for doxygen.

In `examples/` there are several examples.
In `examples/` and `test/` there are examples and tests for the library.


Some subdirectories come with an own `README.md` file which provides further information.


# Supported Systems

Currently, we automatically test the library on Arch Linux (GCC 8) and MacOS (with clang as well as brewed GCC 8).
However, in principle any system with C++11 supporting compiler should work.


# Requirements

- CMake, to use our build process
- (optional) valgrind, to run `./run.sh` in `test/`
- (optional) pdflatex, to compile the tex file in `doc/`
- (optional) doxygen, to generate doxygen documentation in `doc/doxygen`


# Build the library

We use the CMake build system, so you need to have it on your system to build the library out of the box.
Then copy the file `config_template.sh` to `config.sh`, edit it to your liking and then simply execute the command
Copy the file `config_template.sh` to `config.sh`, edit it to your liking and then simply execute the command

`./build.sh`

Note that we build out-of-tree, so the compiled library and executable files can be found in the directories under `./build/`.


# First steps

You may want to read `doc/user_manual.pdf` to get a quick overview of the libraries functionality. However, it is not guaranteed to be perfectly up-to-date and accurate. Therefore, the best way to get your own code started is by studying the examples in `examples/`. See `examples/README.md` for further guidance.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
mkdir -p build && cd build
cmake -DCMAKE_CXX_COMPILER="${CXX_COMPILER}" -DUSER_CXX_FLAGS="${CXX_FLAGS}" -DUSE_COVERAGE="${USE_COVERAGE}" ..

if [ "$1" == "" ]; then
if [ "$1" = "" ]; then
make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
else
make -j$1
Expand Down
3 changes: 3 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# LEGEND OF THE EXAMPLES

Make sure the examples are compiled, by running `./build.sh` in the project root folder.
Execute an example by switching into one of the example folders and running `./run.sh`.
Note that the actual example executables reside inside the `build/examples/` folder under the project's root.


## Example 1
Expand Down
3 changes: 3 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# LEGEND OF THE UNIT TESTS

Use `./run.sh` inside the test directory to run the check program and unit tests
with valgrind or use `make test` inside the build directory, to run unit tests without valgrind.


## Unit Test 1
Expand All @@ -25,6 +27,7 @@
`ut4/`: check the minimisation method DynamicDescent



## Unit Test 5

`ut5/`: check the minimisation method Adam

0 comments on commit 20a5c45

Please sign in to comment.