Fix path to post-processing merge script (#187)

- Path to merge script not found unless user explicitly sources "share/rocprofiler-systems/setup-env.sh" to setup PATHs.
- Instead, let's derive the path when the application loads and use it when executing the helper script
- Rename script to rocprof-sys-merge-output.sh.
- Change install folder to <prefix>/libexec/rocprofiler-systems based on dev-ops feedback.
- Updated PATH variable in the modulefile and source scrtipt.
- For SWDEV-528101

[ROCm/rocprofiler-systems commit: adc66956b0]
Цей коміт міститься в:
David Galiffi
2025-05-02 16:52:54 -04:00
зафіксовано GitHub
джерело 31dc2414e3
коміт 6fe19b681a
10 змінених файлів з 103 додано та 26 видалено
+17
Переглянути файл
@@ -174,6 +174,20 @@ get_internal_libpath(const std::string& _lib)
return filepath::realpath(rocprofsys::common::join("/", _dir, "..", "lib", _lib),
nullptr, false);
}
std::string
get_internal_script_path(void)
{
auto _exe = std::string_view{ realpath("/proc/self/exe", nullptr) };
auto _pos = _exe.find_last_of('/');
auto _dir = std::string{ "./" };
if(_pos != std::string_view::npos) _dir = _exe.substr(0, _pos);
auto _script_dir =
rocprofsys::common::join("/", _dir, "..", "libexec", "rocprofiler-systems");
return _script_dir;
}
} // namespace
bool
@@ -222,6 +236,9 @@ init_parser(parser_data& _data)
_data.dl_libpath = get_realpath(get_internal_libpath("librocprof-sys-dl.so").c_str());
_data.omni_libpath = get_realpath(get_internal_libpath("librocprof-sys.so").c_str());
auto _libexecpath = get_realpath(get_internal_script_path());
update_env(_data, "ROCPROFSYS_SCRIPT_PATH", _libexecpath, UPD_REPLACE);
#if defined(ROCPROFSYS_USE_OMPT)
if(!getenv("OMP_TOOL_LIBRARIES"))
update_env(_data, "OMP_TOOL_LIBRARIES", _data.dl_libpath, UPD_PREPEND);