diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e1c527..eee5131 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,6 @@ build-centos: - source /opt/rh/devtoolset-7/enable - mkdir build - cd build - - cmake3 .. + - CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake3 .. - make -j2 - make test \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 190074c..e58182f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ else() message(WARNING "compiler ${CMAKE_CXX_COMPILER_ID} officially not supported") endif() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++17 -Wpedantic -Ofast -march=native -faligned-new -funroll-loops -fopenmp") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++17 -Wpedantic -O2 -march=native -faligned-new -funroll-loops -fopenmp") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++14 -g -Wpedantic -Ofast -march=native -faligned-new -funroll-loops -fopenmp -ftemplate-backtrace-limit=0") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++14 -g -Wpedantic -O0 -march=native -faligned-new -funroll-loops -fopenmp") diff --git a/src/include/base/assert.h b/src/include/base/assert.h index d0a5c63..d429a76 100644 --- a/src/include/base/assert.h +++ b/src/include/base/assert.h @@ -5,9 +5,8 @@ #define CXZ_ERRTAG __FILE__ << '@' << __LINE__ << '(' << __func__ << "): error" #define CXZ_WARNTAG __FILE__ << '@' << __LINE__ << ": warning" #define CXZ_ERROR(errmsg) {\ - std::stringstream ss;\ - ss << CXZ_ERRTAG << ": " << errmsg << std::flush;\ - throw std::runtime_error(ss.str()); } + auto mkerr = [&](){ std::stringstream ss; ss << CXZ_ERRTAG << ": " << errmsg << std::flush; return ss.str(); }; \ + throw std::runtime_error(mkerr()); } #define CXZ_WARNING(errmsg) {\ std::cerr << CXZ_WARNTAG << ": " << errmsg << std::endl; }