#!/bin/sh # get fedora/ubuntu install script mess # git clone https://github.com/RadeonOpenCompute/Experimental_ROC.git # grab ROCm #mkdir -p ~/ROCm/ #cd ~/ROCm/ #repo init -u https://github.com/RadeonOpenCompute/ROCm.git -b roc-2.4.0 #repo sync roct rocr rocm_smi rocm_cmake rocprofiler rocm_device_libs hcc //builds llvm comgr //builds llvm hip //fixme: looking for comgr in /usr/lib/ clang-ocl opencl //builds llvm fixme: puts files in /usr/lib64/lib/ atmi #${BASE_DIR}/component_scripts/01_00_rock-dkms.sh "$@" ${BASE_DIR}/component_scripts/01_01_roct.sh "$@" ${BASE_DIR}/component_scripts/01_02_rocr.sh "$@" ${BASE_DIR}/component_scripts/01_03_rocm_smi.sh "$@" ${BASE_DIR}/component_scripts/01_04_rocm_cmake.sh "$@" ${BASE_DIR}/component_scripts/01_05_rocminfo.sh "$@" ${BASE_DIR}/component_scripts/01_06_rocprofiler.sh "$@" ${BASE_DIR}/component_scripts/01_07_opencl.sh "$@" ${BASE_DIR}/component_scripts/01_08_clang-ocl.sh "$@" ${BASE_DIR}/component_scripts/01_09_hcc.sh "$@" ${BASE_DIR}/component_scripts/01_10_hip.sh "$@" ${BASE_DIR}/component_scripts/01_11_rocm_device_libs.sh "$@" ${BASE_DIR}/component_scripts/01_12_atmi.sh "$@" ${BASE_DIR}/component_scripts/01_13_comgr.sh "$@" ${BASE_DIR}/component_scripts/01_14_rocr_debug_agent.sh "$@" ${BASE_DIR}/component_scripts/01_15_rocm_bandwidth_test.sh "$@" ${BASE_DIR}/component_scripts/01_16_rocm_meta_packages.sh "$@" PKGNAM=poppler VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} BUILD=${BUILD:-1} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) export ARCH=i586 ;; arm*) export ARCH=arm ;; # Unless $ARCH is already set, use uname -m for all other archs: *) export ARCH=$( uname -m ) ;; esac fi if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} # Set to 1 if you'd like to install/upgrade package as they are built. # This is recommended. INST=1 TMP=${TMP:-/tmp} PKG=$TMP/package-${PKGNAM} rm -rf $PKG mkdir -p $TMP $PKG cd $TMP || exit 1 rm -rf ${PKGNAM}-${VERSION} tar xvf $CWD/${PKGNAM}-$VERSION.tar.?z* || exit 1 cd ${PKGNAM}-$VERSION || exit 1 chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ -exec chmod 755 {} \; -o \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; for package in \ ROCT-Thunk-Interface \ ROCR-Runtime \ ROC-smi \ rocm-cmake \ rocminfo \ rocprofiler \ ROCm-OpenCL-Runtime \ clang-ocl \ hcc \ HIP \ ROCm-Device-Libs \ atmi \ ROCm-CompilerSupport \ comgr requires AMD's LLVM, which is not installed from packages by default. rocr_debug_agent \ rocm_bandwidth_test \ meta \ # Our three utilities/base ROCm meta-packages are: # * rocm-dkms, which depends/installs: rocm-dev # * rocm-dev, which depends/installs: hsa-rocr-dev, hsa-ext-rocr-dev, # rocm-device-libs, rocm-utils, hcc, hip_base, hip_doc, hip_hcc, # hip_samples, rocm-smi, hsakmt-roct, hsakmt-roct-dev, comgr, and # rocr_debug_agent # - The binary-source version of this package also installs the # closed-source hsa-ext-rocr-dev and hsa-amd-aqlprofile. We skip # those for this open source build. # * rocm-utils, which depends/installs: rocminfo, rocm-clang-ocl, and # rocm-cmake ; do cd $package || exit 1 ./${package}.SlackBuild || ( touch /tmp/${package}.failed ; exit 1 ) || exit 1 if [ "$INST" = "1" ]; then PACKAGE="$(ls -t $TMP/$(ls ${package}*.xz | rev | cut -f2- -d - | rev)-*txz | head -n 1)" if [ -f $PACKAGE ]; then upgradepkg --install-new --reinstall $PACKAGE else echo "Error: package to upgrade "$PACKAGE" not found in $TMP" exit 1 fi fi cd .. done # Build, and install ROCt cd ${SOURCE_DIR}/ROCT-Thunk-Interface/ mkdir -p build cd build cmake .. -DCMAKE_BUILD_TYPE=${ROCM_CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${ROCM_OUTPUT_DIR}/ -DCPACK_PACKAGING_INSTALL_PREFIX=${ROCM_OUTPUT_DIR}/ -DCPACK_GENERATOR=RPM ${ROCM_CPACK_RPM_PERMISSIONS} make -j `nproc` make -j `nproc` build-dev CXXFLAGS="$SLKCFLAGS" \ CFLAGS="$SLKCFLAGS" \ cmake \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Release \ .. || exit 1 make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 # Back to source tarball root directory: cd .. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null cd $PKG /sbin/makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz