Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings #6

Merged
merged 3 commits into from
Jan 4, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enable Travis CI
  • Loading branch information
hmenke committed Jan 3, 2018
commit fcd7b8ea12f209cf605371082e29ee4fadc8d593
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
dist: trusty
sudo: false

language: cpp

os: linux

addons:
apt:
packages:
- gfortran
- libarmadillo-dev

compiler:
- clang
- gcc

script:
- mkdir build
- cd build
- cmake -DWITH_COVERAGE=On ..
- make -j 2
- make test
- curl -s https://codecov.io/bash | bash -
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Name of project
project(wignerSymbols)
enable_testing()

set (wignerSymbols_VERSION_MAJOR 0)
set (wignerSymbols_VERSION_MINOR 2)
set (wignerSymbols_VERSION_RELEASE 0)
Expand All @@ -14,6 +16,14 @@ endif()
enable_language (Fortran)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -march=native")

# Coverage report
option(WITH_COVERAGE "Generate code coverage report" OFF)
if(WITH_COVERAGE)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the build type" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
link_libraries(gcov)
endif()

# Included files
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include INC_LIST)

Expand All @@ -40,6 +50,8 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME}
VERSION ${wignerSymbols_VERSION_MAJOR}.${wignerSymbols_VERSION_MINOR}.${wignerSymbols_VERSION_RELEASE}
SOVERSION ${wignerSymbols_VERSION_MAJOR}.${wignerSymbols_VERSION_MINOR}.${wignerSymbols_VERSION_RELEASE})

add_subdirectory(tests)

# Install directories
install(TARGETS ${PROJECT_NAME} DESTINATION lib)
install(DIRECTORY include/ DESTINATION include)
13 changes: 13 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
add_executable(gh-issue-1 gh-issue-1.cpp)
target_link_libraries(gh-issue-1 ${PROJECT_NAME})
add_test(NAME gh-issue-1 COMMAND gh-issue-1)

add_executable(gh-issue-2 gh-issue-2.cpp)
target_link_libraries(gh-issue-2 ${PROJECT_NAME})
add_test(NAME gh-issue-2 COMMAND gh-issue-2)

find_package(Armadillo)
include_directories(${ARMADILLO_INCLUDE_DIRS})
add_executable(testWigner testWigner.cpp)
target_link_libraries(testWigner ${PROJECT_NAME} ${ARMADILLO_LIBRARIES})
add_test(NAME testWigner COMMAND testWigner 10)
6 changes: 3 additions & 3 deletions tests/gh-issue-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ int main (int argc, char* argv[])
std::cout << "FOR impl.: " << test42 << std::endl;
std::cout << std::endl;

std::vector<double> test5 = WignerSymbols::wigner3j(856, 1200, 464, -828, 364);
double test51 WignerSymbols::wigner3j(751, 856, 1200, 464, -828, 364);
double test52 WignerSymbols::wigner3j_f(751, 856, 1200, 464, -828, 364);
std::vector<double> test5 = WignerSymbols::wigner3j(856, 1200, 464, -828, 364);
double test51 = WignerSymbols::wigner3j(751, 856, 1200, 464, -828, 364);
double test52 = WignerSymbols::wigner3j_f(751, 856, 1200, 464, -828, 364);

/*
[ 841 379 1011 -631 313 318] -2.44096504011e-41 -0.0
Expand Down