Skip to content
Snippets Groups Projects
Commit 43e4e35f authored by Dominik Thoennes's avatar Dominik Thoennes
Browse files

add check for llvm bug and disable sign-conversion warning if needed

parent d5be87ec
No related merge requests found
......@@ -1033,6 +1033,15 @@ if ( WALBERLA_BUILD_WITH_OPENMP )
message(FATAL_ERROR "Could NOT enable OpenMP")
endif()
endif()
# check for bug in combination with OpenMP and sign conversion https://bugs.llvm.org/show_bug.cgi?id=48387
try_compile( WALBERLA_CLANG_OPENMP_BUG "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/TestClangOpenMPBug.cpp"
COMPILE_DEFINITIONS -Werror)
if ( NOT ${WALBERLA_CLANG_OPENMP_BUG} )
message(WARNING "Setting -Wno-sign-conversion due to a compiler bug in LLVM (https://bugs.llvm.org/show_bug.cgi?id=48387)" )
add_flag ( CMAKE_CXX_FLAGS "-Wno-sign-conversion" )
endif()
else()
if ( WALBERLA_CXX_COMPILER_IS_CRAY )
add_flag ( CMAKE_C_FLAGS "-h noomp" )
......
#include <iostream>
int main()
{
int min = -10;
#pragma omp parallel for
for (int i = min; i <= 10; ++i)
{
std::cout << i << std::endl;
}
return 0;
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment