From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: "Richardson, Bruce" <bruce.richardson@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "Richardson, Bruce" <bruce.richardson@intel.com>
Subject: Re: [dpdk-dev] [PATCH 04/17] build: add DPDK libraries to build
Date: Mon, 4 Sep 2017 14:08:50 +0000 [thread overview]
Message-ID: <E923DB57A917B54B9182A2E928D00FA640C74082@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <20170901100416.80264-5-bruce.richardson@intel.com>
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, September 1, 2017 11:04 AM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH 04/17] build: add DPDK libraries to build
>
> Add non-EAL libraries to DPDK build. The compat lib is a special case,
> along with the previously-added EAL, but all other libs can be build using
> the same set of commands, where the individual meson.build files only need
> to specify their dependencies, source files, header files and ABI versions.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
<snip>
In librte_acl/meson.build:
> +version = 2
> +sources = files('acl_bld.c', 'acl_gen.c', 'acl_run_scalar.c',
> + 'rte_acl.c', 'tb_mem.c')
> +headers = files('rte_acl.h', 'rte_acl_osdep.h')
> +
> +if arch_subdir == 'x86'
> + sources += files('acl_run_sse.c')
> +
> + # compile AVX2 version if either:
> + # a. we have AVX supported in minimum instruction set baseline
> + # b. it's not minimum instruction set, but supported by compiler
> + #
> + # in former case, just add avx2 C file to files list
> + # in latter case, compile c file to static lib, using correct compiler
> + # flags, and then have the .o file from static lib linked into main lib.
> + if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2')
> + sources += files('acl_run_avx2.c')
> + cflags += '-DCC_AVX2_SUPPORT'
> + elif cc.has_argument('-mavx2')
> + avx2_tmplib = static_library('avx2_tmp',
> + 'acl_run_avx2.c',
> + dependencies: rte_eal,
> + c_args: '-mavx2')
> + objs += avx2_tmplib.extract_objects('acl_run_avx2.c')
> + cflags += '-DCC_AVX2_SUPPORT'
> + endif
> +
> +endif
In future this could be split out to some sort of AVX helper, to avoid it
becoming copy/paste prone to detect AVX features from libraries.
<huge snip of almost all libraries meson.build files>
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -29,4 +29,71 @@
> # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>
> +# special case for eal, not a simple lib, and compat, just a header
> subdir('librte_eal')
> +subdir('librte_compat')
> +
> +# process all libraries equally, as far as possible
> +# "core" libs first, then others alphebetically as far as possible
> +# NOTE: for speed of meson runs, the dependencies in the subdirectories
> +# sometimes skip deps that would be implied by others, e.g. if mempool is
> +# given as a dep, no need to mention ring. This is especially true for the
> +# core libs which are widely reused, so their deps are kept to a minimum.
> +libraries = ['ring', 'mempool', 'mbuf', 'net', 'ether', # core
> + 'metrics', # bitrate/latency stats depends on this
> + 'hash', # efd depends on this
> + 'kvargs', # cryptodev depends on this
> + 'acl', 'bitratestats', 'cfgfile', 'cmdline', 'cryptodev',
> + 'distributor', 'efd', 'eventdev', 'gro', 'ip_frag', 'jobstats',
> + 'kni', 'latencystats', 'lpm', 'meter', 'power', 'pdump',
> + 'reorder', 'sched', 'timer', 'vhost',
> + # add pkt framework libs which use other libs from above
> + 'port', 'table', 'pipeline']
> +
> +foreach l:libraries
> + build = true
> + name = l
> + version = 1
> + sources = []
> + headers = []
> + cflags = []
> + objs = [] # other object files to link against, used e.g. for instruction-
> + # optimized versions of code
Nitpick: comment above could be moved to be before the objs[] line, consistent like below.
I'll send a patch once this stuff is in next-build :D
> + # use "deps" for internal DPDK dependencies, and "ext_deps" for
> + # external package/library requirements
> + deps = ['eal']
> + ext_deps = []
> +
> + dir_name = 'librte_' + l
> + subdir(dir_name)
> +
> + if build
> + dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1)
> + install_headers(headers)
> +
> + dep_objs = ext_deps
> + foreach d:deps
> + dep_objs += [get_variable('dep_rte_' + d)]
> + endforeach
> +
> + version_map = '@0@/@1@/rte_@2@_version.map'.format(
> + meson.current_source_dir(), dir_name, name)
> + libname = 'rte_' + name
> + lib = library(libname,
> + sources,
> + objects: objs,
> + c_args: cflags,
> + dependencies: dep_objs,
> + include_directories: include_directories(dir_name),
> + link_args: '-Wl,--version-script=' + version_map,
> + link_depends: version_map,
> + version: '@0@.1'.format(version),
> + install: true)
> + dep = declare_dependency(link_with: lib,
> + include_directories: include_directories(dir_name),
> + dependencies: dep_objs)
> + set_variable('dep_' + libname, dep)
> +
> + dpdk_libraries = [lib] + dpdk_libraries
> + endif
> +endforeach
> --
> 2.13.5
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
next prev parent reply other threads:[~2017-09-04 14:08 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-01 10:03 [dpdk-dev] [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
2017-09-01 10:04 ` [dpdk-dev] [PATCH 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
2017-09-04 13:36 ` Van Haaren, Harry
2017-09-04 13:51 ` Bruce Richardson
2017-09-06 16:18 ` Bruce Richardson
2017-09-07 13:52 ` Bruce Richardson
2017-09-07 16:21 ` [dpdk-dev] [dpdk-dev, " Neil Horman
2017-09-07 16:47 ` Wiles, Keith
2017-09-07 17:12 ` Neil Horman
2017-09-08 8:50 ` Bruce Richardson
2017-09-08 11:57 ` Neil Horman
2017-09-08 13:55 ` Bruce Richardson
2017-09-08 14:00 ` Bruce Richardson
2017-09-08 16:03 ` [dpdk-dev] [PATCH " Van Haaren, Harry
2017-09-08 16:13 ` Richardson, Bruce
2017-09-12 9:56 ` Bruce Richardson
2017-09-01 10:04 ` [dpdk-dev] [PATCH 02/17] eal: add eal library to meson build Bruce Richardson
2017-09-04 13:53 ` Van Haaren, Harry
2017-09-07 16:25 ` [dpdk-dev] [dpdk-dev, " Neil Horman
2017-09-08 8:51 ` Bruce Richardson
2017-09-01 10:04 ` [dpdk-dev] [PATCH 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
2017-09-01 13:32 ` Luca Boccassi
2017-09-01 13:55 ` Bruce Richardson
2017-09-01 14:27 ` Luca Boccassi
2017-09-04 13:57 ` Van Haaren, Harry
2017-09-01 10:04 ` [dpdk-dev] [PATCH 04/17] build: add DPDK libraries to build Bruce Richardson
2017-09-04 14:08 ` Van Haaren, Harry [this message]
2017-09-04 14:55 ` Bruce Richardson
2017-09-01 10:04 ` [dpdk-dev] [PATCH 05/17] build: add buildtools to meson build Bruce Richardson
2017-09-04 14:24 ` Van Haaren, Harry
2017-09-01 10:04 ` [dpdk-dev] [PATCH 06/17] build: add infrastructure for building PMDs Bruce Richardson
2017-09-04 14:27 ` Van Haaren, Harry
2017-09-01 10:04 ` [dpdk-dev] [PATCH 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
2017-09-04 14:28 ` Van Haaren, Harry
2017-09-04 14:29 ` Van Haaren, Harry
2017-09-01 10:04 ` [dpdk-dev] [PATCH 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
2017-09-04 14:30 ` Van Haaren, Harry
2017-09-01 10:04 ` [dpdk-dev] [PATCH 09/17] crypto/openssl: add driver to meson build Bruce Richardson
2017-09-04 14:30 ` Van Haaren, Harry
2017-09-04 14:31 ` Van Haaren, Harry
2017-09-01 10:04 ` [dpdk-dev] [PATCH 10/17] crypto/qat: " Bruce Richardson
2017-09-04 14:32 ` Van Haaren, Harry
2017-09-01 10:04 ` [dpdk-dev] [PATCH 11/17] drivers/net: add net driver support " Bruce Richardson
2017-09-04 14:32 ` Van Haaren, Harry
2017-09-01 10:04 ` [dpdk-dev] [PATCH 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
2017-09-04 14:34 ` Van Haaren, Harry
2017-09-01 10:04 ` [dpdk-dev] [PATCH 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
2017-09-01 10:04 ` [dpdk-dev] [PATCH 14/17] app/test-pmd: add test-pmd " Bruce Richardson
2017-09-04 15:01 ` Van Haaren, Harry
2017-09-01 10:04 ` [dpdk-dev] [PATCH 15/17] usertools: add usertools installation " Bruce Richardson
2017-09-04 15:00 ` Van Haaren, Harry
2017-09-01 10:04 ` [dpdk-dev] [PATCH 16/17] build: add option to version libs using DPDK version Bruce Richardson
2017-09-07 17:07 ` [dpdk-dev] [dpdk-dev, " Neil Horman
2017-09-08 8:58 ` Bruce Richardson
2017-09-01 10:04 ` [dpdk-dev] [PATCH 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
2017-09-01 10:38 ` [dpdk-dev] [PATCH 00/17] build DPDK libs and some drivers with meson/ninja Bruce Richardson
2017-09-12 10:37 ` [dpdk-dev] [PATCH v2 " Bruce Richardson
2017-09-12 10:37 ` [dpdk-dev] [PATCH v2 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
2017-09-12 10:37 ` [dpdk-dev] [PATCH v2 02/17] eal: add eal library to meson build Bruce Richardson
2017-09-12 10:37 ` [dpdk-dev] [PATCH v2 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
2017-09-12 10:37 ` [dpdk-dev] [PATCH v2 04/17] build: add DPDK libraries to build Bruce Richardson
2017-09-12 10:37 ` [dpdk-dev] [PATCH v2 05/17] build: add buildtools to meson build Bruce Richardson
2017-09-12 10:37 ` [dpdk-dev] [PATCH v2 06/17] build: add infrastructure for building PMDs Bruce Richardson
2017-09-12 10:37 ` [dpdk-dev] [PATCH v2 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
2017-09-12 10:38 ` [dpdk-dev] [PATCH v2 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
2017-09-12 10:38 ` [dpdk-dev] [PATCH v2 09/17] crypto/openssl: add driver to meson build Bruce Richardson
2017-09-12 10:38 ` [dpdk-dev] [PATCH v2 10/17] crypto/qat: " Bruce Richardson
2017-09-12 10:38 ` [dpdk-dev] [PATCH v2 11/17] drivers/net: add net driver support " Bruce Richardson
2017-09-12 10:38 ` [dpdk-dev] [PATCH v2 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
2017-09-12 10:38 ` [dpdk-dev] [PATCH v2 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
2017-09-12 10:38 ` [dpdk-dev] [PATCH v2 14/17] app/test-pmd: add test-pmd " Bruce Richardson
2017-09-12 10:38 ` [dpdk-dev] [PATCH v2 15/17] usertools: add usertools installation " Bruce Richardson
2017-09-12 10:38 ` [dpdk-dev] [PATCH v2 16/17] build: add option to version libs using DPDK version Bruce Richardson
2017-09-13 11:32 ` Luca Boccassi
2017-09-13 13:11 ` Bruce Richardson
2017-09-13 17:02 ` Luca Boccassi
2017-09-12 10:38 ` [dpdk-dev] [PATCH v2 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
2017-09-12 13:21 ` [dpdk-dev] [PATCH v2 00/17] build DPDK libs and some drivers with meson/ninja Wiles, Keith
2017-09-12 13:24 ` Bruce Richardson
2017-09-12 13:26 ` Wiles, Keith
2017-09-12 14:00 ` Wiles, Keith
2017-09-12 15:46 ` Bruce Richardson
2017-09-12 19:19 ` Neil Horman
2017-09-12 20:36 ` Wiles, Keith
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 " Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 01/17] build: add initial infrastructure for meson & ninja builds Bruce Richardson
2017-09-20 10:10 ` Timothy M. Redaelli
2017-09-20 10:24 ` Bruce Richardson
2017-09-20 10:33 ` Timothy M. Redaelli
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 02/17] eal: add eal library to meson build Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 03/17] igb_uio: add igb_uio kmod " Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 04/17] build: add DPDK libraries to build Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 05/17] build: add buildtools to meson build Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 06/17] build: add infrastructure for building PMDs Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 07/17] drivers/mempool: add SW mempool drivers to meson build Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 08/17] drivers/crypto: add crypto drv class and null PMD to meson Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 09/17] crypto/openssl: add driver to meson build Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 10/17] crypto/qat: " Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 11/17] drivers/net: add net driver support " Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 12/17] drivers/net: add set of vdev PMDs to build Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 13/17] drivers/net: add drivers for Intel NICs to meson build Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 14/17] app/test-pmd: add test-pmd " Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 15/17] usertools: add usertools installation " Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 16/17] build: add option to version libs using DPDK version Bruce Richardson
2017-09-13 14:12 ` [dpdk-dev] [PATCH v3 17/17] doc: add documentation on how to add new components to DPDK Bruce Richardson
2017-09-13 17:01 ` [dpdk-dev] [PATCH v3 00/17] build DPDK libs and some drivers with meson/ninja Luca Boccassi
2017-09-14 13:57 ` Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E923DB57A917B54B9182A2E928D00FA640C74082@IRSMSX102.ger.corp.intel.com \
--to=harry.van.haaren@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).