@@ -203,6 +203,10 @@ CHECK_C_SOURCE_COMPILES("
203203 HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE
204204 FAIL_REGEX "warning" )
205205
206+ # Provide a shim if C11 stdatomic.h is not supported.
207+ CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC)
208+ RDMA_DoFixup("${HAVE_STDATOMIC} " "stdatomic.h" )
209+
206210# Enable development support features
207211# Prune unneeded shared libraries during linking
208212RDMA_AddOptLDFlag(CMAKE_EXE_LINKER_FLAGS SUPPORTS_AS_NEEDED "-Wl,--as-needed" )
@@ -278,6 +282,14 @@ check_type_size("long" SIZEOF_LONG BUILTIN_TYPES_ONLY LANGUAGE C)
278282
279283include (RDMA_LinuxHeaders)
280284
285+ # Determine if this arch supports cache coherent DMA. This isn't really an
286+ # arch specific property, but for our purposes arches that do not support it
287+ # also do not define wmb/etc which breaks our compile.
288+ CHECK_C_SOURCE_COMPILES("
289+ #include \" ${CMAKE_CURRENT_SOURCE_DIR} /libibverbs/arch.h\"
290+ int main(int argc,const char *argv[]) {return 0;}"
291+ HAVE_COHERENT_DMA)
292+
281293#-------------------------
282294# Apply fixups
283295
@@ -358,18 +370,21 @@ add_subdirectory(librdmacm/man)
358370add_subdirectory (libibcm)
359371
360372# Providers
373+ if (HAVE_COHERENT_DMA)
361374add_subdirectory (providers/cxgb3)
362375add_subdirectory (providers/cxgb4)
363- add_subdirectory (providers/hfi1verbs)
364376add_subdirectory (providers/hns)
365377add_subdirectory (providers/i40iw)
366- add_subdirectory (providers/ipathverbs)
367378add_subdirectory (providers/mlx4)
368379add_subdirectory (providers/mlx5)
369380add_subdirectory (providers/mthca)
370381add_subdirectory (providers/nes)
371382add_subdirectory (providers/ocrdma)
372383add_subdirectory (providers/qedr)
384+ endif ()
385+
386+ add_subdirectory (providers/hfi1verbs)
387+ add_subdirectory (providers/ipathverbs)
373388add_subdirectory (providers/rxe)
374389add_subdirectory (providers/rxe/man)
375390
@@ -396,6 +411,12 @@ message(STATUS "Missing Optional Items:")
396411if (NOT HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE)
397412 message (STATUS " Compiler attribute always_inline NOT supported" )
398413endif ()
414+ if (NOT HAVE_COHERENT_DMA)
415+ message (STATUS " Architecture NOT able to do coherent DMA (check libibverbs/arch.h) some providers disabled!" )
416+ endif ()
417+ if (NOT HAVE_STDATOMIC)
418+ message (STATUS " C11 stdatomic.h NOT available (old compiler)" )
419+ endif ()
399420if (NOT HAVE_VALGRIND_MEMCHECK)
400421 message (STATUS " Valgrind memcheck.h NOT enabled" )
401422endif ()
0 commit comments