fix cxz error macro (clang)

This commit is contained in:
Christian Zimmermann 2022-12-04 21:57:18 +01:00
parent 9ef055d9c9
commit 13467b800a
3 changed files with 4 additions and 5 deletions

View file

@ -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

View file

@ -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")

View file

@ -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; }