From 2b8a1b00d8a5121c98cd6f10089447531ed18c6f Mon Sep 17 00:00:00 2001 From: Soren Soe Date: Thu, 8 Nov 2018 18:56:29 -0800 Subject: [PATCH 1/5] Merged commit 09b9363 from Xilinx:master to Xilinx:2018.2_XDF --- src/runtime_src/tools/scripts/xrtdeps.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/runtime_src/tools/scripts/xrtdeps.sh b/src/runtime_src/tools/scripts/xrtdeps.sh index d9a717cbf80..49aa907bc5e 100755 --- a/src/runtime_src/tools/scripts/xrtdeps.sh +++ b/src/runtime_src/tools/scripts/xrtdeps.sh @@ -177,13 +177,15 @@ install() # Enable EPEL on CentOS/RHEL if [ $FLAVOR == "centos" ]; then echo "Enabling EPEL repository..." - sudo yum install epel-release + ${SUDO} yum install -y epel-release + echo "Installing cmake3 from EPEL repository..." + ${SUDO} yum install -y cmake3 elif [ $FLAVOR == "rhel" ]; then echo "Enabling EPEL repository..." rpm -q --quiet epel-release if [ $? != 0 ]; then - sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - sudo yum check-update + ${SUDO} yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + ${SUDO} yum check-update fi fi @@ -193,13 +195,13 @@ install() sudo yum-config-manager --enable rhel-server-rhscl-7-rpms elif [ $FLAVOR == "centos" ]; then echo "Enabling CentOS SCL repository..." - sudo yum --enablerepo=extras install centos-release-scl + ${SUDO} yum --enablerepo=extras install -y centos-release-scl fi if [ $FLAVOR == "rhel" ] || [ $FLAVOR == "centos" ]; then echo "Installing RHEL/CentOS packages..." - sudo yum install -y "${RH_LIST[@]}" - sudo yum install devtoolset-6 + ${SUDO} yum install -y "${RH_LIST[@]}" + ${SUDO} yum install -y devtoolset-6 fi } From e92a489f499ea7f4b9de7ec6601eeb8bb09bc2e2 Mon Sep 17 00:00:00 2001 From: Soren Soe Date: Fri, 9 Nov 2018 08:31:37 -0800 Subject: [PATCH 2/5] Merged commit eea19ac from Xilinx:master to Xilinx:2018.2_XDF --- build/build.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/build/build.sh b/build/build.sh index 86358bf738a..83dbcb5f073 100755 --- a/build/build.sh +++ b/build/build.sh @@ -2,8 +2,18 @@ set -e +OSDIST=`lsb_release -i |awk -F: '{print tolower($2)}' | tr -d ' \t'` BUILDDIR=$(readlink -f $(dirname ${BASH_SOURCE[0]})) CORE=`grep -c ^processor /proc/cpuinfo` +CMAKE=cmake + +if [[ $OSDIST == "centos" ]]; then + CMAKE=cmake3 + if [[ ! -x "$(command -v $CMAKE)" ]]; then + echo "$CMAKE is not installed, please run xrtdeps.sh" + exit 1 + fi +fi usage() { @@ -103,20 +113,22 @@ if [[ $covbuild == 1 ]]; then fi mkdir -p Coverity cd Coverity - cmake -DCMAKE_BUILD_TYPE=Release ../../src - make -j $CORE COVUSER=$covuser COVPW=$covpw DATE="`git rev-parse --short HEAD`" coverity + $CMAKE -DCMAKE_BUILD_TYPE=Release ../../src + make COVUSER=$covuser COVPW=$covpw DATE="`git rev-parse --short HEAD`" coverity cd $here exit 0 fi mkdir -p Debug Release cd Debug -time cmake -DRDI_CCACHE=$ccache -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ../../src +echo "$CMAKE -DRDI_CCACHE=$ccache -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ../../src" +time $CMAKE -DRDI_CCACHE=$ccache -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ../../src time make -j $jcore $verbose DESTDIR=$PWD install cd $BUILDDIR cd Release -time cmake -DRDI_CCACHE=$ccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ../../src +echo "$CMAKE -DRDI_CCACHE=$ccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ../../src" +time $CMAKE -DRDI_CCACHE=$ccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ../../src time make -j $jcore $verbose DESTDIR=$PWD install time make package cd $here From 94e19c86cccda1821f59be6a332d93ff0d058625 Mon Sep 17 00:00:00 2001 From: Soren Soe Date: Tue, 13 Nov 2018 11:04:26 -0800 Subject: [PATCH 3/5] Merge pull request #656 from stsoe/pr-647 Amend AWS changes --- build/build.sh | 1 + src/CMake/config/dkms-awsmgmt/dkms.conf.in | 8 +++ src/CMake/config/{ => dkms-xocl}/dkms.conf.in | 0 src/CMake/config/postinst-aws.in | 34 ++++++++++ src/CMake/config/prerm-aws.in | 14 +++++ src/CMake/config/xrt-aws.pc.in | 11 ++++ src/CMake/cpack.cmake | 35 ++++++++++- src/CMake/dkms-aws.cmake | 59 ++++++++++++++++++ src/CMake/dkms.cmake | 2 +- src/CMake/pkgconfig.cmake | 62 ++++++++++++++----- src/CMakeLists.txt | 8 ++- src/runtime_src/driver/xclng/CMakeLists.txt | 6 +- .../driver/xclng/tools/awssak/CMakeLists.txt | 5 +- .../driver/xclng/xrt/CMakeLists.txt | 21 ++++--- 14 files changed, 233 insertions(+), 33 deletions(-) create mode 100644 src/CMake/config/dkms-awsmgmt/dkms.conf.in rename src/CMake/config/{ => dkms-xocl}/dkms.conf.in (100%) create mode 100755 src/CMake/config/postinst-aws.in create mode 100755 src/CMake/config/prerm-aws.in create mode 100644 src/CMake/config/xrt-aws.pc.in create mode 100644 src/CMake/dkms-aws.cmake diff --git a/build/build.sh b/build/build.sh index 83dbcb5f073..d6e2a4149db 100755 --- a/build/build.sh +++ b/build/build.sh @@ -130,5 +130,6 @@ cd Release echo "$CMAKE -DRDI_CCACHE=$ccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ../../src" time $CMAKE -DRDI_CCACHE=$ccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ../../src time make -j $jcore $verbose DESTDIR=$PWD install +#time make xrtpkg time make package cd $here diff --git a/src/CMake/config/dkms-awsmgmt/dkms.conf.in b/src/CMake/config/dkms-awsmgmt/dkms.conf.in new file mode 100644 index 00000000000..972dcd6d9f9 --- /dev/null +++ b/src/CMake/config/dkms-awsmgmt/dkms.conf.in @@ -0,0 +1,8 @@ +PACKAGE_NAME="xrt-awsmgmt" +PACKAGE_VERSION="@XRT_VERSION_STRING@" +MAKE[0]="cd driver/aws/kernel/mgmt; make; cd ../../../.." +CLEAN="cd driver/aws/kernel/mgmt; make clean; cd ../../../.." +BUILT_MODULE_NAME[0]="awsmgmt" +BUILT_MODULE_LOCATION[0]="driver/aws/kernel/mgmt" +DEST_MODULE_LOCATION[0]="/kernel/extras" +AUTOINSTALL="yes" diff --git a/src/CMake/config/dkms.conf.in b/src/CMake/config/dkms-xocl/dkms.conf.in similarity index 100% rename from src/CMake/config/dkms.conf.in rename to src/CMake/config/dkms-xocl/dkms.conf.in diff --git a/src/CMake/config/postinst-aws.in b/src/CMake/config/postinst-aws.in new file mode 100755 index 00000000000..8f2abacf38e --- /dev/null +++ b/src/CMake/config/postinst-aws.in @@ -0,0 +1,34 @@ +#!/bin/sh + +if [ -n "`dkms status -m xrt-aws -v @XRT_VERSION_STRING@`" ]; then + echo "Unloading old XRT Linux kernel modules" + modprobe -r awsmgmt + + echo "Unregistering old XRT Linux kernel module sources @XRT_VERSION_STRING@ from dkms" + dkms remove -m xrt-aws -v @XRT_VERSION_STRING@ --all + find /lib/modules -type f -name awsmgmt.ko -delete + find /lib/modules -type f -name awsmgmt.ko.kz -delete + depmod -A +fi + +if [ -z "`dkms status -m xrt-aws -v @XRT_VERSION_STRING@`" ]; then + echo "Registering new XRT Linux kernel module sources @XRT_VERSION_STRING@ with dkms" + dkms add -m xrt-aws -v "@XRT_VERSION_STRING@" +fi + +if [ -e /lib/modules/`uname -r`/build/include ]; then + echo "Building XRT Linux kernel modules sources with dkms" + dkms build -m xrt-aws -v "@XRT_VERSION_STRING@" + echo "Installing XRT Linux kernel modules sources with dkms" + dkms install -m xrt-aws -v "@XRT_VERSION_STRING@" --force + install -m 644 /usr/src/xrt-aws-@XRT_VERSION_STRING@/driver/aws/kernel/mgmt/10-awsmgmt.rules /etc/udev/rules.d + + echo "Loading new XRT Linux kernel modules" + udevadm control --reload-rules + modprobe awsmgmt + udevadm trigger +else + echo "Build/Install of XRT Linux kernel modules skipped since Linux kernel headers are not installed" +fi + +exit 0 diff --git a/src/CMake/config/prerm-aws.in b/src/CMake/config/prerm-aws.in new file mode 100755 index 00000000000..567a1071582 --- /dev/null +++ b/src/CMake/config/prerm-aws.in @@ -0,0 +1,14 @@ +#!/bin/sh + +echo "Unloading old XRT Linux kernel modules" +modprobe -r awsmgmt + +echo "Unregistering XRT Linux kernel module sources @XRT_VERSION_STRING@ from dkms" +dkms remove -m xrt-aws -v @XRT_VERSION_STRING@ --all +find /lib/modules -type f -name awsmgmt.ko -delete +find /lib/modules -type f -name awsmgmt.ko.kz -delete +depmod -A + +rm -f /etc/udev/rules.d/10-awsmgmt.rules + +exit 0 diff --git a/src/CMake/config/xrt-aws.pc.in b/src/CMake/config/xrt-aws.pc.in new file mode 100644 index 00000000000..c748ac806af --- /dev/null +++ b/src/CMake/config/xrt-aws.pc.in @@ -0,0 +1,11 @@ +prefix=@XRT_INSTALL_DIR@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: libxrt-aws +Description: Xilinx AWS HAL Library +Version: 2.1.0 +Requires: xrt >= 2.1.0 +Libs: -L${libdir} -lxrt-aws +Cflags: -I${includedir} diff --git a/src/CMake/cpack.cmake b/src/CMake/cpack.cmake index c10e939280d..5f32268a78b 100644 --- a/src/CMake/cpack.cmake +++ b/src/CMake/cpack.cmake @@ -11,6 +11,10 @@ SET(CPACK_PACKAGE_VERSION_MINOR "${XRT_VERSION_MINOR}") SET(CPACK_PACKAGE_VERSION_PATCH "${XRT_VERSION_PATCH}") SET(CPACK_PACKAGE_NAME "xrt") +SET(CPACK_ARCHIVE_COMPONENT_INSTALL ON) +SET(CPACK_DEB_COMPONENT_INSTALL ON) +SET(CPACK_RPM_COMPONENT_INSTALL ON) + execute_process( COMMAND lsb_release -r -s OUTPUT_VARIABLE CPACK_REL_VER @@ -21,16 +25,34 @@ SET(PACKAGE_KIND "TGZ") if (${LINUX_FLAVOR} STREQUAL Ubuntu) SET(CPACK_GENERATOR "DEB;TGZ") SET(PACKAGE_KIND "DEB") + # Modify the package name for the xrt component + # Syntax is set(CPACK___PACKAGE_NAME ") + SET(CPACK_DEBIAN_XRT_PACKAGE_NAME "xrt") + SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/postinst;${CMAKE_CURRENT_BINARY_DIR}/prerm") + SET(CPACK_DEBIAN_AWS_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/postinst-aws;${CMAKE_CURRENT_BINARY_DIR}/prerm-aws") SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "OFF") - set(CPACK_DEBIAN_PACKAGE_DEPENDS "ocl-icd-opencl-dev (>= 2.2.0), libboost-dev (>=1.58), libboost-filesystem-dev (>=1.58), uuid-dev (>= 2.27.1), dkms (>= 2.2.0), libprotoc-dev (>=2.6.1), protobuf-compiler (>=2.6.1), libncurses5-dev (>=6.0), lsb-release, libxml2-dev (>=2.9.1), libyaml-dev (>= 0.1.6)") + # aws component dependencies + SET(CPACK_DEBIAN_AWS_PACKAGE_DEPENDS "xrt (>= ${XRT_VERSION_MAJOR}.${XRT_VERSION_MINOR}.${XRT_VERSION_PATCH})") + # xrt component dependencies + SET(CPACK_DEBIAN_XRT_PACKAGE_DEPENDS "ocl-icd-opencl-dev (>= 2.2.0), libboost-dev (>=1.58), libboost-filesystem-dev (>=1.58), uuid-dev (>= 2.27.1), dkms (>= 2.2.0), libprotoc-dev (>=2.6.1), protobuf-compiler (>=2.6.1), libncurses5-dev (>=6.0), lsb-release, libxml2-dev (>=2.9.1), libyaml-dev (>= 0.1.6)") + elseif (${LINUX_FLAVOR} MATCHES "^(RedHat|CentOS)") SET(CPACK_GENERATOR "RPM;TGZ") SET(PACKAGE_KIND "RPM") + # Modify the package name for the xrt component + # Syntax is set(CPACK___PACKAGE_NAME ") + set(CPACK_RPM_XRT_PACKAGE_NAME "xrt") + SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/postinst") SET(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/prerm") + SET(CPACK_RPM_AWS_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/postinst-aws") + SET(CPACK_RPM_AWS_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/prerm-aws") SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/local" "/usr/src" "/opt" "/etc/OpenCL" "/etc/OpenCL/vendors" "/usr/lib" "/usr/lib/pkgconfig" "/usr/lib64/pkgconfig") - set(CPACK_RPM_PACKAGE_REQUIRES "ocl-icd-devel >= 2.2, boost-devel >= 1.53, boost-filesystem >= 1.53, libuuid-devel >= 2.23.2, dkms >= 2.5.0, protobuf-devel >= 2.5.0, protobuf-compiler >= 2.5.0, ncurses-devel >= 5.9, redhat-lsb-core, libxml2-devel >= 2.9.1, libyaml-devel >= 0.1.4 ") + # aws component dependencies + SET(CPACK_RPM_AWS_PACKAGE_REQUIRES "xrt >= ${XRT_VERSION_MAJOR}.${XRT_VERSION_MINOR}.${XRT_VERSION_PATCH}") + # xrt component dependencies + SET(CPACK_RPM_XRT_PACKAGE_REQUIRES "ocl-icd-devel >= 2.2, boost-devel >= 1.53, boost-filesystem >= 1.53, libuuid-devel >= 2.23.2, dkms >= 2.5.0, protobuf-devel >= 2.5.0, protobuf-compiler >= 2.5.0, ncurses-devel >= 5.9, redhat-lsb-core, libxml2-devel >= 2.9.1, libyaml-devel >= 0.1.4 ") else () SET (CPACK_GENERATOR "TGZ") endif() @@ -44,4 +66,13 @@ SET(CPACK_PACKAGE_CONTACT "sonal.santan@xilinx.com") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Xilinx RunTime stack for use with Xilinx FPGA platforms") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/../LICENSE") +add_custom_target(xrtpkg + echo "COMMAND ${CMAKE_CPACK_COMMAND}" + COMMAND ${CMAKE_CPACK_COMMAND} + COMMAND -mv -f ${CPACK_PACKAGE_FILE_NAME}-xrt.deb ${CPACK_PACKAGE_FILE_NAME}.deb 2> /dev/null + COMMAND -mv -f ${CPACK_PACKAGE_FILE_NAME}-xrt.rpm ${CPACK_PACKAGE_FILE_NAME}.rpm 2> /dev/null + COMMAND -mv -f ${CPACK_PACKAGE_FILE_NAME}-xrt.tar.gz ${CPACK_PACKAGE_FILE_NAME}.tar.gz 2> /dev/null + +) + INCLUDE(CPack) diff --git a/src/CMake/dkms-aws.cmake b/src/CMake/dkms-aws.cmake new file mode 100644 index 00000000000..abc75d823a8 --- /dev/null +++ b/src/CMake/dkms-aws.cmake @@ -0,0 +1,59 @@ +# Custom variables imported by this CMake stub which should be defined by parent CMake: +# XRT_DKMS_DRIVER_SRC_BASE_DIR + +set(XRT_DKMS_INSTALL_DIR_aws "/usr/src/xrt-aws-${XRT_VERSION_STRING}") + +message("-- XRT DRIVER SRC BASE DIR ${XRT_DKMS_DRIVER_SRC_BASE_DIR}") + +set(DKMS_FILE_NAME "dkms.conf") +set(DKMS_POSTINST "postinst-aws") +set(DKMS_PRERM "prerm-aws") + +configure_file( + "${CMAKE_SOURCE_DIR}/CMake/config/dkms-awsmgmt/${DKMS_FILE_NAME}.in" + "dkms-awsmgmt/${DKMS_FILE_NAME}" + ) + +configure_file( + "${CMAKE_SOURCE_DIR}/CMake/config/${DKMS_POSTINST}.in" + "${DKMS_POSTINST}" + ) + +configure_file( + "${CMAKE_SOURCE_DIR}/CMake/config/${DKMS_PRERM}.in" + "${DKMS_PRERM}" + ) + +set(XRT_DKMS_SRCS_aws + driver/aws/kernel/mgmt/mgmt-bit.c + driver/aws/kernel/mgmt/mgmt-bit.h + driver/aws/kernel/mgmt/mgmt-core.c + driver/aws/kernel/mgmt/mgmt-core.h + driver/aws/kernel/mgmt/mgmt-cw.c + driver/aws/kernel/mgmt/mgmt-cw.h + driver/aws/kernel/mgmt/mgmt-firewall.c + driver/aws/kernel/mgmt/mgmt-sysfs.c + driver/aws/kernel/mgmt/mgmt-thread.c + driver/aws/kernel/mgmt/10-awsmgmt.rules + driver/aws/kernel/mgmt/Makefile + driver/xclng/include/xocl_ioctl.h + driver/xclng/include/mgmt-reg.h + driver/xclng/include/mgmt-ioctl.h + driver/xclng/include/qdma_ioctl.h + #driver/xclng/include/devices.h + driver/include/ert.h + driver/include/xclfeatures.h + driver/include/xclbin.h + driver/include/xclerr.h + ) + +set(XRT_DKMS_ABS_SRCS_aws) + +foreach(DKMS_FILE ${XRT_DKMS_SRCS_aws}) + get_filename_component(DKMS_DIR ${DKMS_FILE} DIRECTORY) + install(FILES ${XRT_DKMS_DRIVER_SRC_BASE_DIR}/${DKMS_FILE} DESTINATION ${XRT_DKMS_INSTALL_DIR_aws}/${DKMS_DIR} COMPONENT aws) + list(APPEND XRT_DKMS_ABS_SRCS_aws ${XRT_DKMS_DRIVER_SRC_BASE_DIR}/${DKMS_FILE}) +endforeach() + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dkms-awsmgmt/${DKMS_FILE_NAME} DESTINATION ${XRT_DKMS_INSTALL_DIR_aws} COMPONENT aws) + diff --git a/src/CMake/dkms.cmake b/src/CMake/dkms.cmake index e2b5eeb5351..18c8eabd0ae 100644 --- a/src/CMake/dkms.cmake +++ b/src/CMake/dkms.cmake @@ -10,7 +10,7 @@ SET (DKMS_POSTINST "postinst") SET (DKMS_PRERM "prerm") configure_file ( - "${CMAKE_SOURCE_DIR}/CMake/config/${DKMS_FILE_NAME}.in" + "${CMAKE_SOURCE_DIR}/CMake/config/dkms-xocl/${DKMS_FILE_NAME}.in" ${DKMS_FILE_NAME} ) diff --git a/src/CMake/pkgconfig.cmake b/src/CMake/pkgconfig.cmake index 28951e49fd6..26ab3890e01 100644 --- a/src/CMake/pkgconfig.cmake +++ b/src/CMake/pkgconfig.cmake @@ -1,12 +1,4 @@ -SET (PKG_CONFIG_FILE_NAME "xrt.pc") - -message("-- Preparing XRT pkg-config ${PKG_CONFIG_FILE_NAME}") - -configure_file ( - "${CMAKE_SOURCE_DIR}/CMake/config/${PKG_CONFIG_FILE_NAME}.in" - ${PKG_CONFIG_FILE_NAME} - @ONLY - ) +message("-- Preparing XRT pkg-config") if (${LINUX_FLAVOR} STREQUAL Ubuntu) set(XRT_PKG_CONFIG_DIR "/usr/lib/pkgconfig") @@ -16,12 +8,50 @@ else () set(XRT_PKG_CONFIG_DIR "/usr/share/pkgconfig") endif () -install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKG_CONFIG_FILE_NAME} DESTINATION ${XRT_PKG_CONFIG_DIR}) +configure_file ( + ${CMAKE_SOURCE_DIR}/CMake/config/xrt.pc.in + xrt.pc + @ONLY + ) +install ( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/xrt.pc + DESTINATION + ${XRT_PKG_CONFIG_DIR} + ) + +configure_file ( + ${CMAKE_SOURCE_DIR}/CMake/config/xrt-aws.pc.in + xrt-aws.pc + @ONLY + ) +install ( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/xrt-aws.pc + DESTINATION + ${XRT_PKG_CONFIG_DIR} + ) -configure_file(${CMAKE_SOURCE_DIR}/CMake/config/libxmaapi.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libxmaapi.pc @ONLY) -#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxmaapi.pc DESTINATION ${XMA_INSTALL_DIR}/lib/pkgconfig) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxmaapi.pc DESTINATION ${XRT_PKG_CONFIG_DIR}) +configure_file ( + ${CMAKE_SOURCE_DIR}/CMake/config/libxmaapi.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/libxmaapi.pc + @ONLY + ) +install ( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/libxmaapi.pc + DESTINATION + ${XRT_PKG_CONFIG_DIR} + ) -configure_file(${CMAKE_SOURCE_DIR}/CMake/config/libxmaplugin.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libxmaplugin.pc @ONLY) -#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxmaplugin.pc DESTINATION ${XMA_INSTALL_DIR}/lib/pkgconfig) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxmaplugin.pc DESTINATION ${XRT_PKG_CONFIG_DIR}) +configure_file ( + ${CMAKE_SOURCE_DIR}/CMake/config/libxmaplugin.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/libxmaplugin.pc + @ONLY + ) +install ( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/libxmaplugin.pc + DESTINATION + ${XRT_PKG_CONFIG_DIR} + ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5bb5b5de2a0..2505277b2c4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ PROJECT(XRT) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) +CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) SET(PROJECT_DESCRIPTION "https://github.com/Xilinx/XRT") @@ -78,6 +78,9 @@ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) endif() set (CMAKE_INSTALL_PREFIX "/opt/xilinx") +# Default component name for any install() command without the COMPONENT argument +set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "xrt") + set (XRT_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set (XRT_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/xrt") @@ -132,7 +135,6 @@ set(XMA_SOVERSION ${XRT_SOVERSION}) add_subdirectory(xma) #XMA settings END - message("-- XRT version: ${XRT_VERSION_STRING}") include (CMake/cpack.cmake) @@ -140,7 +142,9 @@ include (CMake/cpack.cmake) include (CMake/lint.cmake) set (XRT_DKMS_DRIVER_SRC_BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/runtime_src") + include (CMake/dkms.cmake) +include (CMake/dkms-aws.cmake) include (CMake/icd.cmake) diff --git a/src/runtime_src/driver/xclng/CMakeLists.txt b/src/runtime_src/driver/xclng/CMakeLists.txt index ac7f698b930..82ae55c27fe 100644 --- a/src/runtime_src/driver/xclng/CMakeLists.txt +++ b/src/runtime_src/driver/xclng/CMakeLists.txt @@ -1,13 +1,13 @@ # Set INTERNAL_TESTING variable by setting the shell environment # variable "AWS_F1_TARGET" when invoking build.sh or cmake. If it # is not defined, default to INTERNAL_TESTING = 1. -if( $ENV{AWS_F1_TARGET} ) +if( $ENV{AWS_FPGA_REPO_DIR} ) set(INTERNAL_TESTING 0) else() - set(INTERNAL_TESTING 1) #AWS_INTERNAL_TESTING + set(INTERNAL_TESTING 1) endif() - add_subdirectory(xrt) add_subdirectory(tools/xbflash) add_subdirectory(tools/xbutil) add_subdirectory(tools/awssak) + diff --git a/src/runtime_src/driver/xclng/tools/awssak/CMakeLists.txt b/src/runtime_src/driver/xclng/tools/awssak/CMakeLists.txt index b5d2a2c9815..341b7ae23ee 100644 --- a/src/runtime_src/driver/xclng/tools/awssak/CMakeLists.txt +++ b/src/runtime_src/driver/xclng/tools/awssak/CMakeLists.txt @@ -34,6 +34,9 @@ else() ) endif() -install (TARGETS awssak RUNTIME DESTINATION ${XRT_INSTALL_DIR}/bin) +install(TARGETS awssak + RUNTIME + DESTINATION ${XRT_INSTALL_DIR}/bin + COMPONENT aws) endif (NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") diff --git a/src/runtime_src/driver/xclng/xrt/CMakeLists.txt b/src/runtime_src/driver/xclng/xrt/CMakeLists.txt index c873e60ef18..032a6d94c8f 100644 --- a/src/runtime_src/driver/xclng/xrt/CMakeLists.txt +++ b/src/runtime_src/driver/xclng/xrt/CMakeLists.txt @@ -31,7 +31,9 @@ target_link_libraries(xrt_core rt ) -install (TARGETS xrt_core LIBRARY DESTINATION ${XRT_INSTALL_DIR}/lib) +install(TARGETS xrt_core + LIBRARY + DESTINATION ${XRT_INSTALL_DIR}/lib) # Vendor - AWS # Skip for arm @@ -57,18 +59,21 @@ set_target_properties(xrt_aws PROPERTIES VERSION ${XRT_VERSION_STRING} if(${INTERNAL_TESTING}) target_link_libraries(xrt_aws - pthread - rt + pthread + rt ) else() set(AWS_FPGA_MGMT_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../sdk/userspace/lib) target_link_libraries(xrt_aws - pthread - rt - ${AWS_FPGA_MGMT_LIB_DIR}/libfpga_mgmt.a - ) + pthread + rt + ${AWS_FPGA_MGMT_LIB_DIR}/libfpga_mgmt.a +) endif() -install (TARGETS xrt_aws LIBRARY DESTINATION ${XRT_INSTALL_DIR}/lib) +install(TARGETS xrt_aws + LIBRARY + DESTINATION ${XRT_INSTALL_DIR}/lib + COMPONENT aws) endif (NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") From 9f44a7f597cad9a7d15a29dba6b966db402e27d2 Mon Sep 17 00:00:00 2001 From: Ryan Radjabi <32471108+rradjabi@users.noreply.github.com> Date: Wed, 14 Nov 2018 11:38:42 -0800 Subject: [PATCH 4/5] modified dkms-aws.cmake for 2018.2_XDF Includes driver/xclng/include/devices.h on 2018.2_XDF --- src/CMake/dkms-aws.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMake/dkms-aws.cmake b/src/CMake/dkms-aws.cmake index abc75d823a8..f710b36552e 100644 --- a/src/CMake/dkms-aws.cmake +++ b/src/CMake/dkms-aws.cmake @@ -40,7 +40,7 @@ set(XRT_DKMS_SRCS_aws driver/xclng/include/mgmt-reg.h driver/xclng/include/mgmt-ioctl.h driver/xclng/include/qdma_ioctl.h - #driver/xclng/include/devices.h + driver/xclng/include/devices.h driver/include/ert.h driver/include/xclfeatures.h driver/include/xclbin.h From ca51450d57a5509a83a6a086e2900fd7962c6387 Mon Sep 17 00:00:00 2001 From: rradjabi Date: Wed, 14 Nov 2018 15:58:45 -0800 Subject: [PATCH 5/5] Completese merge from Xilinx:master to Xilinx:2018.2_XDF, it was missing parts of commit 62f307a --- src/runtime_src/tools/scripts/xrtdeps.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime_src/tools/scripts/xrtdeps.sh b/src/runtime_src/tools/scripts/xrtdeps.sh index 49aa907bc5e..2fa80fae5ed 100755 --- a/src/runtime_src/tools/scripts/xrtdeps.sh +++ b/src/runtime_src/tools/scripts/xrtdeps.sh @@ -136,6 +136,7 @@ fi FLAVOR=`grep '^ID=' /etc/os-release | awk -F= '{print $2}'` FLAVOR=`echo $FLAVOR | tr -d '"'` ARCH=`uname -m` +SUDO=${SUDO:-sudo} #dmidecode is only applicable for x86_64 if [ $ARCH == "x86_64" ]; then @@ -171,7 +172,7 @@ install() { if [ $FLAVOR == "ubuntu" ]; then echo "Installing Ubuntu packages..." - sudo apt install -y "${UB_LIST[@]}" + ${SUDO} apt install -y "${UB_LIST[@]}" fi # Enable EPEL on CentOS/RHEL @@ -192,7 +193,7 @@ install() # Enable GCC 6 compiler set on RHEL/CentOS 7.X if [ $FLAVOR == "rhel" ]; then echo "Enabling RHEL SCL repository..." - sudo yum-config-manager --enable rhel-server-rhscl-7-rpms + ${SUDO} yum-config-manager --enable rhel-server-rhscl-7-rpms elif [ $FLAVOR == "centos" ]; then echo "Enabling CentOS SCL repository..." ${SUDO} yum --enablerepo=extras install -y centos-release-scl