From patchwork Wed Jul 8 14:16:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 492952 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F3B21140770 for ; Thu, 9 Jul 2015 00:17:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=uA44vgp2; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=DX4vl3qdC0YjEpl+ zIwENsCotxZiR9LoO5on7hZNkzAyfz5QbAe1FUTf/V/ISIEjEeQoRWd23uTRCpC0 4GY6MfKYLOMc5tnJeP9lp52R+uyiQuLPoF2eMZcg6OyFTTtGdR5PE7Ao7cNbnWsa Jqm9YKxWZifgaorP+6aRxBGiqgU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=VXHq3da+dCVOe+U6yP6SWw +PN14=; b=uA44vgp2q4vAnV4z1c2kdcMbUkikInuK7lwbPKkZ6oa9vxLPp52CTU iSJvkoHBOj2kGOD9QgVV43Ct84Zsm84f3TBGbdXLzxRLRo84UI8kQpCet3Zi+4SH WSxlfpGmExCdxoKbgtFVKIMQF9uSbNg/1VLtW2pQFX5GHN7e7ZMrM= Received: (qmail 9268 invoked by alias); 8 Jul 2015 14:16:57 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 9251 invoked by uid 89); 8 Jul 2015 14:16:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Jul 2015 14:16:55 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ZCq9b-0002TX-3N from Thomas_Schwinge@mentor.com ; Wed, 08 Jul 2015 07:16:51 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Wed, 8 Jul 2015 15:16:49 +0100 From: Thomas Schwinge To: Ilya Verbin , Jakub Jelinek , CC: Kirill Yukhin , Andrey Turetskiy Subject: Re: [PATCH 3/4] Add libgomp plugin for Intel MIC In-Reply-To: <20141021172413.GD47586@msticlxl57.ims.intel.com> References: <20141021171323.GA47586@msticlxl57.ims.intel.com> <20141021172413.GD47586@msticlxl57.ims.intel.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Wed, 8 Jul 2015 16:16:44 +0200 Message-ID: <878uaq68fn.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Tue, 21 Oct 2014 21:24:13 +0400, Ilya Verbin wrote: > This patch contains a plugin for libgomp and appropriate changes for makefiles. > > The plugin uses liboffloadmic_host.so to interact with the device (or with an > emulator). Also the patch contains offload_target_main executable, which is the > corresponding target side part of a libgomp plugin, and it uses > liboffloadmic_target.so. > > The plugin builds automatically with liboffloadmic. With recent GCC trunk sources, builds of the Intel MIC Offload Plugin fail as follows: libtool: compile: [...]/build-gcc/./gcc/xg++ [...] -I[...]/install/offload-x86_64-intelmicemul-linux-gnu/x86_64-intelmicemul-linux-gnu/liboffloadmic/plugin -I[...]/install/offload-x86_64-intelmicemul-linux-gnu/lib/gcc/x86_64-intelmicemul-linux-gnu/6.0.0/include -c [...]/source-gcc/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp -fPIC -DPIC -o .libs/libgomp_plugin_intelmic_la-libgomp-plugin-intelmic.o In file included from [...]/source-gcc/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp:40:0: [...]/install/offload-x86_64-intelmicemul-linux-gnu/lib/gcc/x86_64-intelmicemul-linux-gnu/6.0.0/include/main_target_image.h:8628:1: error: narrowing conversion of '192' from 'int' to 'char' inside { } [-Wnarrowing] }; ^ [...]/install/offload-x86_64-intelmicemul-linux-gnu/lib/gcc/x86_64-intelmicemul-linux-gnu/6.0.0/include/main_target_image.h:8628:1: error: narrowing conversion of '192' from 'int' to 'char' inside { } [-Wnarrowing] [...]/install/offload-x86_64-intelmicemul-linux-gnu/lib/gcc/x86_64-intelmicemul-linux-gnu/6.0.0/include/main_target_image.h:8628:1: error: narrowing conversion of '164' from 'int' to 'char' inside { } [-Wnarrowing] [many more] Apart from the actual compilation error, it is surprising for me to see the GCC build reference/depend on the Intel MIC offloading compiler's installation directory (which I built and installed earlier), [...]/install/offload-x86_64-intelmicemul-linux-gnu/ -- is that the correct thing to do? Shouldn't the GCC build be self-contained? (I have not yet made an attempt to understand how the target and device liboffloadmic builds work together.) This main_target_image.h file is coming from here: > --- /dev/null > +++ b/liboffloadmic/plugin/Makefile.am > @@ -0,0 +1,123 @@ > +# Plugin for offload execution on Intel MIC devices. > +main_target_image.h: offload_target_main > + @echo -n "const int image_size = " > $@ > + @stat -c '%s' $< >> $@ > + @echo ";" >> $@ > + @echo "struct MainTargetImage {" >> $@ > + @echo " int64_t size;" >> $@ > + @echo " char name[sizeof \"offload_target_main\"];" >> $@ > + @echo " char data[image_size];" >> $@ > + @echo "};" >> $@ > + @echo "extern \"C\" const MainTargetImage main_target_image = {" >> $@ > + @echo " image_size, \"offload_target_main\"," >> $@ > + @cat $< | xxd -include >> $@ > + @echo "};" >> $@ > + > +offload_target_main: $(liboffload_dir)/ofldbegin.o offload_target_main.o $(liboffload_dir)/ofldend.o > + $(CXX) $(AM_LDFLAGS) $^ -o $@ > + > +offload_target_main.o: offload_target_main.cpp > + $(CXX) $(AM_CXXFLAGS) $(AM_CPPFLAGS) -c $< -o $@ Here, I note that the xxd tool is being used, which in my distribution is part of the Vim editor's package, which -- as far as I know -- is not currently declared as a build dependency of GCC? Anyway, all that aside for the moment -- OK to commit the following? Grüße, Thomas --- liboffloadmic/plugin/Makefile.am +++ liboffloadmic/plugin/Makefile.am @@ -69,7 +69,7 @@ main_target_image.h: offload_target_main @echo "struct MainTargetImage {" >> $@ @echo " int64_t size;" >> $@ @echo " char name[sizeof \"offload_target_main\"];" >> $@ - @echo " char data[image_size];" >> $@ + @echo " uint8_t data[image_size];" >> $@ @echo "};" >> $@ @echo "extern \"C\" const MainTargetImage main_target_image = {" >> $@ @echo " image_size, \"offload_target_main\"," >> $@