Skip to content

Commit

Permalink
CMakeList - Updates (ROCm#7)
Browse files Browse the repository at this point in the history
* CMakeList - Updates

* CMakeList - Find Fix
  • Loading branch information
kiritigowda authored Dec 28, 2022
1 parent 7ab413a commit 1c6367a
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 39 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ set(CPACK_PACKAGE_NAME "rocal")
set(CPACK_PACKAGE_LICENSE "MIT")
set(CPACK_PACKAGE_CONTACT "rocAL Support <mivisionx.support@amd.com>")
set(CPACK_PACKAGE_VENDOR "AMD Radeon")
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/docs/images/MIVisionX.bmp")
set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/docs/images/rocAL_logo.png")
set(CPACK_PACKAGE_GROUP "Development/Tools")
set(CPACK_PACKAGE_HOMEPAGE "https://github.com/ROCmSoftwarePlatform/rocAL")

Expand Down
26 changes: 18 additions & 8 deletions cmake/FindAMDRPP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,28 @@ find_path(AMDRPP_INCLUDE_DIRS
/usr/include
${ROCM_PATH}/include/rpp
)
mark_as_advanced( AMDRPP_INCLUDE_DIRS )
mark_as_advanced(AMDRPP_INCLUDE_DIRS)

find_library( AMDRPP_LIBRARIES
find_library(AMDRPP_LIBRARIES
NAMES amd_rpp
PATHS
/usr/lib
${ROCM_PATH}/lib
)
mark_as_advanced( AMDRPP_LIBRARIES_DIR )
mark_as_advanced(AMDRPP_LIBRARIES)

find_path(AMDRPP_LIBRARIES_DIR
NAMES libamd_rpp.so
find_path(AMDRPP_LIBRARIES_DIRS
NAMES amd_rpp
PATHS
/usr/lib
${ROCM_PATH}/lib
)

mark_as_advanced(AMDRPP_LIBRARIES_DIRS)

if(AMDRPP_LIBRARIES AND AMDRPP_INCLUDE_DIRS)
set(AMDRPP_FOUND TRUE)
endif( )

include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( AMDRPP
FOUND_VAR AMDRPP_FOUND
Expand All @@ -57,8 +62,13 @@ find_package_handle_standard_args( AMDRPP
set(AMDRPP_FOUND ${AMDRPP_FOUND} CACHE INTERNAL "")
set(AMDRPP_LIBRARIES ${AMDRPP_LIBRARIES} CACHE INTERNAL "")
set(AMDRPP_INCLUDE_DIRS ${AMDRPP_INCLUDE_DIRS} CACHE INTERNAL "")
set(AMDRPP_LIBRARIES_DIR ${AMDRPP_LIBRARIES_DIR} CACHE INTERNAL "")
set(AMDRPP_LIBRARIES_DIRS ${AMDRPP_LIBRARIES_DIRS} CACHE INTERNAL "")

if( NOT AMDRPP_FOUND )
if(AMDRPP_FOUND )
message("-- ${White}Using AMD RPP -- \n\tLibraries:${AMDRPP_LIBRARIES} \n\tIncludes:${AMDRPP_INCLUDE_DIRS}${ColourReset}")
else()
if(AMDRPP_FIND_REQUIRED)
message(FATAL_ERROR "{Red}FindAMDRPP -- NOT FOUND${ColourReset}")
endif()
message( "-- ${Yellow}NOTE: FindAMDRPP failed to find -- amd_rpp${ColourReset}" )
endif()
96 changes: 96 additions & 0 deletions cmake/FindMIVisionX.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
################################################################################
#
# MIT License
#
# Copyright (c) 2017 - 2022 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
################################################################################
if(APPLE)
set(SHARED_LIB_TYPE ".dylib")
else()
set(SHARED_LIB_TYPE ".so")
endif()

find_path(MIVisionX_INCLUDE_DIRS
NAMES vx_ext_amd.h
PATHS
/usr/include
${ROCM_PATH}/include/mivisionx
)
mark_as_advanced(MIVisionX_INCLUDE_DIRS)

# OpenVX
find_library(OPENVX_LIBRARIES
NAMES libopenvx${SHARED_LIB_TYPE}
PATHS
/usr/lib
${ROCM_PATH}/lib
)
mark_as_advanced(OPENVX_LIBRARIES)

# VX_RPP
find_library(VXRPP_LIBRARIES
NAMES libvx_rpp${SHARED_LIB_TYPE}
PATHS
/usr/lib
${ROCM_PATH}/lib
)
mark_as_advanced(VXRPP_LIBRARIES)

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

if(OPENVX_LIBRARIES AND MIVisionX_INCLUDE_DIRS)
set(MIVisionX_FOUND TRUE)
endif( )

include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( MIVisionX
FOUND_VAR MIVisionX_FOUND
REQUIRED_VARS
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}")
else()
if(MIVisionX_FIND_REQUIRED)
message(FATAL_ERROR "{Red}FindMIVisionX -- NOT FOUND${ColourReset}")
endif()
message( "-- ${Yellow}NOTE: FindMIVisionX failed to find -- openvx${ColourReset}" )
endif()
7 changes: 6 additions & 1 deletion cmake/FindOpenCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ else()
message("-- ${White}OpenCL - Setting CL_TARGET_OPENCL_VERSION=${CL_TARGET_OpenCL_VERSION}${ColourReset}")
endif()

if( NOT OpenCL_FOUND )
if(OpenCL_FOUND)
message("-- ${White}Using OpenCL -- \n\tLibraries:${OpenCL_LIBRARIES} \n\tIncludes:${OpenCL_INCLUDE_DIRS}${ColourReset}")
else()
if(OpenCL_FIND_REQUIRED)
message(FATAL_ERROR "{Red}FindOpenCL -- NOT FOUND${ColourReset}")
endif()
message( "-- ${Yellow}NOTE: FindOpenCL failed to find -- OpenCL${ColourReset}" )
endif()
endif()
38 changes: 27 additions & 11 deletions cmake/FindTurboJpeg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,53 +23,69 @@
# SOFTWARE.
#
################################################################################
if(APPLE)
set(SHARED_LIB_TYPE ".dylib")
else()
set(SHARED_LIB_TYPE ".so")
endif()

find_path(TurboJpeg_INCLUDE_DIRS
NAMES turbojpeg.h
HINTS
$ENV{TURBO_JPEG_PATH}/include
PATHS
${TURBO_JPEG_PATH}/include
/usr/include/
/usr/include
/opt/libjpeg-turbo/include
)
mark_as_advanced( TurboJpeg_INCLUDE_DIRS )
mark_as_advanced(TurboJpeg_INCLUDE_DIRS)

find_library( TurboJpeg_LIBRARIES
NAMES libturbojpeg.so
find_library(TurboJpeg_LIBRARIES
NAMES libturbojpeg${SHARED_LIB_TYPE}
HINTS
$ENV{TURBO_JPEG_PATH}/lib
$ENV{TURBO_JPEG_PATH}/lib64
PATHS
${TURBO_JPEG_PATH}/lib
${TURBO_JPEG_PATH}/lib64
/usr/lib
/opt/libjpeg-turbo/lib
)
mark_as_advanced( TurboJpeg_LIBRARIES_DIR )
mark_as_advanced(TurboJpeg_LIBRARIES)

find_path(TurboJpeg_LIBRARIES_DIR
NAMES libturbojpeg.so
find_path(TurboJpeg_LIBRARIES_DIRS
NAMES libturbojpeg${SHARED_LIB_TYPE}
HINTS
$ENV{TURBO_JPEG_PATH}/lib
$ENV{TURBO_JPEG_PATH}/lib64
PATHS
${TURBO_JPEG_PATH}/lib
${TURBO_JPEG_PATH}/lib64
/usr/lib
/opt/libjpeg-turbo/lib
)
mark_as_advanced(TurboJpeg_LIBRARIES_DIRS)

if(TurboJpeg_LIBRARIES AND TurboJpeg_INCLUDE_DIRS)
set(TurboJpeg_FOUND TRUE)
endif( )

include( FindPackageHandleStandardArgs )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args( TurboJpeg
FOUND_VAR TurboJpeg_FOUND
REQUIRED_VARS
TurboJpeg_LIBRARIES
TurboJpeg_INCLUDE_DIRS
TurboJpeg_LIBRARIES_DIR
TurboJpeg_LIBRARIES_DIRS
)

set(TurboJpeg_FOUND ${TurboJpeg_FOUND} CACHE INTERNAL "")
set(TurboJpeg_LIBRARIES ${TurboJpeg_LIBRARIES} CACHE INTERNAL "")
set(TurboJpeg_INCLUDE_DIRS ${TurboJpeg_INCLUDE_DIRS} CACHE INTERNAL "")
set(TurboJpeg_LIBRARIES_DIR ${TurboJpeg_LIBRARIES_DIR} CACHE INTERNAL "")
set(TurboJpeg_LIBRARIES_DIRS ${TurboJpeg_LIBRARIES_DIRS} CACHE INTERNAL "")

if( NOT TurboJpeg_FOUND )
if(TurboJpeg_FOUND)
message("-- ${White}Using Turbo JPEG -- \n\tLibraries:${TurboJpeg_LIBRARIES} \n\tIncludes:${TurboJpeg_INCLUDE_DIRS}${ColourReset}")
else()
message( "-- ${Yellow}NOTE: FindTurboJpeg failed to find -- turbojpeg${ColourReset}" )
endif()
Loading

0 comments on commit 1c6367a

Please sign in to comment.