AMDMIGraphX icon indicating copy to clipboard operation
AMDMIGraphX copied to clipboard

Rocm-cmake: move unstable libraries to $ROCM_PATH/lib/migraphx

Open ahsan-ca opened this issue 9 months ago • 0 comments

Changes need to be made in rocm-cmake to support installation of libraries at $ROCM_PATH/lib/migraphx.

First, a PRIVATE flag should be added to the rocm_install_targets that will install the binaries and headers under lib/${PROJECT_NAME}. So instead of installing in $<INSTALL_PREFIX>/lib or $<INSTALL_PREFIX>/include it will install into $<INSTALL_PREFIX>/lib/${PROJECT_NAME}/lib and $<INSTALL_PREFIX>/lib/${PROJECT_NAME}/include respectively. For ASAN build we will need to install into lib/asan/${PROJECT_NAME} instead.

Secondly, we will need to update the RPATH of every library to have this private path. This can be done by updating the RPATH property on non-private targets, something like this:

if(POLICY CMP0095)
    set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "\${ORIGIN}/${PROJECT_NAME}/lib")
else()
    set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "\\\${ORIGIN}/${PROJECT_NAME}/lib")
endif()
This RPATH should work for asan and non-asan builds.

Finally, we will need to update migraphx to use the PRIVATE flag to install the libraries and headers.

ahsan-ca avatar May 01 '24 18:05 ahsan-ca