From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 0C93D3770 for ; Mon, 4 Sep 2017 16:08:53 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2017 07:08:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,474,1498546800"; d="scan'208";a="1191374885" Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2017 07:08:51 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.59]) by IRSMSX106.ger.corp.intel.com ([169.254.8.36]) with mapi id 14.03.0319.002; Mon, 4 Sep 2017 15:08:50 +0100 From: "Van Haaren, Harry" To: "Richardson, Bruce" , "dev@dpdk.org" CC: "Richardson, Bruce" Thread-Topic: [dpdk-dev] [PATCH 04/17] build: add DPDK libraries to build Thread-Index: AQHTIwvSEaa4uNObOk2eDblm++c5a6KkxgRA Date: Mon, 4 Sep 2017 14:08:50 +0000 Message-ID: References: <20170901100416.80264-1-bruce.richardson@intel.com> <20170901100416.80264-5-bruce.richardson@intel.com> In-Reply-To: <20170901100416.80264-5-bruce.richardson@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTU0MWM0ZDEtZTNkNS00ODE1LWI3NzEtYTljMDZjMDU5MGE2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InFHY21nN3Q4a1lyV3ppUHpEb05YSFIrRE8wdlF5RUdTcGJwSzZ2Tk1cL0d3PSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 04/17] build: add DPDK libraries to build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Sep 2017 14:08:54 -0000 > 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 > Subject: [dpdk-dev] [PATCH 04/17] build: add DPDK libraries to build >=20 > 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 usin= g > the same set of commands, where the individual meson.build files only nee= d > to specify their dependencies, source files, header files and ABI version= s. >=20 > Signed-off-by: Bruce Richardson In librte_acl/meson.build: > +version =3D 2 > +sources =3D files('acl_bld.c', 'acl_gen.c', 'acl_run_scalar.c', > + 'rte_acl.c', 'tb_mem.c') > +headers =3D files('rte_acl.h', 'rte_acl_osdep.h') > + > +if arch_subdir =3D=3D 'x86' > + sources +=3D 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 +=3D files('acl_run_avx2.c') > + cflags +=3D '-DCC_AVX2_SUPPORT' > + elif cc.has_argument('-mavx2') > + avx2_tmplib =3D static_library('avx2_tmp', > + 'acl_run_avx2.c', > + dependencies: rte_eal, > + c_args: '-mavx2') > + objs +=3D avx2_tmplib.extract_objects('acl_run_avx2.c') > + cflags +=3D '-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. > --- a/lib/meson.build > +++ b/lib/meson.build > @@ -29,4 +29,71 @@ > # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE US= E > # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >=20 > +# 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 i= s > +# given as a dep, no need to mention ring. This is especially true for t= he > +# core libs which are widely reused, so their deps are kept to a minimum= . > +libraries =3D ['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 =3D true > + name =3D l > + version =3D 1 > + sources =3D [] > + headers =3D [] > + cflags =3D [] > + objs =3D [] # other object files to link against, used e.g. for instruc= tion- > + # optimized versions of code Nitpick: comment above could be moved to be before the objs[] line, consist= ent 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 =3D ['eal'] > + ext_deps =3D [] > + > + dir_name =3D 'librte_' + l > + subdir(dir_name) > + > + if build > + dpdk_conf.set('RTE_LIBRTE_' + name.to_upper(), 1) > + install_headers(headers) > + > + dep_objs =3D ext_deps > + foreach d:deps > + dep_objs +=3D [get_variable('dep_rte_' + d)] > + endforeach > + > + version_map =3D '@0@/@1@/rte_@2@_version.map'.format( > + meson.current_source_dir(), dir_name, name) > + libname =3D 'rte_' + name > + lib =3D library(libname, > + sources, > + objects: objs, > + c_args: cflags, > + dependencies: dep_objs, > + include_directories: include_directories(dir_name), > + link_args: '-Wl,--version-script=3D' + version_map, > + link_depends: version_map, > + version: '@0@.1'.format(version), > + install: true) > + dep =3D declare_dependency(link_with: lib, > + include_directories: include_directories(dir_name), > + dependencies: dep_objs) > + set_variable('dep_' + libname, dep) > + > + dpdk_libraries =3D [lib] + dpdk_libraries > + endif > +endforeach > -- > 2.13.5 Reviewed-by: Harry van Haaren