Fixing Build Library Paths
Change-Id: If71f548dda3dd7cab3dc251b4a3e6389cfc9e4f9
Bu işleme şunda yer alıyor:
işlemeyi yapan:
Ammar Elwazir
ebeveyn
8350f42329
işleme
7ea04a63c5
@@ -43,6 +43,7 @@ std::string golden_trace_path;
|
||||
std::string test_app_path;
|
||||
std::string metrics_path;
|
||||
std::string binary_path;
|
||||
std::string profiler_api_lib_path = "";
|
||||
|
||||
static void init_test_path() {
|
||||
if (is_installed_path()) {
|
||||
@@ -52,6 +53,7 @@ static void init_test_path() {
|
||||
test_app_path = "share/rocprofiler/tests/featuretests/profiler/apps/";
|
||||
metrics_path = "lib/rocprofiler/gfx_metrics.xml";
|
||||
binary_path = "bin/rocprofv2";
|
||||
profiler_api_lib_path = "/lib";
|
||||
} else {
|
||||
running_path = "tests-v2/featuretests/profiler/runFeatureTests";
|
||||
lib_path = "librocprofiler_tool.so";
|
||||
@@ -73,6 +75,14 @@ void ApplicationParser::SetApplicationEnv(const char* app_name) {
|
||||
|
||||
app_path = GetRunningPath(running_path);
|
||||
|
||||
std::stringstream ld_library_path;
|
||||
ld_library_path << app_path << profiler_api_lib_path << []() {
|
||||
const char* path = getenv("LD_LIBRARY_PATH");
|
||||
if (path != nullptr) return ":" + std::string(path);
|
||||
return std::string("");
|
||||
}();
|
||||
setenv("LD_LIBRARY_PATH", ld_library_path.str().c_str(), true);
|
||||
|
||||
std::stringstream counter_path;
|
||||
counter_path << app_path << golden_trace_path << "input.txt";
|
||||
setenv("COUNTERS_PATH", counter_path.str().c_str(), true);
|
||||
|
||||
@@ -31,6 +31,19 @@ THE SOFTWARE.
|
||||
void ApplicationParser::SetApplicationEnv(const char* app_name, const char* trace_option) {
|
||||
std::string app_path = GetRunningPath("tests-v2/featuretests/tracer/runTracerFeatureTests");
|
||||
|
||||
std::string profiler_api_lib_path = "";
|
||||
if(is_installed_path()) {
|
||||
profiler_api_lib_path = "/lib";
|
||||
}
|
||||
|
||||
std::stringstream ld_library_path;
|
||||
ld_library_path << app_path << profiler_api_lib_path << []() {
|
||||
const char* path = getenv("LD_LIBRARY_PATH");
|
||||
if (path != nullptr) return ":" + std::string(path);
|
||||
return std::string("");
|
||||
}();
|
||||
setenv("LD_LIBRARY_PATH", ld_library_path.str().c_str(), true);
|
||||
|
||||
std::stringstream hsa_tools_lib_path;
|
||||
hsa_tools_lib_path << app_path << "librocprofiler_tool.so";
|
||||
setenv("LD_PRELOAD", hsa_tools_lib_path.str().c_str(), true);
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle