-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ibdiags: Add cmake files for ibdiags components
These are simple cmakefiles that emulate what the autotools stuff did. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
- Loading branch information
1 parent
3f69f34
commit 58670e0
Showing
12 changed files
with
334 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
set(BUILD_DATE "2019") | ||
|
||
# rst2man has no way to set the include search path | ||
rdma_create_symlink("${CMAKE_CURRENT_SOURCE_DIR}/common" "${CMAKE_CURRENT_BINARY_DIR}/common") | ||
|
||
rdma_man_pages( | ||
check_lft_balance.8.in.rst | ||
dump_fts.8.in.rst | ||
ibaddr.8.in.rst | ||
ibcacheedit.8.in.rst | ||
ibccconfig.8.in.rst | ||
ibccquery.8.in.rst | ||
ibfindnodesusing.8.in.rst | ||
ibhosts.8.in.rst | ||
ibidsverify.8.in.rst | ||
iblinkinfo.8.in.rst | ||
ibnetdiscover.8.in.rst | ||
ibnodes.8.in.rst | ||
ibping.8.in.rst | ||
ibportstate.8.in.rst | ||
ibqueryerrors.8.in.rst | ||
ibroute.8.in.rst | ||
ibrouters.8.in.rst | ||
ibstat.8.in.rst | ||
ibstatus.8.in.rst | ||
ibswitches.8.in.rst | ||
ibsysstat.8.in.rst | ||
ibtracert.8.in.rst | ||
infiniband-diags.8.in.rst | ||
perfquery.8.in.rst | ||
saquery.8.in.rst | ||
sminfo.8.in.rst | ||
smpdump.8.in.rst | ||
smpquery.8.in.rst | ||
vendstat.8.in.rst | ||
) | ||
|
||
rdma_alias_man_pages( | ||
dump_fts.8 dump_lfts.8 | ||
dump_fts.8 dump_mfts.8 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
publish_headers(infiniband | ||
../include/infiniband/mad.h | ||
../include/infiniband/mad_osd.h | ||
) | ||
|
||
rdma_library(ibmad libibmad.map | ||
# See Documentation/versioning.md | ||
5 5.3.${PACKAGE_VERSION} | ||
bm.c | ||
cc.c | ||
dump.c | ||
fields.c | ||
gs.c | ||
mad.c | ||
portid.c | ||
register.c | ||
resolve.c | ||
rpc.c | ||
sa.c | ||
serv.c | ||
smp.c | ||
vendor.c | ||
) | ||
target_link_libraries(ibmad LINK_PRIVATE | ||
ibumad | ||
) | ||
rdma_pkg_config("ibmad" "libibumad" "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
rdma_man_pages( | ||
ibnd_discover_fabric.3 | ||
ibnd_find_node_guid.3 | ||
ibnd_iter_nodes.3 | ||
) | ||
|
||
rdma_alias_man_pages( | ||
ibnd_discover_fabric.3 ibnd_debug.3 | ||
ibnd_discover_fabric.3 ibnd_destroy_fabric.3 | ||
ibnd_discover_fabric.3 ibnd_set_max_smps_on_wire.3 | ||
ibnd_discover_fabric.3 ibnd_show_progress.3 | ||
ibnd_find_node_guid.3 ibnd_find_node_dr.3 | ||
ibnd_iter_nodes.3 ibnd_iter_nodes_type.3 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
publish_headers(infiniband | ||
../include/infiniband/ibnetdisc.h | ||
../include/infiniband/ibnetdisc_osd.h | ||
) | ||
|
||
rdma_library(ibnetdisc libibnetdisc.map | ||
# See Documentation/versioning.md | ||
5 5.0.${PACKAGE_VERSION} | ||
chassis.c | ||
ibnetdisc.c | ||
ibnetdisc_cache.c | ||
query_smp.c | ||
) | ||
target_link_libraries(ibnetdisc LINK_PRIVATE | ||
ibmad | ||
ibumad | ||
osmcomp | ||
) | ||
# FIXME for osmcomp | ||
target_include_directories(ibnetdisc PRIVATE "/usr/include/infiniband") | ||
rdma_pkg_config("ibnetdisc" "libibumad libibmad" "") | ||
|
||
rdma_test_executable(testleaks ../test/testleaks.c) | ||
target_link_libraries(testleaks LINK_PRIVATE | ||
ibmad | ||
ibnetdisc | ||
) | ||
target_include_directories(testleaks PRIVATE "/usr/include/infiniband") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
if (ENABLE_IBDIAGS_COMPAT) | ||
rdma_man_pages( | ||
ibcheckerrors.8 | ||
ibcheckerrs.8 | ||
ibchecknet.8 | ||
ibchecknode.8 | ||
ibcheckport.8 | ||
ibcheckportstate.8 | ||
ibcheckportwidth.8 | ||
ibcheckstate.8 | ||
ibcheckwidth.8 | ||
ibclearcounters.8 | ||
ibclearerrors.8 | ||
ibdatacounters.8 | ||
ibdatacounts.8 | ||
ibdiscover.8 | ||
ibprintca.8 | ||
ibprintrt.8 | ||
ibprintswitch.8 | ||
ibswportwatch.8 | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
function(_rdma_sbin_interp INTERP IFN OFN) | ||
configure_file("${IFN}" "${CMAKE_CURRENT_BINARY_DIR}/${OFN}" @ONLY) | ||
file(WRITE "${BUILD_BIN}/${OFN}" "#!${INTERP}\nexec ${INTERP} ${CMAKE_CURRENT_BINARY_DIR}/${OFN} \"$@\"\n") | ||
execute_process(COMMAND "chmod" "a+x" "${BUILD_BIN}/${OFN}") | ||
|
||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${OFN}" | ||
DESTINATION "${CMAKE_INSTALL_SBINDIR}" | ||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) | ||
endfunction() | ||
|
||
function(_rdma_sbin_interp_link INTERP IFN OFN) | ||
file(WRITE "${BUILD_BIN}/${OFN}" "#!${INTERP}\nexec ${INTERP} ${CMAKE_CURRENT_SOURCE_DIR}/${IFN} \"$@\"\n") | ||
execute_process(COMMAND "chmod" "a+x" "${BUILD_BIN}/${OFN}") | ||
|
||
install(FILES "${IFN}" | ||
DESTINATION "${CMAKE_INSTALL_SBINDIR}" | ||
RENAME "${OFN}" | ||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) | ||
endfunction() | ||
|
||
function(rdma_sbin_shell_program) | ||
foreach(IFN ${ARGN}) | ||
if (IFN MATCHES "\\.sh\\.in") | ||
if (DISTRO_FLAVOUR STREQUAL Debian) | ||
string(REGEX REPLACE "^(.+)\\.sh\\.in$" "\\1" OFN "${IFN}") | ||
else() | ||
string(REGEX REPLACE "^(.+)\\.in$" "\\1" OFN "${IFN}") | ||
endif() | ||
_rdma_sbin_interp("/bin/bash" "${IFN}" "${OFN}") | ||
elseif (IFN MATCHES "\\.in") | ||
string(REGEX REPLACE "^(.+)\\.in$" "\\1" OFN "${IFN}") | ||
_rdma_sbin_interp("/bin/bash" "${IFN}" "${OFN}") | ||
elseif (IFN MATCHES "\\.sh") | ||
if (DISTRO_FLAVOUR STREQUAL Debian) | ||
string(REGEX REPLACE "^(.+)\\.sh$" "\\1" OFN "${IFN}") | ||
else() | ||
set(OFN "${IFN}") | ||
endif() | ||
_rdma_sbin_interp_link("/bin/bash" "${IFN}" "${OFN}") | ||
else() | ||
_rdma_sbin_interp_link("/bin/bash" "${IFN}" "${IFN}") | ||
endif() | ||
endforeach() | ||
endfunction() | ||
|
||
function(rdma_sbin_perl_program) | ||
foreach(IFN ${ARGN}) | ||
if (IFN MATCHES "\\.pl\\.in") | ||
if (DISTRO_FLAVOUR STREQUAL Debian) | ||
string(REGEX REPLACE "^(.+)\\.pl\\.in$" "\\1" OFN "${IFN}") | ||
else() | ||
string(REGEX REPLACE "^(.+)\\.in$" "\\1" OFN "${IFN}") | ||
endif() | ||
_rdma_sbin_interp("/usr/bin/perl" "${IFN}" "${OFN}") | ||
elseif (IFN MATCHES "\\.pl") | ||
if (DISTRO_FLAVOUR STREQUAL Debian) | ||
string(REGEX REPLACE "^(.+)\\.pl$" "\\1" OFN "${IFN}") | ||
else() | ||
set(OFN "${IFN}") | ||
endif() | ||
_rdma_sbin_interp_link("/usr/bin/perl" "${IFN}" "${OFN}") | ||
endif() | ||
endforeach() | ||
endfunction() | ||
|
||
set(IBSCRIPTPATH "${CMAKE_INSTALL_FULL_SBINDIR}") | ||
|
||
rdma_sbin_shell_program( | ||
dump_lfts.sh.in | ||
dump_mfts.sh.in | ||
ibhosts.in | ||
ibnodes.in | ||
ibrouters.in | ||
ibstatus | ||
ibswitches.in | ||
) | ||
|
||
rdma_sbin_perl_program( | ||
check_lft_balance.pl | ||
ibfindnodesusing.pl | ||
ibidsverify.pl | ||
) | ||
|
||
install(FILES "IBswcountlimits.pm" | ||
DESTINATION "${CMAKE_INSTALL_PERLDIR}") | ||
|
||
install(FILES | ||
"../etc/error_thresholds" | ||
"../etc/ibdiag.conf" | ||
DESTINATION "${IBDIAG_CONFIG_PATH}") | ||
|
||
if (ENABLE_IBDIAGS_COMPAT) | ||
rdma_sbin_shell_program( | ||
ibcheckerrors.in | ||
ibcheckerrs.in | ||
ibchecknet.in | ||
ibchecknode.in | ||
ibcheckport.in | ||
ibcheckportstate.in | ||
ibcheckportwidth.in | ||
ibcheckstate.in | ||
ibcheckwidth.in | ||
ibclearcounters.in | ||
ibclearerrors.in | ||
ibdatacounters.in | ||
ibdatacounts.in | ||
set_nodedesc.sh | ||
) | ||
|
||
rdma_sbin_perl_program( | ||
ibdiscover.pl | ||
iblinkinfo.pl.in | ||
ibprintca.pl | ||
ibprintrt.pl | ||
ibprintswitch.pl | ||
ibqueryerrors.pl.in | ||
ibswportwatch.pl | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
publish_internal_headers("" | ||
../include/ibdiag_common.h | ||
../include/ibdiag_sa.h | ||
) | ||
|
||
add_library(ibdiags_tools STATIC | ||
ibdiag_common.c | ||
ibdiag_sa.c | ||
) | ||
target_include_directories(ibdiags_tools PRIVATE "/usr/include/infiniband") | ||
|
||
function(ibdiag_programs) | ||
foreach(I ${ARGN}) | ||
rdma_sbin_executable(${I} "${I}.c") | ||
target_link_libraries(${I} PRIVATE ${RT_LIBRARIES} ibumad ibmad ibdiags_tools ibnetdisc osmcomp) | ||
target_include_directories(${I} PRIVATE "/usr/include/infiniband") | ||
endforeach() | ||
endfunction() | ||
|
||
ibdiag_programs( | ||
dump_fts | ||
ibaddr | ||
ibcacheedit | ||
ibccconfig | ||
ibccquery | ||
iblinkinfo | ||
ibnetdiscover | ||
ibping | ||
ibportstate | ||
ibqueryerrors | ||
ibroute | ||
ibstat | ||
ibsysstat | ||
ibtracert | ||
perfquery | ||
saquery | ||
sminfo | ||
smpdump | ||
smpquery | ||
vendstat | ||
) | ||
|
||
rdma_test_executable(ibsendtrap "ibsendtrap.c") | ||
target_link_libraries(ibsendtrap PRIVATE ibumad ibmad ibdiags_tools) | ||
target_include_directories(ibsendtrap PRIVATE "/usr/include/infiniband") | ||
rdma_test_executable(mcm_rereg_test "mcm_rereg_test.c") | ||
target_link_libraries(mcm_rereg_test PRIVATE ibumad ibmad ibdiags_tools) | ||
target_include_directories(mcm_rereg_test PRIVATE "/usr/include/infiniband") |
Oops, something went wrong.