mirror of
https://github.com/ROCm/ROCm.git
synced 2026-01-08 22:28:06 -05:00
Update build scripts of ROCm6.3 release to develop branch
This commit is contained in:
@@ -66,46 +66,44 @@ endef
|
||||
# It is a space seperated list with zero or more elements.
|
||||
|
||||
$(call adddep,amd_smi_lib,${ASAN_DEP})
|
||||
$(call adddep,aqlprofile,${ASAN_DEP} hsa)
|
||||
$(call adddep,aqlprofile,${ASAN_DEP} rocr)
|
||||
$(call adddep,comgr,lightning devicelibs)
|
||||
$(call adddep,dbgapi,hsa comgr)
|
||||
$(call adddep,dbgapi,rocr comgr)
|
||||
$(call adddep,devicelibs,lightning)
|
||||
$(call adddep,hip_on_rocclr,${ASAN_DEP} hsa comgr hipcc rocprofiler-register)
|
||||
$(call adddep,hip_on_rocclr,${ASAN_DEP} rocr comgr hipcc rocprofiler-register)
|
||||
$(call adddep,hipcc,)
|
||||
$(call adddep,hipify_clang,hip_on_rocclr lightning)
|
||||
$(call adddep,hsa,${ASAN_DEP} thunk lightning devicelibs rocprofiler-register)
|
||||
$(call adddep,lightning,)
|
||||
$(call adddep,omniperf,${ASAN_DEP})
|
||||
$(call adddep,omnitrace,hipcc hsa hip_on_rocclr rocm_smi_lib rocprofiler roctracer)
|
||||
$(call adddep,opencl_icd_loader,)
|
||||
$(call adddep,opencl_on_rocclr,${ASAN_DEP} hsa comgr opencl_icd_loader)
|
||||
$(call adddep,openmp_extras,thunk lightning devicelibs hsa)
|
||||
$(call adddep,rdc,${ASAN_DEP} rocm_smi_lib hsa rocprofiler)
|
||||
$(call adddep,rocclr,${ASAN_DEP} hsa comgr hipcc rocprofiler-register)
|
||||
$(call adddep,rocm_bandwidth_test,${ASAN_DEP} hsa)
|
||||
$(call adddep,opencl_on_rocclr,${ASAN_DEP} rocr comgr)
|
||||
$(call adddep,openmp_extras,lightning devicelibs rocr)
|
||||
$(call adddep,rocm_bandwidth_test,${ASAN_DEP} rocr)
|
||||
$(call adddep,rocm_smi_lib,${ASAN_DEP})
|
||||
$(call adddep,rocm-cmake,${ASAN_DEP})
|
||||
$(call adddep,rocm-core,${ASAN_DEP})
|
||||
$(call adddep,rocm-gdb,dbgapi)
|
||||
$(call adddep,rocminfo,${ASAN_DEP} hsa)
|
||||
$(call adddep,rocminfo,${ASAN_DEP} rocr)
|
||||
$(call adddep,rocprofiler-register,${ASAN_DEP})
|
||||
$(call adddep,rocprofiler-sdk,${ASAN_DEP} hsa aqlprofile opencl_on_rocclr hip_on_rocclr comgr)
|
||||
$(call adddep,rocprofiler,${ASAN_DEP} hsa roctracer aqlprofile opencl_on_rocclr hip_on_rocclr comgr)
|
||||
$(call adddep,rocr_debug_agent,${ASAN_DEP} hip_on_rocclr hsa dbgapi)
|
||||
$(call adddep,roctracer,${ASAN_DEP} hsa hip_on_rocclr)
|
||||
$(call adddep,thunk,${ASAN_DEP})
|
||||
$(call adddep,rocprofiler-sdk,${ASAN_DEP} rocr aqlprofile opencl_on_rocclr hip_on_rocclr comgr)
|
||||
$(call adddep,rocprofiler-systems,${ASAN_DEP} hipcc rocr hip_on_rocclr rocm_smi_lib rocprofiler roctracer rocprofiler-sdk)
|
||||
$(call adddep,rocprofiler,${ASAN_DEP} rocr roctracer aqlprofile opencl_on_rocclr hip_on_rocclr comgr)
|
||||
$(call adddep,rocprofiler-compute,${ASAN_DEP})
|
||||
$(call adddep,rocr,${ASAN_DEP} lightning rocm_smi_lib devicelibs rocprofiler-register)
|
||||
$(call adddep,rocr_debug_agent,${ASAN_DEP} hip_on_rocclr rocr dbgapi)
|
||||
$(call adddep,roctracer,${ASAN_DEP} rocr hip_on_rocclr)
|
||||
|
||||
# rocm-dev points to all possible last finish components of Stage1 build.
|
||||
rocm-dev-components :=rdc hipify_clang openmp_extras \
|
||||
omniperf omnitrace rocm-core amd_smi_lib hipcc \
|
||||
rocm_bandwidth_test rocr_debug_agent rocm-gdb
|
||||
$(call adddep,rocm-dev,$(filter-out ${NOBUILD},${rocm-dev-components}))
|
||||
rocm-dev-components :=amd_smi_lib aqlprofile comgr dbgapi devicelibs hip_on_rocclr hipcc hipify_clang \
|
||||
lightning rocprofiler-compute opencl_on_rocclr openmp_extras rocm_bandwidth_test rocm_smi_lib \
|
||||
rocm-cmake rocm-core rocm-gdb rocminfo rocprofiler-register rocprofiler-sdk rocprofiler-systems \
|
||||
rocprofiler rocr rocr_debug_agent roctracer
|
||||
$(call adddep,rocm-dev,$(filter-out ${NOBUILD} kernel_ubuntu,${rocm-dev-components}))
|
||||
|
||||
$(call adddep,amdmigraphx,hip_on_rocclr half rocblas miopen-hip lightning hipcc)
|
||||
$(call adddep,amdmigraphx,hip_on_rocclr half rocblas miopen-hip lightning hipcc hiptensor)
|
||||
$(call adddep,composable_kernel,lightning hipcc hip_on_rocclr rocm-cmake)
|
||||
$(call adddep,half,rocm-cmake)
|
||||
$(call adddep,hipblas-common,lightning)
|
||||
$(call adddep,hipblas,hip_on_rocclr rocblas rocsolver lightning hipcc)
|
||||
$(call adddep,hipblaslt,hip_on_rocclr openmp_extras hipblas lightning hipcc)
|
||||
$(call adddep,hipblaslt,hip_on_rocclr openmp_extras lightning hipcc hipblas-common rocm-dev)
|
||||
$(call adddep,hipcub,hip_on_rocclr rocprim lightning hipcc)
|
||||
$(call adddep,hipfft,hip_on_rocclr openmp_extras rocfft rocrand hiprand lightning hipcc)
|
||||
$(call adddep,hipfort,rocblas hipblas rocsparse hipsparse rocfft hipfft rocrand hiprand rocsolver hipsolver lightning hipcc)
|
||||
@@ -115,22 +113,25 @@ $(call adddep,hipsparse,hip_on_rocclr rocsparse lightning hipcc)
|
||||
$(call adddep,hipsparselt,hip_on_rocclr hipsparse lightning hipcc openmp_extras)
|
||||
$(call adddep,hiptensor,hip_on_rocclr composable_kernel lightning hipcc)
|
||||
$(call adddep,miopen-deps,lightning hipcc)
|
||||
$(call adddep,miopen-hip,composable_kernel half hip_on_rocclr miopen-deps rocblas roctracer lightning hipcc)
|
||||
$(call adddep,miopen-hip,composable_kernel half hip_on_rocclr miopen-deps hipblas hipblaslt rocrand roctracer lightning hipcc)
|
||||
$(call adddep,mivisionx,amdmigraphx miopen-hip rpp lightning hipcc)
|
||||
$(call adddep,rccl,hip_on_rocclr hsa lightning hipcc rocm_smi_lib hipify_clang)
|
||||
$(call adddep,rccl,rocm-core hip_on_rocclr rocr lightning hipcc rocm_smi_lib hipify_clang)
|
||||
$(call adddep,rdc,rocm_smi_lib rocprofiler rocmvalidationsuite)
|
||||
$(call adddep,rocalution,rocblas rocsparse rocrand lightning hipcc)
|
||||
$(call adddep,rocblas,hip_on_rocclr openmp_extras lightning hipcc)
|
||||
$(call adddep,rocblas,hip_on_rocclr openmp_extras lightning hipcc hipblaslt)
|
||||
$(call adddep,rocal,mivisionx)
|
||||
$(call adddep,rocdecode,hip_on_rocclr lightning hipcc)
|
||||
$(call adddep,rocdecode,hip_on_rocclr lightning hipcc amdmigraphx)
|
||||
$(call adddep,rocfft,hip_on_rocclr rocrand hiprand lightning hipcc openmp_extras)
|
||||
$(call adddep,rocmvalidationsuite,hip_on_rocclr hsa rocblas rocm-core lightning hipcc rocm_smi_lib)
|
||||
$(call adddep,rocjpeg,hip_on_rocclr lightning hipcc rocm-dev)
|
||||
$(call adddep,rocmvalidationsuite,hip_on_rocclr rocr hipblas hiprand hipblaslt rocm-core lightning hipcc rocm_smi_lib)
|
||||
$(call adddep,rocprim,hip_on_rocclr lightning hipcc)
|
||||
$(call adddep,rocrand,hip_on_rocclr lightning hipcc)
|
||||
$(call adddep,rocsolver,hip_on_rocclr rocblas rocsparse lightning hipcc)
|
||||
$(call adddep,rocsolver,hip_on_rocclr rocblas rocsparse rocprim lightning hipcc)
|
||||
$(call adddep,rocsparse,hip_on_rocclr rocprim lightning hipcc)
|
||||
$(call adddep,rocthrust,hip_on_rocclr rocprim lightning hipcc)
|
||||
$(call adddep,rocwmma,hip_on_rocclr rocblas lightning hipcc rocm-cmake rocm_smi_lib)
|
||||
$(call adddep,rpp,half lightning hipcc openmp_extras)
|
||||
$(call adddep,transferbench,hip_on_rocclr lightning hipcc)
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
@@ -189,7 +190,7 @@ else # } {
|
||||
# Pass in jobserver info using the RMAKE variable
|
||||
${RMAKE}@( if set -x && source $${INFRA_REPO}/envsetup.sh && \
|
||||
rm -f $$@.errors $$@ $$@.repackaged && \
|
||||
$${INFRA_REPO}/build_$1.sh -c && source $${INFRA_REPO}/ccache-env-mathlib.sh && \
|
||||
$${INFRA_REPO}/build_$1.sh -c && \
|
||||
time bash -x $${INFRA_REPO}/build_$1.sh $${RELEASE_FLAG} $${SANITIZER_FLAG} && $${INFRA_REPO}/post_inst_pkg.sh "$1" ; \
|
||||
then mv $$@.inprogress $$@ ; \
|
||||
else mv $$@.inprogress $$@.errors ; echo Error in $1 >&2 ; exit 1 ;\
|
||||
@@ -216,11 +217,14 @@ $(call peval,$(foreach dep,$(strip ${components}),$(call toplevel,${dep})))
|
||||
all: $(addprefix T_,$(filter-out ${NOBUILD},${components}))
|
||||
@echo All ROCm components built
|
||||
# Do not document this target
|
||||
upload: $(addprefix U_,${components})
|
||||
upload: $(addprefix U_,$(filter-out ${NOBUILD},${components}))
|
||||
@echo All ROCm components built and uploaded
|
||||
|
||||
upload-rocm-dev: $(addprefix U_,$(filter-out ${NOBUILD},${components}))
|
||||
@echo All rocm-dev components built and uploaded
|
||||
|
||||
##help rocm-dev: Build a subset of ROCm
|
||||
rocm-dev: T_rocm-dev
|
||||
rocm-dev: $(addprefix T_,$(filter-out ${NOBUILD},${components}))
|
||||
@echo rocm-dev built
|
||||
|
||||
${OUT_DIR}/logs:
|
||||
|
||||
@@ -22,15 +22,15 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
PROJ_NAME="amdsmi"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
TARGET="build"
|
||||
|
||||
PACKAGE_LIB=$(getLibPath)
|
||||
PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
|
||||
AMDSMI_BUILD_DIR=$(getBuildPath amdsmi)
|
||||
AMDSMI_PACKAGE_DEB_DIR="$(getPackageRoot)/deb/amdsmi"
|
||||
AMDSMI_PACKAGE_RPM_DIR="$(getPackageRoot)/rpm/amdsmi"
|
||||
AMDSMI_BUILD_DIR=$(getBuildPath $PROJ_NAME)
|
||||
AMDSMI_PACKAGE_DEB_DIR="$PACKAGE_ROOT/deb/$PROJ_NAME"
|
||||
AMDSMI_PACKAGE_RPM_DIR="$PACKAGE_ROOT/rpm/$PROJ_NAME"
|
||||
AMDSMI_BUILD_TYPE="debug"
|
||||
BUILD_TYPE="Debug"
|
||||
|
||||
@@ -57,10 +57,9 @@ do
|
||||
(-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
# TODO - support standard option of passing cmake environment vars - CFLAGS,CXXFLAGS etc., to enable address sanitizer
|
||||
ADDRESS_SANITIZER=true ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
ack_and_skip_static ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
|
||||
@@ -10,7 +10,9 @@ build_amdmigraphx() {
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
|
||||
if ! command -v rbuild &> /dev/null; then
|
||||
pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
@@ -20,7 +22,7 @@ build_amdmigraphx() {
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
GPU_TARGETS="gfx900;gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102;gfx942;gfx1200;gfx1201"
|
||||
fi
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
@@ -29,7 +31,7 @@ build_amdmigraphx() {
|
||||
--cxx="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
--cc="${ROCM_PATH}/llvm/bin/clang" \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--enable-new-dtags -Wl,--rpath,$ROCM_LIB_RPATH" \
|
||||
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_LIB_RPATH" \
|
||||
-DGPU_TARGETS="${GPU_TARGETS}" \
|
||||
-DCMAKE_INSTALL_RPATH=""
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@ printUsage() {
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
type referred to by pkg_type"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore.
|
||||
No effect of the param on this build"
|
||||
echo " -h, --help Prints this help"
|
||||
echo
|
||||
echo "Possible values for <type>:"
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/compute_utils.sh"
|
||||
|
||||
printUsage() {
|
||||
echo
|
||||
echo "Usage: $(basename "${BASH_SOURCE}") [-c|-r|-h] [makeopts]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -c, --clean Removes all clang-ocl build artifacts"
|
||||
echo " -r, --release Build non-debug version clang-ocl (default is debug)"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -s, --static Supports static CI by accepting this param & not bailing out. No effect of the param though"
|
||||
echo
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
TARGET="build"
|
||||
CLANG_OCL_DEST="$(getBinPath)"
|
||||
CLANG_OCL_SRC_ROOT="$CLANG_OCL_ROOT"
|
||||
CLANG_OCL_BUILD_DIR="$(getBuildPath clang-ocl)"
|
||||
|
||||
MAKEARG="$DASH_JAY"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_UTILS="$(getUtilsPath)"
|
||||
CLANG_OCL_PACKAGE_DEB="$PACKAGE_ROOT/deb/clang-ocl"
|
||||
CLANG_OCL_PACKAGE_RPM="$PACKAGE_ROOT/rpm/clang-ocl"
|
||||
BUILD_TYPE="Debug"
|
||||
SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
|
||||
VALID_STR=`getopt -o hcraso:g: --long help,clean,release,clean,static,address_sanitizer,outdir:,gpu_list: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
(-c | --clean)
|
||||
TARGET="clean" ; ((CLEAN_OR_OUT|=1)) ; shift ;;
|
||||
(-r | --release)
|
||||
MAKEARG="$MAKEARG BUILD_TYPE=rel" ; BUILD_TYPE="Release" ; shift ;;
|
||||
(-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-g | --gpu_list )
|
||||
GPU_LIST=$2; shift 2 ;;
|
||||
--) shift; break;;
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
RET_CONFLICT=1
|
||||
check_conflicting_options $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
if [ $RET_CONFLICT -ge 30 ]; then
|
||||
print_vars $API_NAME $TARGET $BUILD_TYPE $SHARED_LIBS $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
exit $RET_CONFLICT
|
||||
fi
|
||||
|
||||
clean_clang-ocl() {
|
||||
echo "Removing clang-ocl"
|
||||
rm -rf $CLANG_OCL_DEST/clang-ocl
|
||||
rm -rf $CLANG_OCL_BUILD_DIR
|
||||
rm -rf $CLANG_OCL_PACKAGE_DEB
|
||||
rm -rf $CLANG_OCL_PACKAGE_RPM
|
||||
}
|
||||
|
||||
build_clang-ocl() {
|
||||
if [ ! -d "$CLANG_OCL_BUILD_DIR" ]; then
|
||||
mkdir -p $CLANG_OCL_BUILD_DIR
|
||||
pushd $CLANG_OCL_BUILD_DIR
|
||||
|
||||
if [ -e $PACKAGE_ROOT/lib/bitcode/opencl.amdgcn.bc ]; then
|
||||
BC_DIR="$ROCM_INSTALL_PATH/lib"
|
||||
else
|
||||
BC_DIR="$ROCM_INSTALL_PATH/amdgcn/bitcode"
|
||||
fi
|
||||
|
||||
cmake \
|
||||
$(rocm_cmake_params) \
|
||||
-DDISABLE_CHECKS="ON" \
|
||||
-DCLANG_BIN="$ROCM_INSTALL_PATH/llvm/bin" \
|
||||
-DBITCODE_DIR="$BC_DIR" \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DCPACK_SET_DESTDIR="OFF" \
|
||||
$CLANG_OCL_SRC_ROOT
|
||||
|
||||
echo "Making clang-ocl:"
|
||||
cmake --build . -- $MAKEARG
|
||||
cmake --build . -- $MAKEARG install
|
||||
cmake --build . -- $MAKEARG package
|
||||
popd
|
||||
fi
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$CLANG_OCL_PACKAGE_DEB" $CLANG_OCL_BUILD_DIR/rocm-clang-ocl*.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$CLANG_OCL_PACKAGE_RPM" $CLANG_OCL_BUILD_DIR/rocm-clang-ocl*.rpm
|
||||
}
|
||||
|
||||
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
("deb")
|
||||
echo ${CLANG_OCL_PACKAGE_DEB};;
|
||||
("rpm")
|
||||
echo ${CLANG_OCL_PACKAGE_RPM};;
|
||||
(*)
|
||||
echo "Invalid package type \"${PKGTYPE}\" provided for -o" >&2; exit 1;;
|
||||
esac
|
||||
exit
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_clang-ocl ;;
|
||||
(build) build_clang-ocl ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
exit 0
|
||||
|
||||
@@ -6,73 +6,53 @@ source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
|
||||
set_component_src composable_kernel
|
||||
|
||||
GPU_ARCH_LIST="gfx908;gfx90a;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
|
||||
build_miopen_ck() {
|
||||
echo "Start Building Composable Kernel"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
GPU_ARCH_LIST="gfx908:xnack+;gfx90a:xnack+;gfx942:xnack+"
|
||||
else
|
||||
unset_asan_env_vars
|
||||
set_address_sanitizer_off
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
GPU_ARCH_LIST="gfx942"
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
PYTHON_VERSION_WORKAROUND=''
|
||||
echo "DISTRO_ID: ${DISTRO_ID}"
|
||||
if [ "$DISTRO_ID" = "rhel-8.8" ] || [ "$DISTRO_ID" = "sles-15.5" ] ; then
|
||||
EXTRA_PYTHON_PATH=/opt/Python-3.8.13
|
||||
PYTHON_VERSION_WORKAROUND="-DCK_USE_ALTERNATIVE_PYTHON=${EXTRA_PYTHON_PATH}/bin/python3.8"
|
||||
# For the python interpreter we need to export LD_LIBRARY_PATH.
|
||||
export LD_LIBRARY_PATH=${EXTRA_PYTHON_PATH}/lib:$LD_LIBRARY_PATH
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
mkdir "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="-DAMDGPU_TARGETS=${GPU_ARCHS}"
|
||||
fi
|
||||
|
||||
if [ "${ASAN_CMAKE_PARAMS}" == "true" ] ; then
|
||||
cmake -DBUILD_DEV=OFF \
|
||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-'RelWithDebInfo'} \
|
||||
-DCMAKE_CXX_COMPILER=${ROCM_PATH}/llvm/bin/clang++ \
|
||||
-DCMAKE_CXX_FLAGS=" -O3 " \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH%-*}/lib/cmake;${ROCM_PATH%-*}/$ASAN_LIBDIR;${ROCM_PATH%-*}/llvm;${ROCM_PATH%-*}" \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--enable-new-dtags,--rpath,$ROCM_ASAN_LIB_RPATH" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS_INIT="-Wl,--enable-new-dtags,--rpath,$ROCM_ASAN_EXE_RPATH" \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE \
|
||||
-DCMAKE_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DCMAKE_PACKAGING_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
|
||||
-DROCM_SYMLINK_LIBS=OFF \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DROCM_DISABLE_LDCONFIG=ON \
|
||||
-DROCM_PATH=${ROCM_PATH} \
|
||||
-DCPACK_GENERATOR="${PKGTYPE^^}" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DINSTANCES_ONLY=ON \
|
||||
-DENABLE_ASAN_PACKAGING=true \
|
||||
"${GPU_TARGETS}" \
|
||||
"$COMPONENT_SRC"
|
||||
else
|
||||
cmake -DBUILD_DEV=OFF \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_COMPILER=${ROCM_PATH}/llvm/bin/clang++ \
|
||||
-DCMAKE_CXX_FLAGS=" -O3 " \
|
||||
-DCMAKE_PREFIX_PATH=${ROCM_PATH%-*} \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT='-Wl,--enable-new-dtags,--rpath,$ORIGIN' \
|
||||
-DCMAKE_EXE_LINKER_FLAGS_INIT='-Wl,--enable-new-dtags,--rpath,$ORIGIN/../lib' \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE \
|
||||
-DCMAKE_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DCMAKE_PACKAGING_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
|
||||
-DROCM_SYMLINK_LIBS=OFF \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DROCM_DISABLE_LDCONFIG=ON \
|
||||
-DROCM_PATH=${ROCM_PATH} \
|
||||
-DCPACK_GENERATOR="${PKGTYPE^^}" \
|
||||
-DCMAKE_CXX_COMPILER="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
-DCMAKE_C_COMPILER="${ROCM_PATH}/llvm/bin/clang" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DINSTANCES_ONLY=ON \
|
||||
"${GPU_TARGETS}" \
|
||||
"$COMPONENT_SRC"
|
||||
fi
|
||||
cmake \
|
||||
-DBUILD_DEV=OFF \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
${PYTHON_VERSION_WORKAROUND} \
|
||||
-DCPACK_GENERATOR="${PKGTYPE^^}" \
|
||||
-DCMAKE_CXX_COMPILER="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
-DCMAKE_C_COMPILER="${ROCM_PATH}/llvm/bin/clang" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DGPU_ARCHS="${GPU_ARCH_LIST}" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_FLAGS=" -O3 " \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build . -- -j${PROC} package
|
||||
cmake --build "$BUILD_DIR" -- install
|
||||
mkdir -p $PACKAGE_DIR && cp ./*.${PKGTYPE} $PACKAGE_DIR
|
||||
rm -rf *
|
||||
}
|
||||
|
||||
unset_asan_env_vars() {
|
||||
@@ -88,85 +68,6 @@ set_address_sanitizer_off() {
|
||||
export LDFLAGS=""
|
||||
}
|
||||
|
||||
build_miopen_ckProf() {
|
||||
ENABLE_ADDRESS_SANITIZER=false
|
||||
echo "Start Building Composable Kernel Profiler"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
else
|
||||
unset_asan_env_vars
|
||||
set_address_sanitizer_off
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
cd "$BUILD_DIR"
|
||||
rm -rf *
|
||||
|
||||
architectures='gfx10 gfx11 gfx90 gfx94'
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
architectures=$(echo ${GPU_ARCHS} | awk -F';' '{for(i=1;i<=NF;i++) a[substr($i,1,5)]} END{for(i in a) printf i" "}')
|
||||
fi
|
||||
|
||||
for arch in ${architectures}
|
||||
do
|
||||
if [ "${ASAN_CMAKE_PARAMS}" == "true" ] ; then
|
||||
cmake -DBUILD_DEV=OFF \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH%-*}/lib/cmake;${ROCM_PATH%-*}/$ASAN_LIBDIR;${ROCM_PATH%-*}/llvm;${ROCM_PATH%-*}" \
|
||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-'RelWithDebInfo'} \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--enable-new-dtags,--rpath,$ROCM_ASAN_LIB_RPATH" \
|
||||
-DCMAKE_EXE_LINKER_FLAGS_INIT="-Wl,--enable-new-dtags,--rpath,$ROCM_ASAN_EXE_RPATH" \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE \
|
||||
-DCMAKE_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DCMAKE_PACKAGING_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
|
||||
-DROCM_SYMLINK_LIBS=OFF \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DROCM_DISABLE_LDCONFIG=ON \
|
||||
-DROCM_PATH="${ROCM_PATH}" \
|
||||
-DCPACK_GENERATOR="${PKGTYPE^^}" \
|
||||
-DCMAKE_CXX_COMPILER="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
-DCMAKE_C_COMPILER="${ROCM_PATH}/llvm/bin/clang" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DPROFILER_ONLY=ON \
|
||||
-DENABLE_ASAN_PACKAGING=true \
|
||||
-DGPU_ARCH="${arch}" \
|
||||
"$COMPONENT_SRC"
|
||||
else
|
||||
cmake -DBUILD_DEV=OFF \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH%-*}" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT='-Wl,--enable-new-dtags,--rpath,$ORIGIN' \
|
||||
-DCMAKE_EXE_LINKER_FLAGS_INIT='-Wl,--enable-new-dtags,--rpath,$ORIGIN/../lib' \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE \
|
||||
-DCMAKE_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DCMAKE_PACKAGING_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
|
||||
-DROCM_SYMLINK_LIBS=OFF \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="${ROCM_PATH}" \
|
||||
-DROCM_DISABLE_LDCONFIG=ON \
|
||||
-DROCM_PATH="${ROCM_PATH}" \
|
||||
-DCPACK_GENERATOR="${PKGTYPE^^}" \
|
||||
-DCMAKE_CXX_COMPILER="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
-DCMAKE_C_COMPILER="${ROCM_PATH}/llvm/bin/clang" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DPROFILER_ONLY=ON \
|
||||
-DGPU_ARCH="${arch}" \
|
||||
"$COMPONENT_SRC"
|
||||
fi
|
||||
|
||||
cmake --build . -- -j${PROC} package
|
||||
cp ./*ckprofiler*.${PKGTYPE} $PACKAGE_DIR
|
||||
rm -rf *
|
||||
done
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
|
||||
echo "Finished building Composable Kernel"
|
||||
show_build_cache_stats
|
||||
}
|
||||
|
||||
clean_miopen_ck() {
|
||||
echo "Cleaning MIOpen-CK build directory: ${BUILD_DIR} ${PACKAGE_DIR}"
|
||||
rm -rf "$BUILD_DIR" "$PACKAGE_DIR"
|
||||
@@ -176,7 +77,7 @@ clean_miopen_ck() {
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_miopen_ck; build_miopen_ckProf;;
|
||||
build) build_miopen_ck ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_miopen_ck ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
|
||||
@@ -15,7 +15,7 @@ printUsage() {
|
||||
type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -M, --skip_man_pages Do not build the 'docs' target"
|
||||
echo " -s, --static Supports static CI by accepting this param & not bailing out. No effect of the param though"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo
|
||||
echo "Possible values for <type>:"
|
||||
echo " deb -> Debian format (default)"
|
||||
@@ -65,7 +65,7 @@ do
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ;;
|
||||
ack_and_skip_static ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; ((CLEAN_OR_OUT|=2)) ; shift 1 ;;
|
||||
(-M | --skip_man_pages) DODOCSBUILD=false;;
|
||||
|
||||
@@ -96,6 +96,7 @@ build_devicelibs() {
|
||||
if [ ! -e Makefile ]; then
|
||||
cmake $(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_NEW="$bitcodeInstallLoc/amdgcn" \
|
||||
-DROCM_DEVICE_LIBS_BITCODE_INSTALL_LOC_OLD="amdgcn" \
|
||||
"$DEVICELIBS_ROOT"
|
||||
|
||||
@@ -24,14 +24,15 @@ printUsage() {
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/compute_utils.sh"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
PROJ_NAME="hip-on-rocclr"
|
||||
|
||||
BUILD_PATH="$(getBuildPath hip-on-rocclr)"
|
||||
BUILD_PATH="$(getBuildPath $PROJ_NAME)"
|
||||
|
||||
TARGET="build"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_SRC="$(getSrcPath)"
|
||||
PACKAGE_DEB="$PACKAGE_ROOT/deb/hip-on-rocclr"
|
||||
PACKAGE_RPM="$PACKAGE_ROOT/rpm/hip-on-rocclr"
|
||||
PACKAGE_DEB="$PACKAGE_ROOT/deb/$PROJ_NAME"
|
||||
PACKAGE_RPM="$PACKAGE_ROOT/rpm/$PROJ_NAME"
|
||||
PREFIX_PATH="$PACKAGE_ROOT"
|
||||
CORE_BUILD_DIR="$(getBuildPath hsa-core)"
|
||||
ROCclr_BUILD_DIR="$(getBuildPath rocclr)"
|
||||
@@ -52,7 +53,7 @@ MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
OFFLOAD_ARCH=()
|
||||
|
||||
DEFAULT_OFFLOAD_ARCH=(gfx900 gfx906 gfx908 gfx90a gfx940 gfx941 gfx942 gfx1030 gfx1031 gfx1033 gfx1034 gfx1035 gfx1100 gfx1101 gfx1102 gfx1103)
|
||||
DEFAULT_OFFLOAD_ARCH=(gfx900 gfx906 gfx908 gfx90a gfx940 gfx941 gfx942 gfx1030 gfx1031 gfx1033 gfx1034 gfx1035 gfx1100 gfx1101 gfx1102 gfx1200 gfx1201)
|
||||
|
||||
VALID_STR=`getopt -o hcrast:o: --long help,clean,release,address_sanitizer,static,offload-arch=:,outdir: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
@@ -168,9 +169,11 @@ build_catch_tests() {
|
||||
export ROCM_PATH="$ROCM_INSTALL_PATH"
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DHIP_PLATFORM=amd \
|
||||
-DROCM_PATH="$ROCM_INSTALL_PATH" \
|
||||
-DOFFLOAD_ARCH_STR="$OFFLOAD_ARCH_STR" \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DCPACK_RPM_DEBUGINFO_PACKAGE=FALSE \
|
||||
-DCPACK_DEBIAN_DEBUGINFO_PACKAGE=FALSE \
|
||||
@@ -206,6 +209,8 @@ package_samples() {
|
||||
export ROCM_PATH="$ROCM_INSTALL_PATH"
|
||||
cmake \
|
||||
-DROCM_PATH="$ROCM_INSTALL_PATH" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DCMAKE_MODULE_PATH="$CMAKE_PATH/hip" \
|
||||
-DCPACK_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
|
||||
41
tools/rocm-build/build_hipblas-common.sh
Executable file
41
tools/rocm-build/build_hipblas-common.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
|
||||
set_component_src hipBLAS-common
|
||||
|
||||
build_hipblas-common() {
|
||||
echo "Start build"
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
cmake \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
"$COMPONENT_SRC"
|
||||
cmake --build "$BUILD_DIR" -- install
|
||||
cmake --build "$BUILD_DIR" -- package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
|
||||
clean_hipblas-common() {
|
||||
echo "Cleaning hipBLAS-common build directory: ${BUILD_DIR} ${PACKAGE_DIR}"
|
||||
rm -rf "$BUILD_DIR" "$PACKAGE_DIR"
|
||||
echo "Done!"
|
||||
}
|
||||
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_hipblas-common ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_hipblas-common ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
@@ -10,6 +10,12 @@ build_hipblas() {
|
||||
echo "Start build"
|
||||
|
||||
CXX="g++"
|
||||
CXX_FLAG=
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
CXX="amdclang++"
|
||||
CXX_FLAG="-DCMAKE_CXX_COMPILER=${ROCM_PATH}/llvm/bin/clang++"
|
||||
fi
|
||||
|
||||
CLIENTS_SAMPLES="ON"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
@@ -17,6 +23,8 @@ build_hipblas() {
|
||||
CLIENTS_SAMPLES="OFF"
|
||||
fi
|
||||
|
||||
SHARED_LIBS="ON"
|
||||
|
||||
echo "C compiler: $CC"
|
||||
echo "CXX compiler: $CXX"
|
||||
echo "FC compiler: $FC"
|
||||
@@ -33,11 +41,12 @@ build_hipblas() {
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DUSE_CUDA=OFF \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
-DBUILD_CLIENTS_SAMPLES="${CLIENTS_SAMPLES}" \
|
||||
-DCPACK_SET_DESTDIR=OFF \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
${CXX_FLAG} \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
|
||||
@@ -8,6 +8,10 @@ set_component_src hipBLASLt
|
||||
build_hipblaslt() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
@@ -40,7 +44,6 @@ build_hipblaslt() {
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
-DCPACK_SET_DESTDIR=OFF \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
|
||||
@@ -9,10 +9,12 @@ printUsage() {
|
||||
echo "Options:"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -r, --release Makes a release build"
|
||||
echo " -h, --help Prints this help"
|
||||
echo
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo
|
||||
|
||||
return 0
|
||||
@@ -25,25 +27,31 @@ PROJ_NAME=$API_NAME
|
||||
TARGET="build"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
BUILD_TYPE="Debug"
|
||||
|
||||
SHARED_LIBS="ON"
|
||||
BUILD_DIR=$(getBuildPath $API_NAME)
|
||||
PACKAGE_DEB=$(getPackageRoot)/deb/$API_NAME
|
||||
PACKAGE_RPM=$(getPackageRoot)/rpm/$API_NAME
|
||||
PACKAGE_SRC="$(getSrcPath)"
|
||||
|
||||
while [ "$1" != "" ];
|
||||
VALID_STR=`getopt -o hcraswo:p: --long help,clean,release,address_sanitizer,static,outdir,wheel:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
case $1 in
|
||||
case "$1" in
|
||||
(-a | --address_sanitizer)
|
||||
ack_and_ignore_asan ;;
|
||||
(-c | --clean)
|
||||
TARGET="clean" ;;
|
||||
(-o | --outdir)
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 1 ;;
|
||||
(-r | --release)
|
||||
BUILD_TYPE="RelWithDebInfo" ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ;;
|
||||
(-h | --help)
|
||||
printUsage ; exit 0 ;;
|
||||
--) shift; break;;
|
||||
(*)
|
||||
echo "Invalid option [$1]" >&2; printUsage; exit 1 ;;
|
||||
esac
|
||||
@@ -79,6 +87,7 @@ build() {
|
||||
fi
|
||||
|
||||
cmake \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DHIPCC_BACKWARD_COMPATIBILITY=OFF \
|
||||
@@ -87,7 +96,7 @@ build() {
|
||||
popd
|
||||
|
||||
cmake --build "$BUILD_DIR" -- $MAKEOPTS
|
||||
|
||||
|
||||
echo "Installing and Packaging hipcc"
|
||||
cmake --build "$BUILD_DIR" -- $MAKEOPTS install
|
||||
cmake --build "$BUILD_DIR" -- $MAKEOPTS package
|
||||
|
||||
@@ -9,6 +9,10 @@ set_component_src hipCUB
|
||||
build_hipcub() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
@@ -22,7 +26,7 @@ build_hipcub() {
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
CXX=$(set_build_variables CXX)\
|
||||
|
||||
@@ -21,7 +21,7 @@ build_hipfft() {
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
GPU_TARGETS="gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
cmake \
|
||||
|
||||
@@ -8,11 +8,18 @@ set_component_src hipfort
|
||||
build_hipfort() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
cmake --trace \
|
||||
cmake \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX=${ROCM_PATH}\
|
||||
-DHIPFORT_INSTALL_DIR="${ROCM_PATH}" \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH}/llvm;${ROCM_PATH}" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCPACK_SET_DESTDIR="OFF" \
|
||||
-DCPACK_RPM_PACKAGE_RELOCATABLE="ON" \
|
||||
-DHIPFORT_COMPILER="${ROCM_PATH}/${ROCM_LLVMDIR}/bin/flang" \
|
||||
-DCMAKE_Fortran_FLAGS="-Mfree" \
|
||||
-DHIPFORT_COMPILER_FLAGS="-cpp" \
|
||||
|
||||
@@ -22,12 +22,12 @@ printUsage() {
|
||||
TARGET="build"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
HIPIFY_CLANG_BUILD_DIR="$(getBuildPath $HIPIFY_ROOT)"
|
||||
HIPIFY_CLANG_DIST_DIR="$HIPIFY_CLANG_BUILD_DIR/dist"
|
||||
BUILD_TYPE="Debug"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
HIPIFY_CLANG_HASH=""
|
||||
LIGHTNING_PATH="$ROCM_INSTALL_PATH/llvm"
|
||||
ADDRESS_SANITIZER=false
|
||||
INSTALL_CLANG_HEADERS="OFF"
|
||||
DEB_PATH="$(getDebPath hipify)"
|
||||
RPM_PATH="$(getRpmPath hipify)"
|
||||
SHARED_LIBS="ON"
|
||||
@@ -53,7 +53,7 @@ do
|
||||
set_address_sanitizer_on
|
||||
ADDRESS_SANITIZER=true ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
ack_and_skip_static ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
--) shift; break;;
|
||||
@@ -74,7 +74,6 @@ fi
|
||||
clean_hipify() {
|
||||
echo "Cleaning hipify-clang"
|
||||
rm -rf "$HIPIFY_CLANG_BUILD_DIR"
|
||||
rm -rf "$HIPIFY_CLANG_DIST_DIR"
|
||||
rm -rf "$DEB_PATH"
|
||||
rm -rf "$RPM_PATH"
|
||||
}
|
||||
@@ -101,16 +100,16 @@ package_hipify() {
|
||||
build_hipify() {
|
||||
echo "Building hipify-clang binaries"
|
||||
mkdir -p "$HIPIFY_CLANG_BUILD_DIR"
|
||||
mkdir -p "$HIPIFY_CLANG_DIST_DIR"
|
||||
|
||||
pushd "$HIPIFY_CLANG_BUILD_DIR"
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DCMAKE_INSTALL_PREFIX="$HIPIFY_CLANG_DIST_DIR" \
|
||||
-DCMAKE_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX=$ROCM_INSTALL_PATH \
|
||||
-DCMAKE_PREFIX_PATH="$LIGHTNING_PATH" \
|
||||
-DADDRESS_SANITIZER="$ADDRESS_SANITIZER" \
|
||||
-DHIPIFY_INSTALL_CLANG_HEADERS="$INSTALL_CLANG_HEADERS" \
|
||||
$HIPIFY_ROOT
|
||||
|
||||
cmake --build . -- $MAKEOPTS install
|
||||
|
||||
@@ -21,6 +21,11 @@ done
|
||||
build_hiprand() {
|
||||
echo "Start build"
|
||||
|
||||
SHARED_LIBS="ON"
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
@@ -34,17 +39,20 @@ build_hiprand() {
|
||||
|
||||
mkdir "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
CXX=$(set_build_variables CXX)\
|
||||
cmake \
|
||||
${LAUNCHER_FLAGS} \
|
||||
$(rocm_common_cmake_params) \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DBUILD_TEST=ON \
|
||||
-DBUILD_BENCHMARK=ON \
|
||||
-DBUILD_CRUSH_TEST=ON \
|
||||
@@ -60,7 +68,6 @@ build_hiprand() {
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
|
||||
}
|
||||
|
||||
clean_hiprand() {
|
||||
|
||||
@@ -9,14 +9,23 @@ set_component_src hipSOLVER
|
||||
build_hipsolver() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
CXX_FLAG="-DCMAKE_CXX_COMPILER=${ROCM_PATH}/llvm/bin/clang++"
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
CXX="g++"
|
||||
CXX="amdclang++"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
fi
|
||||
|
||||
SHARED_LIBS="ON"
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
echo "C compiler: $CC"
|
||||
echo "CXX compiler: $CXX"
|
||||
echo "FC compiler: $FC"
|
||||
@@ -30,13 +39,15 @@ build_hipsolver() {
|
||||
init_rocm_common_cmake_params
|
||||
cmake \
|
||||
-DUSE_CUDA=OFF \
|
||||
-DCMAKE_CXX_COMPILER=${CXX} \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
-DCPACK_SET_DESTDIR=OFF \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
${CXX_FLAG} \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
|
||||
@@ -10,14 +10,26 @@ set_component_src hipSPARSE
|
||||
build_hipsparse() {
|
||||
echo "Start build"
|
||||
|
||||
CXX="g++"
|
||||
CXX_FLAG=
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
CXX="${ROCM_PATH}/llvm/bin/clang++"
|
||||
CXX_FLAG="-DCMAKE_CXX_COMPILER=${ROCM_PATH}/llvm/bin/clang++"
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
CXX="g++"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
fi
|
||||
|
||||
SHARED_LIBS="ON"
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
echo "C compiler: $CC"
|
||||
echo "CXX compiler: $CXX"
|
||||
|
||||
@@ -25,15 +37,16 @@ build_hipsparse() {
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
cmake \
|
||||
-DCPACK_SET_DESTDIR=OFF \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DUSE_CUDA=OFF \
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DCMAKE_MODULE_PATH="${ROCM_PATH}/lib/cmake/hip;${ROCM_PATH}/hip/cmake" \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
${CXX_FLAG} \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
|
||||
@@ -21,6 +21,10 @@ done
|
||||
build_hipsparselt() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
@@ -50,7 +54,6 @@ build_hipsparselt() {
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
-DCPACK_SET_DESTDIR=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
@@ -9,6 +9,10 @@ set_component_src hipTensor
|
||||
build_hiptensor() {
|
||||
echo "Start build hipTensor"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
@@ -18,7 +22,6 @@ build_hiptensor() {
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/compute_utils.sh"
|
||||
|
||||
printUsage() {
|
||||
echo
|
||||
echo "Usage: $(basename "${BASH_SOURCE}") [options ...] [make options]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo
|
||||
echo
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
TARGET="build"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_SRC="$(getSrcPath)"
|
||||
PACKAGE_LIB="$(getLibPath)"
|
||||
PACKAGE_BIN="$(getBinPath)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/rocr"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/rocr"
|
||||
MAKEARG=""
|
||||
CORE_BUILD_DIR="$(getBuildPath hsa-core)"
|
||||
ROCR_DEV_BUILD_DIR="$(getBuildPath hsa-rocr-dev)"
|
||||
PREFIX_PATH="$PACKAGE_ROOT"
|
||||
BUILD_TYPE="Debug"
|
||||
SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
unset HIP_DEVICE_LIB_PATH
|
||||
unset ROCM_PATH
|
||||
|
||||
VALID_STR=`getopt -o hcraso: --long help,clean,release,static,address_sanitizer,outdir: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
(-c | --clean)
|
||||
TARGET="clean" ; ((CLEAN_OR_OUT|=1)) ; shift ;;
|
||||
(-r | --release)
|
||||
BUILD_TYPE="RelWithDebInfo" ; shift ;;
|
||||
(-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
--) shift; break;;
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
RET_CONFLICT=1
|
||||
check_conflicting_options $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
if [ $RET_CONFLICT -ge 30 ]; then
|
||||
print_vars $API_NAME $TARGET $BUILD_TYPE $SHARED_LIBS $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
exit $RET_CONFLICT
|
||||
fi
|
||||
|
||||
clean_hsa() {
|
||||
echo "Cleaning HSA"
|
||||
|
||||
rm -rf "$CORE_BUILD_DIR"
|
||||
rm -rf "$PACKAGE_RPM"
|
||||
rm -rf "$PACKAGE_DEB"
|
||||
rm -f "$PACKAGE_ROOT"/lib/libhsa-runtime*
|
||||
rm -rf "$PACKAGE_ROOT/lib/cmake/hsa-runtime64"
|
||||
rm -rf "$PACKAGE_ROOT/include/hsa"
|
||||
rm -rf "$PACKAGE_ROOT/share/doc/hsa-runtime64"
|
||||
rm -rf "$PACKAGE_ROOT/hsa"
|
||||
}
|
||||
|
||||
|
||||
build_hsa_core() {
|
||||
echo "Build HSA"
|
||||
local coreMakeOpts="$DASH_JAY -C $CORE_BUILD_DIR"
|
||||
|
||||
echo "$HSA_CORE_ROOT"
|
||||
|
||||
if [ ! -d "$CORE_BUILD_DIR" ]; then
|
||||
mkdir -p "$CORE_BUILD_DIR"
|
||||
pushd "$CORE_BUILD_DIR"
|
||||
print_lib_type $SHARED_LIBS
|
||||
|
||||
cmake $(rocm_cmake_params) \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DENABLE_LDCONFIG=OFF \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DADDRESS_SANITIZER="$ADDRESS_SANITIZER" \
|
||||
"$HSA_CORE_ROOT"
|
||||
popd
|
||||
fi
|
||||
time cmake --build "$CORE_BUILD_DIR" -- $coreMakeOpts
|
||||
time cmake --build "$CORE_BUILD_DIR" -- $coreMakeOpts install
|
||||
time cmake --build "$CORE_BUILD_DIR" -- $coreMakeOpts package
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$PACKAGE_DEB" $CORE_BUILD_DIR/hsa-rocr*.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$PACKAGE_RPM" $CORE_BUILD_DIR/hsa-rocr*.rpm
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
("deb")
|
||||
echo ${PACKAGE_DEB};;
|
||||
("rpm")
|
||||
echo ${PACKAGE_RPM};;
|
||||
(*)
|
||||
echo "Invalid package type \"${PKGTYPE}\" provided for -o" >&2; exit 1;;
|
||||
esac
|
||||
exit
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_hsa ;;
|
||||
(build) build_hsa_core;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
@@ -11,7 +11,6 @@ printUsage() {
|
||||
echo "Usage: $(basename "${BASH_SOURCE}") [options ...]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -t, --alt Build the 'alt' variant"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -d, --debug Build a debug version of llvm (excludes packaging)"
|
||||
echo " -r, --release Build a release version of the package"
|
||||
@@ -33,35 +32,26 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
PROJ_NAME="lightning"
|
||||
ROCM_LLVM_LIB_RPATH='\$ORIGIN'
|
||||
ROCM_LLVM_EXE_RPATH='\$ORIGIN/../lib:\$ORIGIN/../../../lib'
|
||||
|
||||
PACKAGE_OUT="$(getPackageRoot)"
|
||||
|
||||
BUILD_PATH="$(getBuildPath lightning)"
|
||||
DEB_PATH="$(getDebPath lightning)"
|
||||
RPM_PATH="$(getRpmPath lightning)"
|
||||
BUILD_PATH="$(getBuildPath $PROJ_NAME)"
|
||||
DEB_PATH="$(getDebPath $PROJ_NAME)"
|
||||
RPM_PATH="$(getRpmPath $PROJ_NAME)"
|
||||
INSTALL_PATH="${ROCM_INSTALL_PATH}/lib/llvm"
|
||||
LLVM_ROOT_LCL="${LLVM_ROOT}"
|
||||
ROCM_WHEEL_DIR="${BUILD_PATH}/_wheel"
|
||||
|
||||
TARGET="all"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
BUILD_TYPE="Release"
|
||||
case "${JOB_NAME}" in
|
||||
( *"rel"* | \
|
||||
*"afar"* | \
|
||||
*"nfar"* )
|
||||
ENABLE_ASSERTIONS=0 ;;
|
||||
( * )
|
||||
ENABLE_ASSERTIONS=1 ;;
|
||||
esac
|
||||
ENABLE_ASSERTIONS=0
|
||||
SHARED_LIBS="ON"
|
||||
|
||||
BUILD_LLVM_DYLIB="OFF"
|
||||
|
||||
FLANG_NEW=0
|
||||
BUILD_ALT=0
|
||||
CLEAN_OR_OUT=0;
|
||||
PKGTYPE="deb"
|
||||
MAKETARGET="deb"
|
||||
@@ -74,10 +64,10 @@ BUILD_MANPAGES="ON"
|
||||
STATIC_FLAG=
|
||||
|
||||
SANITIZER_AMDGPU=1
|
||||
HSA_INC_PATH="$WORK_ROOT/ROCR-Runtime/src/inc"
|
||||
COMGR_INC_PATH="$WORK_ROOT/llvm-project/amd/comgr/include"
|
||||
HSA_INC_PATH="$WORK_ROOT/ROCR-Runtime/runtime/hsa-runtime/inc/"
|
||||
COMGR_INC_PATH="$COMGR_ROOT/include"
|
||||
|
||||
VALID_STR=`getopt -o htcV:v:draAswlo:BPNM --long help,alt,clean,assert_llvm_ver_major:,assert_llvm_ver_minor:,debug,release,address_sanitizer,no_address_sanitizer,static,build_llvm_static,wheel,build,package,skip_lit_tests,skip_man_pages,outdir: -- "$@"`
|
||||
VALID_STR=`getopt -o hcV:v:draAswlo:BPNM --long help,clean,assert_llvm_ver_major:,assert_llvm_ver_minor:,debug,release,address_sanitizer,no_address_sanitizer,static,build_llvm_static,wheel,build,package,skip_lit_tests,skip_man_pages,outdir: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
set_dwarf_version(){
|
||||
@@ -96,11 +86,10 @@ set_dwarf_version(){
|
||||
|
||||
while true ;
|
||||
do
|
||||
#echo "processing $1"
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
(-t | --alt)
|
||||
BUILD_ALT=1 ; shift ;;
|
||||
(-c | --clean)
|
||||
TARGET="clean" ; ((CLEAN_OR_OUT|=1)) ; shift ;;
|
||||
(-V | --assert_llvm_ver_major)
|
||||
@@ -115,7 +104,7 @@ do
|
||||
set_dwarf_version
|
||||
SANITIZER_AMDGPU=1 ;
|
||||
HSA_INC_PATH="$WORK_ROOT/hsa/runtime/opensrc/hsa-runtime/inc" ;
|
||||
COMGR_INC_PATH="$WORK_ROOT/external/llvm-project/amd/comgr/include" ; shift ;;
|
||||
COMGR_INC_PATH="$COMGR_ROOT/include" ; shift ;;
|
||||
(-A | --no_address_sanitizer)
|
||||
SANITIZER_AMDGPU=0 ;
|
||||
unset HSA_INC_PATH ;
|
||||
@@ -155,24 +144,11 @@ LLVM_PROJECTS="clang;lld;clang-tools-extra"
|
||||
ENABLE_RUNTIMES="compiler-rt;libunwind"
|
||||
BOOTSTRAPPING_BUILD_LIBCXX=0
|
||||
BUILD_AMDCLANG="ON"
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
BUILD_PATH="${BUILD_PATH}-alt"
|
||||
DEB_PATH="${DEB_PATH}-alt"
|
||||
RPM_PATH="${RPM_PATH}-alt"
|
||||
INSTALL_PATH="${INSTALL_PATH}/alt"
|
||||
LLVM_ROOT_LCL="${LLVM_ALT_ROOT}"
|
||||
BUILD_AMDCLANG="OFF"
|
||||
BUILD_MANPAGES="OFF"
|
||||
SANITIZER_AMDGPU=0
|
||||
unset HSA_INC_PATH
|
||||
unset COMGR_INC_PATH
|
||||
else
|
||||
ENABLE_RUNTIMES="$ENABLE_RUNTIMES;libcxx;libcxxabi";
|
||||
BOOTSTRAPPING_BUILD_LIBCXX=1
|
||||
fi
|
||||
|
||||
ENABLE_RUNTIMES="$ENABLE_RUNTIMES;libcxx;libcxxabi"
|
||||
BOOTSTRAPPING_BUILD_LIBCXX=1
|
||||
|
||||
clean_lightning() {
|
||||
rm -rf "$ROCM_WHEEL_DIR"
|
||||
rm -rf "$BUILD_PATH"
|
||||
rm -rf "$DEB_PATH"
|
||||
rm -rf "$RPM_PATH"
|
||||
@@ -188,22 +164,14 @@ setup_llvm_info() {
|
||||
local LLVM_URL_BRANCH
|
||||
|
||||
if [[ "${JOB_NAME}" == *rel* ]]; then
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
LLVM_URL_BRANCH=$(git rev-parse HEAD)
|
||||
else
|
||||
LLVM_URL_NAME="https://github.com/RadeonOpenCompute/llvm-project"
|
||||
LLVM_BRANCH_NAME="roc-${ROCM_VERSION}"
|
||||
LLVM_URL_BRANCH="${LLVM_URL_NAME} ${LLVM_BRANCH_NAME}"
|
||||
fi
|
||||
else
|
||||
LLVM_REMOTE_NAME=$(git remote)
|
||||
LLVM_URL_NAME=$(git config --get remote."${LLVM_REMOTE_NAME}".url)
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
LLVM_BRANCH_NAME=$(repo manifest | sed -n 's/.*path="external\/llvm-project-alt\/llvm-project".* upstream="\([^"]*\)".*/\1/p' )
|
||||
else
|
||||
LLVM_REMOTE_NAME=$(git remote)
|
||||
LLVM_URL_NAME=$(git config --get remote."${LLVM_REMOTE_NAME}".url)
|
||||
LLVM_BRANCH_NAME=$(repo manifest | sed -n 's/.*path="external\/llvm-project".* upstream="\([^"]*\)".*/\1/p' )
|
||||
fi
|
||||
LLVM_URL_BRANCH="${LLVM_URL_NAME} ${LLVM_BRANCH_NAME}"
|
||||
LLVM_URL_BRANCH="${LLVM_URL_NAME} ${LLVM_BRANCH_NAME}"
|
||||
fi
|
||||
|
||||
LLVM_COMMIT_GITDATE=$(git show -s --format=@%ct | xargs | date -f - --utc +%y%U%w)
|
||||
@@ -283,24 +251,27 @@ build_lightning() {
|
||||
mkdir -p "$BUILD_PATH"
|
||||
pushd "$BUILD_PATH"
|
||||
|
||||
eval EXTRA_LLVM_CMAKE_PARAMS_ARRAY=($EXTRA_LLVM_CMAKE_PARAMS)
|
||||
|
||||
if [ ! -e Makefile ]; then
|
||||
echo "Building LLVM CMake environment"
|
||||
if [ -e "$LLVM_ROOT_LCL/../flang/AFARrelease" ]; then
|
||||
LLVM_PROJECTS="$LLVM_PROJECTS;mlir"
|
||||
if [ -e "$LLVM_ROOT_LCL/../flang/EnableFlangBuild" ]; then
|
||||
FLANG_NEW=1
|
||||
LLVM_PROJECTS="$LLVM_PROJECTS;flang;mlir"
|
||||
LLVM_PROJECTS="$LLVM_PROJECTS;flang"
|
||||
ENABLE_RUNTIMES="$ENABLE_RUNTIMES;openmp";
|
||||
else
|
||||
|
||||
if [[ "${JOB_NAME}" != *afar* ]] && [ -e "$LLVM_ROOT_LCL/../flang/DoROCmRelease" ]; then
|
||||
FLANG_NEW=1
|
||||
LLVM_PROJECTS="$LLVM_PROJECTS;flang;mlir"
|
||||
else
|
||||
echo "NOT building project flang"
|
||||
fi
|
||||
if [[ "${JOB_NAME}" != *afar* ]] && [ -e "$LLVM_ROOT_LCL/../flang/DoROCmRelease" ]; then
|
||||
FLANG_NEW=1
|
||||
LLVM_PROJECTS="$LLVM_PROJECTS;flang"
|
||||
else
|
||||
echo "NOT building project flang"
|
||||
fi
|
||||
fi
|
||||
set -x
|
||||
cmake $(rocm_cmake_params) ${GEN_NINJA} \
|
||||
${STATIC_FLAG} \
|
||||
${PYTHON_VERSION_WORKAROUND} \
|
||||
-DCMAKE_INSTALL_PREFIX="$INSTALL_PATH" \
|
||||
-DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" \
|
||||
-DLLVM_ENABLE_PROJECTS="$LLVM_PROJECTS" \
|
||||
@@ -342,6 +313,7 @@ build_lightning() {
|
||||
-DCLANG_LINK_FLANG_LEGACY=ON \
|
||||
-DCMAKE_CXX_STANDARD=17 \
|
||||
-DFLANG_INCLUDE_DOCS=OFF \
|
||||
"${EXTRA_LLVM_CMAKE_PARAMS_ARRAY[@]}" \
|
||||
"$LLVM_ROOT_LCL"
|
||||
set +x
|
||||
echo "CMake complete"
|
||||
@@ -358,28 +330,11 @@ build_lightning() {
|
||||
echo "End Workaround for race condition"
|
||||
cmake --build . -- $MAKEOPTS
|
||||
|
||||
case "$DISTRO_ID" in
|
||||
(rhel*|centos*)
|
||||
RHEL_BUILD=1
|
||||
;;
|
||||
(*)
|
||||
RHEL_BUILD=0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ $SKIP_LIT_TESTS -eq 0 ]; then
|
||||
if [ $RHEL_BUILD -eq 1 ] && [ $BUILD_ALT != 1 ]; then
|
||||
if [ $FLANG_NEW -eq 1 ]; then
|
||||
cmake --build . -- $MAKEOPTS check-lld check-mlir
|
||||
else
|
||||
cmake --build . -- $MAKEOPTS check-lld
|
||||
fi
|
||||
elif [ "$DISTRO_NAME" != "sles" ] && [ $BUILD_ALT != 1 ]; then
|
||||
if [ $FLANG_NEW -eq 1 ]; then
|
||||
cmake --build . -- $MAKEOPTS check-llvm check-clang check-lld check-mlir
|
||||
else
|
||||
cmake --build . -- $MAKEOPTS check-llvm check-clang check-lld
|
||||
fi
|
||||
if [ $RHEL_BUILD -eq 1 ]; then
|
||||
cmake --build . -- $MAKEOPTS check-lld check-mlir
|
||||
elif [ "$DISTRO_NAME" != "sles" ]; then
|
||||
cmake --build . -- $MAKEOPTS check-llvm check-clang check-lld check-mlir
|
||||
fi
|
||||
fi
|
||||
cmake --build . -- $MAKEOPTS clang-tidy
|
||||
@@ -396,23 +351,15 @@ package_lightning_dynamic(){
|
||||
|
||||
get_llvm_version
|
||||
local llvmParsedVersion="${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}"
|
||||
local packageName="rocm-llvm"
|
||||
local packageSummary="ROCm compiler"
|
||||
local packageSummaryLong="ROCm compiler based on LLVM $llvmParsedVersion"
|
||||
local installPath="$ROCM_INSTALL_PATH/lib/llvm/"
|
||||
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
local packageName="rocm-llvm-alt"
|
||||
local packageSummary="Proprietary ROCm compiler"
|
||||
local packageSummaryLong="ROCm compiler, including proprietary optimizations, based on LLVM $llvmParsedVersion"
|
||||
local installPath="$ROCM_INSTALL_PATH/lib/llvm/alt"
|
||||
else
|
||||
local packageName="rocm-llvm"
|
||||
local packageSummary="ROCm compiler"
|
||||
local packageSummaryLong="ROCm compiler based on LLVM $llvmParsedVersion"
|
||||
local installPath="$ROCM_INSTALL_PATH/lib/llvm/"
|
||||
|
||||
if [ "$BUILD_LLVM_DYLIB" == "ON" ] ; then
|
||||
local packageNameCore="rocm-llvm-core"
|
||||
local packageSummaryCore="ROCm core compiler dylibs"
|
||||
local packageSummaryLongCore="ROCm compiler based on LLVM $llvmParsedVersion"
|
||||
fi
|
||||
if [ "$BUILD_LLVM_DYLIB" == "ON" ] ; then
|
||||
local packageNameCore="rocm-llvm-core"
|
||||
local packageSummaryCore="ROCm core compiler dylibs"
|
||||
local packageSummaryLongCore="ROCm compiler based on LLVM $llvmParsedVersion"
|
||||
fi
|
||||
|
||||
local packageArch="amd64"
|
||||
@@ -433,9 +380,6 @@ package_lightning_dynamic(){
|
||||
local prermFile="$packageDeb/DEBIAN/prerm"
|
||||
local specFile="$packageDir/$packageName.spec"
|
||||
local debDependencies="python3, libc6, libstdc++6|libstdc++8, libstdc++-5-dev|libstdc++-7-dev|libstdc++-11-dev, libgcc-5-dev|libgcc-7-dev|libgcc-11-dev, rocm-core"
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
debDependencies="${debDependencies}, rocm-llvm"
|
||||
fi
|
||||
local debRecommends="gcc, g++, gcc-multilib, g++-multilib"
|
||||
|
||||
local packageRpm="$packageDir/rpm"
|
||||
@@ -508,42 +452,33 @@ package_lightning_dynamic(){
|
||||
debDependencies="${debDependencies}, ${packageNameCore}"
|
||||
fi
|
||||
|
||||
if [ $BUILD_ALT -eq 0 ] ; then
|
||||
cp -r "$LLVM_ROOT_LCL/LICENSE.TXT" "$packageDeb/$licenseDir"
|
||||
else
|
||||
cp -r "$LLVM_PROJECT_ALT_ROOT/EULA" "$packageDeb/$licenseDir"
|
||||
cp -r "$LLVM_PROJECT_ALT_ROOT/DISCLAIMER.txt" "$packageDeb/$licenseDir"
|
||||
fi
|
||||
cp -r "$LLVM_ROOT_LCL/LICENSE.TXT" "$packageDeb/$licenseDir"
|
||||
cp -r "$distBin" "$packageDeb/$installPath/bin"
|
||||
cp -r "$distInc" "$packageDeb/$installPath/include"
|
||||
cp -r "$distLib" "$packageDeb/$installPath/lib"
|
||||
if [ "$BUILD_MANPAGES" == "ON" ]; then
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
for i in "${man_pages[@]}"; do
|
||||
gzip -f "$distMan/man1/$i"
|
||||
for i in "${man_pages[@]}"; do
|
||||
gzip -f "$distMan/man1/$i"
|
||||
done
|
||||
if [ -f "$distMan/man1/clang.1.gz" ]; then
|
||||
for i in "${amd_man_pages[@]}"; do
|
||||
ln -sf "clang.1.gz" "$distMan/man1/$i"
|
||||
done
|
||||
if [ -f "$distMan/man1/clang.1.gz" ]; then
|
||||
for i in "${amd_man_pages[@]}"; do
|
||||
ln -sf "clang.1.gz" "$distMan/man1/$i"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
cp -r "$distMan" "$packageDeb/$installPath/share"
|
||||
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
touch "$postinstFile" "$prermFile"
|
||||
echo "mkdir -p \"$ROCM_INSTALL_PATH/bin\"" >> $postinstFile
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$packageDeb/$installPath/bin/$i" ]; then
|
||||
echo "ln -s \"../lib/llvm/bin/$i\" \"$ROCM_INSTALL_PATH/bin/$i\"" >> $postinstFile
|
||||
echo "rm -f \"$ROCM_INSTALL_PATH/bin/$i\"" >> $prermFile
|
||||
fi
|
||||
done
|
||||
echo "rmdir --ignore-fail-on-non-empty \"$ROCM_INSTALL_PATH/bin\"" >> $prermFile
|
||||
chmod 0555 "$postinstFile" "$prermFile"
|
||||
cp -P "$backwardsCompatibleSymlink" "$packageDeb/$ROCM_INSTALL_PATH"
|
||||
fi
|
||||
touch "$postinstFile" "$prermFile"
|
||||
echo "mkdir -p \"$ROCM_INSTALL_PATH/bin\"" >> $postinstFile
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$packageDeb/$installPath/bin/$i" ]; then
|
||||
echo "ln -s \"../lib/llvm/bin/$i\" \"$ROCM_INSTALL_PATH/bin/$i\"" >> $postinstFile
|
||||
echo "rm -f \"$ROCM_INSTALL_PATH/bin/$i\"" >> $prermFile
|
||||
fi
|
||||
done
|
||||
echo "rmdir --ignore-fail-on-non-empty \"$ROCM_INSTALL_PATH/bin\"" >> $prermFile
|
||||
chmod 0555 "$postinstFile" "$prermFile"
|
||||
cp -P "$backwardsCompatibleSymlink" "$packageDeb/$ROCM_INSTALL_PATH"
|
||||
|
||||
echo "Package: $packageName" > $controlFile
|
||||
echo "Architecture: $packageArch" >> $controlFile
|
||||
@@ -613,16 +548,12 @@ package_lightning_dynamic(){
|
||||
echo "Release: ${JOB_DESIGNATOR}${SLES_BUILD_ID_PREFIX}${BUILD_ID}%{?dist}" >> $specFile
|
||||
echo "Summary: $packageSummary" >> $specFile
|
||||
echo "Group: System Environment/Libraries" >> $specFile
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
echo "License: AMD Proprietary" >> $specFile
|
||||
else
|
||||
echo "License: ASL 2.0 with exceptions" >> $specFile
|
||||
fi
|
||||
echo "License: ASL 2.0 with exceptions" >> $specFile
|
||||
echo "Requires: $rpmRequires" >> $specFile
|
||||
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
echo "%define _build_id_links none" >> $specFile
|
||||
fi
|
||||
# The following is commented as Centos 7 has a version of rpm
|
||||
# that does not understand it. When we no longer support Centos 7
|
||||
# then we should have a correct recommends line.
|
||||
#echo "Recommends: $rpmRecommends" >> $specFile
|
||||
|
||||
echo "%description" >> $specFile
|
||||
echo "$packageSummaryLong" >> $specFile
|
||||
@@ -638,28 +569,20 @@ package_lightning_dynamic(){
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$installPath/share/man" >> $specFile
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$licenseDir" >> $specFile
|
||||
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
echo "cp -R $LLVM_ROOT_LCL/LICENSE.TXT \$RPM_BUILD_ROOT/$licenseDir" >> $specFile
|
||||
echo "cp -P $backwardsCompatibleSymlink \$RPM_BUILD_ROOT/$ROCM_INSTALL_PATH" >> $specFile
|
||||
else
|
||||
echo "cp -R $LLVM_PROJECT_ALT_ROOT/EULA \$RPM_BUILD_ROOT/$licenseDir" >> $specFile
|
||||
echo "cp -R $LLVM_PROJECT_ALT_ROOT/DISCLAIMER.txt \$RPM_BUILD_ROOT/$licenseDir" >> $specFile
|
||||
fi
|
||||
|
||||
echo "cp -R $LLVM_ROOT_LCL/LICENSE.TXT \$RPM_BUILD_ROOT/$licenseDir" >> $specFile
|
||||
echo "cp -P $backwardsCompatibleSymlink \$RPM_BUILD_ROOT/$ROCM_INSTALL_PATH" >> $specFile
|
||||
echo "cp -R $distBin \$RPM_BUILD_ROOT/$installPath" >> $specFile
|
||||
echo "cp -R $distInc \$RPM_BUILD_ROOT/$installPath" >> $specFile
|
||||
echo "cp -R $distLib \$RPM_BUILD_ROOT/$installPath" >> $specFile
|
||||
if [ "$BUILD_MANPAGES" == "ON" ]; then
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
for i in "${man_pages[@]}"; do
|
||||
echo "gzip -f $distMan/man1/$i" >> $specFile
|
||||
done
|
||||
if [ -f "$distMan/man1/clang.1.gz" ]; then
|
||||
for i in "${amd_man_pages[@]}"; do
|
||||
echo "ln -sf clang.1.gz \"$distMan/man1/$i\"" >> $specFile
|
||||
done
|
||||
fi
|
||||
fi
|
||||
for i in "${man_pages[@]}"; do
|
||||
echo "gzip -f $distMan/man1/$i" >> $specFile
|
||||
done
|
||||
if [ -f "$distMan/man1/clang.1.gz" ]; then
|
||||
for i in "${amd_man_pages[@]}"; do
|
||||
echo "ln -sf clang.1.gz \"$distMan/man1/$i\"" >> $specFile
|
||||
done
|
||||
fi
|
||||
fi
|
||||
echo "cp -R $distMan \$RPM_BUILD_ROOT/$installPath/share" >> $specFile
|
||||
|
||||
@@ -676,25 +599,20 @@ package_lightning_dynamic(){
|
||||
echo "$ROCM_INSTALL_PATH" >> $specFile
|
||||
|
||||
echo "%post" >> $specFile
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
echo "mkdir -p \"$ROCM_INSTALL_PATH/bin\"" >> $specFile
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$distBin/$i" ]; then
|
||||
echo "ln -sf ../lib/llvm/bin/$i \"$ROCM_INSTALL_PATH/bin/$i\"" >> $specFile
|
||||
fi
|
||||
done
|
||||
fi
|
||||
echo "mkdir -p \"$ROCM_INSTALL_PATH/bin\"" >> $specFile
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$distBin/$i" ]; then
|
||||
echo "ln -sf ../lib/llvm/bin/$i \"$ROCM_INSTALL_PATH/bin/$i\"" >> $specFile
|
||||
fi
|
||||
done
|
||||
|
||||
echo "%preun" >> $specFile
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$distBin/$i" ]; then
|
||||
echo "rm -f \"$ROCM_INSTALL_PATH/bin/$i\"" >> $specFile
|
||||
fi
|
||||
done
|
||||
echo "rmdir --ignore-fail-on-non-empty \"$ROCM_INSTALL_PATH/bin\"" >> $specFile
|
||||
fi
|
||||
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$distBin/$i" ]; then
|
||||
echo "rm -f \"$ROCM_INSTALL_PATH/bin/$i\"" >> $specFile
|
||||
fi
|
||||
done
|
||||
echo "rmdir --ignore-fail-on-non-empty \"$ROCM_INSTALL_PATH/bin\"" >> $specFile
|
||||
echo "%postun" >> $specFile
|
||||
|
||||
rpmbuild --define "_topdir $packageRpm" -ba $specFile
|
||||
@@ -711,32 +629,17 @@ package_lightning_static() {
|
||||
get_llvm_version
|
||||
local llvmParsedVersion="${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}"
|
||||
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
local packageName="rocm-llvm-alt"
|
||||
local packageSummary="Proprietary ROCm core compiler"
|
||||
local packageSummaryLong="ROCm core compiler, including proprietary optimizations based on LLVM $llvmParsedVersion"
|
||||
if [ "$PACKAGEEXT" = "deb" ]; then
|
||||
local packageNameExtra="rocm-llvm-alt-dev"
|
||||
else
|
||||
local packageNameExtra="rocm-llvm-alt-devel"
|
||||
fi
|
||||
local packageSummaryExtra="Proprietary ROCm compiler dev tools"
|
||||
local packageSummaryLongExtra="ROCm compiler dev tools and documentation, including proprietary optimizations, based on LLVM $llvmParsedVersion"
|
||||
local installPath="$ROCM_INSTALL_PATH/lib/llvm/alt"
|
||||
local packageName="rocm-llvm"
|
||||
local packageSummary="ROCm core compiler"
|
||||
local packageSummaryLong="ROCm core compiler based on LLVM $llvmParsedVersion"
|
||||
if [ "$PACKAGEEXT" = "deb" ]; then
|
||||
local packageNameExtra="rocm-llvm-dev"
|
||||
else
|
||||
local packageName="rocm-llvm"
|
||||
local packageSummary="ROCm core compiler"
|
||||
local packageSummaryLong="ROCm core compiler based on LLVM $llvmParsedVersion"
|
||||
if [ "$PACKAGEEXT" = "deb" ]; then
|
||||
local packageNameExtra="rocm-llvm-dev"
|
||||
else
|
||||
local packageNameExtra="rocm-llvm-devel"
|
||||
fi
|
||||
local packageSummaryExtra="ROCm compiler dev tools"
|
||||
local packageSummaryLongExtra="ROCm compiler dev tools and documentation, based on LLVM $llvmParsedVersion"
|
||||
local installPath="$ROCM_INSTALL_PATH/lib/llvm/"
|
||||
|
||||
local packageNameExtra="rocm-llvm-devel"
|
||||
fi
|
||||
local packageSummaryExtra="ROCm compiler dev tools"
|
||||
local packageSummaryLongExtra="ROCm compiler dev tools and documentation, based on LLVM $llvmParsedVersion"
|
||||
local installPath="$ROCM_INSTALL_PATH/lib/llvm/"
|
||||
|
||||
local packageArch="amd64"
|
||||
local packageVersion="${llvmParsedVersion}.${LLVM_COMMIT_GITDATE}"
|
||||
@@ -746,7 +649,6 @@ package_lightning_static() {
|
||||
local distLib="$INSTALL_PATH/lib"
|
||||
local distMan="$INSTALL_PATH/share/man"
|
||||
local licenseDir="$ROCM_INSTALL_PATH/share/doc/$packageName"
|
||||
local licenseDirExtra="$ROCM_INSTALL_PATH/share/doc/$packageNameExtra"
|
||||
local packageDir="$BUILD_PATH/package"
|
||||
local backwardsCompatibleSymlink="$ROCM_INSTALL_PATH/llvm"
|
||||
|
||||
@@ -756,9 +658,6 @@ package_lightning_static() {
|
||||
local prermFile="$packageDeb/DEBIAN/prerm"
|
||||
local specFile="$packageDir/$packageName.spec"
|
||||
local debDependencies="python3, libc6, libstdc++6|libstdc++8, libstdc++-5-dev|libstdc++-7-dev|libstdc++-11-dev, libgcc-5-dev|libgcc-7-dev|libgcc-11-dev, rocm-core"
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
debDependencies="${debDependencies}, rocm-llvm"
|
||||
fi
|
||||
local debRecommends="gcc, g++, gcc-multilib, g++-multilib"
|
||||
|
||||
local packageRpm="$packageDir/rpm"
|
||||
@@ -767,10 +666,6 @@ package_lightning_static() {
|
||||
local specFileExtra="$packageDir/$packageNameExtra.spec"
|
||||
local rpmRequires="rocm-core"
|
||||
local rpmRequiresExtra="rocm-core, $packageName"
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
rpmRequires+=", rocm-llvm"
|
||||
rpmRequiresExtra+=", rocm-llvm-devel"
|
||||
fi
|
||||
local rpmRecommends="gcc, gcc-c++, devtoolset-7-gcc-c++"
|
||||
|
||||
rm -rf "$packageDir"
|
||||
@@ -807,12 +702,7 @@ package_lightning_static() {
|
||||
mkdir -p "$DEB_PATH"
|
||||
mkdir -p "$packageDeb/$licenseDir"
|
||||
|
||||
if [ $BUILD_ALT -eq 0 ] ; then
|
||||
cp -r "$LLVM_ROOT_LCL/LICENSE.TXT" "$packageDeb/$licenseDir"
|
||||
else
|
||||
cp -r "$LLVM_PROJECT_ALT_ROOT/EULA" "$packageDeb/$licenseDir"
|
||||
cp -r "$LLVM_PROJECT_ALT_ROOT/DISCLAIMER.txt" "$packageDeb/$licenseDir"
|
||||
fi
|
||||
cp -r "$LLVM_ROOT_LCL/LICENSE.TXT" "$packageDeb/$licenseDir"
|
||||
|
||||
mkdir -p "$packageDeb/$installPath/bin"
|
||||
for i in "${core_bin[@]}"; do
|
||||
@@ -838,36 +728,32 @@ package_lightning_static() {
|
||||
done
|
||||
|
||||
if [ "$BUILD_MANPAGES" == "ON" ]; then
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
mkdir -p "$packageDeb/$installPath/share/man1"
|
||||
for i in "${core_man_pages[@]}"; do
|
||||
if [ -f "$distMan/man1/$i" ]; then
|
||||
gzip -f "$distMan/man1/$i"
|
||||
cp -d "$distMan/man1/${i}.gz" "$packageDeb/$installPath/share/man1/"
|
||||
fi
|
||||
done
|
||||
if [ -f "$distMan/man1/clang.1.gz" ]; then
|
||||
for i in "${amd_man_pages[@]}"; do
|
||||
ln -sf "clang.1.gz" "$distMan/man1/$i"
|
||||
cp -d "$distMan/man1/${i}" "$packageDeb/$installPath/share/man1/"
|
||||
done
|
||||
mkdir -p "$packageDeb/$installPath/share/man1"
|
||||
for i in "${core_man_pages[@]}"; do
|
||||
if [ -f "$distMan/man1/$i" ]; then
|
||||
gzip -f "$distMan/man1/$i"
|
||||
cp -d "$distMan/man1/${i}.gz" "$packageDeb/$installPath/share/man1/"
|
||||
fi
|
||||
done
|
||||
if [ -f "$distMan/man1/clang.1.gz" ]; then
|
||||
for i in "${amd_man_pages[@]}"; do
|
||||
ln -sf "clang.1.gz" "$distMan/man1/$i"
|
||||
cp -d "$distMan/man1/${i}" "$packageDeb/$installPath/share/man1/"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
touch "$postinstFile" "$prermFile"
|
||||
echo "mkdir -p \"$ROCM_INSTALL_PATH/bin\"" >> $postinstFile
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$packageDeb/$installPath/bin/$i" ]; then
|
||||
echo "ln -s \"../lib/llvm/bin/$i\" \"$ROCM_INSTALL_PATH/bin/$i\"" >> $postinstFile
|
||||
echo "rm -f \"$ROCM_INSTALL_PATH/bin/$i\"" >> $prermFile
|
||||
fi
|
||||
done
|
||||
echo "rmdir --ignore-fail-on-non-empty \"$ROCM_INSTALL_PATH/bin\"" >> $prermFile
|
||||
chmod 0555 "$postinstFile" "$prermFile"
|
||||
cp -P "$backwardsCompatibleSymlink" "$packageDeb/$ROCM_INSTALL_PATH"
|
||||
fi
|
||||
touch "$postinstFile" "$prermFile"
|
||||
echo "mkdir -p \"$ROCM_INSTALL_PATH/bin\"" >> $postinstFile
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$packageDeb/$installPath/bin/$i" ]; then
|
||||
echo "ln -s \"../lib/llvm/bin/$i\" \"$ROCM_INSTALL_PATH/bin/$i\"" >> $postinstFile
|
||||
echo "rm -f \"$ROCM_INSTALL_PATH/bin/$i\"" >> $prermFile
|
||||
fi
|
||||
done
|
||||
echo "rmdir --ignore-fail-on-non-empty \"$ROCM_INSTALL_PATH/bin\"" >> $prermFile
|
||||
chmod 0555 "$postinstFile" "$prermFile"
|
||||
cp -P "$backwardsCompatibleSymlink" "$packageDeb/$ROCM_INSTALL_PATH"
|
||||
|
||||
{
|
||||
echo "Package: $packageName"
|
||||
@@ -892,14 +778,6 @@ package_lightning_static() {
|
||||
mkdir -p "$packageDeb/$installPath"
|
||||
mkdir "${controlFile%/*}"
|
||||
mkdir -p "$DEB_PATH"
|
||||
mkdir -p "$packageDeb/$licenseDirExtra"
|
||||
|
||||
if [ $BUILD_ALT -eq 0 ] ; then
|
||||
cp -r "$LLVM_ROOT_LCL/LICENSE.TXT" "$packageDeb/$licenseDirExtra"
|
||||
else
|
||||
cp -r "$LLVM_PROJECT_ALT_ROOT/EULA" "$packageDeb/$licenseDirExtra"
|
||||
cp -r "$LLVM_PROJECT_ALT_ROOT/DISCLAIMER.txt" "$packageDeb/$licenseDirExtra"
|
||||
fi
|
||||
|
||||
mkdir -p "$packageDeb/$installPath/bin"
|
||||
for i in "$distBin"/*; do
|
||||
@@ -922,21 +800,16 @@ package_lightning_static() {
|
||||
fi
|
||||
|
||||
if [ "$BUILD_MANPAGES" == "ON" ]; then
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
mkdir -p "$packageDeb/$installPath/share/man1"
|
||||
for i in "${dev_man_pages[@]}"; do
|
||||
if [ -f "$distMan/man1/$i" ]; then
|
||||
gzip -f "$distMan/man1/$i"
|
||||
cp -d "$distMan/man1/${i}.gz" "$packageDeb/$installPath/share/man1/"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
mkdir -p "$packageDeb/$installPath/share/man1"
|
||||
for i in "${dev_man_pages[@]}"; do
|
||||
if [ -f "$distMan/man1/$i" ]; then
|
||||
gzip -f "$distMan/man1/$i"
|
||||
cp -d "$distMan/man1/${i}.gz" "$packageDeb/$installPath/share/man1/"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
debDependencies="${debDependencies}, ${packageName}"
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
debDependencies="${debDependencies}, rocm-llvm-dev"
|
||||
fi
|
||||
|
||||
echo "Package: $packageNameExtra" > $controlFile
|
||||
echo "Architecture: $packageArch" >> $controlFile
|
||||
@@ -979,13 +852,8 @@ package_lightning_static() {
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$installPath/bin" >> $specFile
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$licenseDir" >> $specFile
|
||||
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
echo "cp -R $LLVM_ROOT_LCL/LICENSE.TXT \$RPM_BUILD_ROOT/$licenseDir" >> $specFile
|
||||
echo "cp -P $backwardsCompatibleSymlink \$RPM_BUILD_ROOT/$ROCM_INSTALL_PATH" >> $specFile
|
||||
else
|
||||
echo "cp -R $LLVM_PROJECT_ALT_ROOT/EULA \$RPM_BUILD_ROOT/$licenseDir" >> $specFile
|
||||
echo "cp -R $LLVM_PROJECT_ALT_ROOT/DISCLAIMER.txt \$RPM_BUILD_ROOT/$licenseDir" >> $specFile
|
||||
fi
|
||||
echo "cp -R $LLVM_ROOT_LCL/LICENSE.TXT \$RPM_BUILD_ROOT/$licenseDir" >> $specFile
|
||||
echo "cp -P $backwardsCompatibleSymlink \$RPM_BUILD_ROOT/$ROCM_INSTALL_PATH" >> $specFile
|
||||
|
||||
for i in "${core_bin[@]}"; do
|
||||
if [ -f "$distBin/$i" ]; then
|
||||
@@ -995,9 +863,7 @@ package_lightning_static() {
|
||||
|
||||
echo "cp -d \"$distBin/flang\" \$RPM_BUILD_ROOT/$installPath/bin/" >> $specFile
|
||||
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
echo "cp -d \"$distBin\"/*.cfg \$RPM_BUILD_ROOT/$installPath/bin/" >> $specFile
|
||||
fi
|
||||
echo "cp -d \"$distBin\"/*.cfg \$RPM_BUILD_ROOT/$installPath/bin/" >> $specFile
|
||||
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$installPath/lib/clang" >> $specFile
|
||||
echo "cp -R \"$distLib/clang/\" \$RPM_BUILD_ROOT/$installPath/lib/" >> $specFile
|
||||
@@ -1014,20 +880,18 @@ package_lightning_static() {
|
||||
done
|
||||
|
||||
if [ "$BUILD_MANPAGES" == "ON" ]; then
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$installPath/share/man/man1" >> $specFile
|
||||
for i in "${core_man_pages[@]}"; do
|
||||
if [ -f "$distMan/man1/$i" ]; then
|
||||
echo "gzip -f $distMan/man1/$i" >> $specFile
|
||||
echo "cp -d $distMan/man1/${i}.gz \$RPM_BUILD_ROOT/$installPath/share/man/man1/" >> $specFile
|
||||
fi
|
||||
done
|
||||
if [ -f "$distMan/man1/clang.1.gz" ]; then
|
||||
for i in "${amd_man_pages[@]}"; do
|
||||
echo "ln -sf clang.1.gz \"$distMan/man1/$i\"" >> $specFile
|
||||
echo "cp -d $distMan/man1/${i} \$RPM_BUILD_ROOT/$installPath/share/man/man1/" >> $specFile
|
||||
done
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$installPath/share/man/man1" >> $specFile
|
||||
for i in "${core_man_pages[@]}"; do
|
||||
if [ -f "$distMan/man1/$i" ]; then
|
||||
echo "gzip -f $distMan/man1/$i" >> $specFile
|
||||
echo "cp -d $distMan/man1/${i}.gz \$RPM_BUILD_ROOT/$installPath/share/man/man1/" >> $specFile
|
||||
fi
|
||||
done
|
||||
if [ -f "$distMan/man1/clang.1.gz" ]; then
|
||||
for i in "${amd_man_pages[@]}"; do
|
||||
echo "ln -sf clang.1.gz \"$distMan/man1/$i\"" >> $specFile
|
||||
echo "cp -d $distMan/man1/${i} \$RPM_BUILD_ROOT/$installPath/share/man/man1/" >> $specFile
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1039,24 +903,20 @@ package_lightning_static() {
|
||||
echo "$ROCM_INSTALL_PATH"
|
||||
|
||||
echo "%post"
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
echo "mkdir -p \"$ROCM_INSTALL_PATH/bin\""
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$distBin/$i" ]; then
|
||||
echo "ln -sf ../lib/llvm/bin/$i \"$ROCM_INSTALL_PATH/bin/$i\""
|
||||
fi
|
||||
done
|
||||
fi
|
||||
echo "mkdir -p \"\$RPM_INSTALL_PREFIX0/bin\""
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$distBin/$i" ]; then
|
||||
echo "ln -sf ../lib/llvm/bin/$i \"\$RPM_INSTALL_PREFIX0/bin/$i\""
|
||||
fi
|
||||
done
|
||||
|
||||
echo "%preun"
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$distBin/$i" ]; then
|
||||
echo "rm -f \"$ROCM_INSTALL_PATH/bin/$i\""
|
||||
fi
|
||||
done
|
||||
echo "rmdir --ignore-fail-on-non-empty \"$ROCM_INSTALL_PATH/bin\""
|
||||
fi
|
||||
for i in "${amd_compiler_commands[@]}"; do
|
||||
if [ -f "$distBin/$i" ]; then
|
||||
echo "rm -f \"\$RPM_INSTALL_PREFIX0/bin/$i\""
|
||||
fi
|
||||
done
|
||||
echo "rmdir --ignore-fail-on-non-empty \"\$RPM_INSTALL_PREFIX0/bin\""
|
||||
|
||||
echo "%postun"
|
||||
} >> "$specFile"
|
||||
@@ -1071,16 +931,13 @@ package_lightning_static() {
|
||||
echo "Release: ${JOB_DESIGNATOR}${SLES_BUILD_ID_PREFIX}${BUILD_ID}%{?dist}" >> $specFileExtra
|
||||
echo "Summary: $packageSummaryExtra" >> $specFileExtra
|
||||
echo "Group: System Environment/Libraries" >> $specFileExtra
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
echo "License: AMD Proprietary" >> $specFileExtra
|
||||
else
|
||||
echo "License: ASL 2.0 with exceptions" >> $specFileExtra
|
||||
fi
|
||||
echo "License: ASL 2.0 with exceptions" >> $specFileExtra
|
||||
echo "Prefix: $ROCM_INSTALL_PATH" >> $specFileExtra
|
||||
echo "Requires: $rpmRequiresExtra" >> $specFileExtra
|
||||
|
||||
if [ $BUILD_ALT -eq 1 ]; then
|
||||
echo "%define _build_id_links none" >> $specFileExtra
|
||||
fi
|
||||
# The following is commented as Centos 7 has a version of rpm
|
||||
# that does not understand it. When we no longer support Centos 7
|
||||
# then we should have a correct recommends line.
|
||||
#echo "Recommends: $rpmRecommends" >> $specFileExtra
|
||||
|
||||
echo "%description" >> $specFileExtra
|
||||
echo "$packageSummaryLongExtra" >> $specFileExtra
|
||||
@@ -1093,15 +950,8 @@ package_lightning_static() {
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$installPath/bin" >> $specFileExtra
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$installPath/include" >> $specFileExtra
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$installPath/lib" >> $specFileExtra
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$licenseDirExtra" >> $specFileExtra
|
||||
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
echo "cp -R $LLVM_ROOT_LCL/LICENSE.TXT \$RPM_BUILD_ROOT/$licenseDirExtra" >> $specFileExtra
|
||||
echo "cp -P $backwardsCompatibleSymlink \$RPM_BUILD_ROOT/$ROCM_INSTALL_PATH" >> $specFileExtra
|
||||
else
|
||||
echo "cp -R $LLVM_PROJECT_ALT_ROOT/EULA \$RPM_BUILD_ROOT/$licenseDirExtra" >> $specFileExtra
|
||||
echo "cp -R $LLVM_PROJECT_ALT_ROOT/DISCLAIMER.txt \$RPM_BUILD_ROOT/$licenseDirExtra" >> $specFileExtra
|
||||
fi
|
||||
echo "cp -P $backwardsCompatibleSymlink \$RPM_BUILD_ROOT/$ROCM_INSTALL_PATH" >> $specFileExtra
|
||||
|
||||
for i in "$distBin"/*; do
|
||||
bin=$(basename "$i")
|
||||
@@ -1122,15 +972,13 @@ package_lightning_static() {
|
||||
fi
|
||||
|
||||
if [ "$BUILD_MANPAGES" == "ON" ]; then
|
||||
if [ $BUILD_ALT -eq 0 ]; then
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$installPath/share/man/man1" >> $specFileExtra
|
||||
for i in "${extra_man_pages[@]}"; do
|
||||
if [ -f "$distMan/man1/$i" ]; then
|
||||
echo "gzip -f $distMan/man1/$i" >> $specFileExtra
|
||||
echo "cp -d \"$distMan/man1/${i}.gz\" \$RPM_BUILD_ROOT/$installPath/share/man/man1/" >> $specFileExtra
|
||||
fi
|
||||
done
|
||||
fi
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT/$installPath/share/man/man1" >> $specFileExtra
|
||||
for i in "${dev_man_pages[@]}"; do
|
||||
if [ -f "$distMan/man1/$i" ]; then
|
||||
echo "gzip -f $distMan/man1/$i" >> $specFileExtra
|
||||
echo "cp -d \"$distMan/man1/${i}.gz\" \$RPM_BUILD_ROOT/$installPath/share/man/man1/" >> $specFileExtra
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo "%clean" >> $specFileExtra
|
||||
@@ -1266,21 +1114,7 @@ print_output_directory() {
|
||||
build() {
|
||||
mkdir -p "${INSTALL_PATH}"
|
||||
build_lightning
|
||||
if [ $BUILD_ALT -eq 0 ] ; then
|
||||
create_compiler_config_files
|
||||
fi
|
||||
}
|
||||
|
||||
create_wheel_package() {
|
||||
echo "Creating rocm-llvm wheel package"
|
||||
mkdir -p "$ROCM_WHEEL_DIR"
|
||||
cp -f $SCRIPT_ROOT/generate_setup_py.py $ROCM_WHEEL_DIR
|
||||
cp -f $SCRIPT_ROOT/repackage_wheel.sh $ROCM_WHEEL_DIR
|
||||
cd $ROCM_WHEEL_DIR
|
||||
# Currently only supports python3.6
|
||||
./repackage_wheel.sh $RPM_PATH/rocm-llvm*.rpm python3.6
|
||||
# Copy the wheel created to RPM folder which will be uploaded to artifactory
|
||||
mv "$ROCM_WHEEL_DIR"/dist/*.whl "$RPM_PATH"
|
||||
create_compiler_config_files
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
@@ -1301,9 +1135,4 @@ case $TARGET in
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
if [[ $WHEEL_PACKAGE == true ]]; then
|
||||
echo "Wheel Package build started !!!!"
|
||||
create_wheel_package
|
||||
fi
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -12,6 +12,10 @@ RPM_PATH=$PACKAGE_DIR
|
||||
build_miopen_hip() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
git config --global --add safe.directory "$COMPONENT_SRC"
|
||||
checkout_lfs
|
||||
@@ -26,10 +30,12 @@ build_miopen_hip() {
|
||||
cmake \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DMIOPEN_BACKEND=HIP \
|
||||
-DMIOPEN_OFFLINE_COMPILER_PATHS_V2=1 \
|
||||
-DCMAKE_CXX_COMPILER="${ROCM_PATH}/llvm/bin/clang++" \
|
||||
-DCMAKE_C_COMPILER="${ROCM_PATH}/llvm/bin/clang" \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_PATH};${ROCM_PATH}/hip;${HOME}/miopen-deps" \
|
||||
-DHIP_OC_COMPILER="${ROCM_PATH}/bin/clang-ocl" \
|
||||
-DMIOPEN_TEST_DISCRETE=OFF \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
|
||||
@@ -9,6 +9,10 @@ BUILD_DEV=ON
|
||||
build_mivisionx() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
@@ -21,7 +25,7 @@ build_mivisionx() {
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100"
|
||||
GPU_TARGETS="gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
cmake \
|
||||
@@ -40,8 +44,7 @@ build_mivisionx() {
|
||||
cpack -G ${PKGTYPE^^}
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR
|
||||
cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
mkdir -p $PACKAGE_DIR && cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
|
||||
show_build_cache_stats
|
||||
}
|
||||
|
||||
@@ -1,141 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/compute_utils.sh"
|
||||
PROJ_NAME=OpenCL-ICD-Loader
|
||||
TARGET="build"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
BUILD_TYPE="Debug"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_DEB="$PACKAGE_ROOT/deb/${PROJ_NAME,,}"
|
||||
PACKAGE_RPM="$PACKAGE_ROOT/rpm/${PROJ_NAME,,}"
|
||||
CLEAN_OR_OUT=0;
|
||||
PKGTYPE="deb"
|
||||
MAKETARGET="deb"
|
||||
API_NAME="rocm-opencl-icd-loader"
|
||||
|
||||
printUsage() {
|
||||
echo
|
||||
echo "Usage: $(basename "${BASH_SOURCE}") [options ...]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -o, --outdir Print path of output directory containing packages"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo
|
||||
echo "Possible values for <type>:"
|
||||
echo " deb -> Debian format (default)"
|
||||
echo " rpm -> RPM format"
|
||||
echo
|
||||
return 0
|
||||
}
|
||||
|
||||
RET_CONFLICT=1
|
||||
check_conflicting_options $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
if [ $RET_CONFLICT -ge 30 ]; then
|
||||
print_vars $TARGET $BUILD_TYPE $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
exit $RET_CONFLICT
|
||||
fi
|
||||
|
||||
clean_opencl_icd_loader() {
|
||||
echo "Cleaning $PROJ_NAME"
|
||||
rm -rf "$PACKAGE_DEB"
|
||||
rm -rf "$PACKAGE_RPM"
|
||||
rm -rf "$PACKAGE_ROOT/${PROJ_NAME,,}"
|
||||
}
|
||||
|
||||
copy_pkg_files_to_rocm() {
|
||||
local comp_folder=$1
|
||||
local comp_pkg_name=$2
|
||||
|
||||
cd "${OUT_DIR}/${PKGTYPE}/${comp_folder}"|| exit 2
|
||||
if [ "${PKGTYPE}" = 'deb' ]; then
|
||||
dpkg-deb -x ${comp_pkg_name}_*.deb pkg/
|
||||
else
|
||||
mkdir pkg && pushd pkg/ || exit 2
|
||||
if [[ "${comp_pkg_name}" != *-dev* ]]; then
|
||||
rpm2cpio ../${comp_pkg_name}-*.rpm | cpio -idmv
|
||||
else
|
||||
rpm2cpio ../${comp_pkg_name}el-*.rpm | cpio -idmv
|
||||
fi
|
||||
popd || exit 2
|
||||
fi
|
||||
ls ./pkg -alt
|
||||
cp -r ./pkg/*/rocm*/* "${ROCM_PATH}" || exit 2
|
||||
rm -rf pkg/
|
||||
}
|
||||
|
||||
build_opencl_icd_loader() {
|
||||
echo "Downloading $PROJ_NAME" package
|
||||
if [ "$DISTRO_NAME" = ubuntu ]; then
|
||||
mkdir -p "$PACKAGE_DEB"
|
||||
local rocm_ver=${ROCM_VERSION}
|
||||
if [ ${ROCM_VERSION##*.} = 0 ]; then
|
||||
rocm_ver=${ROCM_VERSION%.*}
|
||||
fi
|
||||
local url="https://repo.radeon.com/rocm/apt/${rocm_ver}/pool/main/r/${API_NAME}/"
|
||||
local package
|
||||
package=$(curl -s "$url" | grep -Po 'href="\K[^"]*' | grep "${DISTRO_RELEASE}" | head -n 1)
|
||||
|
||||
if [ -z "$package" ]; then
|
||||
echo "No package found for Ubuntu version $DISTRO_RELEASE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
wget -t3 -P "$PACKAGE_DEB" "${url}${package}"
|
||||
copy_pkg_files_to_rocm ${PROJ_NAME,,} ${API_NAME}
|
||||
else
|
||||
echo "$DISTRO_ID is not supported..."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "Installing $PROJ_NAME" package
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
("deb")
|
||||
echo ${PACKAGE_DEB};;
|
||||
("rpm")
|
||||
echo ${PACKAGE_RPM};;
|
||||
(*)
|
||||
echo "Invalid package type \"${PKGTYPE}\" provided for -o" >&2; exit 1;;
|
||||
esac
|
||||
exit
|
||||
}
|
||||
|
||||
VALID_STR=`getopt -o hcraswlo:p: --long help,clean,release,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
while true ;
|
||||
do
|
||||
case "$1" in
|
||||
(-c | --clean )
|
||||
TARGET="clean" ; ((CLEAN_OR_OUT|=1)) ; shift ;;
|
||||
(-r | --release )
|
||||
BUILD_TYPE="RelWithDebInfo" ; shift ;;
|
||||
(-h | --help )
|
||||
printUsage ; exit 0 ;;
|
||||
(-a | --address_sanitizer)
|
||||
ack_and_ignore_asan ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
MAKETARGET="$2" ; shift 2;;
|
||||
(-s | --static)
|
||||
echo "-s parameter accepted but ignored" ; shift ;;
|
||||
--) shift; break;;
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
done
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_opencl_icd_loader ;;
|
||||
(build) build_opencl_icd_loader ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
@@ -21,14 +21,15 @@ printUsage() {
|
||||
|
||||
return 0
|
||||
}
|
||||
PROJ_NAME="opencl-on-rocclr"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
|
||||
BUILD_PATH="$(getBuildPath opencl-on-rocclr)"
|
||||
BUILD_PATH="$(getBuildPath $PROJ_NAME)"
|
||||
|
||||
TARGET="build"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_DEB="$PACKAGE_ROOT/deb/opencl-on-rocclr"
|
||||
PACKAGE_RPM="$PACKAGE_ROOT/rpm/opencl-on-rocclr"
|
||||
PACKAGE_DEB="$PACKAGE_ROOT/deb/$PROJ_NAME"
|
||||
PACKAGE_RPM="$PACKAGE_ROOT/rpm/$PROJ_NAME"
|
||||
CORE_BUILD_DIR="$(getBuildPath hsa-core)"
|
||||
ROCclr_BUILD_DIR="$(getBuildPath rocclr)"
|
||||
BUILD_TYPE="Debug"
|
||||
@@ -54,7 +55,7 @@ do
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
ack_and_skip_static ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
--) shift; break;;
|
||||
@@ -148,7 +149,7 @@ print_output_directory() {
|
||||
case $TARGET in
|
||||
(clean) clean_opencl_on_rocclr ;;
|
||||
(build) build_opencl_on_rocclr ; package_opencl_on_rocclr ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ printUsage() {
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param for configuring package deps"
|
||||
echo " -h, --help Prints this help"
|
||||
echo
|
||||
echo "Possible values for <type>:"
|
||||
@@ -23,20 +24,25 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
packageMajorVersion="17.60"
|
||||
PROJ_NAME="openmp-extras"
|
||||
packageMajorVersion="18.63"
|
||||
packageMinorVersion="0"
|
||||
packageVersion="${packageMajorVersion}.${packageMinorVersion}.${ROCM_LIBPATCH_VERSION}"
|
||||
BUILD_PATH="$(getBuildPath openmp-extras)"
|
||||
DEB_PATH="$(getDebPath openmp-extras)"
|
||||
RPM_PATH="$(getRpmPath openmp-extras)"
|
||||
BUILD_PATH="$(getBuildPath $PROJ_NAME)"
|
||||
DEB_PATH="$(getDebPath $PROJ_NAME)"
|
||||
RPM_PATH="$(getRpmPath $PROJ_NAME)"
|
||||
TARGET="build"
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
STATIC_PKG_DEPS="OFF"
|
||||
|
||||
export INSTALL_PREFIX=${ROCM_INSTALL_PATH}
|
||||
|
||||
while [ "$1" != "" ];
|
||||
VALID_STR=`getopt -o hcraso:p: --long help,clean,release,address_sanitizer,static,outdir,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
case $1 in
|
||||
case "$1" in
|
||||
-c | --clean )
|
||||
TARGET="clean" ;;
|
||||
-p | --package )
|
||||
@@ -52,8 +58,11 @@ do
|
||||
export SANITIZER=1 ;;
|
||||
-o | --outdir )
|
||||
shift 1; PKGTYPE=$1 ; TARGET="outdir" ;;
|
||||
-s | --static )
|
||||
export STATIC_PKG_DEPS="ON" ;;
|
||||
-h | --help )
|
||||
printUsage ; exit 0 ;;
|
||||
--) shift; break;;
|
||||
*)
|
||||
MAKEARG=$@ ; break ;;
|
||||
esac
|
||||
@@ -124,6 +133,23 @@ build_openmp_extras() {
|
||||
export AOMP_JENKINS_BUILD_LIST="extras openmp pgmath flang flang_runtime"
|
||||
echo "BEGIN Build of openmp-extras"
|
||||
"$AOMP_REPOS"/aomp/bin/build_aomp.sh $MAKEARG
|
||||
|
||||
local llvm_ver=`$INSTALL_PREFIX/lib/llvm/bin/clang --print-resource-dir | sed 's^/llvm/lib/clang/^ ^' | awk '{print $2}'`
|
||||
if [ ! -e $ROCM_INSTALL_PATH/lib/llvm/lib/clang/$llvm_ver/include/omp.h ] ; then
|
||||
if [ ! -h $ROCM_INSTALL_PATH/lib/llvm/lib/clang/$llvm_ver/include/omp.h ] ; then
|
||||
ln -s ../../../../include/omp.h $ROCM_INSTALL_PATH/lib/llvm/lib/clang/$llvm_ver/include/omp.h
|
||||
fi
|
||||
fi
|
||||
if [ ! -e $ROCM_INSTALL_PATH/lib/llvm/lib/clang/$llvm_ver/include/ompt.h ] ; then
|
||||
if [ ! -h $ROCM_INSTALL_PATH/lib/llvm/lib/clang/$llvm_ver/include/ompt.h ] ; then
|
||||
ln -s ../../../../include/ompt.h $ROCM_INSTALL_PATH/lib/llvm/lib/clang/$llvm_ver/include/ompt.h
|
||||
fi
|
||||
fi
|
||||
if [ ! -e $ROCM_INSTALL_PATH/lib/llvm/lib/clang/$llvm_ver/include/omp-tools.h ] ; then
|
||||
if [ ! -h $ROCM_INSTALL_PATH/lib/llvm/lib/clang/$llvm_ver/include/omp-tools.h ] ; then
|
||||
ln -s ../../../../include/omp-tools.h $ROCM_INSTALL_PATH/lib/llvm/lib/clang/$llvm_ver/include/omp-tools.h
|
||||
fi
|
||||
fi
|
||||
popd
|
||||
}
|
||||
|
||||
@@ -133,20 +159,30 @@ package_openmp_extras_deb() {
|
||||
local packageArch="amd64"
|
||||
local packageMaintainer="Openmp Extras Support <openmp-extras.support@amd.com>"
|
||||
local packageSummary="OpenMP Extras provides openmp and flang libraries."
|
||||
local packageSummaryLong="openmp-extras $packageVersion is based on LLVM 15 and is used for offloading to Radeon GPUs."
|
||||
local packageSummaryLong="openmp-extras $packageVersion is based on LLVM 17 and is used for offloading to Radeon GPUs."
|
||||
local debDependencies="rocm-llvm, rocm-device-libs, rocm-core"
|
||||
local debRecommends="gcc, g++"
|
||||
local controlFile="$packageDeb/openmp-extras/DEBIAN/control"
|
||||
|
||||
if [ "$packageName" == "openmp-extras-runtime" ]; then
|
||||
packageType="runtime"
|
||||
debDependencies="rocm-core, hsa-rocr"
|
||||
if [ "$STATIC_PKG_DEPS" == "OFF" ]; then
|
||||
debDependencies="rocm-core, hsa-rocr"
|
||||
else
|
||||
echo "static package dependency configuration for runtime" ;
|
||||
debDependencies="rocm-core, hsa-rocr-static-dev"
|
||||
fi
|
||||
else
|
||||
local debProvides="openmp-extras"
|
||||
local debConflicts="openmp-extras"
|
||||
local debReplaces="openmp-extras"
|
||||
packageType="devel"
|
||||
debDependencies="$debDependencies, openmp-extras-runtime, hsa-rocr-dev"
|
||||
if [ "$STATIC_PKG_DEPS" == "OFF" ]; then
|
||||
debDependencies="$debDependencies, openmp-extras-runtime, hsa-rocr-dev"
|
||||
else
|
||||
echo "Enabled static package dependency configuration for dev" ;
|
||||
debDependencies="$debDependencies, openmp-extras-runtime, hsa-rocr-static-dev"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f "$BUILD_PATH"/build/installed_files.txt ] && [ ! -d "$INSTALL_PREFIX"/openmp-extras/devel ]; then
|
||||
@@ -209,6 +245,9 @@ package_openmp_extras_deb() {
|
||||
cp -r "$AOMP_REPOS"/aomp/examples/fortran "$packageDeb"/openmp-extras"$copyPath"/share/openmp-extras/examples
|
||||
cp -r "$AOMP_REPOS"/aomp/examples/openmp "$packageDeb"/openmp-extras"$copyPath"/share/openmp-extras/examples
|
||||
cp -r "$AOMP_REPOS"/aomp/examples/tools "$packageDeb"/openmp-extras"$copyPath"/share/openmp-extras/examples
|
||||
if [ -e "$AOMP_REPOS/aomp/examples/Makefile.help" ]; then
|
||||
cp "$AOMP_REPOS"/aomp/examples/Makefile* "$packageDeb"/openmp-extras"$copyPath"/share/openmp-extras/examples
|
||||
fi
|
||||
clean_examples "$packageDeb"/openmp-extras"$copyPath"/share/openmp-extras/examples
|
||||
fi
|
||||
|
||||
@@ -260,7 +299,7 @@ package_openmp_extras_asan_deb() {
|
||||
local packageArch="amd64"
|
||||
local packageMaintainer="Openmp Extras Support <openmp-extras.support@amd.com>"
|
||||
local packageSummary="AddressSanitizer OpenMP Extras provides instrumented openmp and flang libraries."
|
||||
local packageSummaryLong="openmp-extras $packageVersion is based on LLVM 15 and is used for offloading to Radeon GPUs."
|
||||
local packageSummaryLong="openmp-extras $packageVersion is based on LLVM 17 and is used for offloading to Radeon GPUs."
|
||||
local debDependencies="hsa-rocr-asan, rocm-core-asan"
|
||||
local debRecommends="gcc, g++"
|
||||
local controlFile="$packageDeb/openmp-extras/DEBIAN/control"
|
||||
@@ -317,23 +356,26 @@ package_openmp_extras_rpm() {
|
||||
local packageRpm="$packageDir/rpm"
|
||||
local specFile="$packageDir/$packageName.spec"
|
||||
local packageSummary="OpenMP Extras provides openmp and flang libraries."
|
||||
local packageSummaryLong="openmp-extras $packageVersion is based on LLVM 15 and is used for offloading to Radeon GPUs."
|
||||
local packageSummaryLong="openmp-extras $packageVersion is based on LLVM 17 and is used for offloading to Radeon GPUs."
|
||||
local rpmRequires="rocm-llvm, rocm-device-libs, rocm-core"
|
||||
if [ "$packageName" == "openmp-extras-runtime" ]; then
|
||||
packageType="runtime"
|
||||
rpmRequires="rocm-core, hsa-rocr"
|
||||
if [ "$STATIC_PKG_DEPS" == "OFF" ]; then
|
||||
rpmRequires="rocm-core, hsa-rocr"
|
||||
else
|
||||
rpmRequires="rocm-core, hsa-rocr-static-devel"
|
||||
fi
|
||||
else
|
||||
local rpmProvides="openmp-extras"
|
||||
local rpmObsoletes="openmp-extras"
|
||||
packageType="devel"
|
||||
rpmRequires="$rpmRequires, openmp-extras-runtime, hsa-rocr-devel"
|
||||
if [ "$STATIC_PKG_DEPS" == "OFF" ]; then
|
||||
rpmRequires="$rpmRequires, openmp-extras-runtime, hsa-rocr-devel"
|
||||
else
|
||||
rpmRequires="$rpmRequires, openmp-extras-runtime, hsa-rocr-static-devel"
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f "$AOMP_REPOS"/aomp/examples/*.sh
|
||||
rm -f "$AOMP_REPOS"/aomp/examples/fortran/*.sh
|
||||
rm -f "$AOMP_REPOS"/aomp/examples/openmp/*.sh
|
||||
|
||||
|
||||
if [ "$packageType" == "runtime" ]; then
|
||||
rm -rf "$packageDir"
|
||||
rm -rf "$RPM_PATH"
|
||||
@@ -354,6 +396,7 @@ package_openmp_extras_rpm() {
|
||||
echo "Group: System Environment/Libraries"
|
||||
echo "License: MIT and ASL 2.0 and ASL 2.0 with exceptions"
|
||||
echo "Vendor: Advanced Micro Devices, Inc."
|
||||
echo "Prefix: $INSTALL_PREFIX"
|
||||
echo "Requires: $rpmRequires"
|
||||
echo "%if %is_devel"
|
||||
echo "Provides: $rpmProvides"
|
||||
@@ -435,6 +478,9 @@ package_openmp_extras_rpm() {
|
||||
echo " cp -r $AOMP_REPOS/aomp/examples/fortran \$RPM_BUILD_ROOT$copyPath/share/openmp-extras/examples"
|
||||
echo " cp -r $AOMP_REPOS/aomp/examples/openmp \$RPM_BUILD_ROOT$copyPath/share/openmp-extras/examples"
|
||||
echo " cp -r $AOMP_REPOS/aomp/examples/tools \$RPM_BUILD_ROOT$copyPath/share/openmp-extras/examples"
|
||||
if [ -e "$AOMP_REPOS/aomp/examples/Makefile.help" ]; then
|
||||
echo " cp $AOMP_REPOS/aomp/examples/Makefile* \$RPM_BUILD_ROOT$copyPath/share/openmp-extras/examples"
|
||||
fi
|
||||
clean_examples \$RPM_BUILD_ROOT$copyPath/share/openmp-extras/examples
|
||||
echo "%endif"
|
||||
echo "%clean"
|
||||
@@ -461,7 +507,7 @@ package_openmp_extras_asan_rpm() {
|
||||
local packageRpm="$packageDir/rpm"
|
||||
local specFile="$packageDir/$packageName.spec"
|
||||
local packageSummary="AddressSanitizer OpenMP Extras provides instrumented openmp and flang libraries."
|
||||
local packageSummaryLong="openmp-extras $packageVersion is based on LLVM 15 and is used for offloading to Radeon GPUs."
|
||||
local packageSummaryLong="openmp-extras $packageVersion is based on LLVM 17 and is used for offloading to Radeon GPUs."
|
||||
local rpmRequires="hsa-rocr-asan, rocm-core-asan"
|
||||
local asanLibDir="runtime"
|
||||
|
||||
@@ -527,7 +573,6 @@ package_openmp_extras_asan_rpm() {
|
||||
mv $packageRpm/RPMS/x86_64/*.rpm $RPM_PATH
|
||||
}
|
||||
|
||||
|
||||
package_openmp_extras() {
|
||||
local DISTRO_NAME=$(cat /etc/os-release | grep -e ^NAME=)
|
||||
local installPath="$ROCM_INSTALL_PATH/lib/llvm"
|
||||
@@ -563,21 +608,23 @@ package_tests_deb(){
|
||||
local packageArch="amd64"
|
||||
local packageMaintainer="Openmp Extras Support <openmp-extras.support@amd.com>"
|
||||
local packageSummary="Tests for openmp-extras."
|
||||
local packageSummaryLong="Tests for openmp-extras $packageMajorVersion-$packageMinorVersion is based on LLVM 15 and is used for offloading to Radeon GPUs."
|
||||
local debDependencies="rocm-core"
|
||||
local debRecommends="gcc, g++"
|
||||
local packageSummaryLong="Tests for openmp-extras $packageMajorVersion-$packageMinorVersion is based on LLVM 17 and is used for offloading to Radeon GPUs."
|
||||
local debDependencies="openmp-extras-dev, rocm-core"
|
||||
local debRecommends=""
|
||||
local controlFile="$packageDeb/openmp-extras/DEBIAN/control"
|
||||
local installPath="$ROCM_INSTALL_PATH/share/openmp-extras/tests"
|
||||
local packageName="openmp-extras-tests"
|
||||
|
||||
rm -rf "$packageDir"
|
||||
|
||||
mkdir -p $packageDeb/openmp-extras$installPath; mkdir -p $packageDeb/openmp-extras$copyPath/bin
|
||||
mkdir -p $packageDeb/openmp-extras"$installPath"
|
||||
if [ -e $(dirname $controlFile) ]; then
|
||||
rm $(dirname $controlFile)
|
||||
fi
|
||||
mkdir -p "$(dirname $controlFile)"
|
||||
cp -r "$AOMP_REPOS/aomp/test/smoke" "$packageDeb$installPath"
|
||||
cp -r "$AOMP_REPOS/aomp/." "$packageDeb/openmp-extras/$installPath"
|
||||
rm -rf "$packageDeb"/openmp-extras"$installPath"/.git "$packageDeb"/openmp-extras"$installPath"/.github
|
||||
cp "$OUT_DIR/build/lightning/bin/FileCheck" "$packageDeb/openmp-extras/$installPath/bin"
|
||||
{
|
||||
echo "Package: $packageName"
|
||||
echo "Architecture: $packageArch"
|
||||
@@ -603,11 +650,12 @@ package_tests_rpm(){
|
||||
local packageName="openmp-extras-tests"
|
||||
local specFile="$packageDir/$packageName.spec"
|
||||
local packageSummary="Tests for openmp-extras."
|
||||
local packageSummaryLong="Tests for openmp-extras $packageVersion is based on LLVM 15 and is used for offloading to Radeon GPUs."
|
||||
local packageSummaryLong="Tests for openmp-extras $packageVersion is based on LLVM 18 and is used for offloading to Radeon GPUs."
|
||||
|
||||
rm -rf "$packageDir"
|
||||
mkdir -p "$packageRpm$installPath"
|
||||
mkdir -p "$packageRpm/openmp-extras/$installPath"
|
||||
{
|
||||
echo "AutoReqProv: no"
|
||||
echo "Name: $packageName"
|
||||
echo "Version: $packageVersion"
|
||||
echo "Release: ${CPACK_RPM_PACKAGE_RELEASE}%{?dist}"
|
||||
@@ -615,7 +663,10 @@ package_tests_rpm(){
|
||||
echo "Group: System Environment/Libraries"
|
||||
echo "License: Advanced Micro Devices, Inc."
|
||||
echo "Vendor: Advanced Micro Devices, Inc."
|
||||
echo "Prefix: $INSTALL_PREFIX"
|
||||
echo "Requires: $rpmRequires"
|
||||
echo "%define debug_package %{nil}"
|
||||
# Redefining __os_install_post to remove stripping
|
||||
echo "%define __os_install_post %{nil}"
|
||||
echo "%description"
|
||||
echo "$packageSummaryLong"
|
||||
@@ -625,18 +676,21 @@ package_tests_rpm(){
|
||||
echo "%build"
|
||||
|
||||
echo "%install"
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT$copyPath/share/aomp/tests"
|
||||
echo "cp -R $AOMP_REPOS/aomp/test/smoke \$RPM_BUILD_ROOT$copyPath/share/aomp/tests"
|
||||
echo "mkdir -p \$RPM_BUILD_ROOT$installPath"
|
||||
echo "cp -R $AOMP_REPOS/aomp/. \$RPM_BUILD_ROOT$installPath"
|
||||
echo "rm -rf \$RPM_BUILD_ROOT$installPath/.git \$RPM_BUILD_ROOT$installPath/.github"
|
||||
echo "cp $OUT_DIR/build/lightning/bin/FileCheck \$RPM_BUILD_ROOT$installPath/bin"
|
||||
echo 'find $RPM_BUILD_ROOT \! -type d | sed "s|$RPM_BUILD_ROOT||"> files.list'
|
||||
|
||||
echo "%clean"
|
||||
echo "rm -rf \$RPM_BUILD_ROOT"
|
||||
|
||||
echo "%files -f files.list"
|
||||
echo "$installPath"
|
||||
echo "%defattr(-,root,root,-)"
|
||||
|
||||
echo "%postun"
|
||||
echo "rm -rf $ROCM_INSTALL_PATH/share/aomp"
|
||||
echo "rm -rf $installPath"
|
||||
} > $specFile
|
||||
rpmbuild --define "_topdir $packageRpm" -ba $specFile
|
||||
mv $packageRpm/RPMS/x86_64/*.rpm $RPM_PATH
|
||||
@@ -665,7 +719,7 @@ print_output_directory() {
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_openmp_extras ;;
|
||||
(build) build_openmp_extras; package_openmp_extras ;;
|
||||
(build) build_openmp_extras; package_openmp_extras; package_tests ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -10,6 +10,10 @@ ENABLE_ADDRESS_SANITIZER=false
|
||||
build_rccl() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
mkdir -p $ROCM_PATH/.info/
|
||||
echo $ROCM_VERSION | tee $ROCM_PATH/.info/version
|
||||
|
||||
@@ -23,7 +27,7 @@ build_rccl() {
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
@@ -13,7 +13,7 @@ printUsage() {
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -h, --help Prints this help"
|
||||
echo
|
||||
return 0
|
||||
@@ -41,7 +41,7 @@ RDC_PKG_NAME_ROOT="rdc"
|
||||
RDC_PKG_NAME="${RDC_PKG_NAME_ROOT}"
|
||||
GRPC_PROTOC_ROOT="${RDC_BUILD_DIR}/grpc"
|
||||
GRPC_SEARCH_ROOT="/usr/grpc"
|
||||
GRPC_DESIRED_VERSION="1.59.1" # do not include 'v'
|
||||
GRPC_DESIRED_VERSION="1.61.0"
|
||||
|
||||
RDC_LIB_RPATH='$ORIGIN'
|
||||
RDC_LIB_RPATH=$RDC_LIB_RPATH:'$ORIGIN/..'
|
||||
@@ -70,7 +70,7 @@ do
|
||||
(-d | --documentation )
|
||||
BUILD_DOCS="yes" ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
ack_and_skip_static ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
@@ -111,49 +111,20 @@ find_grpc() {
|
||||
GRPC_PROTOC_ROOT=$GRPC_SEARCH_ROOT
|
||||
}
|
||||
|
||||
build_grpc() {
|
||||
if find_grpc; then
|
||||
return 0
|
||||
fi
|
||||
echo "GRPC SEARCH FAILED! Building from scratch..."
|
||||
|
||||
mkdir -p $PACKAGE_ROOT/build
|
||||
pushd $PACKAGE_ROOT/build
|
||||
|
||||
if [ ! -d $PACKAGE_ROOT/build/grpc/.git ]; then
|
||||
git clone \
|
||||
--shallow-submodules \
|
||||
--recurse-submodules \
|
||||
$DASH_JAY \
|
||||
-b v${GRPC_DESIRED_VERSION} \
|
||||
--depth 1 \
|
||||
https://github.com/grpc/grpc
|
||||
fi
|
||||
|
||||
cd grpc
|
||||
mkdir -p cmake/build
|
||||
cd cmake/build
|
||||
|
||||
cmake \
|
||||
-DgRPC_INSTALL=ON \
|
||||
-DgRPC_BUILD_TESTS=OFF \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${GRPC_PROTOC_ROOT} \
|
||||
../..
|
||||
cmake --build . -- $DASH_JAY
|
||||
cmake --build . -- install
|
||||
|
||||
cp ../../LICENSE ${GRPC_PROTOC_ROOT}
|
||||
popd
|
||||
}
|
||||
|
||||
rdc_backwards_compat_cmake_params() {
|
||||
grep -q "RDC_CLIENT_INSTALL_PREFIX" "$RDC_ROOT/CMakeLists.txt" &&
|
||||
echo "-DRDC_CLIENT_INSTALL_PREFIX=$PACKAGE_ROOT"
|
||||
}
|
||||
|
||||
build_rdc() {
|
||||
if ! find_grpc; then
|
||||
echo "ERROR: GRPC SEARCH FAILED!"
|
||||
echo "You are expected to have gRPC [${GRPC_DESIRED_VERSION}] in [${GRPC_SEARCH_ROOT}]"
|
||||
# Compiling gRPC as part of the RDC build takes too long and times out the build job
|
||||
return 1
|
||||
fi
|
||||
echo "gRPC [${GRPC_DESIRED_VERSION}] found!"
|
||||
|
||||
echo "Building RDC"
|
||||
echo "RDC_BUILD_DIR: ${RDC_BUILD_DIR}"
|
||||
echo "GRPC_PROTOC_ROOT: ${GRPC_PROTOC_ROOT}"
|
||||
@@ -226,7 +197,7 @@ verifyEnvSetup
|
||||
case $TARGET in
|
||||
(clean) clean_rdc ;;
|
||||
(clean_grpc) clean_grpc ;;
|
||||
(build) build_grpc; build_rdc ;;
|
||||
(build) build_rdc ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
@@ -7,11 +7,6 @@ set_component_src rocAL
|
||||
|
||||
build_rocal() {
|
||||
|
||||
if [ "$DISTRO_ID" = "mariner-2.0" ] ; then
|
||||
echo "Not building rocal for ${DISTRO_ID}. Exiting..."
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "Start build"
|
||||
|
||||
# Enable ASAN
|
||||
|
||||
@@ -10,6 +10,10 @@ set_component_src rocALUTION
|
||||
build_rocalution() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
CXX="g++"
|
||||
@@ -27,7 +31,7 @@ build_rocalution() {
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
cmake \
|
||||
@@ -35,7 +39,6 @@ build_rocalution() {
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DCPACK_SET_DESTDIR=OFF \
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
|
||||
@@ -12,6 +12,11 @@ stage2_command_args "$@"
|
||||
build_rocblas() {
|
||||
echo "Start build"
|
||||
|
||||
SHARED_LIBS="ON"
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
@@ -26,7 +31,7 @@ build_rocblas() {
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
GPU_TARGETS="gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
@@ -36,8 +41,8 @@ build_rocblas() {
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DROCM_DIR="${ROCM_PATH}" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DCMAKE_PREFIX_PATH="${DEPS_DIR};${ROCM_PATH}" \
|
||||
-DCPACK_SET_DESTDIR=OFF \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/compute_utils.sh"
|
||||
|
||||
printUsage() {
|
||||
echo
|
||||
echo "Usage: $(basename "${BASH_SOURCE}") [options ...] [make options]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of type referred to by pkg_type"
|
||||
echo
|
||||
echo "Possible values for <type>:"
|
||||
echo " deb -> Debian format (default)"
|
||||
echo " rpm -> RPM format"
|
||||
echo
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
MAKEOPTS="$DASH_JAY"
|
||||
|
||||
BUILD_PATH="$(getBuildPath rocclr)"
|
||||
|
||||
TARGET="build"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/rocclr"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/rocclr"
|
||||
CORE_BUILD_DIR="$(getBuildPath hsa-core)"
|
||||
BUILD_TYPE="Debug"
|
||||
SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
|
||||
VALID_STR=`getopt -o hcraso: --long help,clean,release,static,address_sanitizer,outdir: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
(-c | --clean)
|
||||
TARGET="clean" ; ((CLEAN_OR_OUT|=1)) ; shift ;;
|
||||
(-r | --release)
|
||||
BUILD_TYPE="Release" ; shift ;;
|
||||
(-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
--) shift; break;;
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
RET_CONFLICT=1
|
||||
check_conflicting_options $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
if [ $RET_CONFLICT -ge 30 ]; then
|
||||
print_vars $API_NAME $TARGET $BUILD_TYPE $SHARED_LIBS $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
exit $RET_CONFLICT
|
||||
fi
|
||||
|
||||
|
||||
clean_rocclr() {
|
||||
rm -rf "$BUILD_PATH"
|
||||
rm -rf "$PACKAGE_DEB"
|
||||
rm -rf "$PACKAGE_RPM"
|
||||
}
|
||||
|
||||
build_rocclr() {
|
||||
if [ "$SHARED_LIBS" = "ON" ]; then
|
||||
echo "rocclr not a standalone repo. skipping build" >&2
|
||||
echo "rocclr not a standalone repo. skipping build"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -e "$CLR_ROOT/CMakeLists.txt" ]; then
|
||||
_ROCclr_CMAKELIST_DIR="$CLR_ROOT"
|
||||
elif [ ! -e "$ROCclr_ROOT/CMakeLists.txt" ]; then
|
||||
echo "No $ROCclr_ROOT/CMakeLists.txt file, skipping rocclr" >&2
|
||||
echo "No $ROCclr_ROOT/CMakeLists.txt file, skipping rocclr"
|
||||
exit 0
|
||||
else
|
||||
_ROCclr_CMAKELIST_DIR="$ROCclr_ROOT"
|
||||
fi
|
||||
echo "$_ROCclr_CMAKELIST_DIR"
|
||||
mkdir -p "$BUILD_PATH"
|
||||
pushd "$BUILD_PATH"
|
||||
print_lib_type $SHARED_LIBS
|
||||
if [ ! -e Makefile ]; then
|
||||
echo "Building ROCclr CMake environment"
|
||||
|
||||
cmake -DUSE_COMGR_LIBRARY=ON \
|
||||
$(rocm_cmake_params) \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DLLVM_INCLUDES="$LLVM_ROOT/include" \
|
||||
$(rocm_common_cmake_params) \
|
||||
"$_ROCclr_CMAKELIST_DIR"
|
||||
|
||||
echo "CMake complete"
|
||||
fi
|
||||
|
||||
echo "Building ROCclr"
|
||||
cmake --build . -- $MAKEOPTS "VERBOSE=1"
|
||||
|
||||
popd
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_rocclr ;;
|
||||
(build) build_rocclr ;;
|
||||
(outdir) exit ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
@@ -4,14 +4,14 @@ source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
set_component_src rocDecode
|
||||
BUILD_DEV=ON
|
||||
build_rocdecode() {
|
||||
if [ "$DISTRO_ID" = "centos-7" ] || [ "$DISTRO_ID" = "sles-15.4" ] ; then
|
||||
echo "Not building rocDecode for ${DISTRO_ID}. Exiting..."
|
||||
return 0
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
echo "Start build"
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
python3 ${COMPONENT_SRC}/rocDecode-setup.py --developer OFF
|
||||
# python3 ${COMPONENT_SRC}/rocDecode-setup.py --developer OFF
|
||||
|
||||
cmake -DROCM_DEP_ROCMCORE=ON ${COMPONENT_SRC}
|
||||
make -j8
|
||||
|
||||
@@ -21,7 +21,7 @@ build_rocfft() {
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
GPU_TARGETS="gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
CXX="${ROCM_PATH}/bin/hipcc" \
|
||||
@@ -34,7 +34,6 @@ build_rocfft() {
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_CLIENTS_RIDER=ON \
|
||||
-DCPACK_SET_DESTDIR=OFF \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
|
||||
39
tools/rocm-build/build_rocjpeg.sh
Executable file
39
tools/rocm-build/build_rocjpeg.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
set_component_src rocJPEG
|
||||
BUILD_DEV=ON
|
||||
build_rocjpeg() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
# python3 ../rocJPEG-setup.py
|
||||
|
||||
cmake -DROCM_DEP_ROCMCORE=ON "$COMPONENT_SRC"
|
||||
make -j8
|
||||
make install
|
||||
make package
|
||||
|
||||
cmake --build "$BUILD_DIR" -- -j${PROC}
|
||||
cpack -G ${PKGTYPE^^}
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR
|
||||
cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
show_build_cache_stats
|
||||
}
|
||||
clean_rocjpeg() {
|
||||
echo "Cleaning rocJPEG build directory: ${BUILD_DIR} ${PACKAGE_DIR}"
|
||||
rm -rf "$BUILD_DIR" "$PACKAGE_DIR"
|
||||
echo "Done!"
|
||||
}
|
||||
stage2_command_args "$@"
|
||||
case $TARGET in
|
||||
build) build_rocjpeg ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_rocjpeg ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
@@ -32,7 +32,6 @@ ROCM_CMAKE_BUILD_DIR="$(getBuildPath rocm-cmake)"
|
||||
ROCM_CMAKE_BUILD_DIR="$(getBuildPath rocm-cmake)"
|
||||
ROCM_CMAKE_PACKAGE_DEB="$(getPackageRoot)/deb/rocm-cmake"
|
||||
ROCM_CMAKE_PACKAGE_RPM="$(getPackageRoot)/rpm/rocm-cmake"
|
||||
ROCM_WHEEL_DIR="${ROCM_CMAKE_BUILD_DIR}/_wheel"
|
||||
ROCM_CMAKE_BUILD_TYPE="debug"
|
||||
BUILD_TYPE="Debug"
|
||||
SHARED_LIBS="ON"
|
||||
@@ -56,8 +55,6 @@ do
|
||||
ack_and_ignore_asan ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
@@ -78,7 +75,6 @@ fi
|
||||
|
||||
|
||||
clean_rocm_cmake() {
|
||||
rm -rf "$ROCM_WHEEL_DIR"
|
||||
rm -rf $ROCM_CMAKE_BUILD_DIR
|
||||
rm -rf $ROCM_CMAKE_PACKAGE_DEB
|
||||
rm -rf $ROCM_CMAKE_PACKAGE_RPM
|
||||
@@ -106,19 +102,6 @@ build_rocm_cmake() {
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$ROCM_CMAKE_PACKAGE_RPM" $ROCM_CMAKE_BUILD_DIR/rocm-cmake*.rpm
|
||||
}
|
||||
|
||||
create_wheel_package() {
|
||||
echo "Creating rocm-cmake wheel package"
|
||||
# Copy the setup.py generator to build folder
|
||||
mkdir -p $ROCM_WHEEL_DIR
|
||||
cp -f $SCRIPT_ROOT/generate_setup_py.py $ROCM_WHEEL_DIR
|
||||
cp -f $SCRIPT_ROOT/repackage_wheel.sh $ROCM_WHEEL_DIR
|
||||
cd $ROCM_WHEEL_DIR
|
||||
# Currently only supports python3.6
|
||||
./repackage_wheel.sh $ROCM_CMAKE_BUILD_DIR/rocm-cmake*.rpm python3.6
|
||||
# Copy the wheel created to RPM folder which will be uploaded to artifactory
|
||||
copy_if WHL "WHL" "$ROCM_CMAKE_PACKAGE_RPM" "$ROCM_WHEEL_DIR"/dist/*.whl
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
("deb")
|
||||
@@ -138,9 +121,4 @@ case $TARGET in
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
if [[ $WHEEL_PACKAGE == true ]]; then
|
||||
echo "Wheel Package build started !!!!"
|
||||
create_wheel_package
|
||||
fi
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -24,10 +24,11 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
PROJ_NAME="rocm-core"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
ROCM_CORE_BUILD_DIR="$(getBuildPath rocm_core)"
|
||||
ROCM_CORE_PACKAGE_DEB="$(getPackageRoot)/deb/rocm-core"
|
||||
ROCM_CORE_PACKAGE_RPM="$(getPackageRoot)/rpm/rocm-core"
|
||||
ROCM_CORE_PACKAGE_DEB="$(getPackageRoot)/deb/$PROJ_NAME"
|
||||
ROCM_CORE_PACKAGE_RPM="$(getPackageRoot)/rpm/$PROJ_NAME"
|
||||
ROCM_CORE_MAKE_OPTS="$DASH_JAY -C $ROCM_CORE_BUILD_DIR"
|
||||
BUILD_TYPE="Debug"
|
||||
TARGET="build"
|
||||
|
||||
@@ -48,7 +48,7 @@ CLEAN_OR_OUT=0;
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
LDFLAGS="$LDFLAGS -Wl,--enable-new-dtags"
|
||||
|
||||
LIB_AMD_PYTHON="libamdpython.so"
|
||||
|
||||
tokeep=(
|
||||
main${ROCM_INSTALL_PATH}/bin/rocgdb
|
||||
@@ -123,11 +123,41 @@ package_deb(){
|
||||
local VERSION
|
||||
get_version unknown
|
||||
VERSION="${VERSION}.${ROCM_LIBPATCH_VERSION}"
|
||||
|
||||
grep -v '^# ' > "$BUILD_DIR/package/main/DEBIAN/control" <<EOF
|
||||
#create postinstall and prerm
|
||||
grep -v '^# ' > "$BUILD_DIR/package/main/DEBIAN/preinst" <<EOF
|
||||
#!/bin/sh
|
||||
# Pre-installation script commands
|
||||
echo "Running pre-installation script..."
|
||||
mkdir -p ${ROCM_INSTALL_PATH}/lib
|
||||
PYTHON_LIB_INSTALLED=\$(ldconfig -p | awk '/libpython3/ { print \$NF; exit}')
|
||||
ln -s \$PYTHON_LIB_INSTALLED ${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON
|
||||
echo "pre-installation done."
|
||||
EOF
|
||||
grep -v '^# ' > "$BUILD_DIR/package/main/DEBIAN/postrm" <<EOF
|
||||
#!/bin/sh
|
||||
# Post-uninstallation script commands
|
||||
echo "Running post-uninstallation script..."
|
||||
PYTHON_LINK_BY_OPENCL=\$(ldconfig -p | awk '/libpython3/ { print \$NF; exit}' | awk -F'/' '{print \$NF}')
|
||||
rm -f ${ROCM_INSTALL_PATH}/lib/\$PYTHON_LINK_BY_OPENCL
|
||||
rm -f ${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON
|
||||
if [ -L "${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON" ] || \
|
||||
[ -L "${ROCM_INSTALL_PATH}/lib/\$PYTHON_LINK_BY_OPENCL" ] ; then
|
||||
echo " some rocm-gdb requisite libs could not be removed"
|
||||
else
|
||||
echo " all requisite libs removed successfully "
|
||||
fi
|
||||
echo "post-uninstallation done."
|
||||
EOF
|
||||
chmod +x $BUILD_DIR/package/main/DEBIAN/postrm
|
||||
chmod +x $BUILD_DIR/package/main/DEBIAN/preinst
|
||||
# Create control file, with variable substitution.
|
||||
# Lines with # at the start are removed, to allow for comments
|
||||
mkdir "$BUILD_DIR/debian"
|
||||
grep -v '^# ' > "$BUILD_DIR/debian/control" <<EOF
|
||||
# Required fields
|
||||
Version: ${VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}
|
||||
Package: ${PROJ_NAME}
|
||||
Source: ${PROJ_NAME}-src
|
||||
Maintainer: ROCm Debugger Support <rocm-gdb.support@amd.com>
|
||||
Description: ROCgdb
|
||||
This is ROCgdb, the AMD ROCm source-level debugger for Linux,
|
||||
@@ -137,15 +167,37 @@ Section: utils
|
||||
Architecture: amd64
|
||||
Essential: no
|
||||
Priority: optional
|
||||
Depends: libexpat1, libtinfo5, libncurses5, rocm-dbgapi, libpython3.10 | libpython3.8, libbabeltrace-ctf1 (>= 1.2.1), libbabeltrace1 (>= 1.2.1), rocm-core
|
||||
Depends: \${shlibs:Depends}, rocm-dbgapi, rocm-core
|
||||
EOF
|
||||
|
||||
# Use dpkg-shlibdeps to list shlib dependencies, the result is placed
|
||||
# in $BUILD_DIR/debian/substvars.
|
||||
(
|
||||
cd "$BUILD_DIR"
|
||||
if [[ $ASAN_BUILD == "yes" ]]
|
||||
then
|
||||
LD_LIBRARY_PATH=${ROCM_INSTALL_PATH}/lib/asan:$LD_LIBRARY_PATH
|
||||
fi
|
||||
dpkg-shlibdeps --ignore-missing-info -e "$BUILD_DIR/package/main/${ROCM_INSTALL_PATH}/bin/rocgdb"
|
||||
)
|
||||
# Generate the final DEBIAN/control, and substitute the shlibs:Depends.
|
||||
# This is a bit unorthodox as we are only using bits and pieces of the
|
||||
# dpkg tools.
|
||||
(
|
||||
SHLIB_DEPS=$(grep "^shlibs:Depends" "$BUILD_DIR/debian/substvars" | \
|
||||
sed -e "s/shlibs:Depends=//")
|
||||
sed -E \
|
||||
-e "/^#/d" \
|
||||
-e "/^Source:/d" \
|
||||
-e "s/\\$\{shlibs:Depends\}/$SHLIB_DEPS/" \
|
||||
< debian/control > "$BUILD_DIR/package/main/DEBIAN/control"
|
||||
)
|
||||
mkdir -p "$OUT_DIR/deb/$PROJ_NAME"
|
||||
fakeroot dpkg-deb -Zgzip --build "$BUILD_DIR/package/main" "$OUT_DIR/deb/$PROJ_NAME"
|
||||
|
||||
# Package the tests so they can be run on a test slave
|
||||
mkdir -p "$BUILD_DIR/package/tests/DEBIAN"
|
||||
mkdir -p "$BUILD_DIR/package/tests/${ROCM_INSTALL_PATH}/test/gdb"
|
||||
|
||||
# Create control file, with variable substitution.
|
||||
# Lines with # at the start are removed, to allow for comments
|
||||
grep -v '^# ' > "$BUILD_DIR/package/tests/DEBIAN/control" <<EOF
|
||||
# Required fields
|
||||
Version: ${VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}
|
||||
@@ -161,7 +213,6 @@ Priority: optional
|
||||
# rocm-core as policy says everything to depend on rocm-core
|
||||
Depends: ${PROJ_NAME} (=${VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}), dejagnu, rocm-core, make
|
||||
EOF
|
||||
|
||||
copy_testsuite_files
|
||||
fakeroot dpkg-deb -Zgzip --build "$BUILD_DIR/package/tests" "$OUT_DIR/deb/$PROJ_NAME"
|
||||
}
|
||||
@@ -204,7 +255,9 @@ Summary: ROCm source-level debugger for Linux
|
||||
Version: ${VERSION//-/_}
|
||||
Release: ${CPACK_RPM_PACKAGE_RELEASE}%{?dist}
|
||||
License: GPL
|
||||
Prefix: ${ROCM_INSTALL_PATH}
|
||||
Requires: rocm-core
|
||||
Provides: $LIB_AMD_PYTHON()(64bit)
|
||||
|
||||
%description
|
||||
This is ROCgdb, the ROCm source-level debugger for Linux, based on
|
||||
@@ -225,6 +278,27 @@ https://github.com/RadeonOpenCompute/ROCm
|
||||
## into the local RPM_BUILD_ROOT and left the defaults take over. Need
|
||||
## to quote the dollar signs as we want rpm to expand them when it is
|
||||
## run, rather than the shell when we build the spec file.
|
||||
%pre
|
||||
# Post-install script commands
|
||||
echo "Running post-install script..."
|
||||
mkdir -p ${ROCM_INSTALL_PATH}/lib
|
||||
PYTHON_LIB_INSTALLED=\$(ldconfig -p | awk '/libpython3/ { print \$NF; exit}')
|
||||
ln -s \$PYTHON_LIB_INSTALLED ${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON
|
||||
|
||||
%postun
|
||||
# Post-uninstallation script commands
|
||||
echo "Running post-uninstallation script..."
|
||||
PYTHON_LINK_BY_OPENCL=\$(ldconfig -p | awk '/libpython3/ { print \$NF; exit}' | awk -F'/' '{print \$NF}')
|
||||
rm -f ${ROCM_INSTALL_PATH}/lib/\$PYTHON_LINK_BY_OPENCL
|
||||
rm -f ${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON
|
||||
if [ -L "${ROCM_INSTALL_PATH}/lib/$LIB_AMD_PYTHON" ] || \
|
||||
[ -L "${ROCM_INSTALL_PATH}/lib/\$PYTHON_LINK_BY_OPENCL" ] ; then
|
||||
echo " some rocm-gdb requisite libs could not be removed"
|
||||
else
|
||||
echo " all requisite libs removed successfully "
|
||||
fi
|
||||
echo "post-uninstallation done."
|
||||
|
||||
%install
|
||||
rm -rf \$RPM_BUILD_ROOT
|
||||
mkdir -p \$RPM_BUILD_ROOT
|
||||
@@ -279,6 +353,7 @@ Summary: Tests for gdb enhanced to debug AMD GPUs
|
||||
Version: ${VERSION//-/_}
|
||||
Release: ${RELEASE}
|
||||
License: GPL
|
||||
Prefix: ${ROCM_INSTALL_PATH}
|
||||
Requires: dejagnu, ${PROJ_NAME} = ${VERSION//-/_}-${RELEASE}, rocm-core, make
|
||||
|
||||
%description
|
||||
@@ -340,15 +415,36 @@ build() {
|
||||
--infodir="\${prefix}/share/info/rocgdb" \
|
||||
--with-separate-debug-dir="\${prefix}/lib/debug:/usr/lib/debug" \
|
||||
--with-gdb-datadir="\${prefix}/share/rocgdb" --enable-64-bit-bfd \
|
||||
--with-bugurl="$BUG_URL" --with-pkgversion="${ROCM_BUILD_ID:-ROCm}" \
|
||||
--enable-targets="x86_64-linux-gnu,amdgcn-amd-amdhsa" \
|
||||
--disable-ld --disable-gas --disable-gdbserver --disable-sim --enable-tui \
|
||||
--disable-gdbtk --disable-shared --disable-gprofng \
|
||||
--with-expat --with-system-zlib --without-guile --with-babeltrace --with-lzma \
|
||||
--with-python=$pythonver --with-rocm-dbgapi=$ROCM_INSTALL_PATH \
|
||||
--with-amd-dbgapi PKG_CONFIG_PATH="${ROCM_INSTALL_PATH}/share/pkgconfig" \
|
||||
--with-bugurl="$BUG_URL" --with-pkgversion="${ROCM_BUILD_ID:-ROCm}" \
|
||||
--enable-targets="x86_64-linux-gnu,amdgcn-amd-amdhsa" \
|
||||
--disable-gas \
|
||||
--disable-gdbserver \
|
||||
--disable-gdbtk \
|
||||
--disable-gprofng \
|
||||
--disable-ld \
|
||||
--disable-shared \
|
||||
--disable-sim \
|
||||
--enable-tui \
|
||||
--with-amd-dbgapi \
|
||||
--with-expat \
|
||||
--with-lzma \
|
||||
--with-python=$pythonver \
|
||||
--with-rocm-dbgapi=$ROCM_INSTALL_PATH \
|
||||
--with-system-zlib \
|
||||
--with-zstd \
|
||||
--without-babeltrace \
|
||||
--without-guile \
|
||||
--without-intel-pt \
|
||||
--without-libunwind-ia64 \
|
||||
--without-xxhash \
|
||||
PKG_CONFIG_PATH="${ROCM_INSTALL_PATH}/share/pkgconfig" \
|
||||
LDFLAGS="$LDFLAGS"
|
||||
LD_RUN_PATH='${ORIGIN}/../lib' make $MAKE_OPTS
|
||||
|
||||
REPLACE_LIB_NAME=$(ldd -d $BUILD_DIR/gdb/gdb |awk '/libpython/{print $1}')
|
||||
echo "Replacing $REPLACE_LIB_NAME with $LIB_AMD_PYTHON"
|
||||
patchelf --replace-needed $REPLACE_LIB_NAME $LIB_AMD_PYTHON $BUILD_DIR/gdb/gdb
|
||||
|
||||
mkdir -p $BUILD_DIR/package/main${ROCM_INSTALL_PATH}/{share/rocgdb,bin}
|
||||
|
||||
make $MAKE_OPTS -C gdb DESTDIR=$BUILD_DIR/package/main install install-pdf install-html
|
||||
@@ -381,7 +477,7 @@ main(){
|
||||
|
||||
VALID_STR=`getopt -o hcraso:p: --long help,clean,release,static,address_sanitizer,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
ASAN_BUILD="no"
|
||||
while true ;
|
||||
do
|
||||
case "$1" in
|
||||
@@ -393,9 +489,10 @@ do
|
||||
BUILD_TYPE="Release" ; shift ; MAKEARG="$MAKEARG REL=1" ;; # For compatability with other scripts
|
||||
(-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
set_address_sanitizer_on
|
||||
ASAN_BUILD="yes" ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
ack_and_skip_static ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package) #FIXME
|
||||
|
||||
@@ -7,7 +7,7 @@ printUsage() {
|
||||
echo "Usage: $(basename "${BASH_SOURCE}") [options ...]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -s, --static Supports static CI by accepting this param & not bailing out. No effect of the param though"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
@@ -65,7 +65,7 @@ do
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
ack_and_skip_static ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
@@ -127,6 +127,10 @@ build_rocm_bandwidth_test() {
|
||||
echo "Packaging $TEST_NAME"
|
||||
cmake --build "$TEST_BLD_DIR" -- $MAKEARG -C $TEST_BLD_DIR package
|
||||
|
||||
mkdir -p "$TEST_BIN_DIR"
|
||||
echo "Copying $TEST_NAME to $TEST_BIN_DIR"
|
||||
progressCopy "$TEST_BLD_DIR/$TEST_NAME" "$TEST_BIN_DIR"
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$TEST_PKG_DEB" $TEST_BLD_DIR/*.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$TEST_PKG_RPM" $TEST_BLD_DIR/*.rpm
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
PROJ_NAME="rsmi"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
TARGET="build"
|
||||
|
||||
@@ -30,8 +31,8 @@ PACKAGE_LIB=$(getLibPath)
|
||||
PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
|
||||
RSMI_BUILD_DIR=$(getBuildPath rsmi)
|
||||
RSMI_PACKAGE_DEB_DIR="$(getPackageRoot)/deb/rsmi"
|
||||
RSMI_PACKAGE_RPM_DIR="$(getPackageRoot)/rpm/rsmi"
|
||||
RSMI_PACKAGE_DEB_DIR="$(getPackageRoot)/deb/$PROJ_NAME"
|
||||
RSMI_PACKAGE_RPM_DIR="$(getPackageRoot)/rpm/$PROJ_NAME"
|
||||
RSMI_BUILD_TYPE="debug"
|
||||
BUILD_TYPE="Debug"
|
||||
|
||||
|
||||
@@ -22,17 +22,16 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
PROJ_NAME="rocminfo"
|
||||
TARGET="build"
|
||||
ROCMINFO_DEST="$(getBinPath)"
|
||||
ROCMINFO_SRC_ROOT="$ROCMINFO_ROOT"
|
||||
ROCMINFO_BUILD_DIR="$(getBuildPath rocminfo)"
|
||||
ROCMINFO_BUILD_DIR="$(getBuildPath $PROJ_NAME)"
|
||||
|
||||
MAKEARG="$DASH_JAY"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_UTILS="$(getUtilsPath)"
|
||||
ROCMINFO_PACKAGE_DEB="$(getPackageRoot)/deb/rocminfo"
|
||||
ROCMINFO_PACKAGE_RPM="$(getPackageRoot)/rpm/rocminfo"
|
||||
ROCMINFO_PACKAGE_DEB="$PACKAGE_ROOT/deb/$PROJ_NAME"
|
||||
ROCMINFO_PACKAGE_RPM="$PACKAGE_ROOT/rpm/$PROJ_NAME"
|
||||
BUILD_TYPE="debug"
|
||||
SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
@@ -91,6 +90,7 @@ build_rocminfo() {
|
||||
|
||||
cmake \
|
||||
$(rocm_cmake_params) \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DROCRTST_BLD_TYPE="$BUILD_TYPE" \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DCPACK_PACKAGE_VERSION_MAJOR="1" \
|
||||
|
||||
@@ -10,6 +10,10 @@ ROCM_RVS_LIB_RPATH="\$ORIGIN/.."
|
||||
build_rocmvalidationsuite() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
@@ -17,11 +21,13 @@ build_rocmvalidationsuite() {
|
||||
|
||||
cd "${COMPONENT_SRC}"
|
||||
mkdir -p "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
cmake \
|
||||
$(rocm_common_cmake_params) \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DFETCH_ROCMPATH_FROM_ROCMCORE=ON \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--enable-new-dtags,--rpath,$ROCM_LIB_RPATH:$ROCM_RVS_LIB_RPATH" \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_LIB_RPATH:$ROCM_RVS_LIB_RPATH" \
|
||||
-DRVS_BUILD_TESTS=FALSE \
|
||||
-B "$BUILD_DIR" \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
|
||||
@@ -16,12 +16,17 @@ build_rocprim() {
|
||||
ASAN_CMAKE_PARAMS="false"
|
||||
fi
|
||||
|
||||
SHARED_LIBS="ON"
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
@@ -31,8 +36,8 @@ build_rocprim() {
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DBUILD_BENCHMARK=OFF \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_TEST=ON \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DCMAKE_MODULE_PATH="${ROCM_PATH}/lib/cmake/hip;${ROCM_PATH}/hip/cmake" \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
|
||||
@@ -7,18 +7,18 @@ printUsage() {
|
||||
echo "Usage: ${BASH_SOURCE##*/} [options ...]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -w, --wheel Creates python wheel package of omniperf.
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -w, --wheel Creates python wheel package of ROCm Compute Profiler.
|
||||
It needs to be used along with -r option"
|
||||
echo " -h, --help Prints this help"
|
||||
echo
|
||||
echo "Possible values for <type>:"
|
||||
echo "Possible values for package <type>:"
|
||||
echo " deb -> Debian format (default)"
|
||||
echo " rpm -> RPM format"
|
||||
echo
|
||||
@@ -26,7 +26,7 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
API_NAME="omniperf"
|
||||
API_NAME="rocprofiler-compute"
|
||||
PROJ_NAME="$API_NAME"
|
||||
LIB_NAME="lib${API_NAME}"
|
||||
TARGET="build"
|
||||
@@ -36,17 +36,13 @@ PACKAGE_LIB="$(getLibPath)"
|
||||
BUILD_DIR="$(getBuildPath $API_NAME)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/$API_NAME"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/$API_NAME"
|
||||
ROCM_WHEEL_DIR="${BUILD_DIR}/_wheel"
|
||||
BUILD_TYPE="Debug"
|
||||
MAKE_OPTS="$DASH_JAY -C $BUILD_DIR"
|
||||
SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
WHEEL_PACKAGE=false
|
||||
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=$(getopt -o hcraso:p:w --long help,clean,release,static,address_sanitizer,outdir:,package:,wheel -- "$@")
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
@@ -55,22 +51,22 @@ do
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
-c | --clean)
|
||||
TARGET="clean" ; ((CLEAN_OR_OUT|=1)) ; shift ;;
|
||||
-r | --release)
|
||||
BUILD_TYPE="Release" ; shift ;;
|
||||
-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
-c | --clean)
|
||||
TARGET="clean" ; ((CLEAN_OR_OUT|=1)) ; shift ;;
|
||||
-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
-p | --package)
|
||||
MAKETARGET="$2" ; shift 2 ;;
|
||||
-r | --release)
|
||||
BUILD_TYPE="Release" ; shift ;;
|
||||
-s | --static)
|
||||
ack_and_skip_static ;;
|
||||
-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
--) shift; break;; # end delimiter
|
||||
--) shift; break;;
|
||||
*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
@@ -86,7 +82,6 @@ fi
|
||||
|
||||
clean() {
|
||||
echo "Cleaning $PROJ_NAME"
|
||||
rm -rf "$ROCM_WHEEL_DIR"
|
||||
rm -rf "$BUILD_DIR"
|
||||
rm -rf "$PACKAGE_DEB"
|
||||
rm -rf "$PACKAGE_RPM"
|
||||
@@ -97,10 +92,9 @@ clean() {
|
||||
build() {
|
||||
echo "Building $PROJ_NAME"
|
||||
if [ "$DISTRO_ID" = centos-7 ]; then
|
||||
echo "Skip make and uploading packages for Omniperf on Centos7 distro, due to python dependency"
|
||||
echo "Skip make and uploading packages for ROCm Compute Profiler on Centos7 distro, due to python dependency"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -d "$BUILD_DIR" ]; then
|
||||
mkdir -p "$BUILD_DIR"
|
||||
pushd "$BUILD_DIR" || exit
|
||||
@@ -108,16 +102,16 @@ build() {
|
||||
echo "ROCm CMake Params: $(rocm_cmake_params)"
|
||||
echo "ROCm Common CMake Params: $(rocm_common_cmake_params)"
|
||||
|
||||
#install python deps
|
||||
#python3 -m pip install -t ${BUILD_DIR}/python-libs -r ${ROCPROFILER_COMPUTE_ROOT}/requirements.txt
|
||||
print_lib_type $SHARED_LIBS
|
||||
cmake \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DCHECK_PYTHON_DEPS=NO \
|
||||
-DPYTHON_DEPS=${BUILD_DIR}/python-libs \
|
||||
-DMOD_INSTALL_PATH=${BUILD_DIR}/modulefiles \
|
||||
"$OMNIPERF_ROOT"
|
||||
"$ROCPROFILER_COMPUTE_ROOT"
|
||||
fi
|
||||
|
||||
make $MAKE_OPTS
|
||||
make $MAKE_OPTS install
|
||||
make $MAKE_OPTS package
|
||||
@@ -126,22 +120,6 @@ build() {
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$PACKAGE_RPM" "$BUILD_DIR/${API_NAME}"*.rpm
|
||||
}
|
||||
|
||||
create_wheel_package() {
|
||||
echo "Creating Omniperf wheel package"
|
||||
|
||||
# Copy the setup.py generator to build folder
|
||||
mkdir -p "$ROCM_WHEEL_DIR"
|
||||
cp -f "$SCRIPT_ROOT"/generate_setup_py.py "$ROCM_WHEEL_DIR"
|
||||
cp -f "$SCRIPT_ROOT"/repackage_wheel.sh "$ROCM_WHEEL_DIR"
|
||||
cd "$ROCM_WHEEL_DIR" || exit
|
||||
|
||||
# Currently only supports python3.6
|
||||
./repackage_wheel.sh "$BUILD_DIR"/*.rpm python3.6
|
||||
|
||||
# Copy the wheel created to RPM folder which will be uploaded to artifactory
|
||||
copy_if WHL "WHL" "$PACKAGE_RPM" "$ROCM_WHEEL_DIR"/dist/*.whl
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
("deb")
|
||||
@@ -163,9 +141,4 @@ case "$TARGET" in
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
if [[ $WHEEL_PACKAGE == true ]]; then
|
||||
echo "Wheel Package build started !!!!"
|
||||
create_wheel_package
|
||||
fi
|
||||
|
||||
echo "Operation complete"
|
||||
echo "Operation complete"
|
||||
@@ -37,7 +37,6 @@ PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
BUILD_DIR="$(getBuildPath $API_NAME)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/$API_NAME"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/$API_NAME"
|
||||
ROCM_WHEEL_DIR="${BUILD_DIR}/_wheel"
|
||||
PACKAGE_PREFIX="$ROCM_INSTALL_PATH"
|
||||
BUILD_TYPE="Debug"
|
||||
MAKE_OPTS="$DASH_JAY"
|
||||
@@ -74,8 +73,7 @@ while true; do
|
||||
shift
|
||||
;;
|
||||
-s | --static)
|
||||
SHARED_LIBS="OFF"
|
||||
shift
|
||||
ack_and_skip_static
|
||||
;;
|
||||
-w | --wheel)
|
||||
WHEEL_PACKAGE=true
|
||||
@@ -113,7 +111,6 @@ fi
|
||||
|
||||
clean() {
|
||||
echo "Cleaning $PROJ_NAME"
|
||||
rm -rf "$ROCM_WHEEL_DIR"
|
||||
rm -rf "$BUILD_DIR"
|
||||
rm -rf "$PACKAGE_DEB"
|
||||
rm -rf "$PACKAGE_RPM"
|
||||
@@ -177,18 +174,6 @@ build_rocprofiler-sdk() {
|
||||
fi
|
||||
}
|
||||
|
||||
create_wheel_package() {
|
||||
echo "Creating rocprofiler sdk wheel package"
|
||||
mkdir -p "$ROCM_WHEEL_DIR"
|
||||
cp -f "$SCRIPT_ROOT"/generate_setup_py.py "$ROCM_WHEEL_DIR"
|
||||
cp -f "$SCRIPT_ROOT"/repackage_wheel.sh "$ROCM_WHEEL_DIR"
|
||||
cd "$ROCM_WHEEL_DIR"
|
||||
# Currently only supports python3.6
|
||||
./repackage_wheel.sh "$BUILD_DIR"/*.rpm python3.6
|
||||
# Copy the wheel created to RPM folder which will be uploaded to artifactory
|
||||
copy_if WHL "WHL" "$PACKAGE_RPM" "$ROCM_WHEEL_DIR"/dist/*.whl
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
"deb")
|
||||
@@ -214,9 +199,4 @@ case "$TARGET" in
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
if [[ $WHEEL_PACKAGE == true ]]; then
|
||||
echo "Wheel Package build started !!!!"
|
||||
create_wheel_package
|
||||
fi
|
||||
|
||||
echo "Operation complete"
|
||||
|
||||
@@ -14,7 +14,7 @@ printUsage() {
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -w, --wheel Creates python wheel package of omnitrace.
|
||||
echo " -w, --wheel Creates python wheel package of rocprof_sys.
|
||||
It needs to be used along with -r option"
|
||||
echo " -h, --help Prints this help"
|
||||
echo
|
||||
@@ -26,16 +26,18 @@ printUsage() {
|
||||
return 0
|
||||
}
|
||||
|
||||
API_NAME="omnitrace"
|
||||
API_NAME="rocprofiler-systems"
|
||||
PROJ_NAME="$API_NAME"
|
||||
LIB_NAME="lib${API_NAME}"
|
||||
TARGET="build"
|
||||
MAKETARGET="deb"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_LIB="$(getLibPath)"
|
||||
|
||||
BUILD_DIR="$(getBuildPath $API_NAME)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/$API_NAME"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/$API_NAME"
|
||||
|
||||
BUILD_TYPE="Debug"
|
||||
MAKE_OPTS="-j 8"
|
||||
SHARED_LIBS="ON"
|
||||
@@ -44,11 +46,11 @@ MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
ASAN=0
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=$(getopt -o hcraso:p:w --long help,clean,release,address_sanitizer,static,outdir:,package:,wheel -- "$@")
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true; do
|
||||
#echo "parocessing $1"
|
||||
case "$1" in
|
||||
-h | --help)
|
||||
printUsage
|
||||
@@ -65,17 +67,19 @@ while true; do
|
||||
;;
|
||||
-a | --address_sanitizer)
|
||||
ack_and_ignore_asan
|
||||
# set_asan_env_vars
|
||||
# set_address_sanitizer_on
|
||||
|
||||
ASAN=1
|
||||
shift
|
||||
;;
|
||||
-s | --static)
|
||||
SHARED_LIBS="OFF"
|
||||
shift
|
||||
ack_and_skip_static
|
||||
;;
|
||||
-o | --outdir)
|
||||
TARGET="outdir"
|
||||
PKGTYPE=$2
|
||||
# OUT_DIR_SPECIFIED=1
|
||||
((CLEAN_OR_OUT |= 2))
|
||||
shift 2
|
||||
;;
|
||||
@@ -84,13 +88,13 @@ while true; do
|
||||
shift 2
|
||||
;;
|
||||
-w | --wheel)
|
||||
echo "omnitrace: wheel build option accepted and ignored"
|
||||
WHEEL_PACKAGE=true
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
;; # end delimiter
|
||||
*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] " >&2
|
||||
exit 20
|
||||
@@ -115,15 +119,11 @@ clean() {
|
||||
rm -rf "$PACKAGE_LIB/${LIB_NAME:?}"*
|
||||
}
|
||||
|
||||
build_omnitrace() {
|
||||
build_rocprofiler_systems() {
|
||||
echo "Building $PROJ_NAME"
|
||||
if [ "$DISTRO_ID" = "mariner-2.0" ] || [ "$DISTRO_ID" = "ubuntu-24.04" ] || [ "$DISTRO_ID" = "azurelinux-3.0" ]; then
|
||||
echo "Skip make and uploading packages for Omnitrace on \"${DISTRO_ID}\" distro"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $ASAN == 1 ]; then
|
||||
echo "Skip make and uploading packages for Omnitrace on ASAN build"
|
||||
echo "Skip make and uploading packages for rocprofiler-systems on ASAN build"
|
||||
exit 0
|
||||
fi
|
||||
if [ ! -d "$BUILD_DIR" ]; then
|
||||
@@ -131,24 +131,69 @@ build_omnitrace() {
|
||||
echo "Created build directory: $BUILD_DIR"
|
||||
fi
|
||||
|
||||
cd $ROCPROFILER_SYSTEMS_ROOT || exit
|
||||
|
||||
echo "Current submodule status"
|
||||
git submodule status
|
||||
echo "Cached (old) submodule status"
|
||||
git submodule status --cached
|
||||
cat .git/config
|
||||
|
||||
echo "Updating submodules"
|
||||
git submodule init
|
||||
|
||||
git submodule sync --recursive
|
||||
|
||||
git submodule update --init --recursive --force
|
||||
|
||||
echo "Updated submodule status"
|
||||
git submodule status
|
||||
cat .git/config
|
||||
|
||||
echo "Build directory: $BUILD_DIR"
|
||||
pushd "$BUILD_DIR" || exit
|
||||
print_lib_type $SHARED_LIBS
|
||||
|
||||
ELFUTIL_URL="https://compute-artifactory.amd.com/artifactory/rocm-generic-local/dev-tools/omnitrace/elfutils-0.188.tar.bz2"
|
||||
BINUTIL_URL="https://compute-artifactory.amd.com/artifactory/rocm-generic-local/dev-tools/omnitrace/binutils-2.40.tar.gz"
|
||||
|
||||
echo "ROCm CMake Params: $(rocm_cmake_params)"
|
||||
echo "ROCm Common CMake Params: $(rocm_common_cmake_params)"
|
||||
|
||||
echo "ELFUTIL_URL=$ELFUTIL_URL, BINUTIL_URL=$BINUTIL_URL"
|
||||
|
||||
if [ $ASAN == 1 ]; then
|
||||
echo "Address Sanitizer path"
|
||||
|
||||
# Commenting out the below cmake command as it is not working as expected
|
||||
# LD_LIBRARY_PATH=$ROCM_INSTALL_PATH/lib/asan:$LD_LIBRARY_PATH
|
||||
# cmake \
|
||||
# $(rocm_cmake_params) \
|
||||
# $(rocm_common_cmake_params) \
|
||||
# -DROCPROFSYS_BUILD_{LIBUNWIND,DYNINST}=ON \
|
||||
# -DDYNINST_BUILD_{TBB,BOOST,ELFUTILS,LIBIBERTY}=ON \
|
||||
# -DAMDDeviceLibs_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/AMDDeviceLibs" \
|
||||
# -Dhip_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/hip" \
|
||||
# -Dhip-lang_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/hip-lang" \
|
||||
# -Damd_comgr_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/amd_comgr" \
|
||||
# -Dhsa-runtime64_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/hsa-runtime64" \
|
||||
# -Dhsakmt_DIR="${ROCM_INSTALL_PATH}/lib/asan/cmake/hsakmt" \
|
||||
# -DROCM_PATH="${ROCM_INSTALL_PATH}/lib/asan" \
|
||||
# -Drocprofiler_ROOT_DIR="${ROCM_INSTALL_PATH}/lib/asan" \
|
||||
# -DCMAKE_HIP_COMPILER_ROCM_ROOT="${ROCM_INSTALL_PATH}" \
|
||||
# -DCMAKE_PREFIX_PATH="${ROCM_INSTALL_PATH};${ROCM_INSTALL_PATH}/lib/asan" \
|
||||
# -DCMAKE_LIBRARY_PATH="${ROCM_INSTALL_PATH}/lib/asan" \
|
||||
# -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=OFF \
|
||||
# "$ROCPROFILER_SYSTEMS_ROOT"
|
||||
|
||||
else
|
||||
cmake \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DOMNITRACE_BUILD_{LIBUNWIND,DYNINST}=ON \
|
||||
-DROCPROFSYS_BUILD_{LIBUNWIND,DYNINST}=ON \
|
||||
-DDYNINST_BUILD_{TBB,BOOST,ELFUTILS,LIBIBERTY}=ON \
|
||||
"$OMNITRACE_ROOT"
|
||||
-DElfUtils_DOWNLOAD_URL="$ELFUTIL_URL" \
|
||||
-D{DYNINST,TIMEMORY}_BINUTILS_DOWNLOAD_URL="$BINUTIL_URL" \
|
||||
"$ROCPROFILER_SYSTEMS_ROOT"
|
||||
fi
|
||||
|
||||
|
||||
@@ -182,10 +227,10 @@ print_output_directory() {
|
||||
verifyEnvSetup
|
||||
|
||||
case "$TARGET" in
|
||||
clean) clean ;;
|
||||
build) build_omnitrace ;;
|
||||
outdir) print_output_directory ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
clean) clean ;;
|
||||
build) build_rocprofiler_systems ;;
|
||||
outdir) print_output_directory ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
@@ -8,7 +8,7 @@ printUsage() {
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
@@ -42,9 +42,9 @@ SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
GPU_LIST="gfx900,gfx906,gfx908,gfx90a,gfx940,gfx941,gfx942,gfx1030,gfx1100,gfx1101,gfx1102"
|
||||
GPU_LIST="gfx900,gfx906,gfx908,gfx90a,gfx940,gfx941,gfx942,gfx1030,gfx1031,gfx1100,gfx1101,gfx1102,gfx1200,gfx1201"
|
||||
|
||||
VALID_STR=$(getopt -o hcraso:p: --long help,clean,release,static,address_sanitizer,outdir:,package: -- "$@")
|
||||
VALID_STR=$(getopt -o hcraswo:p: --long help,clean,release,static,wheel,address_sanitizer,outdir:,package: -- "$@")
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true; do
|
||||
@@ -68,7 +68,7 @@ while true; do
|
||||
shift
|
||||
;;
|
||||
-s | --static)
|
||||
SHARED_LIBS="OFF"
|
||||
ack_and_skip_static
|
||||
shift
|
||||
;;
|
||||
-o | --outdir)
|
||||
@@ -131,7 +131,9 @@ build_rocprofiler() {
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DENABLE_LDCONFIG=OFF \
|
||||
-DUSE_PROF_API=1 \
|
||||
-DUSE_GET_ROCM_PATH_API=1 \
|
||||
-DGPU_TARGETS="$GPU_LIST" \
|
||||
-DPython3_EXECUTABLE=$(which python3) \
|
||||
-DPROF_API_HEADER_PATH="$WORK_ROOT/roctracer/inc/ext" \
|
||||
-DHIP_HIPCC_FLAGS=$HIP_HIPCC_FLAGS";--offload-arch=$GPU_LIST" \
|
||||
-DCPACK_OBJCOPY_EXECUTABLE="${ROCM_INSTALL_PATH}/llvm/bin/llvm-objcopy" \
|
||||
|
||||
360
tools/rocm-build/build_rocr.sh
Executable file
360
tools/rocm-build/build_rocr.sh
Executable file
@@ -0,0 +1,360 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/compute_utils.sh"
|
||||
PROJ_NAME="rocr"
|
||||
|
||||
printUsage() {
|
||||
echo
|
||||
echo "Usage: $(basename "${BASH_SOURCE}") [options ...] [make options]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo " -n, --norocr Don't build ROCr runtime (default is to build). This implies --norocrtst."
|
||||
echo " -k, --nokfdtest Don't build kfdtest (default is to build)"
|
||||
echo " -w, --wheel Creates python wheel packages. It needs to be used along with -r option"
|
||||
echo " -t, --norocrtst Don't build rocrtst (default is to build)"
|
||||
echo ""
|
||||
echo " rocrtst options:"
|
||||
echo " -e, --emulator Build a version suitable for running on emulator"
|
||||
echo " -g, --gpu_list <gpus> Quoted, semi-colon separated list of gpu architectures that"
|
||||
echo " kernels will run on; e.g., \"gfx803;gfx900;...\" the"
|
||||
echo " default is to build kernels for all supported architectures."
|
||||
|
||||
echo
|
||||
echo "Default build: debug, shared libs"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
build_rocr_runtime() {
|
||||
echo "Build ROCr Runtime"
|
||||
echo "$ROCR_ROOT"
|
||||
|
||||
if [ "$shared_libs" == "OFF" ]; then
|
||||
install_drmStatic_lib
|
||||
fi
|
||||
|
||||
if [ ! -d "$rocr_build_dir" ]; then
|
||||
mkdir -p "$rocr_build_dir"
|
||||
pushd "$rocr_build_dir" || { echo "Failed to pushd into $rocr_build_dir"; exit 1; }
|
||||
print_lib_type "$shared_libs"
|
||||
|
||||
cmake \
|
||||
$(rocm_cmake_params) \
|
||||
-DBUILD_SHARED_LIBS="$shared_libs" \
|
||||
-DBUILD_ROCR="$rocr_target" \
|
||||
-DENABLE_LDCONFIG=OFF \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DADDRESS_SANITIZER="$ADDRESS_SANITIZER" \
|
||||
-DROCM_INSTALL_PATH="$ROCM_INSTALL_PATH" \
|
||||
-DCPACK_GENERATOR="${CPACKGEN:-"DEB;RPM"}" \
|
||||
-DTHUNK_DEFINITIONS="$thunk_defines_string" \
|
||||
-DROCR_DEFINITIONS="$rocr_defines_string" \
|
||||
"$ROCR_ROOT"
|
||||
popd
|
||||
fi
|
||||
|
||||
cmake --build "$rocr_build_dir" --verbose -- $DASH_JAY
|
||||
cmake --build "$rocr_build_dir" --target install --verbose
|
||||
cmake --build "$rocr_build_dir" --target package --verbose
|
||||
mkdir -p "$package_lib"
|
||||
|
||||
copy_if DEB "${CPACKGEN:-"DEB;RPM"}" "$package_root_deb" "$rocr_build_dir"/hsa-rocr*.deb
|
||||
copy_if RPM "${CPACKGEN:-"DEB;RPM"}" "$package_root_rpm" "$rocr_build_dir"/hsa-rocr*.rpm
|
||||
}
|
||||
|
||||
build_rocrtst() {
|
||||
rocrtst_build_type="debug"
|
||||
mkdir -p "$rocrtst_build_dir"
|
||||
pushd "$rocrtst_build_dir" || { echo "Failed to pushd into $rocrtst_build_dir"; exit 1; }
|
||||
|
||||
BUILD_TYPE=
|
||||
if [[ $gpu_list ]]; then
|
||||
cmake -DTARGET_DEVICES="$gpu_list" \
|
||||
-DROCRTST_BLD_TYPE="$rocrtst_build_type" \
|
||||
-DBUILD_SHARED_LIBS="$shared_libs" \
|
||||
-DCMAKE_PREFIX_PATH="$ROCM_INSTALL_PATH;$ROCM_INSTALL_PATH/llvm" \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DCMAKE_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
-DCPACK_GENERATOR="${CPACKGEN:-"DEB;RPM"}" \
|
||||
-DROCM_PATCH_VERSION="$ROCM_LIBPATCH_VERSION" \
|
||||
-DROCM_DIR="$ROCM_INSTALL_PATH" \
|
||||
-DLLVM_DIR="$ROCM_INSTALL_PATH/llvm/bin" \
|
||||
-DOPENCL_DIR="$ROCM_INSTALL_PATH" \
|
||||
-DEMULATOR_BUILD="$emulator_build" \
|
||||
"$rocrtst_src_root"
|
||||
else
|
||||
$ADDRESS_SANITIZER cmake -DROCRTST_BLD_TYPE="$rocrtst_build_type" \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=1 \
|
||||
-DBUILD_SHARED_LIBS="$shared_libs" \
|
||||
-DCMAKE_PREFIX_PATH="$ROCM_INSTALL_PATH;$ROCM_INSTALL_PATH/llvm" \
|
||||
-DCMAKE_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
-DCPACK_GENERATOR="${CPACKGEN:-"DEB;RPM"}" \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DROCM_PATCH_VERSION="$ROCM_LIBPATCH_VERSION" \
|
||||
-DROCM_DIR="$ROCM_INSTALL_PATH" \
|
||||
-DLLVM_DIR="$ROCM_INSTALL_PATH/llvm/bin" \
|
||||
-DOPENCL_DIR="$ROCM_INSTALL_PATH" \
|
||||
-DEMULATOR_BUILD="$emulator_build" \
|
||||
"$rocrtst_src_root"
|
||||
fi
|
||||
echo "Making rocrtst:"
|
||||
echo "MAKEARG=$MAKEARG [eom]"
|
||||
|
||||
cmake --build . -- $DASH_JAY
|
||||
cmake --build . -- rocrtst_kernels
|
||||
|
||||
cmake --build . -- package || true
|
||||
mkdir -p "$rocrtst_package"
|
||||
|
||||
echo "Copying rocrtst binaries to $rocrtst_package"
|
||||
progressCopy "$rocrtst_build_dir" "$rocrtst_package"
|
||||
progressCopy "$ROCRTST_ROOT/thirdparty" "$rocrtst_package/thirdparty" || true
|
||||
|
||||
DEB_FILE=(./rocrtst*.deb)
|
||||
if [ -e "${DEB_FILE[0]}" ]; then
|
||||
mkdir -p "$package_root_deb"
|
||||
progressCopy "${DEB_FILE[@]}" "$package_root_deb"
|
||||
fi
|
||||
|
||||
RPM_FILE=(./rocrtst*.rpm)
|
||||
if [ -e "${RPM_FILE[0]}" ]; then
|
||||
mkdir -p "$package_root_rpm"
|
||||
progressCopy "${RPM_FILE[@]}" "$package_root_rpm"
|
||||
fi
|
||||
|
||||
mkdir -p "$package_utils"
|
||||
progressCopy "$SCRIPT_ROOT/run_rocrtst.sh" "$package_utils"
|
||||
popd
|
||||
|
||||
}
|
||||
|
||||
file_exists(){
|
||||
set -- $1
|
||||
[ -e "$1" ]
|
||||
}
|
||||
|
||||
build_kfdtest() {
|
||||
echo "Building kfdtest"
|
||||
|
||||
mkdir -p "$kfdtest_build_dir"
|
||||
pushd "$kfdtest_build_dir" || { echo "Failed to pushd into $kfdtest_build_dir"; exit 1; }
|
||||
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE="$build_type" \
|
||||
-DBUILD_SHARED_LIBS="$shared_libs" \
|
||||
-DCMAKE_PREFIX_PATH="${ROCM_INSTALL_PATH}" \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="$ROCM_INSTALL_PATH" \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DADDRESS_SANITIZER="$ADDRESS_SANITIZER" \
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH="FALSE" \
|
||||
-DCPACK_GENERATOR="${CPACKGEN:-"DEB;RPM"}" \
|
||||
-DCPACK_RPM_DEBUGINFO_PACKAGE=YES \
|
||||
-DCPACK_RPM_PACKAGE_DEBUG=YES \
|
||||
-DCMAKE_SKIP_BUILD_RPATH=TRUE \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--enable-new-dtags -Wl,--rpath,$ROCM_RPATH $LDFLAGS" \
|
||||
"$kfdtest_src_root"
|
||||
cmake --build . -- $DASH_JAY
|
||||
|
||||
cmake --build . -- package || true
|
||||
popd
|
||||
|
||||
mkdir -p "$kfdtest_bin"
|
||||
progressCopy "$kfdtest_build_dir" "$kfdtest_bin"
|
||||
progressCopy "$kfdtest_build_dir/kfdtest.exclude" "$kfdtest_bin"
|
||||
progressCopy "$kfdtest_build_dir/run_kfdtest.sh" "$kfdtest_bin"
|
||||
|
||||
mkdir -p "$package_utils"
|
||||
progressCopy "$SCRIPT_ROOT/run_kfdtest.sh" "$package_utils"
|
||||
|
||||
if file_exists $kfdtest_build_dir/kfdtest*.deb ; then
|
||||
mkdir -p "$package_root_deb"
|
||||
cp "$kfdtest_build_dir"/kfdtest*.deb "$package_root_deb"
|
||||
fi
|
||||
|
||||
if file_exists "$kfdtest_build_dir"/kfdtest*.rpm ; then
|
||||
mkdir -p "$package_root_rpm"
|
||||
cp $kfdtest_build_dir/kfdtest*.rpm "$package_root_rpm"
|
||||
fi
|
||||
}
|
||||
|
||||
clean_rocr_runtime() {
|
||||
echo "Cleaning ROCr Runtime"
|
||||
|
||||
rm -f $package_lib/libhsakmt.so*
|
||||
rm -f $package_lib/libhsakmt.a
|
||||
rm -f $package_lib/libhsakmt-staticdrm.a
|
||||
rm -f $package_include/hsakmt*.h $package_include/linux/kfd_ioctl.h
|
||||
|
||||
rm -rf "${runtime_build_dir}"
|
||||
rm -f "$package_root"/lib/libhsa-runtime*
|
||||
rm -rf "$package_root/lib/cmake/hsa-runtime64"
|
||||
rm -rf "$package_root/include/hsa"
|
||||
rm -rf "$package_root/share/doc/hsa-runtime64"
|
||||
rm -f "$package_root_deb"/hsa-rocr*.deb
|
||||
rm -f "$package_root_rpm"/hsa-rocr*.rpm
|
||||
rm -f "$package_root_rpm"/hsa_rocr*.whl
|
||||
|
||||
rm -rf "$PACKAGE_ROOT/hsa"
|
||||
|
||||
clean_rocrtst
|
||||
clean_kfdtest
|
||||
}
|
||||
|
||||
clean_rocrtst() {
|
||||
echo "Cleaning rocrtst"
|
||||
rm -rf "${rocrtst_package}"
|
||||
rm -rf "${rocrtst_build_dir}"
|
||||
rm -rf "${package_root_deb}"/rocrtst*.deb
|
||||
rm -rf "${package_root_rpm}"/rocrtst*.rpm
|
||||
}
|
||||
|
||||
clean_kfdtest() {
|
||||
echo "Cleaning kfdtest"
|
||||
rm -rf "$kfdtest_build_dir"
|
||||
rm -rf "$kfdtest_bin"
|
||||
rm -rf "$package_root_deb"/kfdtest*.deb
|
||||
rm -rf "$package_root_rpm"/kfdtest*.rpm
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
case ${pkgtype} in
|
||||
("deb")
|
||||
echo "${package_root_deb}";;
|
||||
("rpm")
|
||||
package_rpm="some_value"
|
||||
echo "${package_root_rpm}";;
|
||||
(*)
|
||||
echo "Invalid package type \"${pkgtype}\" provided for -o" >&2; exit 1;;
|
||||
esac
|
||||
exit
|
||||
}
|
||||
|
||||
target="build"
|
||||
|
||||
kfdtest_target="yes"
|
||||
rocrtst_target="yes"
|
||||
rocr_target="ON"
|
||||
|
||||
package_root="$(getPackageRoot)"
|
||||
package_root_deb="${package_root}/deb/$PROJ_NAME"
|
||||
package_root_rpm="${package_root}/rpm/$PROJ_NAME"
|
||||
|
||||
package_lib="$(getLibPath)"
|
||||
|
||||
package_include="$(getIncludePath)"
|
||||
runtime_build_dir="$(getBuildPath runtime)"
|
||||
|
||||
BUILD_TYPE="Debug"
|
||||
shared_libs="ON"
|
||||
clean_or_out=0;
|
||||
maketarget="deb"
|
||||
pkgtype="deb"
|
||||
WHEEL_PACKAGE=false
|
||||
|
||||
thunk_defines_string=
|
||||
roct_build_dir="${runtime_build_dir}/libhsakmt"
|
||||
|
||||
rocr_defines_string=
|
||||
rocr_build_dir="${runtime_build_dir}/$PROJ_NAME"
|
||||
|
||||
rocrtst_package="$(getBinPath)/rocrtst_tests"
|
||||
rocrtst_build_dir="${runtime_build_dir}/rocrtst"
|
||||
rocrtst_src_root="$ROCRTST_ROOT/suites/test_common"
|
||||
emulator_build=0
|
||||
|
||||
kfdtest_src_root="$ROCR_ROOT/libhsakmt/tests/kfdtest"
|
||||
kfdtest_bin="$(getBinPath)/kfdtest"
|
||||
package_utils="$(getUtilsPath)"
|
||||
kfdtest_build_dir=${runtime_build_dir}/kfdtest
|
||||
|
||||
unset HIP_DEVICE_LIB_PATH
|
||||
unset ROCM_PATH
|
||||
|
||||
valid_str=$(getopt -o hcraswnkteg:o: --long help,clean,release,static,wheel,address_sanitizer,norocr,nokfdtest,norocrtst,emulator,gpu_list:,outdir: -- "$@")
|
||||
eval set -- "$valid_str"
|
||||
|
||||
while true ;
|
||||
do
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
(-c | --clean)
|
||||
target="clean" ; ((clean_or_out|=1)) ; shift ;;
|
||||
(-r | --release)
|
||||
BUILD_TYPE="RelWithDebInfo" ; shift ;;
|
||||
(-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
shared_libs="OFF" ; shift ;;
|
||||
(-w | --wheel)
|
||||
WHEEL_PACKAGE=true ; shift ;;
|
||||
(-n | --norocr)
|
||||
rocr_target="OFF"
|
||||
rocrtst_target="no"; shift ;;
|
||||
(-k | --nokfdtest)
|
||||
kfdtest_target="no" ; shift ;;
|
||||
(-t | --norocrtst)
|
||||
rocrtst_target="no" ; shift ;;
|
||||
(-e | --emulator )
|
||||
emulator_build=1 ; shift ;;
|
||||
(-g | --gpu_list )
|
||||
gpu_list=$2 ; shift 2;;
|
||||
(-o | --outdir)
|
||||
target="outdir"; pkgtype=$2 ; OUT_DIR_SPECIFIED=1 ; ((clean_or_out|=2)) ; shift 2 ;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo " ${BASH_SOURCE}: UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 22;;
|
||||
esac
|
||||
done
|
||||
|
||||
ret_conflict=1
|
||||
check_conflicting_options $clean_or_out $pkgtype $maketarget
|
||||
if [ $ret_conflict -ge 30 ]; then
|
||||
print_vars $API_NAME $target $BUILD_TYPE $shared_libs $clean_or_out $pkgtype $maketarget
|
||||
exit $ret_conflict
|
||||
fi
|
||||
|
||||
case $target in
|
||||
(clean) clean_rocr_runtime ;;
|
||||
(build) build_rocr_runtime;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $target" ;;
|
||||
esac
|
||||
|
||||
checkchild(){
|
||||
if wait "$1"; then
|
||||
return;
|
||||
else
|
||||
die "$2 failed with exit code $?"
|
||||
fi
|
||||
}
|
||||
|
||||
# if [ "$target" != "clean" ]; then
|
||||
# if [ "$rocrtst_target" == "yes" ]; then
|
||||
# build_rocrtst &
|
||||
# else
|
||||
# true & # Dummy build_rocrtst
|
||||
# fi
|
||||
# rocrtst_pid=$!
|
||||
# if [ "$kfdtest_target" == "yes" ]; then
|
||||
# build_kfdtest &
|
||||
# else
|
||||
# true & # Dummy build_kfdtest
|
||||
# fi
|
||||
# kfdtest_pid=$!
|
||||
# checkchild $kfdtest_pid kfdtest
|
||||
# checkchild $rocrtst_pid rocrtst
|
||||
# fi
|
||||
|
||||
echo "Operation complete"
|
||||
@@ -6,7 +6,7 @@ printUsage() {
|
||||
echo "Usage: $(basename "${BASH_SOURCE}") [options ...]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -s, --static Supports static CI by accepting this param & not bailing out. No effect of the param though"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
@@ -70,7 +70,7 @@ do
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s | --static)
|
||||
SHARED_LIBS="OFF" ; shift ;;
|
||||
ack_and_skip_static ;;
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
|
||||
@@ -8,6 +8,11 @@ set_component_src rocRAND
|
||||
build_rocrand() {
|
||||
echo "Start build"
|
||||
|
||||
SHARED_LIBS="ON"
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
@@ -31,6 +36,7 @@ build_rocrand() {
|
||||
cmake \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DBUILD_TEST=ON \
|
||||
-DBUILD_BENCHMARK=ON \
|
||||
|
||||
124
tools/rocm-build/build_rocrsamples.sh
Executable file
124
tools/rocm-build/build_rocrsamples.sh
Executable file
@@ -0,0 +1,124 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/compute_utils.sh"
|
||||
|
||||
printUsage() {
|
||||
echo
|
||||
echo "Usage: $(basename "${BASH_SOURCE}") [-c|-r|-h] [makeopts]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -c, --clean Removes all RocR Samples build artifacts"
|
||||
echo " -e, --emulator Build a version suitable for running on emulator"
|
||||
echo " -r, --release Build release version RocR Samples (default is debug)"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -g, --gpu_list <gpus> Semi-colon separated List of gpu architectures that"
|
||||
echo " kernels will run on; e.g., \"gfx803;gfx900;...\" the"
|
||||
echo " default is to build kernels for all supported architectures."
|
||||
echo " -h, --help Prints this help"
|
||||
echo " makeopts Options to pass to the make command"
|
||||
echo
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
GPU_LIST="gfx803;gfx701;gfx801;gfx802;gfx900;gfx902;gfx906;gfx908"
|
||||
|
||||
TARGET="build"
|
||||
ROCRTST_SAMPLES_PACKAGE=$(getBinPath)/rocrtst_samples
|
||||
ROCRTST_SAMPLES_ROOT=$ROCRTST_ROOT/samples
|
||||
ROCRTST_SAMPLES_BUILD_DIR=$(getBuildPath rocrtst_samples)
|
||||
|
||||
MAKEARG="$DASH_JAY"
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_UTILS="$(getUtilsPath)"
|
||||
ROCRTST_SAMPLES_BUILD_TYPE="debug"
|
||||
EMULATOR_BUILD=0
|
||||
SHARED_LIBS="ON"
|
||||
CLEAN_OR_OUT=0;
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
|
||||
#parse the arguments
|
||||
VALID_STR=`getopt -o hcrao:seg: --long help,clean,release,outdir:,static,address_sanitizer,emulator,gpu_list: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
(-c | --clean)
|
||||
TARGET="clean" ; ((CLEAN_OR_OUT|=1)) ; shift ;;
|
||||
(-r | --release)
|
||||
ROCRTST_SAMPLES_BUILD_TYPE="release"; shift ;;
|
||||
(-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-o | --outdir )
|
||||
exit ;;
|
||||
(-s | --static)
|
||||
ack_and_skip_static ;;
|
||||
(-e | --emulator )
|
||||
EMULATOR_BUILD=1 ; ((CLEAN_OR_OUT|=3)) ; shift ;;
|
||||
(-g | --gpu_list )
|
||||
GPU_LIST=$2 ; shift 2;;
|
||||
--) shift; break;; # end delimiter
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
RET_CONFLICT=1
|
||||
check_conflicting_options $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
if [ $RET_CONFLICT -ge 30 ]; then
|
||||
print_vars $API_NAME $TARGET $BUILD_TYPE $SHARED_LIBS $CLEAN_OR_OUT $PKGTYPE $MAKETARGET
|
||||
exit $RET_CONFLICT
|
||||
fi
|
||||
|
||||
clean_rocrsamples() {
|
||||
echo "Removing ROCR Samples"
|
||||
rm -rf "$ROCRTST_SAMPLES_PACKAGE"
|
||||
rm -rf "$ROCRTST_SAMPLES_BUILD_DIR"
|
||||
}
|
||||
|
||||
build_rocrsamples() {
|
||||
mkdir -p $ROCRTST_SAMPLES_BUILD_DIR
|
||||
pushd $ROCRTST_SAMPLES_BUILD_DIR
|
||||
|
||||
cmake -DTARGET_DEVICES=$GPU_LIST \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DROCRTST_BLD_TYPE=$ROCRTST_SAMPLES_BUILD_TYPE \
|
||||
-DROCM_DIR=$PACKAGE_ROOT \
|
||||
-DLLVM_DIR="$ROCM_INSTALL_PATH/llvm/bin" \
|
||||
-DOPENCL_DIR=$ROCM_INSTALL_PATH \
|
||||
-DEMULATOR_BUILD=$EMULATOR_BUILD \
|
||||
$ROCRTST_SAMPLES_ROOT
|
||||
|
||||
echo "Making ROCR Samples:"
|
||||
cmake --build . -- $MAKEARG
|
||||
cmake --build . -- sample_kernels
|
||||
mkdir -p "$ROCRTST_SAMPLES_PACKAGE"
|
||||
|
||||
echo "Copying HSA Sample binaries to $ROCRTST_SAMPLES_PACKAGE"
|
||||
progressCopy "$ROCRTST_SAMPLES_BUILD_DIR" "$ROCRTST_SAMPLES_PACKAGE"
|
||||
|
||||
mkdir -p "$PACKAGE_UTILS"
|
||||
progressCopy "$SCRIPT_ROOT/run_rocrsamples.sh" "$PACKAGE_UTILS"
|
||||
popd
|
||||
}
|
||||
|
||||
case $TARGET in
|
||||
clean) clean_rocrsamples ;;
|
||||
build) build_rocrsamples ;;
|
||||
*) die "Invalid target $target" ;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
exit 0
|
||||
|
||||
|
||||
@@ -9,13 +9,19 @@ set_component_src rocSOLVER
|
||||
build_rocsolver() {
|
||||
echo "Start build"
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
SHARED_LIBS="ON"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
@@ -25,18 +31,17 @@ build_rocsolver() {
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
GPU_TARGETS="gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
CXX="${ROCM_PATH}/bin/hipcc" \
|
||||
cmake \
|
||||
-DCPACK_SET_DESTDIR=OFF \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-Drocblas_DIR="${ROCM_PATH}/rocblas/lib/cmake/rocblas" \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DAMDGPU_TARGETS="${GPU_TARGETS}" \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
|
||||
@@ -16,6 +16,11 @@ build_rocsparse() {
|
||||
set_address_sanitizer_on
|
||||
fi
|
||||
|
||||
SHARED_LIBS="ON"
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
SHARED_LIBS="OFF"
|
||||
fi
|
||||
|
||||
MIRROR="http://compute-artifactory.amd.com/artifactory/list/rocm-generic-local/mathlib/sparse/"
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
@@ -23,7 +28,7 @@ build_rocsparse() {
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
GPU_TARGETS="gfx900;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack+;gfx90a:xnack-;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
fi
|
||||
|
||||
ROCSPARSE_TEST_MIRROR=$MIRROR \
|
||||
@@ -34,11 +39,11 @@ build_rocsparse() {
|
||||
cmake \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}"\
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DBUILD_SHARED_LIBS=$SHARED_LIBS \
|
||||
-DBUILD_CLIENTS_SAMPLES=ON \
|
||||
-DBUILD_CLIENTS_TESTS=ON \
|
||||
-DBUILD_CLIENTS_BENCHMARKS=ON \
|
||||
-DCPACK_SET_DESTDIR=OFF \
|
||||
-DCMAKE_INSTALL_PREFIX=${ROCM_PATH} \
|
||||
-DBUILD_ADDRESS_SANITIZER="${ADDRESS_SANITIZER}" \
|
||||
-DCMAKE_MODULE_PATH="${ROCM_PATH}/lib/cmake/hip;${ROCM_PATH}/hip/cmake" \
|
||||
|
||||
@@ -4,13 +4,16 @@ set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
|
||||
ENABLE_ADDRESS_SANITIZER=false
|
||||
build_release=true
|
||||
set_component_src rocThrust
|
||||
|
||||
build_rocthrust() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
cd $COMPONENT_SRC
|
||||
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ]; then
|
||||
@@ -21,19 +24,12 @@ build_rocthrust() {
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101"
|
||||
fi
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
CXX=$(set_build_variables CXX)\
|
||||
cmake \
|
||||
${LAUNCHER_FLAGS} \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DCMAKE_MODULE_PATH="${ROCM_PATH}/lib/cmake/hip;${ROCM_PATH}/hip/cmake" \
|
||||
-DROCPRIM_ROOT="${ROCM_PATH}/rocprim" \
|
||||
-DBUILD_TEST=ON \
|
||||
|
||||
@@ -11,8 +11,8 @@ printUsage() {
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of
|
||||
type referred to by pkg_type"
|
||||
echo " -s, --static Component/Build does not support static builds just accepting this param & ignore. No effect of the param on this build"
|
||||
echo " -h, --help Prints this help"
|
||||
echo " -s, --static Build static lib (.a). build instead of dynamic/shared(.so) "
|
||||
echo
|
||||
|
||||
return 0
|
||||
@@ -39,7 +39,7 @@ CLEAN_OR_OUT=0
|
||||
MAKETARGET="deb"
|
||||
PKGTYPE="deb"
|
||||
|
||||
GPU_LIST="gfx900;gfx906;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102"
|
||||
GPU_LIST="gfx900;gfx906;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1031;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
|
||||
|
||||
VALID_STR=$(getopt -o hcraso: --long help,clean,release,static,address_sanitizer,outdir: -- "$@")
|
||||
eval set -- "$VALID_STR"
|
||||
@@ -65,7 +65,7 @@ while true; do
|
||||
shift
|
||||
;;
|
||||
-s | --static)
|
||||
SHARED_LIBS="OFF"
|
||||
ack_and_skip_static
|
||||
shift
|
||||
;;
|
||||
-o | --outdir)
|
||||
@@ -119,10 +119,12 @@ build() {
|
||||
mkdir -p "$BUILD_DIR"
|
||||
pushd "$BUILD_DIR"
|
||||
print_lib_type $SHARED_LIBS
|
||||
export HIPCC_COMPILE_FLAGS_APPEND="--rocm-path=$ROCM_PATH --offload-arch=gfx900 --offload-arch=gfx906 --offload-arch=gfx908 \
|
||||
--offload-arch=gfx90a --offload-arch=gfx940 --offload-arch=gfx1030 \
|
||||
--offload-arch=gfx1100 --offload-arch=gfx1101 --offload-arch=gfx1102"
|
||||
|
||||
export HIPCC_COMPILE_FLAGS_APPEND="--rocm-path=$ROCM_PATH --offload-arch=gfx900 --offload-arch=gfx906 --offload-arch=gfx908 \
|
||||
--offload-arch=gfx90a --offload-arch=gfx940 --offload-arch=gfx941 \
|
||||
--offload-arch=gfx942 --offload-arch=gfx1030 --offload-arch=gfx1031 \
|
||||
--offload-arch=gfx1100 --offload-arch=gfx1101 --offload-arch=gfx1102 \
|
||||
--offload-arch=gfx1200 --offload-arch=gfx1201"
|
||||
cmake $(rocm_cmake_params) \
|
||||
-DCPACK_PACKAGING_INSTALL_PREFIX="$PACKAGE_PREFIX/$PROJ_NAME" \
|
||||
-DCMAKE_MODULE_PATH="$PACKAGE_CMAKE/hip" \
|
||||
|
||||
@@ -8,6 +8,10 @@ set_component_src rocWMMA
|
||||
build_rocwmma() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
if [ ! -e $COMPONENT_SRC/CMakeLists.txt ]; then
|
||||
echo "Skipping rocWMMA as source is not available"
|
||||
mkdir -p $COMPONENT_SRC
|
||||
@@ -21,19 +25,11 @@ build_rocwmma() {
|
||||
fi
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1100;gfx1101"
|
||||
fi
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
CXX=$(set_build_variables CXX)\
|
||||
cmake \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
${LAUNCHER_FLAGS} \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DROCWMMA_BUILD_VALIDATION_TESTS=ON \
|
||||
-DROCWMMA_VALIDATE_WITH_ROCBLAS=ON \
|
||||
-DROCWMMA_BUILD_BENCHMARK_TESTS=ON \
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
|
||||
set_component_src rpp
|
||||
@@ -22,6 +23,10 @@ rpp_specific_cmake_params() {
|
||||
build_rpp() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
if [ ! -e $COMPONENT_SRC/CMakeLists.txt ]; then
|
||||
echo "Skipping RPP build as source is not available"
|
||||
mkdir -p $COMPONENT_SRC
|
||||
@@ -35,13 +40,7 @@ build_rpp() {
|
||||
|
||||
mkdir -p $BUILD_DIR && cd $BUILD_DIR
|
||||
|
||||
if [ -n "$GPU_ARCHS" ]; then
|
||||
GPU_TARGETS="$GPU_ARCHS"
|
||||
else
|
||||
GPU_TARGETS="gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100"
|
||||
fi
|
||||
|
||||
init_rocm_common_cmake_params
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
cmake \
|
||||
"${rocm_math_common_cmake_params[@]}" \
|
||||
@@ -49,7 +48,6 @@ build_rpp() {
|
||||
-DBACKEND=HIP \
|
||||
-DCMAKE_INSTALL_LIBDIR=$(getInstallLibDir) \
|
||||
$(rpp_specific_cmake_params) \
|
||||
-DAMDGPU_TARGETS=${GPU_TARGETS} \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fno-openmp-implicit-rpath -Wl,--enable-new-dtags,--build-id=sha1,--rpath,${ROCM_LIB_RPATH}:${DEPS_DIR}/lib:${ROCM_LLVM_LIB_RPATH}" \
|
||||
-DCMAKE_PREFIX_PATH="${DEPS_DIR};${ROCM_PATH}" \
|
||||
"$COMPONENT_SRC"
|
||||
|
||||
@@ -1,205 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/compute_utils.sh"
|
||||
|
||||
printUsage() {
|
||||
echo
|
||||
echo "Usage: $(basename "${BASH_SOURCE}") [options ...]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " -c, --clean Clean output and delete all intermediate work"
|
||||
echo " -p, --package <type> Specify packaging format"
|
||||
echo " -r, --release Make a release build instead of a debug build"
|
||||
echo " -a, --address_sanitizer Enable address sanitizer"
|
||||
echo " -o, --outdir <pkg_type> Print path of output directory containing packages of type referred to by pkg_type"
|
||||
echo " -h, --help Prints this help"
|
||||
echo
|
||||
echo "Possible values for <type>:"
|
||||
echo " deb -> Debian format (default)"
|
||||
echo " rpm -> RPM format"
|
||||
echo
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
PACKAGE_ROOT="$(getPackageRoot)"
|
||||
PACKAGE_DEB="$(getPackageRoot)/deb/libhsakmt"
|
||||
PACKAGE_RPM="$(getPackageRoot)/rpm/libhsakmt"
|
||||
THUNK_BUILD_DIR="$(getBuildPath thunk)"
|
||||
TARGET="build"
|
||||
MAKETARGET="deb"
|
||||
MAKEARG="$DASH_JAY O=$THUNK_BUILD_DIR"
|
||||
PACKAGE_LIB="$(getLibPath)"
|
||||
PACKAGE_INCLUDE="$(getIncludePath)"
|
||||
|
||||
ROCT_BUILD_DIR="$(getBuildPath roct)"
|
||||
ROCT_PACKAGE_DEB="$(getPackageRoot)/deb/roct"
|
||||
ROCT_PACKAGE_RPM="$(getPackageRoot)/rpm/roct"
|
||||
ROCT_BUILD_TYPE="debug"
|
||||
BUILD_TYPE="Debug"
|
||||
ROCT_MAKE_OPTS="$DASH_JAY -C $ROCT_BUILD_DIR"
|
||||
CLEAN_OR_OUT=0;
|
||||
|
||||
print_vars() {
|
||||
echo " Var status thunk "
|
||||
echo "TARGET= $TARGET"
|
||||
echo "BUILD_TYPE = $BUILD_TYPE"
|
||||
echo "MAKETARGE = $MAKETARGET"
|
||||
echo "CLEAN_OR_OUT = $CLEAN_OR_OUT"
|
||||
echo "PKGTYPE= $PKGTYPE"
|
||||
}
|
||||
|
||||
check_conflicting_options() {
|
||||
|
||||
if [ "$MAKETARGET" != "deb" ] && [ "$MAKETARGET" != "rpm" ] && [ "$MAKETARGET" != "tar" ]; then
|
||||
echo " Wrong Param Passed for Package Type. Aborting .. "
|
||||
print_vars
|
||||
exit 30
|
||||
fi
|
||||
|
||||
if [ $CLEAN_OR_OUT -ge 2 ]; then
|
||||
if [ "$PKGTYPE" != "deb" ] && [ "$PKGTYPE" != "rpm" ] && [ "$PKGTYPE" != "tar" ]; then
|
||||
echo " Wrong Param Passed for Package Type for the Outdir. Aborting .. "
|
||||
print_vars
|
||||
exit 40
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $CLEAN_OR_OUT -ge 3 ]; then
|
||||
echo " Clean & Out Both are sepcified. Not accepted. Bailing .. "
|
||||
exit 50
|
||||
fi
|
||||
}
|
||||
|
||||
VALID_STR=`getopt -o hcraso:p: --long help,clean,release,address_sanitizer,clean,outdir:,package: -- "$@"`
|
||||
eval set -- "$VALID_STR"
|
||||
|
||||
while true ;
|
||||
do
|
||||
case "$1" in
|
||||
(-h | --help)
|
||||
printUsage ; exit 0;;
|
||||
(-c | --clean)
|
||||
TARGET="clean" ; ((CLEAN_OR_OUT|=1)) ; shift ;;
|
||||
(-r | --release)
|
||||
BUILD_TYPE="RelWithDebInfo" ; shift ;;
|
||||
(-a | --address_sanitizer)
|
||||
set_asan_env_vars
|
||||
set_address_sanitizer_on ; shift ;;
|
||||
(-s)
|
||||
shift ;; # Static build requested, NO-OP for this package. Required for static Jenkins builds
|
||||
(-o | --outdir)
|
||||
TARGET="outdir"; PKGTYPE=$2 ; OUT_DIR_SPECIFIED=1 ; ((CLEAN_OR_OUT|=2)) ; shift 2 ;;
|
||||
(-p | --package)
|
||||
MAKETARGET="$2" ; shift 2;;
|
||||
--) shift; break;;
|
||||
(*)
|
||||
echo " This should never come but just incase : UNEXPECTED ERROR Parm : [$1] ">&2 ; exit 20;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
check_conflicting_options
|
||||
|
||||
|
||||
clean_roct() {
|
||||
rm -rf "$ROCT_BUILD_DIR"
|
||||
rm -rf "$ROCT_PACKAGE_DEB"
|
||||
rm -rf "$ROCT_PACKAGE_RPM"
|
||||
rm -rf "$PACKAGE_ROOT/libhsakmt"
|
||||
rm -rf "$PACKAGE_INCLUDE/libhsakmt"
|
||||
rm -f $PACKAGE_LIB/libhsakmt.so*
|
||||
rm -f $PACKAGE_LIB/libhsakmt.a
|
||||
rm -f $PACKAGE_INCLUDE/hsakmt*.h $PACKAGE_INCLUDE/linux/kfd_ioctl.h
|
||||
}
|
||||
|
||||
build_roct() {
|
||||
echo "Building ROCt"
|
||||
|
||||
rm -f $ROCT_BUILD_DIR/hsakmt-roct*.deb
|
||||
rm -f $ROCT_BUILD_DIR/hsakmt-roct-dev/hsakmt-roct*.deb
|
||||
rm -f "$ROCT_PACKAGE_DEB"/*
|
||||
|
||||
rm -f $ROCT_BUILD_DIR/hsakmt-roct*.rpm
|
||||
rm -f $ROCT_BUILD_DIR/hsakmt-roct-dev/hsakmt-roct*.rpm
|
||||
rm -f "$ROCT_PACKAGE_RPM"/*
|
||||
|
||||
if [ "${DISTRO_ID}" = "centos-7" ]; then
|
||||
libdrm_cmake_var="-DHSAKMT_REQUIRES_LIBDRM=true"
|
||||
fi
|
||||
|
||||
if [ ! -d "$ROCT_BUILD_DIR" ]; then
|
||||
mkdir -p "$ROCT_BUILD_DIR"
|
||||
pushd "$ROCT_BUILD_DIR"
|
||||
|
||||
cmake \
|
||||
-DCMAKE_MODULE_PATH="$THUNK_ROOT/cmake_modules" \
|
||||
-DBUILD_SHARED_LIBS="OFF" \
|
||||
$(rocm_cmake_params) \
|
||||
$(rocm_common_cmake_params) \
|
||||
-DHSAKMT_INSTALL_PREFIX="$PACKAGE_ROOT" \
|
||||
-DHSAKMT_INSTALL_LIBDIR="$PACKAGE_LIB" \
|
||||
-DHSAKMT_PACKAGING_INSTALL_PREFIX="$ROCM_PATH" \
|
||||
-DENABLE_LDCONFIG=OFF \
|
||||
-DHSAKMT_WERROR=1 \
|
||||
-DADDRESS_SANITIZER="$ADDRESS_SANITIZER" \
|
||||
$libdrm_cmake_var \
|
||||
"$THUNK_ROOT"
|
||||
popd
|
||||
fi
|
||||
cmake --build "$ROCT_BUILD_DIR" -- $ROCT_MAKE_OPTS
|
||||
cmake --build "$ROCT_BUILD_DIR" -- $ROCT_MAKE_OPTS install
|
||||
cmake --build "$ROCT_BUILD_DIR" -- $ROCT_MAKE_OPTS package
|
||||
|
||||
if [ -e "$THUNK_ROOT/hsakmt-dev.txt" ]; then
|
||||
cmake --build "$ROCT_BUILD_DIR" -- $ROCT_MAKE_OPTS install-dev
|
||||
cmake --build "$ROCT_BUILD_DIR" -- $ROCT_MAKE_OPTS package-dev
|
||||
fi
|
||||
|
||||
mkdir -p "$PACKAGE_LIB"
|
||||
if [ -e "$ROCT_BUILD_DIR/libhsakmt.so" ]; then
|
||||
cp -R "$ROCT_BUILD_DIR/libhsakmt.so"* "$PACKAGE_LIB"
|
||||
fi
|
||||
if [ -e "$ROCT_BUILD_DIR/libhsakmt.a" ]; then
|
||||
cp -R "$ROCT_BUILD_DIR/libhsakmt.a" "$PACKAGE_LIB"
|
||||
fi
|
||||
|
||||
mkdir -p "$ROCT_PACKAGE_DEB"
|
||||
if [[ "${CPACKGEN:-"DEB;RPM"}" =~ "DEB" ]] ; then
|
||||
cp -a $ROCT_BUILD_DIR/hsakmt*.deb "$ROCT_PACKAGE_DEB"
|
||||
if [ -e "$THUNK_ROOT/hsakmt-dev.txt" ]; then
|
||||
cp -a $ROCT_BUILD_DIR/hsakmt-roct-dev/hsakmt-roct*.deb "$ROCT_PACKAGE_DEB"
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p "$ROCT_PACKAGE_RPM"
|
||||
if [[ "${CPACKGEN:-"DEB;RPM"}" =~ "RPM" ]] ; then
|
||||
cp -a $ROCT_BUILD_DIR/hsakmt*.rpm "$ROCT_PACKAGE_RPM"
|
||||
if [ -e "$THUNK_ROOT/hsakmt-dev.txt" ]; then
|
||||
cp -a $ROCT_BUILD_DIR/hsakmt-roct-dev/hsakmt-roct*.rpm "$ROCT_PACKAGE_RPM"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
print_output_directory() {
|
||||
case ${PKGTYPE} in
|
||||
("deb")
|
||||
echo ${ROCT_PACKAGE_DEB};;
|
||||
("rpm")
|
||||
echo ${ROCT_PACKAGE_RPM};;
|
||||
(*)
|
||||
echo "Invalid package type \"${PKGTYPE}\" provided for -o" >&2; exit 1;;
|
||||
esac
|
||||
exit
|
||||
}
|
||||
|
||||
verifyEnvSetup
|
||||
|
||||
case $TARGET in
|
||||
(clean) clean_roct ;;
|
||||
(build) build_roct ;;
|
||||
(outdir) print_output_directory ;;
|
||||
(*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
|
||||
echo "Operation complete"
|
||||
44
tools/rocm-build/build_transferbench.sh
Executable file
44
tools/rocm-build/build_transferbench.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/compute_helper.sh"
|
||||
|
||||
set_component_src TransferBench
|
||||
|
||||
build_transferbench() {
|
||||
echo "Start build"
|
||||
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ]; then
|
||||
ack_and_skip_static
|
||||
fi
|
||||
|
||||
sed -i 's/^\(\s*set\s*(CMAKE_RUNTIME_OUTPUT_DIRECTORY.*\)$/#\1/' "${COMPONENT_SRC}/CMakeLists.txt"
|
||||
|
||||
mkdir -p "$BUILD_DIR" && cd "$BUILD_DIR"
|
||||
init_rocm_common_cmake_params
|
||||
|
||||
CXX="$ROCM_PATH"/bin/hipcc \
|
||||
cmake "${rocm_math_common_cmake_params[@]}" "$COMPONENT_SRC"
|
||||
make package
|
||||
|
||||
rm -rf _CPack_Packages/ && find -name '*.o' -delete
|
||||
mkdir -p $PACKAGE_DIR
|
||||
cp ${BUILD_DIR}/*.${PKGTYPE} $PACKAGE_DIR
|
||||
show_build_cache_stats
|
||||
}
|
||||
|
||||
clean_transferbench() {
|
||||
echo "Cleaning TransferBench build directory: ${BUILD_DIR} ${PACKAGE_DIR}"
|
||||
rm -rf "$BUILD_DIR" "$PACKAGE_DIR"
|
||||
echo "Done!"
|
||||
}
|
||||
|
||||
stage2_command_args "$@"
|
||||
|
||||
case $TARGET in
|
||||
build) build_transferbench ;;
|
||||
outdir) print_output_directory ;;
|
||||
clean) clean_transferbench ;;
|
||||
*) die "Invalid target $TARGET" ;;
|
||||
esac
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# set ccache environment variable for math libraries
|
||||
if [ "${CCACHE_ENABLED}" == "true" ] && [ -f "${OUT_DIR}"/logs/lightning ]; then
|
||||
export LAUNCHER_FLAGS="-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache -DCMAKE_C_COMPILER_LAUNCHER=/usr/local/bin/ccache"
|
||||
export CCACHE_IGNOREHEADERS=${ROCM_PATH}/include:${ROCM_PATH}/llvm/include:${ROCM_PATH}/lib/llvm/lib/clang/17/include:${ROCM_PATH}/lib/llvm/include
|
||||
export CCACHE_COMPILERCHECK=none
|
||||
export CCACHE_EXTRAFILES=${OUT_DIR}/rocm_compilers_hash_file
|
||||
fi
|
||||
@@ -12,6 +12,11 @@ set -o pipefail
|
||||
ROCM_LLVMDIR="lib/llvm"
|
||||
# Set ADDRESS_SANITIZER to OFF by default
|
||||
export ADDRESS_SANITIZER="OFF"
|
||||
|
||||
DISABLE_DEBUG_PACKAGE="false"
|
||||
export CFLAGS="$CFLAGS $SET_DWARF_VERSION_4 "
|
||||
export CXXFLAGS="$CXXFLAGS $SET_DWARF_VERSION_4 "
|
||||
|
||||
# Print message to stderr
|
||||
# param message string to print on exit
|
||||
# Example: printErr "file not found"
|
||||
@@ -38,6 +43,11 @@ dieIfEmpty() {
|
||||
fi
|
||||
}
|
||||
|
||||
ack_and_skip_static() {
|
||||
echo "static build is not enabled for this component..skipping"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Copy a file or directory to target location and show single line progress
|
||||
progressCopy() {
|
||||
if [ -d "$1" ]; then
|
||||
@@ -127,9 +137,6 @@ getCmakePath() {
|
||||
echo "$rocmInstallPath/$cmakePath"
|
||||
}
|
||||
|
||||
# Get the install directory name for libraries
|
||||
# lib - For normal builds
|
||||
# lib/asan -For ASAN builds
|
||||
getInstallLibDir() {
|
||||
local libDir="lib"
|
||||
if [ "${ENABLE_ADDRESS_SANITIZER}" == "true" ] ; then
|
||||
@@ -138,8 +145,6 @@ getInstallLibDir() {
|
||||
echo "$libDir"
|
||||
}
|
||||
|
||||
# TODO: Use the function to set the LDFLAGS and CXXFLAGS for ASAN
|
||||
# rather than setting in individual build scripts
|
||||
set_asan_env_vars() {
|
||||
# Flag to set cmake build params for ASAN builds
|
||||
ASAN_CMAKE_PARAMS="true"
|
||||
@@ -151,14 +156,14 @@ set_asan_env_vars() {
|
||||
export PATH="$LLVM_BIN_DIR/:$PATH"
|
||||
# get exact path to ASAN lib containing clang version
|
||||
ASAN_LIB_PATH=$(clang --print-file-name=libclang_rt.asan-x86_64.so)
|
||||
export LD_LIBRARY_PATH="${ASAN_LIB_PATH%/*}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
||||
export LD_LIBRARY_PATH="${ASAN_LIB_PATH%/*}:${ROCM_PATH}/llvm/lib:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
||||
export ASAN_OPTIONS="detect_leaks=0"
|
||||
}
|
||||
|
||||
set_address_sanitizer_on() {
|
||||
export CFLAGS="-fsanitize=address -shared-libasan -g -gz"
|
||||
export CXXFLAGS="-fsanitize=address -shared-libasan -g -gz"
|
||||
export LDFLAGS="-Wl,--enable-new-dtags -fuse-ld=lld -fsanitize=address -shared-libasan -g -gz -Wl,--build-id=sha1 -L${ROCM_PATH}/lib/asan"
|
||||
export CFLAGS="-fsanitize=address -shared-libasan $SET_DWARF_VERSION_4 -g -gz"
|
||||
export CXXFLAGS="-fsanitize=address -shared-libasan $SET_DWARF_VERSION_4 -g -gz"
|
||||
export LDFLAGS="-Wl,--enable-new-dtags -fuse-ld=lld -fsanitize=address -shared-libasan -g -gz -Wl,--build-id=sha1 -L${ROCM_PATH}/llvm/lib -L${ROCM_PATH}/lib/asan"
|
||||
}
|
||||
|
||||
rebuild_lapack() {
|
||||
@@ -223,6 +228,8 @@ init_rocm_common_cmake_params(){
|
||||
"-DROCM_SYMLINK_LIBS=OFF"
|
||||
"-DCPACK_PACKAGING_INSTALL_PREFIX=${ROCM_PATH}"
|
||||
"-DROCM_DISABLE_LDCONFIG=ON"
|
||||
"-DCPACK_SET_DESTDIR=OFF"
|
||||
"-DCPACK_RPM_PACKAGE_RELOCATABLE=ON"
|
||||
"-DROCM_PATH=${ROCM_PATH}"
|
||||
)
|
||||
|
||||
@@ -248,43 +255,16 @@ init_rocm_common_cmake_params(){
|
||||
eval "${retCmakeParams}=( \"\${cmake_params[@]}\" ) "
|
||||
}
|
||||
|
||||
# Common cmake parameters can be set
|
||||
# component build scripts can use this function
|
||||
rocm_common_cmake_params() {
|
||||
local cmake_params
|
||||
if [ "${ASAN_CMAKE_PARAMS}" == "true" ] ; then
|
||||
local ASAN_LIBDIR="lib/asan"
|
||||
local CMAKE_PATH=$(getCmakePath)
|
||||
cmake_params=(
|
||||
"-DCMAKE_PREFIX_PATH=$CMAKE_PATH;${ROCM_PATH}/$ASAN_LIBDIR;$ROCM_PATH/llvm;$ROCM_PATH"
|
||||
"-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-'RelWithDebInfo'}"
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--rpath,$ROCM_ASAN_LIB_RPATH"
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--rpath,$ROCM_ASAN_EXE_RPATH"
|
||||
"-DENABLE_ASAN_PACKAGING=true"
|
||||
)
|
||||
else
|
||||
cmake_params=(
|
||||
"-DCMAKE_PREFIX_PATH=${ROCM_PATH}/llvm;${ROCM_PATH}"
|
||||
"-DCMAKE_BUILD_TYPE=${BUILD_TYPE:-'Release'}"
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--rpath,$ROCM_LIB_RPATH"
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--rpath,$ROCM_EXE_RPATH"
|
||||
)
|
||||
fi
|
||||
printf '%s ' "${cmake_params[@]}"
|
||||
|
||||
local common_cmake_params
|
||||
common_cmake_params=(
|
||||
"-DCMAKE_VERBOSE_MAKEFILE=1"
|
||||
"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE"
|
||||
"-DCMAKE_INSTALL_PREFIX=${ROCM_PATH}"
|
||||
"-DCMAKE_PACKAGING_INSTALL_PREFIX=${ROCM_PATH}"
|
||||
"-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF"
|
||||
"-DROCM_SYMLINK_LIBS=OFF"
|
||||
"-DCPACK_PACKAGING_INSTALL_PREFIX=${ROCM_PATH}"
|
||||
"-DROCM_DISABLE_LDCONFIG=ON"
|
||||
"-DROCM_PATH=${ROCM_PATH}"
|
||||
)
|
||||
printf '%s ' "${common_cmake_params[@]}"
|
||||
disable_debug_package_generation(){
|
||||
case "$DISTRO_ID" in
|
||||
(sles*|rhel*)
|
||||
export CFLAGS=${CFLAGS//"$SET_DWARF_VERSION_4"}
|
||||
export CXXFLAGS=${CXXFLAGS//"$SET_DWARF_VERSION_4"}
|
||||
;;
|
||||
(*)
|
||||
;;
|
||||
esac
|
||||
DISABLE_DEBUG_PACKAGE="true"
|
||||
}
|
||||
|
||||
# Setup a number of variables to specify where to find the source
|
||||
|
||||
@@ -243,6 +243,11 @@ ack_and_ignore_asan() {
|
||||
echo "-a parameter accepted but ignored"
|
||||
}
|
||||
|
||||
ack_and_skip_static() {
|
||||
echo "-s parameter accepted but static build is not enabled for this component..skipping"
|
||||
exit 0
|
||||
}
|
||||
|
||||
#debug function #dumping values in case of error to solve the same
|
||||
print_vars() {
|
||||
echo " Status of Vars in $1 build "
|
||||
@@ -271,6 +276,8 @@ rocm_common_cmake_params(){
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_EXE_RPATH" \
|
||||
"-DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,$ROCM_LIB_RPATH" \
|
||||
"-DFILE_REORG_BACKWARD_COMPATIBILITY=OFF" \
|
||||
"-DCPACK_RPM_PACKAGE_RELOCATABLE=ON" \
|
||||
"-DCPACK_SET_DESTDIR=OFF" \
|
||||
"-DINCLUDE_PATH_COMPATIBILITY=OFF" \
|
||||
# set lib directory to lib/asan for ASAN builds
|
||||
# Disable file reorg backward compatibilty for ASAN builds
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
FROM ubuntu:focal as builder
|
||||
COPY packages /tmp/packages
|
||||
COPY install-prerequisites.sh /tmp/install-prerequisites.sh
|
||||
RUN chmod +x /tmp/install-prerequisites.sh
|
||||
ENV KBUILD_PKG_ROOTCMD=
|
||||
ENV RPP_DEPS_LOCATION=/usr/local/rpp-deps
|
||||
RUN /tmp/install-prerequisites.sh
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
1. Clone this repositry
|
||||
|
||||
```bash
|
||||
git clone -b roc-6.1.x https://github.com/ROCm/ROCm.git
|
||||
git clone -b <release_branch> https://github.com/ROCm/ROCm.git
|
||||
```
|
||||
|
||||
2. Go into the OS specific docker directory in build-infra
|
||||
|
||||
@@ -2,132 +2,142 @@
|
||||
|
||||
set -ex
|
||||
|
||||
apt-get update
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install --no-install-recommends -y $(grep -v '^#' /tmp/packages)
|
||||
apt-get clean
|
||||
apt-get clean
|
||||
rm -rf /var/cache/apt/ /var/lib/apt/lists/* /etc/apt/apt.conf.d/01proxy
|
||||
|
||||
#Install git 2.17.1 version
|
||||
curl -o git.tar.gz https://cdn.kernel.org/pub/software/scm/git/git-2.17.1.tar.gz
|
||||
curl -o git.tar.gz https://cdn.kernel.org/pub/software/scm/git/git-2.17.1.tar.gz
|
||||
tar -zxf git.tar.gz
|
||||
cd git-*
|
||||
make prefix=/usr/local all
|
||||
cd git-*
|
||||
make prefix=/usr/local all
|
||||
make prefix=/usr/local install
|
||||
git --version
|
||||
|
||||
#install argparse and CppHeaderParser python modules for roctracer and rocprofiler
|
||||
# CppHeader needs setuptools. setuptools needs wheel.
|
||||
pip3 install --no-cache-dir setuptools wheel tox
|
||||
pip3 install --no-cache-dir CppHeaderParser argparse requests lxml barectf recommonmark jinja2==3.0.0 websockets matplotlib numpy scipy minimal msgpack pytest sphinx joblib cmake==3.25.2 pandas myst-parser
|
||||
pip3 install --no-cache-dir CppHeaderParser argparse requests lxml barectf recommonmark jinja2==3.0.0\
|
||||
websockets matplotlib numpy scipy minimal msgpack pytest sphinx joblib cmake==3.25.2 pandas myst-parser lit
|
||||
|
||||
# Allow sudo for everyone user
|
||||
echo 'ALL ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/everyone
|
||||
|
||||
# Install OCaml packages to build LLVM's OCaml bindings to be used in lightning compiler test pipeline
|
||||
wget -nv https://sourceforge.net/projects/opam.mirror/files/2.1.4/opam-2.1.4-x86_64-linux -O /usr/local/bin/opam
|
||||
chmod +x /usr/local/bin/opam
|
||||
opam init --yes --disable-sandboxing
|
||||
wget https://repo.radeon.com/amdgpu-install/6.3/ubuntu/focal/amdgpu-install_6.3.60300-1_all.deb
|
||||
apt install -y ./amdgpu-install_6.3.60300-1_all.deb
|
||||
apt update
|
||||
apt install -y libva-amdgpu-dev libdrm-amdgpu-dev
|
||||
rm -rf /etc/apt/sources.list.d/amdgpu.list /etc/apt/sources.list.d/amdgpu-proprietary.list ./amdgpu-install_6.3.60300-1_all.deb
|
||||
apt autoremove -y --purge amdgpu-install
|
||||
apt update
|
||||
|
||||
# Build ccache from the source
|
||||
cd /tmp
|
||||
git clone https://github.com/ccache/ccache -b v4.7.5
|
||||
cd ccache
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf ccache
|
||||
|
||||
# symlinks for ccache
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/gcc
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/g++
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/cc
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/c++
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/amdclang
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/amdclang++
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/hipcc
|
||||
|
||||
# Install OCaml packages
|
||||
wget -nv https://sourceforge.net/projects/opam.mirror/files/2.1.6/opam-2.1.6-x86_64-linux/download -O /usr/local/bin/opam
|
||||
chmod +x /usr/local/bin/opam
|
||||
opam init --yes --disable-sandboxing
|
||||
opam install ctypes --yes
|
||||
|
||||
# Install and modify git-repo (#!/usr/bin/env python -> #!/usr/bin/env python3)
|
||||
# Install and modify git-repo
|
||||
curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/bin/repo
|
||||
chmod a+x /usr/bin/repo
|
||||
|
||||
# Build a newer version of doxygen because of issue 6456
|
||||
#Install doxygen 1.8.11 for dbgapi
|
||||
#Install doxygen 1.8.11
|
||||
mkdir /tmp/doxygen
|
||||
cd /tmp/doxygen
|
||||
curl -LO https://sourceforge.net/projects/doxygen/files/rel-1.8.18/doxygen-1.8.18.src.tar.gz
|
||||
tar xzf doxygen-1.8.18.src.tar.gz
|
||||
cd doxygen-1.8.18
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -Wno-dev ..
|
||||
make -j install
|
||||
cd ../..
|
||||
curl -LO https://sourceforge.net/projects/doxygen/files/rel-1.8.18/doxygen-1.8.18.src.tar.gz
|
||||
tar xzf doxygen-1.8.18.src.tar.gz
|
||||
cd doxygen-1.8.18
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -Wno-dev ..
|
||||
make -j install
|
||||
cd ../..
|
||||
rm -rf /tmp/doxygen
|
||||
|
||||
# Build ccache from the source
|
||||
cd /tmp
|
||||
git clone https://github.com/ccache/ccache -b v4.7.5
|
||||
cd ccache
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf ccache
|
||||
|
||||
# Install sharp from MLNX_OFED_LINUX as dependency for rccl-rdma-sharp-plugins
|
||||
cd /var/tmp
|
||||
mkdir mlnx
|
||||
wget -O mlnx/tar.tgz https://content.mellanox.com/ofed/MLNX_OFED-5.2-1.0.4.0/MLNX_OFED_LINUX-5.2-1.0.4.0-ubuntu20.04-x86_64.tgz
|
||||
tar -xz -C mlnx -f mlnx/tar.tgz
|
||||
apt-key add mlnx/*/RPM-GPG-KEY-Mellanox
|
||||
echo "deb [arch=amd64] file:$(echo $PWD/mlnx/*/DEBS) ./" > /etc/apt/sources.list.d/sharp.list
|
||||
apt update
|
||||
apt install -y sharp
|
||||
apt clean
|
||||
mkdir mlnx
|
||||
wget -O mlnx/tar.tgz https://content.mellanox.com/ofed/MLNX_OFED-5.2-1.0.4.0/MLNX_OFED_LINUX-5.2-1.0.4.0-ubuntu20.04-x86_64.tgz
|
||||
tar -xz -C mlnx -f mlnx/tar.tgz
|
||||
apt-key add mlnx/*/RPM-GPG-KEY-Mellanox
|
||||
echo "deb [arch=amd64] file:$(echo $PWD/mlnx/*/DEBS) ./" > /etc/apt/sources.list.d/sharp.list
|
||||
apt update
|
||||
apt install -y sharp
|
||||
apt clean
|
||||
rm -rf /var/cache/apt/ /var/lib/apt/lists/* mlnx /etc/apt/sources.list.d/sharp.list
|
||||
|
||||
#Install older version of hwloc-devel package for rocrtst
|
||||
curl -lO https://download.open-mpi.org/release/hwloc/v1.11/hwloc-1.11.13.tar.bz2
|
||||
tar -xvf hwloc-1.11.13.tar.bz2
|
||||
cd hwloc-1.11.13
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
cp /usr/local/lib/libhwloc.so.5 /usr/lib
|
||||
curl -lO https://download.open-mpi.org/release/hwloc/v1.11/hwloc-1.11.13.tar.bz2
|
||||
tar -xvf hwloc-1.11.13.tar.bz2
|
||||
cd hwloc-1.11.13
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
cp /usr/local/lib/libhwloc.so.5 /usr/lib
|
||||
hwloc-info --version
|
||||
|
||||
## Install googletest from source
|
||||
mkdir -p /tmp/gtest
|
||||
cd /tmp/gtest
|
||||
wget https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip -O googletest.zip
|
||||
unzip googletest.zip
|
||||
# Install googletest from source
|
||||
mkdir -p /tmp/gtest
|
||||
cd /tmp/gtest
|
||||
wget https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip -O googletest.zip
|
||||
unzip googletest.zip
|
||||
cd googletest-1.14.0/
|
||||
mkdir build
|
||||
cd build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
rm -rf /tmp/gtest
|
||||
|
||||
## Install gRPC from source
|
||||
## RDC Pre-requisites
|
||||
# Install gRPC from source
|
||||
GRPC_ARCHIVE=grpc-1.61.0.tar.gz
|
||||
mkdir /tmp/grpc
|
||||
mkdir /usr/grpc
|
||||
cd /tmp
|
||||
git clone --recurse-submodules -b v1.61.0 https://github.com/grpc/grpc
|
||||
cd /tmp
|
||||
git clone --recurse-submodules -b v1.61.0 https://github.com/grpc/grpc
|
||||
cd grpc
|
||||
mkdir -p cmake/build
|
||||
cd cmake/build
|
||||
cmake -DgRPC_INSTALL=ON -DBUILD_SHARED_LIBS=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/grpc -DCMAKE_CXX_STANDARD=14 -DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,'$ORIGIN' ../..
|
||||
cmake -DgRPC_INSTALL=ON -DBUILD_SHARED_LIBS=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/grpc -DCMAKE_CXX_STANDARD=14 -DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,'$ORIGIN' ../..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
cd /
|
||||
rm -rf /tmp/grpc
|
||||
make install
|
||||
cd /
|
||||
rm -rf /tmp/grpc
|
||||
|
||||
## Download prebuilt AMD multithreaded blis (2.0)
|
||||
## Reference : https://github.com/ROCmSoftwarePlatform/rocBLAS/blob/develop/install.sh#L403
|
||||
# Download prebuilt AMD multithreaded blis (2.0)
|
||||
mkdir -p /tmp/blis
|
||||
cd /tmp/blis
|
||||
wget -O - https://github.com/amd/blis/releases/download/2.0/aocl-blis-mt-ubuntu-2.0.tar.gz | tar xfz -
|
||||
mv amd-blis-mt /usr/blis
|
||||
cd /
|
||||
cd /tmp/blis
|
||||
wget -O - https://github.com/amd/blis/releases/download/2.0/aocl-blis-mt-ubuntu-2.0.tar.gz | tar xfz -
|
||||
mv amd-blis-mt /usr/blis
|
||||
cd /
|
||||
rm -rf /tmp/blis
|
||||
|
||||
## Download aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
mkdir -p /tmp/aocl
|
||||
cd /tmp/aocl
|
||||
wget -nv https://download.amd.com/developer/eula/aocl/aocl-4-2/aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
# Download aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
mkdir -p /tmp/aocl
|
||||
cd /tmp/aocl
|
||||
wget -nv https://download.amd.com/developer/eula/aocl/aocl-4-2/aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
apt install ./aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
rm -rf /tmp/aocl
|
||||
|
||||
## lapack(3.9.1v)
|
||||
## Reference https://github.com/ROCmSoftwarePlatform/rocSOLVER/blob/develop/install.sh#L174
|
||||
# lapack(3.9.1v)
|
||||
lapack_version=3.9.1
|
||||
lapack_srcdir=lapack-$lapack_version
|
||||
lapack_blddir=lapack-$lapack_version-bld
|
||||
@@ -135,81 +145,125 @@ mkdir -p /tmp/lapack
|
||||
cd /tmp/lapack
|
||||
mkdir -p /tmp/lapack
|
||||
cd /tmp/lapack
|
||||
rm -rf "$lapack_srcdir" "$lapack_blddir"
|
||||
wget -O - https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.9.1.tar.gz | tar xzf -
|
||||
rm -rf "$lapack_srcdir" "$lapack_blddir"
|
||||
wget -O - https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.9.1.tar.gz | tar xzf -
|
||||
cmake -H$lapack_srcdir -B$lapack_blddir -DCMAKE_BUILD_TYPE=Release -DCMAKE_Fortran_FLAGS=-fno-optimize-sibling-calls -DBUILD_TESTING=OFF -DCBLAS=ON -DLAPACKE=OFF
|
||||
make -j$(nproc) -C "$lapack_blddir"
|
||||
make -C "$lapack_blddir" install
|
||||
cd $lapack_blddir
|
||||
cp -r ./include/* /usr/local/include/
|
||||
cp -r ./lib/* /usr/local/lib
|
||||
cd /
|
||||
cp -r ./include/* /usr/local/include/
|
||||
cp -r ./lib/* /usr/local/lib
|
||||
cd /
|
||||
rm -rf /tmp/lapack
|
||||
|
||||
## FMT(7.1.3v)
|
||||
## Reference https://github.com/ROCmSoftwarePlatform/rocSOLVER/blob/develop/install.sh#L152
|
||||
fmt_version=7.1.3
|
||||
# FMT(7.1.3v)
|
||||
fmt_version=7.1.3
|
||||
fmt_srcdir=fmt-$fmt_version
|
||||
fmt_blddir=fmt-$fmt_version-bld
|
||||
rm -rf "$fmt_srcdir" "$fmt_blddir"
|
||||
wget -O - https://github.com/fmtlib/fmt/archive/refs/tags/$fmt_version.tar.gz | tar xzf -
|
||||
cmake -H$fmt_srcdir -B$fmt_blddir -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_CXX_STANDARD_REQUIRED=ON -DFMT_DOC=OFF -DFMT_TEST=OFF
|
||||
make -j$(nproc) -C "$fmt_blddir"
|
||||
cmake -H$fmt_srcdir -B$fmt_blddir -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_CXX_STANDARD_REQUIRED=ON -DFMT_DOC=OFF -DFMT_TEST=OFF
|
||||
make -j$(nproc) -C "$fmt_blddir"
|
||||
make -C "$fmt_blddir" install
|
||||
|
||||
# Build and install libjpeg-turbo
|
||||
mkdir -p /tmp/libjpeg-turbo
|
||||
mkdir -p /tmp/libjpeg-turbo
|
||||
cd /tmp/libjpeg-turbo
|
||||
wget -nv https://github.com/rrawther/libjpeg-turbo/archive/refs/heads/2.0.6.2.zip -O libjpeg-turbo-2.0.6.2.zip
|
||||
unzip libjpeg-turbo-2.0.6.2.zip
|
||||
unzip libjpeg-turbo-2.0.6.2.zip
|
||||
cd libjpeg-turbo-2.0.6.2
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..
|
||||
make -j$(nproc) install
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..
|
||||
make -j$(nproc) install
|
||||
rm -rf /tmp/libjpeg-turbo
|
||||
|
||||
# Get released ninja from source
|
||||
mkdir -p /tmp/ninja
|
||||
mkdir -p /tmp/ninja
|
||||
cd /tmp/ninja
|
||||
wget -nv https://codeload.github.com/Kitware/ninja/zip/refs/tags/v1.11.1.g95dee.kitware.jobserver-1 -O ninja.zip
|
||||
unzip ninja.zip
|
||||
cd ninja-1.11.1.g95dee.kitware.jobserver-1
|
||||
wget -nv https://codeload.github.com/Kitware/ninja/zip/refs/tags/v1.11.1.g95dee.kitware.jobserver-1 -O ninja.zip
|
||||
unzip ninja.zip
|
||||
cd ninja-1.11.1.g95dee.kitware.jobserver-1
|
||||
./configure.py --bootstrap
|
||||
cp ninja /usr/local/bin/
|
||||
cp ninja /usr/local/bin/
|
||||
rm -rf /tmp/ninja
|
||||
|
||||
# Install FFmpeg from source
|
||||
wget -qO- https://www.ffmpeg.org/releases/ffmpeg-4.4.2.tar.gz | tar -xzv -C /usr/local
|
||||
# Build NASM
|
||||
mkdir -p /tmp/nasm-2.15.05
|
||||
cd /tmp
|
||||
wget -qO- "https://distfiles.macports.org/nasm/nasm-2.15.05.tar.bz2" | tar -xvj
|
||||
cd nasm-2.15.05
|
||||
./autogen.sh
|
||||
./configure --prefix="/usr/local"
|
||||
make -j$(nproc) install
|
||||
rm -rf /tmp/nasm-2.15.05
|
||||
|
||||
command -v lbzip2
|
||||
# Build YASM
|
||||
mkdir -p /tmp/yasm-1.3.0
|
||||
cd /tmp
|
||||
wget -qO- "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" | tar -xvz
|
||||
cd yasm-1.3.0
|
||||
./configure --prefix="/usr/local"
|
||||
make -j$(nproc) install
|
||||
rm -rf /tmp/yasm-1.3.0
|
||||
|
||||
# Build x264
|
||||
mkdir -p /tmp/x264-snapshot-20191217-2245-stable
|
||||
cd /tmp
|
||||
wget -qO- "https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20191217-2245-stable.tar.bz2" | tar -xvj
|
||||
cd /tmp/x264-snapshot-20191217-2245-stable
|
||||
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure --prefix="/usr/local" --enable-shared
|
||||
make -j$(nproc) install
|
||||
rm -rf /tmp/x264-snapshot-20191217-2245-stable
|
||||
|
||||
# Build x265
|
||||
mkdir -p /tmp/x265_2.7
|
||||
cd /tmp
|
||||
wget -qO- "https://get.videolan.org/x265/x265_2.7.tar.gz" | tar -xvz
|
||||
cd /tmp/x265_2.7/build/linux
|
||||
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="/usr/local" -DENABLE_SHARED:bool=on ../../source
|
||||
make -j$(nproc) install
|
||||
rm -rf /tmp/x265_2.7
|
||||
|
||||
# Build fdk-aac
|
||||
mkdir -p /tmp/fdk-aac-2.0.2
|
||||
cd /tmp
|
||||
wget -qO- "https://sourceforge.net/projects/opencore-amr/files/fdk-aac/fdk-aac-2.0.2.tar.gz" | tar -xvz
|
||||
cd /tmp/fdk-aac-2.0.2
|
||||
autoreconf -fiv
|
||||
./configure --prefix="/usr/local" --enable-shared --disable-static
|
||||
make -j$(nproc) install
|
||||
rm -rf /tmp/fdk-aac-2.0.2
|
||||
|
||||
# Build FFmpeg
|
||||
cd /tmp
|
||||
git clone -b release/4.4 https://git.ffmpeg.org/ffmpeg.git ffmpeg
|
||||
cd ffmpeg
|
||||
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
|
||||
./configure --prefix="/usr/local" --extra-cflags="-I/usr/local/include" --extra-ldflags="-L/usr/local/lib" --extra-libs=-lpthread --extra-libs=-lm --enable-shared --disable-static --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-gpl --enable-nonfree
|
||||
make -j$(nproc) install
|
||||
rm -rf /tmp/ffmpeg
|
||||
|
||||
command -v lbzip2
|
||||
ln -sf $(command -v lbzip2) /usr/local/bin/compressor || ln -sf $(command -v bzip2) /usr/local/bin/compressor
|
||||
|
||||
# Install Google Benchmark
|
||||
mkdir -p /tmp/Gbenchmark
|
||||
cd /tmp/Gbenchmark
|
||||
wget -qO- https://github.com/google/benchmark/archive/refs/tags/v1.6.1.tar.gz | tar xz
|
||||
cmake -Sbenchmark-1.6.1 -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_CXX_STANDARD=14
|
||||
make -j -C build
|
||||
# Install Google Benchmark
|
||||
mkdir -p /tmp/Gbenchmark
|
||||
cd /tmp/Gbenchmark
|
||||
wget -qO- https://github.com/google/benchmark/archive/refs/tags/v1.6.1.tar.gz | tar xz
|
||||
cmake -Sbenchmark-1.6.1 -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_CXX_STANDARD=14
|
||||
make -j -C build
|
||||
cd /tmp/Gbenchmark/build
|
||||
make install
|
||||
|
||||
# Build boost-1.82.0 from source for RPP
|
||||
# Installing in a non-standard location since the test packages of hipFFT and rocFFT pick up the version of
|
||||
# the installed Boost library and declare a package dependency on that specific version of Boost.
|
||||
# For example, if this was installed in the standard location it would declare a dependency on libboost-dev(el)1.82.0
|
||||
# which is not available as a package in any distro.
|
||||
# Once this is fixed, we can remove the Boost package from the requirements list and install this
|
||||
# in the standard location
|
||||
# export RPP_DEPS_LOCATION=/usr/local/rpp-deps
|
||||
mkdir -p /tmp/boost-1.82.0
|
||||
cd /tmp/boost-1.82.0
|
||||
wget -nv https://sourceforge.net/projects/boost/files/boost/1.82.0/boost_1_82_0.tar.bz2 -O ./boost_1_82_0.tar.bz2
|
||||
tar -xf boost_1_82_0.tar.bz2 --use-compress-program="/usr/local/bin/compressor"
|
||||
cd boost_1_82_0
|
||||
./bootstrap.sh --prefix=${RPP_DEPS_LOCATION} --with-python=python3
|
||||
./b2 stage -j$(nproc) threading=multi link=shared cxxflags="-std=c++11"
|
||||
./b2 install threading=multi link=shared --with-system --with-filesystem
|
||||
./b2 stage -j$(nproc) threading=multi link=static cxxflags="-std=c++11 -fpic" cflags="-fpic"
|
||||
./b2 install threading=multi link=static --with-system --with-filesystem
|
||||
mkdir -p /tmp/boost-1.82.0
|
||||
cd /tmp/boost-1.82.0
|
||||
wget -nv https://sourceforge.net/projects/boost/files/boost/1.82.0/boost_1_82_0.tar.bz2 -O ./boost_1_82_0.tar.bz2
|
||||
tar -xf boost_1_82_0.tar.bz2 --use-compress-program="/usr/local/bin/compressor"
|
||||
cd boost_1_82_0
|
||||
./bootstrap.sh --prefix=${RPP_DEPS_LOCATION} --with-python=python3
|
||||
./b2 stage -j$(nproc) threading=multi link=shared cxxflags="-std=c++11"
|
||||
./b2 install threading=multi link=shared --with-system --with-filesystem
|
||||
./b2 stage -j$(nproc) threading=multi link=static cxxflags="-std=c++11 -fpic" cflags="-fpic"
|
||||
./b2 install threading=multi link=static --with-system --with-filesystem
|
||||
rm -rf /tmp/boost-1.82.0
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# List of packages needed for stage1 build
|
||||
apt-utils
|
||||
aria2
|
||||
autoconf
|
||||
@@ -8,7 +7,6 @@ bison
|
||||
bridge-utils
|
||||
build-essential
|
||||
bzip2
|
||||
ccache
|
||||
check
|
||||
chrpath
|
||||
cifs-utils
|
||||
@@ -22,7 +20,6 @@ flex
|
||||
freeglut3-dev
|
||||
g++
|
||||
g++-multilib
|
||||
# gawk is needed for aomp
|
||||
gawk
|
||||
gcc
|
||||
gcc-multilib
|
||||
@@ -32,7 +29,6 @@ gnupg
|
||||
graphviz
|
||||
kernel-wedge
|
||||
lbzip2
|
||||
# less is needed by repo
|
||||
less
|
||||
libass-dev
|
||||
libatlas-base-dev
|
||||
@@ -78,6 +74,7 @@ libnuma-dev
|
||||
libomp-dev
|
||||
libopenblas-base
|
||||
libopenblas-dev
|
||||
libopencv-dev
|
||||
libpci-dev
|
||||
libpci3
|
||||
libpciaccess-dev
|
||||
@@ -107,6 +104,8 @@ mesa-common-dev
|
||||
mpich
|
||||
ocaml
|
||||
ocaml-findlib
|
||||
ocl-icd-libopencl1
|
||||
ocl-icd-opencl-dev
|
||||
patchelf
|
||||
pigz
|
||||
pkg-config
|
||||
@@ -121,11 +120,9 @@ python3-yaml
|
||||
python3.8-dev
|
||||
re2c
|
||||
redis-tools
|
||||
# Eventually we should be able to remove rpm for debian builds.
|
||||
rpm
|
||||
rsync
|
||||
ssh
|
||||
# This makes life more pleasent inside the container
|
||||
strace
|
||||
sudo
|
||||
systemtap-sdt-dev
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
FROM ubuntu:jammy as builder
|
||||
COPY packages /tmp/packages
|
||||
COPY local-pin-600 /tmp/local-pin-600
|
||||
COPY install-prerequisities.sh /tmp/install-prerequisities.sh
|
||||
RUN chmod +x /tmp/install-prerequisities.sh
|
||||
COPY install-prerequisites.sh /tmp/install-prerequisites.sh
|
||||
RUN chmod +x /tmp/install-prerequisites.sh
|
||||
ENV KBUILD_PKG_ROOTCMD=
|
||||
ENV RPP_DEPS_LOCATION=/usr/local/rpp-deps
|
||||
RUN /tmp/install-prerequisities.sh
|
||||
RUN /tmp/install-prerequisites.sh
|
||||
WORKDIR /src
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
1. Clone this repositry
|
||||
|
||||
```bash
|
||||
git clone -b roc-6.1.x https://github.com/ROCm/ROCm.git
|
||||
git clone -b <release_branch> https://github.com/ROCm/ROCm.git
|
||||
```
|
||||
|
||||
2. Go into the OS specific docker directory in build-infra
|
||||
|
||||
@@ -1,62 +1,74 @@
|
||||
#! /usr/bin/bash
|
||||
|
||||
set -x
|
||||
set -ex
|
||||
|
||||
apt-get -y update
|
||||
apt-get -y update
|
||||
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install --no-install-recommends -y $(sed 's/#.*//' /tmp/packages)
|
||||
apt-get clean
|
||||
apt-get clean
|
||||
rm -rf /var/cache/apt/ /var/lib/apt/lists/* /etc/apt/apt.conf.d/01proxy
|
||||
|
||||
#Install 2.17.1 version of git as we are seeing issues with 2.25 , where it was not allowing to add git submodules if the user is different for parent git directory
|
||||
curl -o git.tar.gz https://cdn.kernel.org/pub/software/scm/git/git-2.17.1.tar.gz
|
||||
tar -zxf git.tar.gz
|
||||
cd git-*
|
||||
make prefix=/usr/local all
|
||||
#Install git 2.17.1 version
|
||||
curl -o git.tar.gz https://cdn.kernel.org/pub/software/scm/git/git-2.17.1.tar.gz
|
||||
tar -zxf git.tar.gz
|
||||
cd git-*
|
||||
make prefix=/usr/local all
|
||||
make prefix=/usr/local install
|
||||
git --version
|
||||
|
||||
#install argparse and CppHeaderParser python modules for roctracer and rocprofiler
|
||||
#install rocm-docs-core for the docs-as-code project. Only needed on one OS
|
||||
# CppHeader needs setuptools. setuptools needs wheel.
|
||||
# Looks like I need them as seperate commands
|
||||
# Sigh, install both python2 and python 3 version
|
||||
pip3 install --no-cache-dir setuptools wheel tox
|
||||
pip3 install --no-cache-dir CppHeaderParser argparse requests lxml barectf recommonmark jinja2==3.0.0 websockets matplotlib numpy scipy minimal msgpack pytest sphinx joblib PyYAML rocm-docs-core cmake==3.25.2 pandas myst-parser
|
||||
pip3 install --no-cache-dir CppHeaderParser argparse requests lxml barectf recommonmark jinja2==3.0.0 \
|
||||
websockets matplotlib numpy==1.26.4 scipy minimal msgpack pytest sphinx joblib PyYAML rocm-docs-core cmake==3.25.2 pandas myst-parser lit
|
||||
|
||||
# Allow sudo for everyone user
|
||||
echo 'ALL ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/everyone
|
||||
|
||||
# Install OCaml packages to build LLVM's OCaml bindings to be used in lightning compiler test pipeline
|
||||
wget -nv https://sourceforge.net/projects/opam.mirror/files/2.1.4/opam-2.1.4-x86_64-linux -O /usr/local/bin/opam
|
||||
wget https://repo.radeon.com/amdgpu-install/6.3/ubuntu/jammy/amdgpu-install_6.3.60300-1_all.deb
|
||||
apt install -y ./amdgpu-install_6.3.60300-1_all.deb
|
||||
apt update
|
||||
apt install -y libva-amdgpu-dev libdrm-amdgpu-dev
|
||||
rm -rf /etc/apt/sources.list.d/amdgpu.list /etc/apt/sources.list.d/amdgpu-proprietary.list ./amdgpu-install_6.3.60300-1_all.deb
|
||||
apt autoremove -y --purge amdgpu-install
|
||||
apt update
|
||||
|
||||
# Build ccache from the source
|
||||
cd /tmp
|
||||
git clone https://github.com/ccache/ccache -b v4.7.5
|
||||
cd ccache
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf ccache
|
||||
|
||||
# symlinks for ccache
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/gcc
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/g++
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/cc
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/c++
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/amdclang
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/amdclang++
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/hipcc
|
||||
|
||||
# Install OCaml packages
|
||||
wget -nv https://sourceforge.net/projects/opam.mirror/files/2.1.6/opam-2.1.6-x86_64-linux/download -O /usr/local/bin/opam
|
||||
chmod +x /usr/local/bin/opam
|
||||
opam init --yes --disable-sandboxing
|
||||
opam install ctypes --yes
|
||||
|
||||
# Install and modify git-repo (#!/usr/bin/env python -> #!/usr/bin/env python3)
|
||||
# Install and modify git-repo
|
||||
curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/bin/repo
|
||||
chmod a+x /usr/bin/repo
|
||||
|
||||
# Build ccache from the source
|
||||
cd /tmp
|
||||
git clone https://github.com/ccache/ccache -b v4.7.5
|
||||
cd ccache
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf ccache
|
||||
|
||||
# Install sharp from MLNX_OFED_LINUX as dependency for rccl-rdma-sharp-plugins
|
||||
cd /var/tmp
|
||||
mkdir mlnx
|
||||
wget -O mlnx/tar.tgz https://content.mellanox.com/ofed/MLNX_OFED-24.01-0.3.3.1/MLNX_OFED_LINUX-24.01-0.3.3.1-ubuntu22.04-x86_64.tgz
|
||||
tar -xz -C mlnx -f mlnx/tar.tgz
|
||||
mkdir mlnx
|
||||
wget -O mlnx/tar.tgz https://content.mellanox.com/ofed/MLNX_OFED-24.01-0.3.3.1/MLNX_OFED_LINUX-24.01-0.3.3.1-ubuntu22.04-x86_64.tgz
|
||||
tar -xz -C mlnx -f mlnx/tar.tgz
|
||||
apt-key add mlnx/*/RPM-GPG-KEY-Mellanox
|
||||
echo "deb [arch=amd64] file:$(echo $PWD/mlnx/*/DEBS) ./" > /etc/apt/sources.list.d/sharp.list
|
||||
apt update
|
||||
apt install -y sharp
|
||||
apt install -y sharp
|
||||
apt clean
|
||||
rm -rf /var/cache/apt/ /var/lib/apt/lists/* mlnx /etc/apt/sources.list.d/sharp.list
|
||||
|
||||
@@ -71,20 +83,18 @@ pwd
|
||||
ls /var/tmp/
|
||||
ls Python-3.8.13
|
||||
mv Python-3.8.13 /opt/
|
||||
apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev pkg-config make -y
|
||||
cd /opt/Python-3.8.13/
|
||||
apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev pkg-config make -y
|
||||
cd /opt/Python-3.8.13/
|
||||
./configure --enable-optimizations --enable-shared
|
||||
make
|
||||
make -j 6
|
||||
make altinstall
|
||||
make
|
||||
make -j 6
|
||||
make altinstall
|
||||
ldconfig /opt/Python3.8.13
|
||||
python3.8 --version
|
||||
|
||||
# roctracer and rocprofiler needs this python3.8
|
||||
python3.8 -m pip install setuptools wheel
|
||||
python3.8 -m pip install CppHeaderParser argparse requests lxml PyYAML joblib
|
||||
|
||||
#Install older version of hwloc-devel package for rocrtst
|
||||
curl -lO https://download.open-mpi.org/release/hwloc/v1.11/hwloc-1.11.13.tar.bz2
|
||||
tar -xvf hwloc-1.11.13.tar.bz2
|
||||
cd hwloc-1.11.13
|
||||
@@ -94,73 +104,65 @@ make install
|
||||
cp /usr/local/lib/libhwloc.so.5 /usr/lib
|
||||
hwloc-info --version
|
||||
|
||||
# Install gtest
|
||||
# Install googletest from source
|
||||
mkdir -p /tmp/gtest
|
||||
cd /tmp/gtest
|
||||
wget https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip -O googletest.zip
|
||||
unzip googletest.zip
|
||||
cd googletest-1.14.0/
|
||||
cd googletest-1.14.0/
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j$(nproc)
|
||||
cmake ..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
rm -rf /tmp/gtest
|
||||
|
||||
## Install gRPC from source
|
||||
## RDC Pre-requisites
|
||||
# Install gRPC from source
|
||||
GRPC_ARCHIVE=grpc-1.61.0.tar.gz
|
||||
mkdir /tmp/grpc
|
||||
mkdir /usr/grpc
|
||||
cd /tmp
|
||||
mkdir /usr/grpc
|
||||
cd /tmp
|
||||
git clone --recurse-submodules -b v1.61.0 https://github.com/grpc/grpc
|
||||
cd grpc
|
||||
mkdir -p build
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -DgRPC_INSTALL=ON -DBUILD_SHARED_LIBS=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/grpc -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14 -DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,'$ORIGIN' ..
|
||||
make -j $(nproc) install
|
||||
cmake -DgRPC_INSTALL=ON -DBUILD_SHARED_LIBS=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/grpc -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14 -DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,'$ORIGIN' ..
|
||||
make -j $(nproc) install
|
||||
rm -rf /tmp/grpc
|
||||
|
||||
## rocBLAS Pre-requisites
|
||||
## Download prebuilt AMD multithreaded blis (2.0)
|
||||
## Reference : https://github.com/ROCmSoftwarePlatform/rocBLAS/blob/develop/install.sh#L403
|
||||
mkdir -p /tmp/blis
|
||||
# Download prebuilt AMD multithreaded blis (2.0)
|
||||
mkdir -p /tmp/blis
|
||||
cd /tmp/blis
|
||||
wget -O - https://github.com/amd/blis/releases/download/2.0/aocl-blis-mt-ubuntu-2.0.tar.gz | tar xfz -
|
||||
mv amd-blis-mt /usr/blis
|
||||
cd /
|
||||
wget -O - https://github.com/amd/blis/releases/download/2.0/aocl-blis-mt-ubuntu-2.0.tar.gz | tar xfz -
|
||||
mv amd-blis-mt /usr/blis
|
||||
cd /
|
||||
rm -rf /tmp/blis
|
||||
|
||||
## rocBLAS Pre-requisites(SWDEV-404612)
|
||||
## Download aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
mkdir -p /tmp/aocl
|
||||
cd /tmp/aocl
|
||||
wget -nv https://download.amd.com/developer/eula/aocl/aocl-4-2/aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
apt install ./aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
# Download aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
mkdir -p /tmp/aocl
|
||||
cd /tmp/aocl
|
||||
wget -nv https://download.amd.com/developer/eula/aocl/aocl-4-2/aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
apt install ./aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
rm -rf /tmp/aocl
|
||||
|
||||
## hipBLAS Pre-requisites
|
||||
## lapack(3.9.1v)
|
||||
## Reference https://github.com/ROCmSoftwarePlatform/rocSOLVER/blob/develop/install.sh#L174
|
||||
# lapack(3.9.1v)
|
||||
lapack_version=3.9.1
|
||||
lapack_srcdir=lapack-$lapack_version
|
||||
lapack_blddir=lapack-$lapack_version-bld
|
||||
mkdir -p /tmp/lapack
|
||||
cd /tmp/lapack
|
||||
rm -rf "$lapack_srcdir" "$lapack_blddir"
|
||||
wget -O - https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.9.1.tar.gz | tar xzf -
|
||||
rm -rf "$lapack_srcdir" "$lapack_blddir"
|
||||
wget -O - https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.9.1.tar.gz | tar xzf -
|
||||
cmake -H$lapack_srcdir -B$lapack_blddir -DCMAKE_BUILD_TYPE=Release -DCMAKE_Fortran_FLAGS=-fno-optimize-sibling-calls -DBUILD_TESTING=OFF -DCBLAS=ON -DLAPACKE=OFF
|
||||
make -j$(nproc) -C "$lapack_blddir"
|
||||
make -C "$lapack_blddir" install
|
||||
cd $lapack_blddir
|
||||
cp -r ./include/* /usr/local/include/
|
||||
cp -r ./lib/* /usr/local/lib
|
||||
cd /
|
||||
cp -r ./include/* /usr/local/include/
|
||||
cp -r ./lib/* /usr/local/lib
|
||||
cd /
|
||||
rm -rf /tmp/lapack
|
||||
|
||||
## rocSOLVER Pre-requisites
|
||||
## FMT(7.1.3v)
|
||||
## Reference https://github.com/ROCmSoftwarePlatform/rocSOLVER/blob/develop/install.sh#L152
|
||||
# FMT(7.1.3v)
|
||||
fmt_version=7.1.3
|
||||
fmt_srcdir=fmt-$fmt_version
|
||||
fmt_blddir=fmt-$fmt_version-bld
|
||||
@@ -173,32 +175,31 @@ make -j$(nproc) -C "$fmt_blddir"
|
||||
make -C "$fmt_blddir" install
|
||||
|
||||
# Build and install libjpeg-turbo
|
||||
mkdir -p /tmp/libjpeg-turbo
|
||||
cd /tmp/libjpeg-turbo
|
||||
mkdir -p /tmp/libjpeg-turbo
|
||||
cd /tmp/libjpeg-turbo
|
||||
wget -nv https://github.com/rrawther/libjpeg-turbo/archive/refs/heads/2.0.6.2.zip -O libjpeg-turbo-2.0.6.2.zip
|
||||
unzip libjpeg-turbo-2.0.6.2.zip
|
||||
unzip libjpeg-turbo-2.0.6.2.zip
|
||||
cd libjpeg-turbo-2.0.6.2
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..
|
||||
make -j$(nproc) install
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..
|
||||
make -j$(nproc) install
|
||||
rm -rf /tmp/libjpeg-turbo
|
||||
|
||||
# Get released ninja from source
|
||||
mkdir -p /tmp/ninja
|
||||
cd /tmp/ninja
|
||||
mkdir -p /tmp/ninja
|
||||
cd /tmp/ninja
|
||||
wget -nv https://codeload.github.com/Kitware/ninja/zip/refs/tags/v1.11.1.g95dee.kitware.jobserver-1 -O ninja.zip
|
||||
unzip ninja.zip
|
||||
cd ninja-1.11.1.g95dee.kitware.jobserver-1
|
||||
./configure.py --bootstrap
|
||||
cp ninja /usr/local/bin/
|
||||
./configure.py --bootstrap
|
||||
cp ninja /usr/local/bin/
|
||||
rm -rf /tmp/ninja
|
||||
|
||||
# Install FFmpeg and dependencies
|
||||
# Build NASM
|
||||
mkdir -p /tmp/nasm-2.15.05
|
||||
mkdir -p /tmp/nasm-2.15.05
|
||||
cd /tmp
|
||||
wget -qO- "https://distfiles.macports.org/nasm/nasm-2.15.05.tar.bz2" | tar -xvj
|
||||
wget -qO- "https://distfiles.macports.org/nasm/nasm-2.15.05.tar.bz2" | tar -xvj
|
||||
cd nasm-2.15.05
|
||||
./autogen.sh
|
||||
./configure --prefix="/usr/local"
|
||||
@@ -206,9 +207,9 @@ make -j$(nproc) install
|
||||
rm -rf /tmp/nasm-2.15.05
|
||||
|
||||
# Build YASM
|
||||
mkdir -p /tmp/yasm-1.3.0
|
||||
mkdir -p /tmp/yasm-1.3.0
|
||||
cd /tmp
|
||||
wget -qO- "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" | tar -xvz
|
||||
wget -qO- "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" | tar -xvz
|
||||
cd yasm-1.3.0
|
||||
./configure --prefix="/usr/local"
|
||||
make -j$(nproc) install
|
||||
@@ -253,33 +254,26 @@ rm -rf /tmp/ffmpeg
|
||||
|
||||
cp /tmp/local-pin-600 /etc/apt/preferences.d
|
||||
|
||||
command -v lbzip2
|
||||
command -v lbzip2
|
||||
ln -sf $(command -v lbzip2) /usr/local/bin/compressor || ln -sf $(command -v bzip2) /usr/local/bin/compressor
|
||||
|
||||
# Install Google Benchmark
|
||||
mkdir -p /tmp/Gbenchmark
|
||||
cd /tmp/Gbenchmark
|
||||
wget -qO- https://github.com/google/benchmark/archive/refs/tags/v1.6.1.tar.gz | tar xz
|
||||
cmake -Sbenchmark-1.6.1 -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_CXX_STANDARD=14
|
||||
make -j -C build
|
||||
mkdir -p /tmp/Gbenchmark
|
||||
cd /tmp/Gbenchmark
|
||||
wget -qO- https://github.com/google/benchmark/archive/refs/tags/v1.6.1.tar.gz | tar xz
|
||||
cmake -Sbenchmark-1.6.1 -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_CXX_STANDARD=14
|
||||
make -j -C build
|
||||
cd /tmp/Gbenchmark/build
|
||||
make install
|
||||
|
||||
# Build boost-1.85.0 from source for RPP
|
||||
# Installing in a non-standard location since the test packages of hipFFT and rocFFT pick up the version of
|
||||
# the installed Boost library and declare a package dependency on that specific version of Boost.
|
||||
# For example, if this was installed in the standard location it would declare a dependency on libboost-dev(el)1.85.0
|
||||
# which is not available as a package in any distro.
|
||||
# Once this is fixed, we can remove the Boost package from the requirements list and install this
|
||||
# in the standard location
|
||||
mkdir -p /tmp/boost-1.85.0
|
||||
cd /tmp/boost-1.85.0
|
||||
wget -nv https://sourceforge.net/projects/boost/files/boost/1.85.0/boost_1_85_0.tar.bz2 -O ./boost_1_85_0.tar.bz2
|
||||
tar -xf boost_1_85_0.tar.bz2 --use-compress-program="/usr/local/bin/compressor"
|
||||
cd boost_1_85_0
|
||||
./bootstrap.sh --prefix=${RPP_DEPS_LOCATION} --with-python=python3
|
||||
./b2 stage -j$(nproc) threading=multi link=shared cxxflags="-std=c++11"
|
||||
./b2 install threading=multi link=shared --with-system --with-filesystem
|
||||
mkdir -p /tmp/boost-1.85.0
|
||||
cd /tmp/boost-1.85.0
|
||||
wget -nv https://sourceforge.net/projects/boost/files/boost/1.85.0/boost_1_85_0.tar.bz2 -O ./boost_1_85_0.tar.bz2
|
||||
tar -xf boost_1_85_0.tar.bz2 --use-compress-program="/usr/local/bin/compressor"
|
||||
cd boost_1_85_0
|
||||
./bootstrap.sh --prefix=${RPP_DEPS_LOCATION} --with-python=python3
|
||||
./b2 stage -j$(nproc) threading=multi link=shared cxxflags="-std=c++11"
|
||||
./b2 install threading=multi link=shared --with-system --with-filesystem
|
||||
./b2 stage -j$(nproc) threading=multi link=static cxxflags="-std=c++11 -fpic" cflags="-fpic"
|
||||
./b2 install threading=multi link=static --with-system --with-filesystem
|
||||
./b2 install threading=multi link=static --with-system --with-filesystem
|
||||
rm -rf /tmp/boost-1.85.0
|
||||
@@ -1,4 +1,3 @@
|
||||
# List of packages needed for stage1 build
|
||||
apt-utils
|
||||
aria2
|
||||
autoconf
|
||||
@@ -8,7 +7,6 @@ bison
|
||||
bridge-utils
|
||||
build-essential
|
||||
bzip2
|
||||
ccache
|
||||
check
|
||||
chrpath
|
||||
cifs-utils
|
||||
@@ -22,7 +20,6 @@ flex
|
||||
freeglut3-dev
|
||||
g++
|
||||
g++-multilib
|
||||
# gawk is needed for aomp
|
||||
gawk
|
||||
gcc
|
||||
gcc-multilib
|
||||
@@ -33,10 +30,8 @@ googletest-tools
|
||||
graphviz
|
||||
grpc-proto
|
||||
kernel-wedge
|
||||
# kmod for kernel build
|
||||
kmod
|
||||
lbzip2
|
||||
# less is needed by repo
|
||||
less
|
||||
libass-dev
|
||||
libatlas-base-dev
|
||||
@@ -81,6 +76,7 @@ libnuma-dev
|
||||
libomp-dev
|
||||
libopenblas-base
|
||||
libopenblas-dev
|
||||
libopencv-dev
|
||||
libpci-dev
|
||||
libpci3
|
||||
libpciaccess-dev
|
||||
@@ -108,6 +104,8 @@ mesa-common-dev
|
||||
mpich
|
||||
ocaml
|
||||
ocaml-findlib
|
||||
ocl-icd-libopencl1
|
||||
ocl-icd-opencl-dev
|
||||
patchelf
|
||||
pigz
|
||||
pkg-config
|
||||
@@ -122,11 +120,9 @@ python3-yaml
|
||||
python3.8-dev
|
||||
re2c
|
||||
redis-tools
|
||||
# hipclang needs rpm
|
||||
rpm
|
||||
rsync
|
||||
ssh
|
||||
# This makes life more pleasent inside the container
|
||||
strace
|
||||
sudo
|
||||
systemtap-sdt-dev
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
FROM ubuntu:noble as builder
|
||||
COPY packages /tmp/packages
|
||||
COPY local-pin-600 /tmp/local-pin-600
|
||||
COPY install-prerequisities.sh /tmp/install-prerequisities.sh
|
||||
RUN chmod +x /tmp/install-prerequisities.sh
|
||||
COPY install-prerequisites.sh /tmp/install-prerequisites.sh
|
||||
RUN chmod +x /tmp/install-prerequisites.sh
|
||||
ENV KBUILD_PKG_ROOTCMD=
|
||||
ENV RPP_DEPS_LOCATION=/usr/local/rpp-deps
|
||||
ENV PATH="/opt/venv/bin:$PATH"
|
||||
ENV PATH=$PATH:"/usr/local/bin"
|
||||
RUN /tmp/install-prerequisities.sh
|
||||
RUN /tmp/install-prerequisites.sh
|
||||
WORKDIR /src
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
1. Clone this repositry
|
||||
|
||||
```bash
|
||||
git clone https://github.com/ROCm/rocm-build.git
|
||||
git clone -b <release_branch> https://github.com/ROCm/ROCm.git
|
||||
```
|
||||
|
||||
2. Go into the OS specific docker directory in build-infra
|
||||
|
||||
@@ -1,59 +1,69 @@
|
||||
|
||||
#! /usr/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
# The following assumes that you have a cache, e.g.
|
||||
# https://docs.docker.com/engine/examples/apt-cacher-ng/
|
||||
# Comment out if it breaks things
|
||||
echo 'Acquire::http { Proxy "http://rocm-ci-services.amd.com:3142"; };' > /etc/apt/apt.conf.d/01proxy
|
||||
|
||||
apt-get update
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install --no-install-recommends -y $(sed 's/#.*//' /tmp/packages)
|
||||
update-ccache-symlinks
|
||||
apt-get upgrade
|
||||
apt-get clean
|
||||
apt-get clean
|
||||
rm -rf /var/cache/apt/ /var/lib/apt/lists/* /etc/apt/apt.conf.d/01proxy
|
||||
|
||||
#Install 2.17.1 version of git as we are seeing issues with 2.25 , where it was not allowing to add git submodules if the user is different for parent git directory
|
||||
curl -o git.tar.gz https://cdn.kernel.org/pub/software/scm/git/git-2.17.1.tar.gz
|
||||
tar -zxf git.tar.gz
|
||||
cd git-*
|
||||
make prefix=/usr/local all
|
||||
#Install git 2.17.1 version
|
||||
curl -o git.tar.gz https://cdn.kernel.org/pub/software/scm/git/git-2.17.1.tar.gz
|
||||
tar -zxf git.tar.gz
|
||||
cd git-*
|
||||
make prefix=/usr/local all
|
||||
make prefix=/usr/local install
|
||||
git --version
|
||||
|
||||
# venv for python to be able to run pip3 without --break-system-packages
|
||||
python3 -m venv /opt/venv
|
||||
|
||||
pip3 install --no-cache-dir setuptools wheel tox
|
||||
pip3 install --no-cache-dir --pre CppHeaderParser argparse requests lxml barectf recommonmark jinja2==3.0.0 websockets matplotlib numpy scipy minimal msgpack pytest sphinx joblib PyYAML==5.3.1 rocm-docs-core cmake==3.25.2 pandas myst-parser
|
||||
pip3 install CppHeaderParser argparse lxml recommonmark jinja2==3.0.0 \
|
||||
websockets matplotlib numpy scipy minimal msgpack pytest sphinx joblib PyYAML rocm-docs-core cmake==3.25.2 pandas \
|
||||
myst-parser setuptools lit
|
||||
|
||||
# Allow sudo for everyone user
|
||||
echo 'ALL ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/everyone
|
||||
|
||||
# Install OCaml packages to build LLVM's OCaml bindings to be used in lightning compiler test pipeline
|
||||
wget -nv https://sourceforge.net/projects/opam.mirror/files/2.1.4/opam-2.1.4-x86_64-linux -O /usr/local/bin/opam
|
||||
wget https://repo.radeon.com/amdgpu-install/6.3/ubuntu/noble/amdgpu-install_6.3.60300-1_all.deb
|
||||
apt install -y ./amdgpu-install_6.3.60300-1_all.deb
|
||||
apt update
|
||||
apt install -y libva-amdgpu-dev libdrm-amdgpu-dev
|
||||
rm -rf /etc/apt/sources.list.d/amdgpu.list /etc/apt/sources.list.d/amdgpu-proprietary.list ./amdgpu-install_6.3.60300-1_all.deb
|
||||
apt autoremove -y --purge amdgpu-install
|
||||
apt update
|
||||
|
||||
# Build ccache from the source
|
||||
cd /tmp
|
||||
git clone https://github.com/ccache/ccache -b v4.7.5
|
||||
cd ccache
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf ccache
|
||||
|
||||
# symlinks for ccache
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/gcc
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/g++
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/cc
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/c++
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/amdclang
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/amdclang++
|
||||
ln -s /usr/local/bin/ccache /usr/local/bin/hipcc
|
||||
|
||||
# Install OCaml packages
|
||||
wget -nv https://sourceforge.net/projects/opam.mirror/files/2.1.6/opam-2.1.6-x86_64-linux/download -O /usr/local/bin/opam
|
||||
chmod +x /usr/local/bin/opam
|
||||
opam init --yes --disable-sandboxing
|
||||
opam install ctypes --yes
|
||||
|
||||
# Install and modify git-repo (#!/usr/bin/env python -> #!/usr/bin/env python3)
|
||||
# Install and modify git-repo
|
||||
curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/bin/repo
|
||||
chmod a+x /usr/bin/repo
|
||||
|
||||
# Build ccache from the source
|
||||
cd /tmp
|
||||
git clone https://github.com/ccache/ccache -b v4.7.5
|
||||
cd ccache
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf ccache
|
||||
|
||||
#Install older version of hwloc-devel package for rocrtst
|
||||
curl -lO https://download.open-mpi.org/release/hwloc/v1.11/hwloc-1.11.13.tar.bz2
|
||||
tar -xvf hwloc-1.11.13.tar.bz2
|
||||
cd hwloc-1.11.13
|
||||
@@ -63,73 +73,65 @@ make install
|
||||
cp /usr/local/lib/libhwloc.so.5 /usr/lib
|
||||
hwloc-info --version
|
||||
|
||||
# Install gtest
|
||||
# Install googletest from source
|
||||
mkdir -p /tmp/gtest
|
||||
cd /tmp/gtest
|
||||
wget https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip -O googletest.zip
|
||||
unzip googletest.zip
|
||||
cd googletest-1.14.0/
|
||||
cd googletest-1.14.0/
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j$(nproc)
|
||||
cmake ..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
rm -rf /tmp/gtest
|
||||
|
||||
## Install gRPC from source
|
||||
## RDC Pre-requisites
|
||||
# Install gRPC from source
|
||||
GRPC_ARCHIVE=grpc-1.61.0.tar.gz
|
||||
mkdir /tmp/grpc
|
||||
mkdir /usr/grpc
|
||||
cd /tmp
|
||||
mkdir /usr/grpc
|
||||
cd /tmp
|
||||
git clone --recurse-submodules -b v1.61.0 https://github.com/grpc/grpc
|
||||
cd grpc
|
||||
mkdir -p build
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake -DgRPC_INSTALL=ON -DBUILD_SHARED_LIBS=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/grpc -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14 -DCMAKE_SHARED_LINKER_FLAGS_INIT=-Wl,--enable-new-dtags,--build-id=sha1,--rpath,'$ORIGIN' ..
|
||||
make -j $(nproc) install
|
||||
cmake -DgRPC_INSTALL=ON -DBUILD_SHARED_LIBS=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/grpc -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=14 ..
|
||||
make -j $(nproc) install
|
||||
rm -rf /tmp/grpc
|
||||
|
||||
## rocBLAS Pre-requisites(ROCMOPS-3856)
|
||||
## Download prebuilt AMD multithreaded blis (2.0)
|
||||
## Reference : https://github.com/ROCmSoftwarePlatform/rocBLAS/blob/develop/install.sh#L403
|
||||
mkdir -p /tmp/blis
|
||||
# Download prebuilt AMD multithreaded blis (2.0)
|
||||
mkdir -p /tmp/blis
|
||||
cd /tmp/blis
|
||||
wget -O - https://github.com/amd/blis/releases/download/2.0/aocl-blis-mt-ubuntu-2.0.tar.gz | tar xfz -
|
||||
mv amd-blis-mt /usr/blis
|
||||
cd /
|
||||
wget -O - https://github.com/amd/blis/releases/download/2.0/aocl-blis-mt-ubuntu-2.0.tar.gz | tar xfz -
|
||||
mv amd-blis-mt /usr/blis
|
||||
cd /
|
||||
rm -rf /tmp/blis
|
||||
|
||||
## rocBLAS Pre-requisites(SWDEV-404612)
|
||||
## Download aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
mkdir -p /tmp/aocl
|
||||
cd /tmp/aocl
|
||||
wget -nv https://download.amd.com/developer/eula/aocl/aocl-4-2/aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
apt install ./aocl-linux-gcc-4.2.0_1_amd64.deb
|
||||
# Download aocl-linux-aocc-4.0_1_amd64
|
||||
mkdir -p /tmp/aocl
|
||||
cd /tmp/aocl
|
||||
wget -nv https://download.amd.com/developer/eula/aocl/aocl-4-0/aocl-linux-aocc-4.0_1_amd64.deb
|
||||
apt install ./aocl-linux-aocc-4.0_1_amd64.deb
|
||||
rm -rf /tmp/aocl
|
||||
|
||||
## hipBLAS Pre-requisites
|
||||
## lapack(3.9.1v)
|
||||
## Reference https://github.com/ROCmSoftwarePlatform/rocSOLVER/blob/develop/install.sh#L174
|
||||
# lapack(3.9.1v)
|
||||
lapack_version=3.9.1
|
||||
lapack_srcdir=lapack-$lapack_version
|
||||
lapack_blddir=lapack-$lapack_version-bld
|
||||
mkdir -p /tmp/lapack
|
||||
cd /tmp/lapack
|
||||
rm -rf "$lapack_srcdir" "$lapack_blddir"
|
||||
wget -O - https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.9.1.tar.gz | tar xzf -
|
||||
rm -rf "$lapack_srcdir" "$lapack_blddir"
|
||||
wget -O - https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.9.1.tar.gz | tar xzf -
|
||||
cmake -H$lapack_srcdir -B$lapack_blddir -DCMAKE_BUILD_TYPE=Release -DCMAKE_Fortran_FLAGS=-fno-optimize-sibling-calls -DBUILD_TESTING=OFF -DCBLAS=ON -DLAPACKE=OFF
|
||||
make -j$(nproc) -C "$lapack_blddir"
|
||||
make -C "$lapack_blddir" install
|
||||
cd $lapack_blddir
|
||||
cp -r ./include/* /usr/local/include/
|
||||
cp -r ./lib/* /usr/local/lib
|
||||
cd /
|
||||
cp -r ./include/* /usr/local/include/
|
||||
cp -r ./lib/* /usr/local/lib
|
||||
cd /
|
||||
rm -rf /tmp/lapack
|
||||
|
||||
## rocSOLVER Pre-requisites
|
||||
## FMT(7.1.3v)
|
||||
## Reference https://github.com/ROCmSoftwarePlatform/rocSOLVER/blob/develop/install.sh#L152
|
||||
# FMT(7.1.3v)
|
||||
fmt_version=7.1.3
|
||||
fmt_srcdir=fmt-$fmt_version
|
||||
fmt_blddir=fmt-$fmt_version-bld
|
||||
@@ -142,32 +144,31 @@ make -j$(nproc) -C "$fmt_blddir"
|
||||
make -C "$fmt_blddir" install
|
||||
|
||||
# Build and install libjpeg-turbo
|
||||
mkdir -p /tmp/libjpeg-turbo
|
||||
cd /tmp/libjpeg-turbo
|
||||
mkdir -p /tmp/libjpeg-turbo
|
||||
cd /tmp/libjpeg-turbo
|
||||
wget -nv https://github.com/rrawther/libjpeg-turbo/archive/refs/heads/2.0.6.2.zip -O libjpeg-turbo-2.0.6.2.zip
|
||||
unzip libjpeg-turbo-2.0.6.2.zip
|
||||
unzip libjpeg-turbo-2.0.6.2.zip
|
||||
cd libjpeg-turbo-2.0.6.2
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..
|
||||
make -j$(nproc) install
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib ..
|
||||
make -j$(nproc) install
|
||||
rm -rf /tmp/libjpeg-turbo
|
||||
|
||||
# Get released ninja from source
|
||||
mkdir -p /tmp/ninja
|
||||
cd /tmp/ninja
|
||||
mkdir -p /tmp/ninja
|
||||
cd /tmp/ninja
|
||||
wget -nv https://codeload.github.com/Kitware/ninja/zip/refs/tags/v1.11.1.g95dee.kitware.jobserver-1 -O ninja.zip
|
||||
unzip ninja.zip
|
||||
cd ninja-1.11.1.g95dee.kitware.jobserver-1
|
||||
./configure.py --bootstrap
|
||||
cp ninja /usr/local/bin/
|
||||
./configure.py --bootstrap
|
||||
cp ninja /usr/local/bin/
|
||||
rm -rf /tmp/ninja
|
||||
|
||||
# Install FFmpeg and dependencies
|
||||
# Build NASM
|
||||
mkdir -p /tmp/nasm-2.15.05
|
||||
mkdir -p /tmp/nasm-2.15.05
|
||||
cd /tmp
|
||||
wget -qO- "https://distfiles.macports.org/nasm/nasm-2.15.05.tar.bz2" | tar -xvj
|
||||
wget -qO- "https://distfiles.macports.org/nasm/nasm-2.15.05.tar.bz2" | tar -xvj
|
||||
cd nasm-2.15.05
|
||||
./autogen.sh
|
||||
./configure --prefix="/usr/local"
|
||||
@@ -175,9 +176,9 @@ make -j$(nproc) install
|
||||
rm -rf /tmp/nasm-2.15.05
|
||||
|
||||
# Build YASM
|
||||
mkdir -p /tmp/yasm-1.3.0
|
||||
mkdir -p /tmp/yasm-1.3.0
|
||||
cd /tmp
|
||||
wget -qO- "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" | tar -xvz
|
||||
wget -qO- "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" | tar -xvz
|
||||
cd yasm-1.3.0
|
||||
./configure --prefix="/usr/local"
|
||||
make -j$(nproc) install
|
||||
@@ -201,7 +202,6 @@ cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="/usr/local" -DENABLE_SHARED:bo
|
||||
make -j$(nproc) install
|
||||
rm -rf /tmp/x265_2.7
|
||||
|
||||
|
||||
# Build fdk-aac
|
||||
mkdir -p /tmp/fdk-aac-2.0.2
|
||||
cd /tmp
|
||||
@@ -224,14 +224,14 @@ rm -rf /tmp/ffmpeg
|
||||
|
||||
cp /tmp/local-pin-600 /etc/apt/preferences.d
|
||||
|
||||
command -v lbzip2
|
||||
command -v lbzip2
|
||||
ln -sf $(command -v lbzip2) /usr/local/bin/compressor || ln -sf $(command -v bzip2) /usr/local/bin/compressor
|
||||
|
||||
# Install Google Benchmark (ROCMOPS-5283)
|
||||
mkdir -p /tmp/Gbenchmark
|
||||
cd /tmp/Gbenchmark
|
||||
wget -qO- https://github.com/google/benchmark/archive/refs/tags/v1.6.1.tar.gz | tar xz
|
||||
cmake -Sbenchmark-1.6.1 -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_CXX_STANDARD=14
|
||||
make -j -C build
|
||||
# Install Google Benchmark
|
||||
mkdir -p /tmp/Gbenchmark
|
||||
cd /tmp/Gbenchmark
|
||||
wget -qO- https://github.com/google/benchmark/archive/refs/tags/v1.6.1.tar.gz | tar xz
|
||||
cmake -Sbenchmark-1.6.1 -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_CXX_STANDARD=14
|
||||
make -j -C build
|
||||
cd /tmp/Gbenchmark/build
|
||||
make install
|
||||
|
||||
3
tools/rocm-build/docker/ubuntu24/local-pin-600
Normal file
3
tools/rocm-build/docker/ubuntu24/local-pin-600
Normal file
@@ -0,0 +1,3 @@
|
||||
Package: *
|
||||
Pin: origin ""
|
||||
Pin-Priority: 600
|
||||
@@ -1,4 +1,3 @@
|
||||
# List of packages needed for stage1 build
|
||||
apt-utils
|
||||
aria2
|
||||
autoconf
|
||||
@@ -8,7 +7,6 @@ bison
|
||||
bridge-utils
|
||||
build-essential
|
||||
bzip2
|
||||
ccache
|
||||
check
|
||||
chrpath
|
||||
cifs-utils
|
||||
@@ -23,7 +21,6 @@ flex
|
||||
freeglut3-dev
|
||||
g++
|
||||
g++-multilib
|
||||
# gawk is needed for aomp
|
||||
gawk
|
||||
gcc
|
||||
gcc-multilib
|
||||
@@ -33,10 +30,8 @@ gnupg
|
||||
googletest
|
||||
graphviz
|
||||
kernel-wedge
|
||||
# kmod for kernel build
|
||||
kmod
|
||||
lbzip2
|
||||
# less is needed by repo
|
||||
less
|
||||
libass-dev
|
||||
libatlas-base-dev
|
||||
@@ -80,6 +75,7 @@ libncurses-dev
|
||||
libnuma-dev
|
||||
libomp-dev
|
||||
libopenblas-dev
|
||||
libopencv-dev
|
||||
libpci-dev
|
||||
libpci3
|
||||
libpciaccess-dev
|
||||
@@ -104,6 +100,8 @@ mesa-common-dev
|
||||
mpich
|
||||
ocaml
|
||||
ocaml-findlib
|
||||
ocl-icd-libopencl1
|
||||
ocl-icd-opencl-dev
|
||||
patchelf
|
||||
pigz
|
||||
pkg-config
|
||||
@@ -116,14 +114,11 @@ python3-pip-whl
|
||||
python3-requests
|
||||
python3-venv
|
||||
python3-yaml
|
||||
python3-yaml
|
||||
re2c
|
||||
redis-tools
|
||||
# hipclang needs rpm
|
||||
rpm
|
||||
rsync
|
||||
ssh
|
||||
# This makes life more pleasent inside the container
|
||||
strace
|
||||
sudo
|
||||
systemtap-sdt-dev
|
||||
|
||||
@@ -23,7 +23,7 @@ if [ "$DASH_JAY" == "" ]; then
|
||||
fi
|
||||
|
||||
export JOB_NAME=release
|
||||
export JOB_DESIGNATOR=
|
||||
export JOB_DESIGNATOR="${JOB_DESIGNATOR-"local."}"
|
||||
echo "JOB_DESIGNATOR=${JOB_DESIGNATOR}"
|
||||
export SLES_BUILD_ID_PREFIX
|
||||
echo "SLES_BUILD_ID_PREFIX=${SLES_BUILD_ID_PREFIX}"
|
||||
@@ -47,7 +47,6 @@ case "${DISTRO_NAME}" in
|
||||
("centos") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ;;
|
||||
("sles") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ;;
|
||||
("rhel") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ;;
|
||||
("mariner") export CPACKGEN=RPM PACKAGEEXT=rpm PKGTYPE=rpm ;;
|
||||
esac
|
||||
|
||||
# set up package file name variables for CPACK_GENERATOR
|
||||
@@ -82,7 +81,7 @@ if [ -f "${WORK_ROOT}/build/rocm_version.txt" ] && [ -z $ROCM_VERSION ]; then
|
||||
ROCM_VERSION="$(cat ${WORK_ROOT}/build/rocm_version.txt)"
|
||||
fi
|
||||
|
||||
: ${ROCM_VERSION:="6.1.0"}
|
||||
: ${ROCM_VERSION:="6.3.0"}
|
||||
ROCM_LIBPATCH_VERSION=$(get_rocm_libpatch_version $ROCM_VERSION)
|
||||
echo "ROCM_VERSION=${ROCM_VERSION}"
|
||||
echo "ROCM_LIBPATCH_VERSION=${ROCM_LIBPATCH_VERSION}"
|
||||
@@ -111,6 +110,7 @@ export DIST_NO_DEBUG=yes
|
||||
export OPENCL_MAINLINE=1
|
||||
export HSA_SOURCE_ROOT=$WORK_ROOT/ROCR-Runtime
|
||||
export HSA_OPENSOURCE_ROOT=$HSA_SOURCE_ROOT/src
|
||||
export ROCR_ROOT=$WORK_ROOT/ROCR-Runtime
|
||||
export ROCRTST_ROOT=$HSA_SOURCE_ROOT/rocrtst
|
||||
export HSA_CORE_ROOT=$HSA_OPENSOURCE_ROOT
|
||||
export HSA_IMAGE_ROOT=$HSA_OPENSOURCE_ROOT/hsa-ext-image
|
||||
@@ -119,16 +119,14 @@ export HSA_TOOLS_ROOT=$HSA_OPENSOURCE_ROOT/hsa-runtime-tools
|
||||
export OCL_RT_SRC_TF_ROOT=$SRC_TF_ROOT/ocl_lc
|
||||
export SCRIPT_ROOT=$WORK_ROOT/build
|
||||
export THUNK_ROOT=$WORK_ROOT/ROCT-Thunk-Interface
|
||||
if [ -d "$HSA_OPENSOURCE_ROOT/ROCT-Thunk-Interface" ]; then
|
||||
export THUNK_ROOT=$HSA_OPENSOURCE_ROOT/ROCT-Thunk-Interface
|
||||
fi
|
||||
export AQLPROFILE_ROOT=$WORK_ROOT/hsa/aqlprofile
|
||||
export OMNIPERF_ROOT=$WORK_ROOT/omniperf
|
||||
|
||||
export AQLPROFILE_ROOT=$WORK_ROOT/aqlprofile
|
||||
export ROCPROFILER_ROOT=$WORK_ROOT/rocprofiler
|
||||
export ROCTRACER_ROOT=$WORK_ROOT/roctracer
|
||||
export ROCPROFILER_REGISTER_ROOT=$WORK_ROOT/rocprofiler-register
|
||||
export ROCPROFILER_SDK_ROOT=$WORK_ROOT/rocprofiler-sdk
|
||||
export OMNITRACE_ROOT=$WORK_ROOT/omnitrace
|
||||
export ROCPROFILER_COMPUTE_ROOT=$WORK_ROOT/rocprofiler-compute
|
||||
export ROCPROFILER_SYSTEMS_ROOT=$WORK_ROOT/rocprofiler-systems
|
||||
export RDC_ROOT=$WORK_ROOT/rdc
|
||||
export RDCTST_ROOT=$RDC_ROOT/tests/rdc_tests
|
||||
export UTILS_ROOT=$WORK_ROOT/rocm-utils
|
||||
@@ -181,7 +179,7 @@ export BUILD_ARTIFACTS=$OUT_DIR/$PACKAGEEXT
|
||||
export HIPCC_COMPILE_FLAGS_APPEND="-O3 -Wno-format-nonliteral -parallel-jobs=4"
|
||||
export HIPCC_LINK_FLAGS_APPEND="-O3 -parallel-jobs=4"
|
||||
|
||||
export PATH="${ROCM_PATH}/bin:${ROCM_PATH}/lib/llvm/bin:${PATH}"
|
||||
export PATH="${ROCM_PATH}/bin:${ROCM_PATH}/lib/llvm/bin:${PATH}:${HOME}/.local/bin"
|
||||
|
||||
export LC_ALL=C.UTF-8
|
||||
export LANG=C.UTF-8
|
||||
@@ -189,5 +187,5 @@ export LANG=C.UTF-8
|
||||
export PROC=${PROC:-"$(nproc)"}
|
||||
export RELEASE_FLAG=${RELEASE_FLAG:-"-r"}
|
||||
export SUDO=sudo
|
||||
export PATH=/usr/local/bin:${PATH}:${HOME}/.local/bin
|
||||
export PATH=/usr/local/bin:${PATH}:/sbin:/bin
|
||||
export CCACHE_DIR=${HOME}/.ccache
|
||||
|
||||
@@ -5,6 +5,12 @@ set -x
|
||||
|
||||
UNTAR_COMPONENT_NAME=$1
|
||||
|
||||
# Static supported components
|
||||
STATIC_SUPPORTED_COMPONENTS="comgr devicelibs hip_on_rocclr hipblas hipblas-common hipcc hiprand hipsolver hipsparse lightning openmp_extras rocblas rocm rocm_smi_lib rocm-cmake rocm-core rocminfo rocprim rocprofiler_register rocr rocrand rocsolver rocsparse"
|
||||
if [ "${ENABLE_STATIC_BUILDS}" == "true" ] && ! echo "$STATIC_SUPPORTED_COMPONENTS" | grep -qE "(^| )$UNTAR_COMPONENT_NAME( |$)"; then
|
||||
echo "Static build is not enabled for $UNTAR_COMPONENT_NAME ..skipping!!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
copy_pkg_files_to_rocm() {
|
||||
local comp_folder=$1
|
||||
@@ -61,17 +67,16 @@ case $UNTAR_COMPONENT_NAME in
|
||||
elif [ -e "${ROCM_PATH}/llvm/bin/rocm.cfg" ]; then
|
||||
sed -i '/-frtlib-add-rpath/d' ${ROCM_PATH}/llvm/bin/rocm.cfg
|
||||
fi
|
||||
|
||||
ln -s "${ROCM_PATH}/lib/llvm/bin/amdclang" "${ROCM_PATH}/bin/amdclang" || true
|
||||
ln -s "${ROCM_PATH}/lib/llvm/bin/amdclang++" "${ROCM_PATH}/bin/amdclang++" || true
|
||||
;;
|
||||
(hipify_clang)
|
||||
copy_pkg_files_to_rocm hipify hipify-clang
|
||||
chmod +x ${ROCM_PATH}/bin/hipify-perl
|
||||
;;
|
||||
(hip_on_rocclr)
|
||||
rm -f ${ROCM_PATH}/bin/hipcc.bat
|
||||
;;
|
||||
(openmp_extras)
|
||||
copy_pkg_files_to_rocm openmp-extras openmp-extras-runtime
|
||||
copy_pkg_files_to_rocm openmp-extras openmp-extras-dev
|
||||
;;
|
||||
(rocblas)
|
||||
copy_pkg_files_to_rocm rocblas rocblas-dev
|
||||
;;
|
||||
|
||||
77
tools/rocm-build/rocm-6.3.0.xml
Normal file
77
tools/rocm-build/rocm-6.3.0.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<manifest>
|
||||
<remote name="rocm-org" fetch="https://github.com/ROCm/" />
|
||||
<default revision="refs/tags/rocm-6.3.0"
|
||||
remote="rocm-org"
|
||||
sync-c="true"
|
||||
sync-j="4" />
|
||||
<!--list of projects for ROCm-->
|
||||
<project name="ROCm" revision="roc-6.3.x" />
|
||||
<project name="ROCK-Kernel-Driver" />
|
||||
<project name="ROCR-Runtime" />
|
||||
<project name="amdsmi" />
|
||||
<project name="rdc" />
|
||||
<project name="rocm_bandwidth_test" />
|
||||
<project name="rocm_smi_lib" />
|
||||
<project name="rocm-core" />
|
||||
<project name="rocm-examples" />
|
||||
<project name="rocminfo" />
|
||||
<project name="rocprofiler" />
|
||||
<project name="rocprofiler-register" />
|
||||
<project name="rocprofiler-sdk" />
|
||||
<project name="rocprofiler-compute" />
|
||||
<project name="rocprofiler-systems" />
|
||||
<project name="roctracer" />
|
||||
<!--HIP Projects-->
|
||||
<project name="HIP" />
|
||||
<project name="hip-tests" />
|
||||
<project name="HIPIFY" />
|
||||
<project name="clr" />
|
||||
<project name="hipother" />
|
||||
<!-- The following projects are all associated with the AMDGPU LLVM compiler -->
|
||||
<project name="half" />
|
||||
<project name="llvm-project" />
|
||||
<!-- gdb projects -->
|
||||
<project name="ROCdbgapi" />
|
||||
<project name="ROCgdb" />
|
||||
<project name="rocr_debug_agent" />
|
||||
<!-- ROCm Libraries -->
|
||||
<project groups="mathlibs" name="AMDMIGraphX" />
|
||||
<project groups="mathlibs" name="MIOpen" />
|
||||
<project groups="mathlibs" name="MIVisionX" />
|
||||
<project groups="mathlibs" name="ROCmValidationSuite" />
|
||||
<project groups="mathlibs" name="Tensile" />
|
||||
<project groups="mathlibs" name="composable_kernel" />
|
||||
<project groups="mathlibs" name="hipBLAS-common" />
|
||||
<project groups="mathlibs" name="hipBLAS" />
|
||||
<project groups="mathlibs" name="hipBLASLt" />
|
||||
<project groups="mathlibs" name="hipCUB" />
|
||||
<project groups="mathlibs" name="hipFFT" />
|
||||
<project groups="mathlibs" name="hipRAND" />
|
||||
<project groups="mathlibs" name="hipSOLVER" />
|
||||
<project groups="mathlibs" name="hipSPARSE" />
|
||||
<project groups="mathlibs" name="hipSPARSELt" />
|
||||
<project groups="mathlibs" name="hipTensor" />
|
||||
<project groups="mathlibs" name="hipfort" />
|
||||
<project groups="mathlibs" name="rccl" />
|
||||
<project groups="mathlibs" name="rocAL" />
|
||||
<project groups="mathlibs" name="rocALUTION" />
|
||||
<project groups="mathlibs" name="rocBLAS" />
|
||||
<project groups="mathlibs" name="rocDecode" />
|
||||
<project groups="mathlibs" name="rocJPEG" />
|
||||
<project groups="mathlibs" name="rocPyDecode" />
|
||||
<project groups="mathlibs" name="rocFFT" />
|
||||
<project groups="mathlibs" name="rocPRIM" />
|
||||
<project groups="mathlibs" name="rocRAND" />
|
||||
<project groups="mathlibs" name="rocSOLVER" />
|
||||
<project groups="mathlibs" name="rocSPARSE" />
|
||||
<project groups="mathlibs" name="rocThrust" />
|
||||
<project groups="mathlibs" name="rocWMMA" />
|
||||
<project groups="mathlibs" name="rocm-cmake" />
|
||||
<project groups="mathlibs" name="rpp" />
|
||||
<project groups="mathlibs" name="TransferBench" />
|
||||
<!-- Projects for OpenMP-Extras -->
|
||||
<project name="aomp" path="openmp-extras/aomp" />
|
||||
<project name="aomp-extras" path="openmp-extras/aomp-extras" />
|
||||
<project name="flang" path="openmp-extras/flang" />
|
||||
</manifest>
|
||||
Reference in New Issue
Block a user