-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #672 from rradjabi/aws-pegasus-build
AWS Pegasus RPM build and AWS-F1 Developer Flow support
- Loading branch information
Showing
15 changed files
with
260 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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_<GENERATOR>_<COMPONENT>_PACKAGE_NAME "<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_<GENERATOR>_<COMPONENT>_PACKAGE_NAME "<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 "[email protected]") | |
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.