Skip to content

Commit

Permalink
Add install script for macOS and Ubuntu 16.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Bensk1 committed Oct 11, 2016
1 parent c127012 commit fe96ab0
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -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
72 changes: 48 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
45 changes: 45 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fe96ab0

Please sign in to comment.