rpp package - fix the add_tests build failure for 6.1 rocm rel (#44738)
* rpp package - fix the add_tests build failure for 6.1 rel * fix test build failure
This commit is contained in:
parent
285563ad01
commit
397ff11d6d
@ -0,0 +1,56 @@
|
|||||||
|
From d94cc49d93800b7b50d2582b28a2b6c84fdb166b Mon Sep 17 00:00:00 2001
|
||||||
|
From: sreenivasa murthy kolam <sreenivasamurthy.kolam@amd.com>
|
||||||
|
Date: Thu, 20 Jun 2024 10:17:09 +0000
|
||||||
|
Subject: [PATCH] changes to cmakelists.txt to include half and turbo-jpeg
|
||||||
|
|
||||||
|
---
|
||||||
|
utilities/test_suite/HIP/CMakeLists.txt | 4 ++--
|
||||||
|
utilities/test_suite/HOST/CMakeLists.txt | 5 ++++-
|
||||||
|
2 files changed, 6 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/utilities/test_suite/HIP/CMakeLists.txt b/utilities/test_suite/HIP/CMakeLists.txt
|
||||||
|
index b8bf361..bfac5ec 100644
|
||||||
|
--- a/utilities/test_suite/HIP/CMakeLists.txt
|
||||||
|
+++ b/utilities/test_suite/HIP/CMakeLists.txt
|
||||||
|
@@ -80,7 +80,7 @@ if (hip_FOUND AND OpenCV_FOUND)
|
||||||
|
|
||||||
|
add_executable(Tensor_hip Tensor_hip.cpp)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGPU_SUPPORT=1 -DRPP_BACKEND_HIP=1 -std=gnu++17")
|
||||||
|
- target_link_libraries(Tensor_hip ${OpenCV_LIBS} -lturbojpeg -lrpp ${hip_LIBRARIES} pthread ${LINK_LIBRARY_LIST} hip::device)
|
||||||
|
+ target_link_libraries(Tensor_hip ${OpenCV_LIBS} -lrpp ${hip_LIBRARIES} pthread ${LINK_LIBRARY_LIST} hip::device)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "-- ${Red}Error: OpenCV and hip must be installed to install ${PROJECT_NAME} successfully!${ColourReset}")
|
||||||
|
endif()
|
||||||
|
@@ -96,4 +96,4 @@ if(NIFTI_FOUND AND OpenCV_FOUND)
|
||||||
|
target_link_libraries(Tensor_voxel_hip ${OpenCV_LIBS} -lturbojpeg -lrpp ${hip_LIBRARIES} pthread ${LINK_LIBRARY_LIST} hip::device ${NIFTI_PACKAGE_PREFIX}NIFTI::${NIFTI_PACKAGE_PREFIX}niftiio)
|
||||||
|
else()
|
||||||
|
message("-- ${Yellow}Warning: libniftiio must be installed to install ${PROJECT_NAME}/Tensor_voxel_hip successfully!${ColourReset}")
|
||||||
|
-endif()
|
||||||
|
\ No newline at end of file
|
||||||
|
+endif()
|
||||||
|
diff --git a/utilities/test_suite/HOST/CMakeLists.txt b/utilities/test_suite/HOST/CMakeLists.txt
|
||||||
|
index 43be2b2..c119f28 100644
|
||||||
|
--- a/utilities/test_suite/HOST/CMakeLists.txt
|
||||||
|
+++ b/utilities/test_suite/HOST/CMakeLists.txt
|
||||||
|
@@ -69,6 +69,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} -ggdb -O0")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||||
|
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} OpenMP::OpenMP_CXX)
|
||||||
|
|
||||||
|
+find_path(HALF_INCLUDE_DIR half.hpp)
|
||||||
|
+include_directories(${HALF_INCLUDE_DIR})
|
||||||
|
+
|
||||||
|
if(TurboJpeg_FOUND)
|
||||||
|
message("-- ${Green}${PROJECT_NAME} set to build with rpp and TurboJpeg${ColourReset}")
|
||||||
|
include_directories(${TurboJpeg_INCLUDE_DIRS})
|
||||||
|
@@ -85,7 +88,7 @@ if (OpenCV_FOUND)
|
||||||
|
|
||||||
|
add_executable(Tensor_host Tensor_host.cpp)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17")
|
||||||
|
- target_link_libraries(Tensor_host ${OpenCV_LIBS} -lturbojpeg -lrpp pthread ${LINK_LIBRARY_LIST})
|
||||||
|
+ target_link_libraries(Tensor_host ${OpenCV_LIBS} -lrpp pthread ${LINK_LIBRARY_LIST})
|
||||||
|
else()
|
||||||
|
message("-- ${Red}Error: OpenCV must be installed to install ${PROJECT_NAME} successfully!${ColourReset}")
|
||||||
|
endif()
|
||||||
|
--
|
||||||
|
2.39.3
|
||||||
|
|
@ -65,7 +65,8 @@ def url_for_version(self, version):
|
|||||||
|
|
||||||
# adds half.hpp include directory and modifies how the libjpegturbo
|
# adds half.hpp include directory and modifies how the libjpegturbo
|
||||||
# library is linked for the rpp unit test
|
# library is linked for the rpp unit test
|
||||||
patch("0003-changes-to-rpp-unit-tests.patch", when="+add_tests")
|
patch("0003-changes-to-rpp-unit-tests.patch", when="@5.7:6.0 +add_tests")
|
||||||
|
patch("0003-changes-to-rpp-unit-tests-6.1.patch", when="@6.1 +add_tests")
|
||||||
|
|
||||||
def patch(self):
|
def patch(self):
|
||||||
if self.spec.satisfies("+hip"):
|
if self.spec.satisfies("+hip"):
|
||||||
@ -104,6 +105,18 @@ def patch(self):
|
|||||||
"utilities/test_suite/HIP/CMakeLists.txt",
|
"utilities/test_suite/HIP/CMakeLists.txt",
|
||||||
string=True,
|
string=True,
|
||||||
)
|
)
|
||||||
|
filter_file(
|
||||||
|
"${ROCM_PATH}/share/rpp/test/cmake",
|
||||||
|
self.spec.prefix.share.rpp.test.cmake,
|
||||||
|
"utilities/test_suite/HOST/CMakeLists.txt",
|
||||||
|
string=True,
|
||||||
|
)
|
||||||
|
filter_file(
|
||||||
|
"${ROCM_PATH}/share/rpp/test/cmake",
|
||||||
|
self.spec.prefix.share.rpp.test.cmake,
|
||||||
|
"utilities/test_suite/HIP/CMakeLists.txt",
|
||||||
|
string=True,
|
||||||
|
)
|
||||||
|
|
||||||
depends_on("cmake@3.5:", type="build")
|
depends_on("cmake@3.5:", type="build")
|
||||||
depends_on("pkgconfig", type="build")
|
depends_on("pkgconfig", type="build")
|
||||||
@ -135,6 +148,8 @@ def patch(self):
|
|||||||
def setup_run_environment(self, env):
|
def setup_run_environment(self, env):
|
||||||
if self.spec.satisfies("+add_tests"):
|
if self.spec.satisfies("+add_tests"):
|
||||||
env.set("TURBO_JPEG_PATH", self.spec["libjpeg-turbo"].prefix)
|
env.set("TURBO_JPEG_PATH", self.spec["libjpeg-turbo"].prefix)
|
||||||
|
if self.spec.satisfies("@6.1:"):
|
||||||
|
env.prepend_path("LD_LIBRARY_PATH", self.spec["hsa-rocr-dev"].prefix.lib)
|
||||||
|
|
||||||
def cmake_args(self):
|
def cmake_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
@ -153,9 +168,3 @@ def cmake_args(self):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
return args
|
return args
|
||||||
|
|
||||||
@run_after("install")
|
|
||||||
def add_tests(self):
|
|
||||||
if self.spec.satisfies("+add_tests"):
|
|
||||||
install_tree("utilities", self.spec.prefix.utilities)
|
|
||||||
install_tree("cmake", self.spec.prefix.cmake)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user