Changeset: 4b8ccf454a25 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4b8ccf454a25 Modified Files: CMakeLists.txt gdk/gdk_utils.c monetdb5/extras/rapi/CMakeLists.txt monetdb_config.h.in sql/backends/monet5/UDF/capi/capi.c Branch: cmake-fun Log Message:
Compilation fixes for Intel compiler. diffs (78 lines): diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,7 +164,7 @@ endif() if(${CMAKE_C_COMPILER_ID} STREQUAL "Intel") if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") MT_addCompilerFlag("-no-gcc" "-no-gcc" "${CMAKE_C_FLAGS}" "all" CMAKE_C_FLAGS) - add_definitions(-D_Float32=float -D_Float64="long double" -D_Float32x=double -D_Float64x="long double") + MT_addCompilerFlag("-no-gcc-include-dir" "-no-gcc-include-dir" "${CMAKE_C_FLAGS}" "all" CMAKE_C_FLAGS) endif() if(EXISTS "${ROOT}/usr/include/math.h") # see https://software.intel.com/en-us/forums/intel-c-compiler/topic/760979 file(READ "${ROOT}/usr/include/math.h" TMPTXT) @@ -174,6 +174,7 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "Inte endif() endif() set(__attribute__(a) ON) + set(_Pragma(a) ON) set(NAN_CANNOT_BE_USED_AS_INITIALIZER ON CACHE INTERNAL "NaN cannot be used as an initializer") # This hack is only required by the Intel compiler elseif(MSVC) set(_Noreturn "__declspec(noreturn)") diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c --- a/gdk/gdk_utils.c +++ b/gdk/gdk_utils.c @@ -1219,9 +1219,11 @@ GDKfatal(const char *format, ...) #endif } } +#ifdef __INTEL_COMPILER /* We should never reach here (Intel compiler fix) */ + exit(1); +#endif } - lng GDKusec(void) { diff --git a/monetdb5/extras/rapi/CMakeLists.txt b/monetdb5/extras/rapi/CMakeLists.txt --- a/monetdb5/extras/rapi/CMakeLists.txt +++ b/monetdb5/extras/rapi/CMakeLists.txt @@ -55,11 +55,7 @@ if(HAVE_LIBR) target_link_libraries(rapi PRIVATE ${RAPI_LINK_LIBRARIES}) set_target_properties(rapi PROPERTIES OUTPUT_NAME _rapi) target_compile_definitions(rapi PRIVATE LIBRAPI) - cmake_push_check_state() - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS};-Wno-redundant-decls") - check_c_source_compiles("int main(int argc,char** argv){(void)argc;(void)argv;return 0;}" COMPILER_Wnoredundantdecls) # Warning don't add '-' or '/' to the output variable! - cmake_pop_check_state() - if(COMPILER_Wnoredundantdecls) + if(${CMAKE_C_COMPILER_ID} MATCHES "^GNU|Clang|AppleClang$") target_compile_options(rapi PRIVATE -Wno-redundant-decls) endif() diff --git a/monetdb_config.h.in b/monetdb_config.h.in --- a/monetdb_config.h.in +++ b/monetdb_config.h.in @@ -441,6 +441,10 @@ #cmakedefine __attribute__(a) #endif +#ifndef _Pragma +#cmakedefine _Pragma(a) +#endif + /* Does your compiler support the `_Noreturn' specifier? (C11 feature) */ #ifndef _Noreturn #cmakedefine _Noreturn @_Noreturn@ diff --git a/sql/backends/monet5/UDF/capi/capi.c b/sql/backends/monet5/UDF/capi/capi.c --- a/sql/backends/monet5/UDF/capi/capi.c +++ b/sql/backends/monet5/UDF/capi/capi.c @@ -19,7 +19,7 @@ #include <unistd.h> #include <string.h> -#if defined(__GNUC__) && !defined(__clang__) +#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) #pragma GCC diagnostic ignored "-Wclobbered" #endif _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list