On Tue, Feb 07, 2017 at 01:59:30PM -0700, Jason Gunthorpe wrote: > On Tue, Feb 07, 2017 at 10:14:28PM +0200, Leon Romanovsky wrote: > > > > > Compile the library to build/lib/libibverbs-dv-mlx5.so.1.0.13 > > > > and setup a symlink build/lib/libmlx5-rdmav2.so -> libibverbs-dv-mlx5.so.1.0.13 > > > > > > Just as a note, I'm calling it libmlx5 and not libibverbs-dv-mlx5. > > That will clash with the legacy providers, don't recommend it. Is it real scenario? Will these legacy providers co-exists with rdma-core library? I really don't like libibverbs-dv-mlx5 name, it is too long and have feature name in the name. > > > > > For install, use realpath like this: > > > > > > > > execute_process(COMMAND "realpath --relative-to ${VERBS_PROVIDER_DIR} ${CMAKE_INSTALL_LIBDIR}/libmlx5.so.1.0.13" OUTPUT_VARIBALE LINK_PATH) > > > > > > It doesn't work for me :( > > Ah realpath needs the paths to exist.. Sigha > > Another alternative is this: > > python -c "import os; print(os.path.relpath('/usr/lib64/libmlx4.so','/usr/lib64/libibverbs'));" It prints to the screen, but doesn't update OUTPUT_VARAIBLE :( 115 execute_process(COMMAND python -c "import os; print(os.path.relpath('/usr/lib64/libmlx5.so','/usr/lib64/libibverbs'));" 116 OUTPUT_VARIBALE LINK_PATH) 117 message(STATUS "link_path = ${LINK_PATH}") .. -- Performing Test HAVE_C_WREDUNDANT_DECLS - Failed ../libmlx5.so -- link_path = -- Missing Optional Items: > > > add_custom_target(share_link ALL DEPENDS "${DEST}" COMMAND ${CMAKE_COMMAND} -E create_symlink "lib${DEST}.so.${VERSION}" > > "${BUILD_LIB}/lib${DEST}-rdmav2.so") > > add_dependencies(share_link ${DEST}) > > The doesn't need a build time, just do: > > execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink > "lib${DEST}.so.${VERSION}" > "${BUILD_LIB}/lib${DEST}-rdmav2.so") > > It creates a dangling link until compilation, which is fine.. In non-ninja builds, it doesn't create libmlx5-rdmav2.so symlink in build/lib, because libmlx5.so is not created yet. This is why I ended with custom target. > > > install(FILES "${BUILD_LIB}/lib${DEST}-rdmav2.so" DESTINATION "${CMAKE_INSTALL_LIBDIR}") > > This line isn't needed, it is part of the next function Not for build/lib > > > rdma_install_symlink("${CMAKE_INSTALL_LIBDIR}/lib${DEST}.so.${VERSION}" "${VERBS_PROVIDER_DIR}/libmlx5-rdmav2.so") > > Should be > > rdma_install_symlink("${CMAKE_INSTALL_LIBDIR}/lib${DEST}.so.${VERSION}" "${VERBS_PROVIDER_DIR}/lib${DEST}-rdmav2.so")a Thanks for catching this. > > And most distros will not allow an absolute link under /usr which is > why you need to make a relpath work and use that instead of > ${CMAKE_INSTALL_LIBDIR} It was my desperate attempt to make it work. > > Jason
Attachment:
signature.asc
Description: PGP signature