From 02883c3d8daf4a01975cf5e5f62153f05954737f Mon Sep 17 00:00:00 2001 From: ajanicijamd Date: Fri, 3 Oct 2025 21:33:02 -0400 Subject: [PATCH] Fixed openmp-vv tests (#1203) * LD_LIBRARY_PATH was being overridden so tool's libraries could not be found. --- .../tests/rocprof-sys-openmp-tests.cmake | 21 ++++--------------- .../tests/rocprof-sys-testing.cmake | 14 ++++++++++--- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/projects/rocprofiler-systems/tests/rocprof-sys-openmp-tests.cmake b/projects/rocprofiler-systems/tests/rocprof-sys-openmp-tests.cmake index 657f5d641d..58e39528d6 100644 --- a/projects/rocprofiler-systems/tests/rocprof-sys-openmp-tests.cmake +++ b/projects/rocprofiler-systems/tests/rocprof-sys-openmp-tests.cmake @@ -7,25 +7,12 @@ # # ----------------------------------------------------------------------------- # -if(ROCmVersion_DIR) - set(_rocm_root "${ROCmVersion_DIR}") -elseif(DEFINED ENV{ROCM_PATH}) - set(_rocm_root "$ENV{ROCM_PATH}") -else() - set(_rocm_root "/opt/rocm") -endif() - -# Set path to ROCm LLVM library directory containing libomptarget.so -set(_rocm_llvm_lib "${_rocm_root}/llvm/lib") - -set(_rocm_ld_env "LD_LIBRARY_PATH=${_rocm_llvm_lib}:$ENV{LD_LIBRARY_PATH}") - -if(NOT EXISTS "${_rocm_llvm_lib}/libomptarget.so" AND ROCPROFSYS_USE_ROCM) +if(NOT EXISTS "${ROCM_LLVM_LIB_PATH}/libomptarget.so" AND ROCPROFSYS_USE_ROCM) message( FATAL_ERROR - "libomptarget.so not found in ${_rocm_llvm_lib}. " - "Verify that ROCm is installed correctly and that _rocm_root " - "(${_rocm_root}) points at the right location." + "libomptarget.so not found in \"${ROCM_LLVM_LIB_PATH}\". " + "Verify that ROCm is installed correctly and that ROCM_PATH " + "(${ROCM_PATH}) points at the right location." ) endif() diff --git a/projects/rocprofiler-systems/tests/rocprof-sys-testing.cmake b/projects/rocprofiler-systems/tests/rocprof-sys-testing.cmake index 6e16c96717..bf28044d52 100644 --- a/projects/rocprofiler-systems/tests/rocprof-sys-testing.cmake +++ b/projects/rocprofiler-systems/tests/rocprof-sys-testing.cmake @@ -68,9 +68,17 @@ if(MAX_CAUSAL_ITERATIONS GREATER 100) set(MAX_CAUSAL_ITERATIONS 100) endif() -set(_test_library_path - "LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}:$ENV{LD_LIBRARY_PATH}" -) +if(DEFINED ROCM_PATH) + set(ROCM_LLVM_LIB_PATH "${ROCM_PATH}/lib/llvm/lib") + set(_test_library_path + "LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}:${ROCM_LLVM_LIB_PATH}/:$ENV{LD_LIBRARY_PATH}" + ) +else() + set(_test_library_path + "LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}:$ENV{LD_LIBRARY_PATH}" + ) +endif() + set(_test_openmp_env "OMP_PROC_BIND=spread" "OMP_PLACES=threads" "OMP_NUM_THREADS=2") set(_base_environment