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. > > > 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.. Sigh Another alternative is this: python -c "import os; print(os.path.relpath('/usr/lib64/libmlx4.so','/usr/lib64/libibverbs'));" > 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.. > install(FILES "${BUILD_LIB}/lib${DEST}-rdmav2.so" DESTINATION "${CMAKE_INSTALL_LIBDIR}") This line isn't needed, it is part of the next function > 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") 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} Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html