On Thu, 2023-12-07 at 07:37 +0000, Liu, Yongxin wrote:
> 
> > -----Original Message-----
> > From: Mittal, Anuj <[email protected]>
> > Sent: Thursday, December 7, 2023 15:24
> > To: Liu, Yongxin <[email protected]>; Lee, Chee Yang
> > <[email protected]>; [email protected]
> > Subject: Re: [meta-intel][meta-intel-qat][PATCH] qatlib: add recipe
> > for
> > QATlib 23.11.0 release.
> > 
> > CAUTION: This email comes from a non Wind River email account!
> > Do not click links or open attachments unless you recognize the
> > sender and
> > know the content is safe.
> > 
> > On Wed, 2023-12-06 at 23:13 +0800, Yongxin Liu wrote:
> > > QATlib provides user space libraries that allow access to Intel
> > > QuickAssist devices and expose the Intel QuickAssist APIs and
> > > samples.
> > > 
> > > Supported hardware:
> > >   4xxx (QAT gen 4 devices)
> > > 
> > > Usage of QATlib:
> > >   1) Enable Intel IOMMU with intel_iommu=on in kernel boot
> > > cmdline.
> > >   2) Driver qat_4xxx and vfio-pci from kernel.
> > >   3) Firmware qat_4xxx.bin and qat_4xxx_mmp.bin in /lib/firmware
> > > from
> > > upstream.
> > >   4) Installed qatlib, qatlib-dev and qatlib-samples in your
> > > target
> > > image.
> > >   4) Enabled /lib/systemd/system/qat.service.
> > >   5) Run samples, such as cpa_sample_code.
> > > 
> > > Tested with kernel v6.1.62 and systemd installed on target.
> > > 
> > > Signed-off-by: Yongxin Liu <[email protected]>
> > > ---
> > >  recipes-extended/qatlib/files/qatlib.sh |  2 +
> > >  recipes-extended/qatlib/qatlib_git.bb   | 84
> > > +++++++++++++++++++++++++
> > >  2 files changed, 86 insertions(+)
> > >  create mode 100755 recipes-extended/qatlib/files/qatlib.sh
> > >  create mode 100644 recipes-extended/qatlib/qatlib_git.bb
> > > 
> > > diff --git a/recipes-extended/qatlib/files/qatlib.sh b/recipes-
> > > extended/qatlib/files/qatlib.sh new file mode 100755 index
> > > 0000000..b4439ce
> > > --- /dev/null
> > > +++ b/recipes-extended/qatlib/files/qatlib.sh
> > > @@ -0,0 +1,2 @@
> > > +export PATH=/opt/intel/qatlib/bin:$PATH export
> > > +LD_LIBRARY_PATH=/opt/intel/qatlib/lib:$LD_LIBRARY_PATH
> > > diff --git a/recipes-extended/qatlib/qatlib_git.bb b/recipes-
> > > extended/qatlib/qatlib_git.bb new file mode 100644 index
> > > 0000000..89e2d7e
> > > --- /dev/null
> > > +++ b/recipes-extended/qatlib/qatlib_git.bb
> > > @@ -0,0 +1,84 @@
> > > +DESCRIPTION = "Intel QuickAssist Technology Library (QATlib)"
> > > +HOMEPAGE = "https://github.com/intel/qatlib";
> > > +
> > > +LICENSE = "BSD-3-Clause"
> > > +LIC_FILES_CHKSUM =
> > > "file://LICENSE;md5=64dc5eee9d532c8a1633bb63ed0d1aac"
> > > +
> > > +COMPATIBLE_MACHINE = "null"
> > > +COMPATIBLE_HOST:x86-x32 = 'null'
> > > +COMPATIBLE_HOST:libc-musl:class-target = 'null'
> > > +
> > > +SRC_URI =
> > > "git://github.com/intel/qatlib.git;protocol=https;branch=main \
> > > +           file://qatlib.sh \
> > > +          "
> > > +SRCREV = "142e305970ec66a860945d20bb7c330f99ed900b"
> > > +PV = "23.11.0+git${SRCPV}"
> > > +S = "${WORKDIR}/git"
> > > +
> > > +inherit autotools systemd useradd
> > > +
> > > +DEPENDS = "openssl zlib nasm-native"
> > > +
> > > +USERADD_PACKAGES = "${PN}"
> > > +GROUPADD_PARAM:${PN} = "qat"
> > > +
> > > +PREFIX = "/opt/intel/qatlib"
> > 
> > Why are we installing this explicitly in /opt?
> 
> No specific reason.
> Just like qat17, installing to independent folder in /opt makes the
> system look clean.
> 

If there is no reason to, then we should install to standard
directories and get rid of all the extra things we are doing to package
it and make it work from /opt.

> > 
> > Thanks,
> > 
> > Anuj
> > 
> > > +SYSTEMD_SERVICE:${PN} = "qat.service"
> > > +SYSTEMD_AUTO_ENABLE = "enable"
> > > +
> > > +do_configure () {
> > > +    cd ${S}
> > > +    ./autogen.sh
> > > +
> > > +    # 1) The systemd unit path "/lib/systemd/system" cannot be
> > > correctly passed to build system of QATlib. So hardcoded here.
> > > +    # 2) Checking "cross_compiling" is not smart and sometimes
> > > causes fatal error due to wrong path of ELF file interpreter.
> > > +    ./configure --enable-service --prefix=${PREFIX}
> > > systemdsystemunitdir=${systemd_unitdir}/system
> > > cross_compiling=yes
> > > +}
> > > +
> > > +do_compile () {
> > > +    cd ${S}
> > > +    oe_runmake
> > > +    oe_runmake samples
> > 
> > Should this recipe be inheriting autotools-brokensep instead and
> > this can
> > just be:
> > 
> > do_compile:append () {
> >     oe_runmake samples
> > }
> 
> Currently it is built and installed from ${S}.
> If we change like yours, it will be built in sperate build dir,
> and the do_install cannot be so directly, we need to install many
> files ourselves,
> instead of using makefile directly.
> 

If you inherit autotools-brokensep, it should build from ${S}.

Thanks,

Anuj

> 
> Thanks,
> Yongxin
> 
> > 
> > > +}
> > > +
> > > +do_install () {
> > > +    cd ${S}
> > > +    export DESTDIR=${D}
> > > +    oe_runmake install-exec
> > > +    oe_runmake install-dist_systemd_scriptsSCRIPTS
> > > +    oe_runmake install-man
> > > +    oe_runmake install-pkgincludeHEADERS
> > > +    oe_runmake samples-install
> > > +
> > > +    install -d ${D}${systemd_unitdir}/system
> > > +    install -m 0644 quickassist/utilities/service/qat.service
> > > ${D}${systemd_unitdir}/system
> > > +
> > > +    install -d ${D}${sysconfdir}/profile.d
> > > +    install -m 0755 ${WORKDIR}/qatlib.sh
> > > ${D}${sysconfdir}/profile.d
> > > +}
> > > +
> > > +SYSROOT_DIRS += "/opt"
> > > +
> > > +PACKAGES = "${PN}-dbg ${PN}-dev ${PN}-doc ${PN}-staticdev ${PN}-
> > > samples ${PN}"
> > > +
> > > +FILES:${PN}-dev = "/opt/intel/qatlib/lib/*.so"
> > > +
> > > +FILES:${PN}-dbg = "/opt/intel/qatlib/bin/.debug/* \
> > > +                   /opt/intel/qatlib/lib/.debug/* \
> > > +                   /opt/intel/qatlib/sbin/.debug/* \
> > > +                  "
> > > +
> > > +FILES:${PN}-doc = "/opt/intel/qatlib/share/man"
> > > +
> > > +FILES:${PN}-staticdev = "/opt/intel/qatlib/include/* \
> > > +                          /opt/intel/qatlib/lib/*.a \
> > > +                         "
> > > +
> > > +FILES:${PN}-samples = "/opt/intel/qatlib/bin/*sample* \
> > > +                       /opt/intel/qatlib/share/qat \
> > > +                      "
> > > +
> > > +FILES:${PN} = "/opt/intel/qatlib/* \
> > > +               ${systemd_unitdir}/system \
> > > +               ${sysconfdir}/profile.d/qatlib.sh \
> > > +              "
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8185): 
https://lists.yoctoproject.org/g/meta-intel/message/8185
Mute This Topic: https://lists.yoctoproject.org/mt/103014413/21656
Group Owner: [email protected]
Unsubscribe: 
https://lists.yoctoproject.org/g/meta-intel/leave/6694807/21656/1869269227/xyzzy
 [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to