Add 'projects/aqlprofile/' from commit '6f236ffb5f1bd128e11ba0bf09e3c0a52b6527e4'
git-subtree-dir: projects/aqlprofile git-subtree-mainline:9011821e05git-subtree-split:6f236ffb5f
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
#!/bin/sh
|
||||
# Display usage
|
||||
cpack_usage()
|
||||
{
|
||||
cat <<EOF
|
||||
Usage: $0 [options]
|
||||
Options: [defaults in brackets after descriptions]
|
||||
--help print this message
|
||||
--prefix=dir directory in which to install
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
cpack_echo_exit()
|
||||
{
|
||||
echo $1
|
||||
exit 1
|
||||
}
|
||||
# Display version
|
||||
cpack_version()
|
||||
{
|
||||
echo "@CPACK_PACKAGE_NAME@ Installer Version: @CPACK_PACKAGE_VERSION@, Copyright (c) @CPACK_PACKAGE_VENDOR@"
|
||||
}
|
||||
# Helper function to fix windows paths.
|
||||
cpack_fix_slashes ()
|
||||
{
|
||||
echo "$1" | sed 's/\\/\//g'
|
||||
}
|
||||
interactive=TRUE
|
||||
cpack_skip_license=FALSE
|
||||
cpack_include_subdir=FALSE
|
||||
for a in "$@CPACK_AT_SIGN@"; do
|
||||
if echo $a | grep "^--prefix=" > /dev/null 2> /dev/null; then
|
||||
cpack_prefix_dir=`echo $a | sed "s/^--prefix=//"`
|
||||
cpack_prefix_dir=`cpack_fix_slashes "${cpack_prefix_dir}"`
|
||||
fi
|
||||
if echo $a | grep "^--help" > /dev/null 2> /dev/null; then
|
||||
cpack_usage
|
||||
fi
|
||||
if echo $a | grep "^--version" > /dev/null 2> /dev/null; then
|
||||
cpack_version
|
||||
exit 2
|
||||
fi
|
||||
done
|
||||
if [ "x${cpack_include_subdir}x" != "xx" -o "x${cpack_skip_license}x" = "xTRUEx" ]
|
||||
then
|
||||
interactive=FALSE
|
||||
fi
|
||||
cpack_version
|
||||
echo "This is a self-extracting archive."
|
||||
toplevel="`pwd`"
|
||||
if [ "x${cpack_prefix_dir}x" != "xx" ]
|
||||
then
|
||||
toplevel="${cpack_prefix_dir}"
|
||||
fi
|
||||
echo "The archive will be extracted to: ${toplevel}"
|
||||
if [ "x${interactive}x" = "xTRUEx" ]
|
||||
then
|
||||
echo ""
|
||||
echo "If you want to stop extracting, please press <ctrl-C>."
|
||||
if [ "x${cpack_skip_license}x" != "xTRUEx" ]
|
||||
then
|
||||
more << '____cpack__here_doc____'
|
||||
@CPACK_RESOURCE_FILE_LICENSE_CONTENT@
|
||||
____cpack__here_doc____
|
||||
echo
|
||||
echo "Do you accept the license? [yN]: "
|
||||
read line leftover
|
||||
case ${line} in
|
||||
y* | Y*)
|
||||
cpack_license_accepted=TRUE;;
|
||||
*)
|
||||
echo "License not accepted. Exiting ..."
|
||||
exit 1;;
|
||||
esac
|
||||
fi
|
||||
if [ "x${cpack_include_subdir}x" = "xx" ]
|
||||
then
|
||||
echo "By default the @CPACK_PACKAGE_NAME@ will be installed in:"
|
||||
echo " \"${toplevel}/@CPACK_PACKAGE_FILE_NAME@\""
|
||||
echo "Do you want to include the subdirectory @CPACK_PACKAGE_FILE_NAME@?"
|
||||
echo "Saying no will install in: \"${toplevel}\" [Yn]: "
|
||||
read line leftover
|
||||
cpack_include_subdir=TRUE
|
||||
case ${line} in
|
||||
n* | N*)
|
||||
cpack_include_subdir=FALSE
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
if [ "x${cpack_include_subdir}x" = "xTRUEx" ]
|
||||
then
|
||||
toplevel="${toplevel}/@CPACK_PACKAGE_FILE_NAME@"
|
||||
mkdir -p "${toplevel}"
|
||||
fi
|
||||
echo
|
||||
echo "Using target directory: ${toplevel}"
|
||||
echo "Extracting, please wait..."
|
||||
echo ""
|
||||
# take the archive portion of this file and pipe it to tar
|
||||
# the NUMERIC parameter in this command should be one more
|
||||
# than the number of lines in this header file
|
||||
# there are tails which don't understand the "-n" argument, e.g. on SunOS
|
||||
# OTOH there are tails which complain when not using the "-n" argument (e.g. GNU)
|
||||
# so at first try to tail some file to see if tail fails if used with "-n"
|
||||
# if so, don't use "-n"
|
||||
use_new_tail_syntax="-n"
|
||||
tail $use_new_tail_syntax +1 "$0" > /dev/null 2> /dev/null || use_new_tail_syntax=""
|
||||
tail $use_new_tail_syntax +###CPACK_HEADER_LENGTH### "$0" | gunzip | (cd "${toplevel}" && tar xf -) || cpack_echo_exit "Problem unpacking the @CPACK_PACKAGE_FILE_NAME@"
|
||||
echo "Unpacking finished successfully"
|
||||
exit 0
|
||||
#-----------------------------------------------------------
|
||||
# Start of TAR.GZ file
|
||||
#-----------------------------------------------------------;
|
||||
@@ -0,0 +1,85 @@
|
||||
## Build is not supported on Windows plaform
|
||||
if ( WIN32 )
|
||||
message ( FATAL_ERROR "Windows build is not supported." )
|
||||
endif ()
|
||||
|
||||
## Compiler Preprocessor definitions.
|
||||
add_definitions ( -DAMD_INTERNAL_BUILD )
|
||||
add_definitions ( -DHSA_LARGE_MODEL= )
|
||||
add_definitions ( -DHSA_DEPRECATED= )
|
||||
add_definitions ( -DLITTLEENDIAN_CPU=1 )
|
||||
|
||||
## Linux Compiler options
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-math-errno")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fms-extensions")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmerge-all-constants")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
||||
|
||||
add_definitions(-DNEW_TRACE_API=1)
|
||||
|
||||
## CLANG options
|
||||
if ( "$ENV{CXX}" STREQUAL "/usr/bin/clang++" )
|
||||
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ferror-limit=1000000" )
|
||||
endif()
|
||||
|
||||
## Enable debug trace
|
||||
if ( DEFINED ENV{CMAKE_DEBUG_TRACE} )
|
||||
add_definitions ( -DDEBUG_TRACE=1 )
|
||||
endif()
|
||||
|
||||
## Enable direct loading of AQL-profile HSA extension
|
||||
if ( DEFINED ENV{CMAKE_LD_AQLPROFILE} )
|
||||
add_definitions (-DROCP_LD_AQLPROFILE=1)
|
||||
endif()
|
||||
|
||||
## Build type
|
||||
if ( NOT DEFINED CMAKE_BUILD_TYPE OR "${CMAKE_BUILD_TYPE}" STREQUAL "" )
|
||||
if ( DEFINED ENV{CMAKE_BUILD_TYPE} )
|
||||
set ( CMAKE_BUILD_TYPE $ENV{CMAKE_BUILD_TYPE} )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
## Installation prefix path
|
||||
if ( NOT DEFINED CMAKE_PREFIX_PATH AND DEFINED ENV{CMAKE_PREFIX_PATH} )
|
||||
set ( CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH} )
|
||||
endif()
|
||||
set ( ENV{CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH} )
|
||||
|
||||
## Extend Compiler flags based on build type
|
||||
string ( TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE )
|
||||
if ( "${CMAKE_BUILD_TYPE}" STREQUAL debug )
|
||||
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb" )
|
||||
set ( CMAKE_BUILD_TYPE "debug" )
|
||||
else ()
|
||||
set ( CMAKE_BUILD_TYPE "release" )
|
||||
endif ()
|
||||
|
||||
## Extend Compiler flags based on Processor architecture
|
||||
if ( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" )
|
||||
set ( NBIT 64 )
|
||||
set ( NBITSTR "64" )
|
||||
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -msse -msse2" )
|
||||
elseif ( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86" )
|
||||
set ( NBIT 32 )
|
||||
set ( NBITSTR "" )
|
||||
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" )
|
||||
endif ()
|
||||
|
||||
## Find hsa-runtime
|
||||
find_package(hsa-runtime64 REQUIRED HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm)
|
||||
|
||||
## Basic Tool Chain Information
|
||||
message ( "----------------NBIT: ${NBIT}" )
|
||||
message ( "-----------BuildType: ${CMAKE_BUILD_TYPE}" )
|
||||
message ( "------------Compiler: ${CMAKE_CXX_COMPILER}" )
|
||||
message ( "----Compiler-Version: ${CMAKE_CXX_COMPILER_VERSION}" )
|
||||
message ( "------------API-path: ${API_PATH}" )
|
||||
message ( "-----CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}" )
|
||||
message ( "---CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}" )
|
||||
message ( "-CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}" )
|
||||
message ( "-CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION}" )
|
||||
message ( "---------GPU_TARGETS: ${GPU_TARGETS}" )
|
||||
@@ -0,0 +1,76 @@
|
||||
|
||||
|
||||
## Parses the VERSION_STRING variable and places
|
||||
## the first, second and third number values in
|
||||
## the major, minor and patch variables.
|
||||
function( parse_version VERSION_STRING )
|
||||
|
||||
string ( FIND ${VERSION_STRING} "-" STRING_INDEX )
|
||||
|
||||
if ( ${STRING_INDEX} GREATER -1 )
|
||||
math ( EXPR STRING_INDEX "${STRING_INDEX} + 1" )
|
||||
string ( SUBSTRING ${VERSION_STRING} ${STRING_INDEX} -1 VERSION_BUILD )
|
||||
endif ()
|
||||
|
||||
string ( REGEX MATCHALL "[0123456789]+" VERSIONS ${VERSION_STRING} )
|
||||
list ( LENGTH VERSIONS VERSION_COUNT )
|
||||
|
||||
if ( ${VERSION_COUNT} GREATER 0)
|
||||
list ( GET VERSIONS 0 MAJOR )
|
||||
set ( VERSION_MAJOR ${MAJOR} PARENT_SCOPE )
|
||||
set ( TEMP_VERSION_STRING "${MAJOR}" )
|
||||
endif ()
|
||||
|
||||
if ( ${VERSION_COUNT} GREATER 1 )
|
||||
list ( GET VERSIONS 1 MINOR )
|
||||
set ( VERSION_MINOR ${MINOR} PARENT_SCOPE )
|
||||
set ( TEMP_VERSION_STRING "${TEMP_VERSION_STRING}.${MINOR}" )
|
||||
endif ()
|
||||
|
||||
if ( ${VERSION_COUNT} GREATER 2 )
|
||||
list ( GET VERSIONS 2 PATCH )
|
||||
set ( VERSION_PATCH ${PATCH} PARENT_SCOPE )
|
||||
set ( TEMP_VERSION_STRING "${TEMP_VERSION_STRING}.${PATCH}" )
|
||||
endif ()
|
||||
|
||||
if ( DEFINED VERSION_BUILD )
|
||||
set ( VERSION_BUILD "${VERSION_BUILD}" PARENT_SCOPE )
|
||||
endif ()
|
||||
|
||||
set ( VERSION_STRING "${TEMP_VERSION_STRING}" PARENT_SCOPE )
|
||||
|
||||
endfunction ()
|
||||
|
||||
## Gets the current version of the repository
|
||||
## using versioning tags and git describe.
|
||||
## Passes back a packaging version string
|
||||
## and a library version string.
|
||||
function ( get_version DEFAULT_VERSION_STRING )
|
||||
|
||||
parse_version ( ${DEFAULT_VERSION_STRING} )
|
||||
|
||||
find_program ( GIT NAMES git )
|
||||
|
||||
if ( GIT )
|
||||
|
||||
execute_process ( COMMAND "git describe --dirty --long --match [0-9]* 2>/dev/null"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_TAG_STRING
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE RESULT )
|
||||
|
||||
if ( ${RESULT} EQUAL 0 )
|
||||
|
||||
parse_version ( ${GIT_TAG_STRING} )
|
||||
|
||||
endif ()
|
||||
|
||||
endif ()
|
||||
|
||||
set( VERSION_STRING "${VERSION_STRING}" PARENT_SCOPE )
|
||||
set( VERSION_MAJOR "${VERSION_MAJOR}" PARENT_SCOPE )
|
||||
set( VERSION_MINOR "${VERSION_MINOR}" PARENT_SCOPE )
|
||||
set( VERSION_PATCH "${VERSION_PATCH}" PARENT_SCOPE )
|
||||
set( VERSION_BUILD "${VERSION_BUILD}" PARENT_SCOPE )
|
||||
|
||||
endfunction()
|
||||
Reference in New Issue
Block a user