Files
systems-assistant[bot] 6b109c11c4 [rocprofv3] Reorganize rocprofv3.avail python package (#175)
* Reorganize rocprofv3 python package

adding Python version candidates

review fix

fix test

fix

remove extra line

fix the exception handle

fix Lint fail

fix installation

adding checks to check version format

disable test for address sanitizer

* review comments

* Removing extra lines

* fix format

* Add lib/python3/site-packages to PYTHONPATH in setup-env.sh

* rocprof-compute update rocprofv3 avail lib path

* Make rocprofv3 python binding build commands consistent with other python bindings

* fix cmake

* fix rocprof-compute

* revert cmake changes

* fix rocprofv3 avail python library

* fix cmake

* fix cmake

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
Co-authored-by: Sriraksha Nagaraj <Sriraksha.Nagaraj@amd.com>
Co-authored-by: Jonathan R. Madsen <Jonathan.Madsen@amd.com>
Co-authored-by: systems-assistant[bot] <systems-assistant[bot]@users.noreply.github.com>
Co-authored-by: Jonathan R. Madsen <jrmadsen@users.noreply.github.com>
Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>
Co-authored-by: Vignesh Edithal <Vignesh.Edithal@amd.com>
2025-10-17 08:27:17 -07:00

43 строки
1.6 KiB
Bash

#!/usr/bin/env bash
BASEDIR=$(dirname ${BASH_SOURCE[0]})
command -v realpath &> /dev/null && BASEDIR=$(realpath ${BASEDIR}/../..) || BASEDIR=$(cd ${BASEDIR}/../.. && pwd)
if [ ! -d "${BASEDIR}" ]; then
echo "${BASEDIR} does not exist"
return 1
fi
@PACKAGE_NAME_UNDERSCORED@_get_python3_path()
{
local PYTHON3_EXECUTABLE=$(command -v python3 2> /dev/null)
if [ -n "${PYTHON3_EXECUTABLE}" ]; then
local PYTHON3_VERSION=$(${PYTHON3_EXECUTABLE} -c "import sys; print(f'{sys.version_info[0]}.{sys.version_info[1]}')" 2> /dev/null)
local @PACKAGE_NAME_UNDERSCORED@_PYTHONPATH=${BASEDIR}/@CMAKE_INSTALL_LIBDIR@/python${PYTHON3_VERSION}/site-packages
if [ -d "${@PACKAGE_NAME_UNDERSCORED@_PYTHONPATH}" ]; then
echo ${BASEDIR}/@CMAKE_INSTALL_LIBDIR@/python${PYTHON3_VERSION}/site-packages
fi
fi
}
@PACKAGE_NAME_UNDERSCORED@_ROOT=${BASEDIR}
@PACKAGE_NAME_UNDERSCORED@_DIR=${BASEDIR}/@CMAKE_INSTALL_LIBDIR@/cmake/@PACKAGE_NAME@
PATH=${BASEDIR}/bin:${PATH}
LD_LIBRARY_PATH=${BASEDIR}/@CMAKE_INSTALL_LIBDIR@:${LD_LIBRARY_PATH}
CMAKE_PREFIX_PATH=${BASEDIR}:${CMAKE_PREFIX_PATH}
if [ -z "@CMAKE_INSTALL_PYTHONDIR@" ]; then
PYTHONPATH=$(@PACKAGE_NAME_UNDERSCORED@_get_python3_path):${BASEDIR}/@CMAKE_INSTALL_LIBDIR@/python3/site-packages:${PYTHONPATH}
else
PYTHONPATH=${BASEDIR}/@CMAKE_INSTALL_PYTHONDIR@:${BASEDIR}/@CMAKE_INSTALL_LIBDIR@/python3/site-packages:${PYTHONPATH}
fi
unset @PACKAGE_NAME_UNDERSCORED@_get_python3_path
export @PACKAGE_NAME_UNDERSCORED@_ROOT
export @PACKAGE_NAME_UNDERSCORED@_DIR
export PATH
export LD_LIBRARY_PATH
export CMAKE_PREFIX_PATH
export PYTHONPATH