Skip to content

Commit 0fbfbdd

Browse files
CMake builds require explicit opt-in by setting NIC_EXEC_ENABLE=1 (#186)
1 parent 4e2be38 commit 0fbfbdd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,19 @@ set( CMAKE_CXX_FLAGS "${flags_str} ${CMAKE_CXX_FLAGS}")
5656

5757
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -L${ROCM_PATH}/lib")
5858
include_directories(${ROCM_PATH}/include)
59+
5960
find_library(IBVERBS_LIBRARY ibverbs)
6061
find_path(IBVERBS_INCLUDE_DIR infiniband/verbs.h)
6162
if (DEFINED ENV{DISABLE_NIC_EXEC})
6263
message(STATUS "Disabling NIC Executor support")
6364
elseif(IBVERBS_LIBRARY AND IBVERBS_INCLUDE_DIR)
6465
message(STATUS "Found ibverbs: ${IBVERBS_LIBRARY}. Building with NIC executor support. Can set DISABLE_NIC_EXEC=1 to disable")
65-
add_definitions(-DNIC_EXEC_ENABLED)
66-
link_libraries(ibverbs)
66+
if (DEFINED ENV{ENABLE_NIC_EXEC})
67+
add_definitions(-DNIC_EXEC_ENABLED)
68+
link_libraries(ibverbs)
69+
else()
70+
message(STATUS "For CMake builds, NIC executor also requires explicit opt-in by setting NIC_EXEC_ENABLE=1")
71+
endif()
6772
else()
6873
if (NOT IBVERBS_LIBRARY)
6974
message(WARNING "IBVerbs library not found")

0 commit comments

Comments
 (0)