diff --git a/.gitmodules b/.gitmodules index 558769d5dc..5a4e85a511 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "third_party/googletest"] path = third_party/googletest - url = git@github.com:google/googletest.git + url = https://github.com/google/googletest.git diff --git a/README.md b/README.md index 93b19e227e..38e7c7c528 100644 --- a/README.md +++ b/README.md @@ -2,23 +2,64 @@ *Have a look at docs/guidelines* -## build -`premake4 gmake -&& make -j && clear && ./build/BinOpossum` +## Dependencies +You can install the dependencies on your own or use the install.sh script which installs most of the following packages. -## lint (is also automatically triggerd before git commit) +The install script currently works with macOS (brew) and Ubuntu 16.10 (apt-get) + +### premake4 +install via homebrew / packet manager + +### boost (version: >= 1.61.0) +install via homebrew / packet manager + +### boost hana +this is part of boost since version 1.61.0 + +In case you are using an older boost version, you have to build it from source: + +http://www.boost.org/doc/libs/1_61_0/libs/hana/doc/html/index.html + +### compiler +install recent versions of compilers (clang >= 3.5.0 and/or gcc >= 6.1) via homebrew / packet manager + +### clang-format (version: >= 3.8) +install via homebrew / packet manager + +### python (version: 2.7) +install via homebrew (python2.7 is standard on macOS) / packet manager + +### gcovr (version: >= 3.2) +install via homebrew / packet manager + +### googletest +get via `git submodule update --init` + + +## Building and Tooling + +### compiler choice +You can specify the compiler via `premake4 --compiler=clang||gcc` + +On linux you have to utilize make's `-R` flag if your choice does not equal your default compiler + +### build +`premake4 && make -j && clear && ./build/BinOpossum` + +### lint (is also automatically triggerd before git commit) `premake4 lint` (Google's cpplint is used which needs python 2.7) -## format (is also automatically triggered with make) +### format (is also automatically triggered with make) `premake4 format` -## testing (is also automatically triggered before git commit) +### testing (is also automatically triggered before git commit) `premake4 test` executes all available tests -## coverage +### coverage `make -j coverage` will print a summary to the command line and create detailed html reports at ./coverage/index.html *Supports only clang on MacOS and only gcc on linux* -Naming convention for gtest macros: +## Naming convention for gtest macros: TEST(module_name_class_name, test_case_description), e.g., TEST(operators_get_table, get_output_returns_correct_table) @@ -27,20 +68,3 @@ If you want to test a single module, class or test case you have to execute the - Testing the storage module: `./build/TestOpossum --gtest_filter="storage*"` - Testing the table class: `./build/TestOpossum --gtest_filter="storage_table*"` - Testing the has_one_chunk_after_creation case: `./build/TestOpossum --gtest_filter="storage_table.has_one_chunk_after_creation"` - -# Dependencies - -## boost -install via homebrew / packet manager - -## Compiler -install recent versions of compilers (clang >= 3.5.0, gcc >= 6.1), required by hana. Using homebrew, you might have to deinstall gcc61 and install again. - -## boost hana -build from source: http://www.boost.org/doc/libs/1_61_0/libs/hana/doc/html/index.html - -## clang-format -install via homebrew / packet manager - -## googletest -get via git submodule update --init \ No newline at end of file diff --git a/install.sh b/install.sh new file mode 100755 index 0000000000..3e51948360 --- /dev/null +++ b/install.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +unamestr=$(uname) +if [[ "$unamestr" == 'Darwin' ]]; then + echo "Installing dependencies (this may take a while)..." + if brew update >/dev/null; then + # python2.7 is preinstalled on macOS + if brew install premake boost gcc clang-format gcovr; then + if git submodule update --init; then + echo "Installation successful" + else + echo "Error during installation." + exit 1 + fi + else + echo "Error during installation." + exit 1 + fi + else + echo "Error during installation." + exit 1 + fi +elif [[ "$unamestr" == 'Linux' ]]; then + if cat /etc/lsb-release | grep DISTRIB_ID | grep Ubuntu >/dev/null; then + echo "Installing dependencies (this may take a while)..." + if sudo apt-get update >/dev/null; then + if sudo apt-get install premake4 libboost-all-dev clang-format gcovr python2.7 gcc-6 clang; then + if git submodule update --init; then + echo "Installation successful." + else + echo "Error during installation." + exit 1 + fi + else + echo "Error during installation." + exit 1 + fi + else + echo "Error during installation." + exit 1 + fi + fi +fi + +exit 0 \ No newline at end of file diff --git a/third_party/googletest b/third_party/googletest index ed9d1e1ff9..ec44c6c167 160000 --- a/third_party/googletest +++ b/third_party/googletest @@ -1 +1 @@ -Subproject commit ed9d1e1ff92ce199de5ca2667a667cd0a368482a +Subproject commit ec44c6c1675c25b9827aacd08c02433cccde7780