Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMakeLists.txt update to remove unnecessary variable #103

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
206 changes: 156 additions & 50 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
cmake_minimum_required(VERSION 3.5)

project(rocAL)
set(VERSION "1.0.0")

# Set Project Version and Language
project(rocal VERSION ${VERSION} LANGUAGES CXX)

set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Library install directory")
include(GNUInstallDirs)

Expand All @@ -37,7 +38,7 @@ find_program(DPKG_EXE dpkg)
if(DEFINED ENV{ROCM_PATH})
set(ROCM_PATH $ENV{ROCM_PATH} CACHE PATH "Default ROCm installation path")
elseif(ROCM_PATH)
message("-- INFO:ROCM_PATH Set -- ${ROCM_PATH}")
message("-- ${PROJECT_NAME} INFO:ROCM_PATH Set -- ${ROCM_PATH}")
else()
set(ROCM_PATH /opt/rocm CACHE PATH "Default ROCm installation path")
endif()
Expand All @@ -49,11 +50,8 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# rocAL Default Options
option(ENHANCED_MESSAGE "rocAL Enhanced Message Option" ON)
option(GPU_SUPPORT "Build rocAL with GPU Support" ON)
option(BUILD_DEV "Build rocAL Development Package" ON)
option(AMD_FP16_SUPPORT "Build rocAL with float16 Support" OFF)
option(BUILD_PYPACKAGE "Build rocAL Python Package" ON)
option(BUILD_WITH_AMD_ADVANCE "Build rocAL for advanced AMD GPU Architecture" OFF)
option(PYTHONVERSION "Python version to build rocal" "")
option(BUILD_WITH_AMD_ADVANCE "Build rocAL with Advanced GPU support" OFF)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hansely why was pythonversion removed? Seems like you have not synced with ToT.


set(DEFAULT_BUILD_TYPE "Release")

Expand Down Expand Up @@ -122,53 +120,72 @@ message("-- ${BoldBlue}rocAL Build Type -- ${CMAKE_BUILD_TYPE}${ColourReset}")
message("-- ${Cyan}rocAL Developer Options${ColourReset}")
message("-- ${Cyan} -D GPU_SUPPORT=${GPU_SUPPORT} [Turn ON/OFF GPU support (default:ON)]${ColourReset}")
message("-- ${Cyan} -D BACKEND=${BACKEND} [Select rocAL Backend [options:CPU/OPENCL/HIP](default:HIP)]${ColourReset}")
message("-- ${Cyan} -D BUILD_DEV=${BUILD_DEV} [rocAL Developement/Runtime Build(default:ON)]${ColourReset}")
message("-- ${Cyan} -D AMD_FP16_SUPPORT=${AMD_FP16_SUPPORT} [Turn ON/OFF OpenVX FP16 Support (default:OFF)]${ColourReset}")
message("-- ${Cyan} -D BUILD_PYPACKAGE=${BUILD_PYPACKAGE} [rocAL Python Package(default:ON)]${ColourReset}")
message("-- ${Cyan} -D BUILD_WITH_AMD_ADVANCE=${BUILD_WITH_AMD_ADVANCE} [rocAL support for advanced GPU(default:OFF)]${ColourReset}")

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(HALF QUIET)

if(AMD_FP16_SUPPORT)
if(HALF_FOUND)
add_definitions(-DAMD_FP16_SUPPORT)
message("-- ${Blue}rocAL -- -DAMD_FP16_SUPPORT definition added${ColourReset}")
endif(AMD_FP16_SUPPORT)
include_directories(${HALF_INCLUDE_DIRS})
message("-- ${Blue}rocAL Built with float16 Support -- -DAMD_FP16_SUPPORT definition added${ColourReset}")
else()
message("-- ${Blue}rocAL Built with float16 Support OFF${ColourReset}")
endif()

add_subdirectory(rocAL)
add_subdirectory(rocAL_pybind)
if(BUILD_PYPACKAGE)
add_subdirectory(rocAL_pybind)
else()
message("-- ${Cyan}ROCAL Python Module turned OFF by user option -D BUILD_PYPACKAGE=OFF ${ColourReset}")
endif()

# install rocAL docs -- {ROCM_PATH}/${CMAKE_INSTALL_DATADIR}/doc/rocal/
install(FILES docs/README.md DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/rocal)
install(FILES docs/README.md DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/rocal COMPONENT runtime)

# test package
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/test COMPONENT test)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/test COMPONENT test)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_api_tests/ DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/test COMPONENT test)
# CTest - Needs RPP Installed
enable_testing()
include(CTest)
add_subdirectory(tests/cpp_api_tests)

# set package information
set(CPACK_PACKAGE_VERSION ${VERSION})
set(CPACK_PACKAGE_NAME "rocal")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_LICENSE "MIT")
set(CPACK_PACKAGE_CONTACT "rocAL Support <[email protected]>")
set(CPACK_PACKAGE_VENDOR "AMD Radeon")
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/docs/data/rocAL_logo.png")
set(CPACK_PACKAGE_VENDOR "AMD ROCm")
set(CPACK_PACKAGE_GROUP "Development/Tools")
set(CPACK_PACKAGE_HOMEPAGE "https://github.com/ROCmSoftwarePlatform/rocAL")

set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocAL is a comprehensive Augmentation Library
The AMD ROCm Augmentation Library (rocAL) is designed to efficiently decode and process images \
and videos from a variety of storage formats and modify them through a processing graph programmable by the user.")
set(CPACK_RPM_PACKAGE_SUMMARY "AMD rocAL is a comprehensive Augmentation Library")
set(CPACK_PACKAGE_HOMEPAGE "https://github.com/ROCm/rocAL")

# set license information
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/rocal)
if(ENABLE_ASAN_PACKAGING)
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocAL address sanitizer libraries")
set(CPACK_RPM_PACKAGE_SUMMARY "AMD rocAL address sanitizer libraries")
else()
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "AMD rocAL is a comprehensive augmentation library")
set(CPACK_RPM_PACKAGE_SUMMARY "AMD rocAL is a comprehensive augmentation library")
endif()

if(DEFINED ENV{ROCM_LIBPATCH_VERSION})
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.$ENV{ROCM_LIBPATCH_VERSION}")
endif()

set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_RELEASE "local")
set(CPACK_RPM_PACKAGE_RELEASE "local")
# set license information
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")

# set license information - {ROCM_PATH}/share/doc/rocal
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR}-asan COMPONENT asan)
install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT runtime)
install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR}-dev COMPONENT dev)
install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION ${CMAKE_INSTALL_DOCDIR}-test COMPONENT test)

if(DEFINED ENV{CPACK_DEBIAN_PACKAGE_RELEASE})
set(CPACK_DEBIAN_PACKAGE_RELEASE $ENV{CPACK_DEBIAN_PACKAGE_RELEASE})
Expand All @@ -177,32 +194,97 @@ if(DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE})
set(CPACK_RPM_PACKAGE_RELEASE $ENV{CPACK_RPM_PACKAGE_RELEASE})
endif()

# set dependency to ROCm if set to TRUE, default to OFF
set(ROCM_DEP_ROCMCORE OFF CACHE BOOL "Set rocm-core dependency")
if(ROCM_DEP_ROCMCORE)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "mivisionx rocm-core")
set(CPACK_RPM_PACKAGE_REQUIRES "mivisionx rocm-core")
endif()
# Set the dependent packages
set(ROCAL_DEBIAN_PACKAGE_LIST "rpp, mivisionx")
set(ROCAL_RPM_PACKAGE_LIST "rpp, mivisionx")
# Set the dev dependent packages
set(ROCAL_DEBIAN_DEV_PACKAGE_LIST "rpp-dev, mivisionx-dev, liblmdb-dev")
set(ROCAL_RPM_DEV_PACKAGE_LIST "rpp-devel, mivisionx-devel, lmdb-devel")

# '%{?dist}' breaks manual builds on debian systems due to empty Provides
execute_process(COMMAND rpm --eval %{?dist}
RESULT_VARIABLE PROC_RESULT
OUTPUT_VARIABLE EVAL_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (PROC_RESULT EQUAL "0" AND NOT EVAL_RESULT STREQUAL "")
string (APPEND CPACK_RPM_PACKAGE_RELEASE "%{?dist}")
execute_process(
COMMAND rpm --eval %{?dist}
RESULT_VARIABLE PROC_RESULT
OUTPUT_VARIABLE EVAL_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(PROC_RESULT EQUAL "0" AND NOT EVAL_RESULT STREQUAL "")
string(APPEND CPACK_RPM_PACKAGE_RELEASE "%{?dist}")
endif()

# set package
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CPACK_PACKAGE_HOMEPAGE})
set(CPACK_RPM_PACKAGE_URL ${CPACK_PACKAGE_HOMEPAGE})
set(CPACK_RPM_PACKAGE_AUTOREQPROV "no")
# Debian package - COMPONENT
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_DEBIAN_RUNTIME_PACKAGE_DEPENDS "rocm-core, ${ROCAL_DEBIAN_PACKAGE_LIST}")
set(CPACK_DEBIAN_DEV_PACKAGE_NAME "${PROJECT_NAME}-dev")
set(CPACK_DEBIAN_DEV_PACKAGE_DEPENDS
"rocm-core, ${CPACK_DEBIAN_RUNTIME_PACKAGE_NAME}, ${ROCAL_DEBIAN_DEV_PACKAGE_LIST}")
# Debian package - specific variable for ASAN
set(CPACK_DEBIAN_ASAN_PACKAGE_NAME "${PROJECT_NAME}-asan" )
set(CPACK_DEBIAN_ASAN_PACKAGE_DEPENDS "rocm-core-asan, ${ROCAL_DEBIAN_PACKAGE_LIST}" )
# Debian package - Test
set(CPACK_DEBIAN_TEST_PACKAGE_NAME "${PROJECT_NAME}-test" )
set(CPACK_DEBIAN_TEST_PACKAGE_DEPENDS "rocm-core, ${CPACK_DEBIAN_DEV_PACKAGE_NAME}" )
# RPM package - COMPONENT
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_RPM_RUNTIME_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_RPM_RUNTIME_PACKAGE_REQUIRES "rocm-core, ${ROCAL_RPM_PACKAGE_LIST}")
set(CPACK_RPM_RUNTIME_PACKAGE_PROVIDES "${PROJECT_NAME}")
set(CPACK_RPM_RUNTIME_PACKAGE_OBSOLETES "${PROJECT_NAME}")
set(CPACK_RPM_DEV_PACKAGE_NAME "${PROJECT_NAME}-devel")
set(CPACK_RPM_DEV_PACKAGE_REQUIRES "rocm-core, ${CPACK_RPM_RUNTIME_PACKAGE_NAME}, ${ROCAL_RPM_DEV_PACKAGE_LIST}")
set(CPACK_RPM_DEV_PACKAGE_PROVIDES "${PROJECT_NAME}-devel")
set(CPACK_RPM_DEV_PACKAGE_OBSOLETES "${PROJECT_NAME}-devel")
# RPM package - specific variable for ASAN
set(CPACK_RPM_ASAN_PACKAGE_NAME "${PROJECT_NAME}-asan" )
set(CPACK_RPM_ASAN_PACKAGE_REQUIRES "rocm-core-asan, ${ROCAL_RPM_PACKAGE_LIST}" )
set(CPACK_RPM_ASAN_PACKAGE_PROVIDES "${PROJECT_NAME}-asan")
set(CPACK_RPM_ASAN_PACKAGE_OBSOLETES "${PROJECT_NAME}-asan")
# RPM package specific variable for ASAN
set(CPACK_RPM_TEST_PACKAGE_NAME "${PROJECT_NAME}-test" )
set(CPACK_RPM_TEST_PACKAGE_REQUIRES "rocm-core, ${CPACK_RPM_DEV_PACKAGE_NAME}" )
set(CPACK_RPM_TEST_PACKAGE_PROVIDES "${PROJECT_NAME}-test")
set(CPACK_RPM_TEST_PACKAGE_OBSOLETES "${PROJECT_NAME}-test")

if(NOT ROCM_DEP_ROCMCORE)
string(REGEX REPLACE ",? ?rocm-core," "" CPACK_RPM_RUNTIME_PACKAGE_REQUIRES ${CPACK_RPM_RUNTIME_PACKAGE_REQUIRES})
string(REGEX REPLACE ",? ?rocm-core-asan," "" CPACK_RPM_ASAN_PACKAGE_REQUIRES ${CPACK_RPM_ASAN_PACKAGE_REQUIRES})
string(REGEX REPLACE ",? ?rocm-core," "" CPACK_RPM_DEV_PACKAGE_REQUIRES ${CPACK_RPM_DEV_PACKAGE_REQUIRES})
string(REGEX REPLACE ",? ?rocm-core," "" CPACK_RPM_TEST_PACKAGE_REQUIRES ${CPACK_RPM_TEST_PACKAGE_REQUIRES})
string(REGEX REPLACE ",? ?rocm-core," "" CPACK_DEBIAN_RUNTIME_PACKAGE_DEPENDS ${CPACK_DEBIAN_RUNTIME_PACKAGE_DEPENDS})
string(REGEX REPLACE ",? ?rocm-core-asan," "" CPACK_DEBIAN_ASAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_ASAN_PACKAGE_DEPENDS})
string(REGEX REPLACE ",? ?rocm-core," "" CPACK_DEBIAN_DEV_PACKAGE_DEPENDS ${CPACK_DEBIAN_DEV_PACKAGE_DEPENDS})
string(REGEX REPLACE ",? ?rocm-core," "" CPACK_DEBIAN_TEST_PACKAGE_DEPENDS ${CPACK_DEBIAN_TEST_PACKAGE_DEPENDS})
endif()

set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${CPACK_PACKAGE_HOMEPAGE})
set(CPACK_RPM_PACKAGE_URL ${CPACK_PACKAGE_HOMEPAGE})
set(CPACK_RPM_PACKAGE_AUTOREQPROV "no")
if(ENABLE_ASAN_PACKAGING)
# ASAN Package requires asan component with only libraries and license file
set(CPACK_COMPONENTS_ALL asan)
else()
set(CPACK_COMPONENTS_ALL runtime dev test)
endif()

set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_RELEASE "local")
set(CPACK_RPM_PACKAGE_RELEASE "local")

if(DEFINED ENV{CPACK_DEBIAN_PACKAGE_RELEASE})
set(CPACK_DEBIAN_PACKAGE_RELEASE $ENV{CPACK_DEBIAN_PACKAGE_RELEASE})
endif()
if(DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE})
set(CPACK_RPM_PACKAGE_RELEASE $ENV{CPACK_RPM_PACKAGE_RELEASE})
endif()

if(APPLE)
set(CPACK_GENERATOR "Bundle")
set(CPACK_BUNDLE_NAME ${CPACK_PACKAGE_NAME})
set(CPACK_BUNDLE_ICON ${CPACK_PACKAGE_ICON})
set(CPACK_BUNDLE_NAME "${PROJECT_NAME}")
set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/docs/data/rocAL_logo.png")
set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/.github/info.plist")
else()
set(CPACK_GENERATOR "TGZ;ZIP")
Expand All @@ -211,10 +293,34 @@ else()
endif()
if(EXISTS ${RPMBUILD_EXE})
list(APPEND CPACK_GENERATOR "RPM")
message("-- ${White}AMD ROCm rocAL RunTime Package -- ${CPACK_RPM_RUNTIME_PACKAGE_REQUIRES}${ColourReset}")
message("-- ${White}AMD ROCm rocAL Dev Package -- ${CPACK_RPM_DEV_PACKAGE_REQUIRES}${ColourReset}")
endif()
if(EXISTS ${DPKG_EXE})
list(APPEND CPACK_GENERATOR "DEB")
endif()
message("-- ${White}AMD ROCm rocAL RunTime Package -- ${CPACK_DEBIAN_RUNTIME_PACKAGE_DEPENDS}${ColourReset}")
message("-- ${White}AMD ROCm rocAL Dev Package -- ${CPACK_DEBIAN_DEV_PACKAGE_DEPENDS}${ColourReset}")
endif()
endif()

include(CPack)

cpack_add_component(runtime
DISPLAY_NAME "rocAL Runtime Package"
DESCRIPTION "AMD rocAL is a comprehensive augmentation library. \
rocAL runtime package provides rocAL libraries and license.txt")

cpack_add_component(dev
DISPLAY_NAME "rocAL Develop Package"
DESCRIPTION "AMD rocAL is a comprehensive augmentation library. \
rocAL develop package provides rocAL libraries, header files, samples, and license.txt")

cpack_add_component(asan
DISPLAY_NAME "rocAL ASAN Package"
DESCRIPTION "AMD rocAL is a comprehensive augmentation library. \
rocAL ASAN package provides rocAL ASAN libraries")

cpack_add_component(test
DISPLAY_NAME "rocAL Test Package"
DESCRIPTION "AMD rocAL is a comprehensive augmentation library. \
rocAL Test package provides rocAL Test Components")
15 changes: 0 additions & 15 deletions cmake/FindMIVisionX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,6 @@ find_library(VXRPP_LIBRARIES
)
mark_as_advanced(VXRPP_LIBRARIES)

find_path(MIVisionX_LIBRARIES_DIRS
NAMES libopenvx${SHARED_LIB_TYPE}
HINTS
$ENV{ROCM_PATH}/lib
$ENV{ROCM_PATH}/lib64
$ENV{MIVisionX_PATH}/lib
PATHS
${MIVisionX_PATH}/lib
/usr/lib
${ROCM_PATH}/lib
)
mark_as_advanced(MIVisionX_LIBRARIES_DIRS)

if(OPENVX_LIBRARIES AND MIVisionX_INCLUDE_DIRS)
set(MIVisionX_FOUND TRUE)
endif( )
Expand All @@ -88,14 +75,12 @@ find_package_handle_standard_args( MIVisionX
OPENVX_LIBRARIES
VXRPP_LIBRARIES
MIVisionX_INCLUDE_DIRS
MIVisionX_LIBRARIES_DIRS
)

set(MIVisionX_FOUND ${MIVisionX_FOUND} CACHE INTERNAL "")
set(OPENVX_LIBRARIES ${OPENVX_LIBRARIES} CACHE INTERNAL "")
set(VXRPP_LIBRARIES ${VXRPP_LIBRARIES} CACHE INTERNAL "")
set(MIVisionX_INCLUDE_DIRS ${MIVisionX_INCLUDE_DIRS} CACHE INTERNAL "")
set(MIVisionX_LIBRARIES_DIRS ${MIVisionX_LIBRARIES_DIRS} CACHE INTERNAL "")

if(MIVisionX_FOUND)
message("-- ${White}Using MIVisionX -- \n\tLibraries:${OPENVX_LIBRARIES} \n\tIncludes:${MIVisionX_INCLUDE_DIRS}${ColourReset}")
Expand Down
24 changes: 10 additions & 14 deletions rocAL_pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
# THE SOFTWARE.

cmake_minimum_required(VERSION 3.5)
project(rocAL_pybind)
set(VERSION "1.0.0")

set(TARGET_NAME rocAL_pybind)
option(BUILD_PYPACKAGE "Build rocAL Python Package" ON)
# Set Project Version and Language
project(rocal_pybind VERSION ${VERSION} LANGUAGES CXX)

set(TARGET_NAME rocal_pybind)

set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Library install directory")
include(GNUInstallDirs)
Expand All @@ -32,22 +34,16 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake)
set(ROCM_PATH /opt/rocm CACHE PATH "Deafult ROCm Installation Path")

set(CMAKE_CXX_STANDARD 17)
set(BUILD_ROCAL_PYBIND true)
set(ROCAL_PYTHON ON)

find_package(AMDRPP QUIET)
find_package(MIVisionX QUIET)
find_package(TurboJpeg QUIET)
if (PYTHONVERSION)
find_package(Python3 "${PYTHONVERSION}" EXACT QUIET COMPONENTS Interpreter Development)
else()
set(Python3_FIND_VIRTUALENV FIRST)
find_package(Python3 QUIET COMPONENTS Interpreter Development)
endif()
find_package(pybind11 QUIET CONFIG)
set(Python3_FIND_VIRTUALENV FIRST)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hansely Please undo these changes and sync to ToT

find_package(Python3 QUIET COMPONENTS Interpreter Development)
find_package(pybind11 QUIET CONFIG)
find_package(HALF QUIET)

# Backend
Expand Down Expand Up @@ -280,8 +276,8 @@ if(${BUILD_ROCAL_PYBIND})
add_dependencies(PyPackageInstall PyPackageBuild)

#install rocAL pybind libs
install(FILES ${CMAKE_BINARY_DIR}/${TARGET_NAME}/${CMAKE_INSTALL_LIBDIR}/${TARGET_PYMODULE_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX_PYTHON})
install(FILES ${CMAKE_BINARY_DIR}/${TARGET_NAME}/${CMAKE_INSTALL_LIBDIR}/${TARGET_PYMODULE_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX_PYTHON} COMPONENT runtime)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hansely did you test this on pytorch dockers?

message("-- ${Green}Radeon Augmentation Library Python Binding - rocal_pybind module added ${ColourReset}")
else()
message("-- ${Red}WARNING: rocAL PyBind Module excluded - Dependency Failure${ColourReset}")
endif()
endif()