From 279ece75e36bc360818bad72a6938a34268acf71 Mon Sep 17 00:00:00 2001 From: kleeman Date: Tue, 9 Apr 2019 22:42:52 -0700 Subject: [PATCH] Switch to using clang-6.0 --- .travis.yml | 24 ++++++++++++------- cmake/ClangTools.cmake | 2 +- .../albatross/core/parameter_handling_mixin.h | 5 ++-- include/albatross/core/parameter_macros.h | 14 +++++------ .../evaluation/differential_entropy.h | 2 +- include/albatross/evaluation/model_metrics.h | 2 +- .../albatross/evaluation/prediction_metrics.h | 2 +- include/albatross/models/ransac_gp.h | 2 +- 8 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 90a8db5e..d50a92b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,30 +19,36 @@ matrix: apt: sources: - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-6.0 + - sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' packages: - g++-6 - libc++-dev - libc++abi-dev - - clang-3.8 - - clang-format-3.8 - - clang-tidy-3.8 + - clang-6.0 + - clang-format-6.0 + - clang-tidy-6.0 - libnlopt-dev env: - - C_COMPILER=gcc-6 CXX_COMPILER=g++-6 COVERAGE='' - - compiler: clang-3.8 + - C_COMPILER=gcc-6 CXX_COMPILER=g++-6 + - compiler: clang-6.0 addons: apt: sources: - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-6.0 + - sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' packages: - libc++-dev - libc++abi-dev - - clang-3.8 - - clang-format-3.8 - - clang-tidy-3.8 + - clang-6.0 + - clang-format-6.0 + - clang-tidy-6.0 - libnlopt-dev env: - - C_COMPILER=clang-3.8 CXX_COMPILER=clang++-3.8 COVERAGE='' + - C_COMPILER=clang-6.0 CXX_COMPILER=clang++-6.0 - compiler: sphinx addons: apt: diff --git a/cmake/ClangTools.cmake b/cmake/ClangTools.cmake index 5bd57015..c47902ec 100644 --- a/cmake/ClangTools.cmake +++ b/cmake/ClangTools.cmake @@ -22,7 +22,7 @@ endif(CMAKE_CROSSCOMPILING) set(CLANG_FORMAT_PATH "NOTSET" CACHE STRING "Absolute path to the clang-format executable") if("${CLANG_FORMAT_PATH}" STREQUAL "NOTSET") find_program(CLANG_FORMAT NAMES - clang-format-3.8 + clang-format-6.0 ) message(STATUS "Using clang format: ${CLANG_FORMAT}") if("${CLANG_FORMAT}" STREQUAL "CLANG_FORMAT-NOTFOUND") diff --git a/include/albatross/core/parameter_handling_mixin.h b/include/albatross/core/parameter_handling_mixin.h index 8a0c6184..1d472e49 100644 --- a/include/albatross/core/parameter_handling_mixin.h +++ b/include/albatross/core/parameter_handling_mixin.h @@ -120,8 +120,9 @@ inline std::string pretty_param_details(const ParameterStore ¶ms) { << " prior: " << std::setw(15) << prior_name << " bounds: [" << (pair.second.has_prior() ? pair.second.prior->lower_bound() : -INFINITY) - << ", " << (pair.second.has_prior() ? pair.second.prior->upper_bound() - : INFINITY) + << ", " + << (pair.second.has_prior() ? pair.second.prior->upper_bound() + : INFINITY) << "]" << std::endl; } return ss.str(); diff --git a/include/albatross/core/parameter_macros.h b/include/albatross/core/parameter_macros.h index 14d00c9e..16b1ca72 100644 --- a/include/albatross/core/parameter_macros.h +++ b/include/albatross/core/parameter_macros.h @@ -96,37 +96,37 @@ if (_cond(x)) { \ _action(x); \ } else \ - _build_if_1(_cond, _action, __VA_ARGS__) + _build_if_1(_cond, _action, __VA_ARGS__) #define _build_if_3(_cond, _action, x, ...) \ if (_cond(x)) { \ _action(x); \ } else \ - _build_if_2(_cond, _action, __VA_ARGS__) + _build_if_2(_cond, _action, __VA_ARGS__) #define _build_if_4(_cond, _action, x, ...) \ if (_cond(x)) { \ _action(x); \ } else \ - _build_if_3(_cond, _action, __VA_ARGS__) + _build_if_3(_cond, _action, __VA_ARGS__) #define _build_if_5(_cond, _action, x, ...) \ if (_cond(x)) { \ _action(x); \ } else \ - _build_if_4(_cond, _action, __VA_ARGS__) + _build_if_4(_cond, _action, __VA_ARGS__) #define _build_if_6(_cond, _action, x, ...) \ if (_cond(x)) { \ _action(x); \ } else \ - _build_if_5(_cond, _action, __VA_ARGS__) + _build_if_5(_cond, _action, __VA_ARGS__) #define _build_if_7(_cond, _action, x, ...) \ if (_cond(x)) { \ _action(x); \ } else \ - _build_if_6(_cond, _action, __VA_ARGS__) + _build_if_6(_cond, _action, __VA_ARGS__) #define _build_if_8(_cond, _action, x, ...) \ if (_cond(x)) { \ _action(x); \ } else \ - _build_if_7(_cond, _action, __VA_ARGS__) + _build_if_7(_cond, _action, __VA_ARGS__) #define BUILD_IF(cond, action, ...) \ _GET_NTH_ARG("ignored", ##__VA_ARGS__, _build_if_8, _build_if_7, \ diff --git a/include/albatross/evaluation/differential_entropy.h b/include/albatross/evaluation/differential_entropy.h index 575b41b4..71170d95 100644 --- a/include/albatross/evaluation/differential_entropy.h +++ b/include/albatross/evaluation/differential_entropy.h @@ -45,6 +45,6 @@ inline double differential_entropy(const Eigen::MatrixXd &cov) { Eigen::LDLT ldlt(cov); return differential_entropy(ldlt); } -} +} // namespace albatross #endif /* INCLUDE_ALBATROSS_EVALUATION_DIFFERENTIAL_ENTROPY_H_ */ diff --git a/include/albatross/evaluation/model_metrics.h b/include/albatross/evaluation/model_metrics.h index b1f25d75..6c6b3ff9 100644 --- a/include/albatross/evaluation/model_metrics.h +++ b/include/albatross/evaluation/model_metrics.h @@ -76,6 +76,6 @@ struct LeaveOneOutRMSE : public ModelMetric { return rmse_score; } }; -} +} // namespace albatross #endif /* ALBATROSS_EVALUATION_MODEL_METRICS_H_ */ diff --git a/include/albatross/evaluation/prediction_metrics.h b/include/albatross/evaluation/prediction_metrics.h index 036373ab..d46546e4 100644 --- a/include/albatross/evaluation/prediction_metrics.h +++ b/include/albatross/evaluation/prediction_metrics.h @@ -123,6 +123,6 @@ struct NegativeLogLikelihood : public PredictionMetric { NegativeLogLikelihood() : PredictionMetric(negative_log_likelihood) {} }; -} +} // namespace albatross #endif /* ALBATROSS_EVALUATION_PREDICTION_METRICS_H_ */ diff --git a/include/albatross/models/ransac_gp.h b/include/albatross/models/ransac_gp.h index 2b2d962f..af0c8a1b 100644 --- a/include/albatross/models/ransac_gp.h +++ b/include/albatross/models/ransac_gp.h @@ -143,6 +143,6 @@ struct GaussianProcessRansacStrategy { using DefaultGPRansacStrategy = GaussianProcessRansacStrategy, LeaveOneOut>; -} +} // namespace albatross #endif /* INCLUDE_ALBATROSS_MODELS_RANSAC_GP_H_ */