From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16340 invoked by alias); 17 Dec 2014 22:48:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 16326 invoked by uid 89); 17 Dec 2014 22:48:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,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, 17 Dec 2014 22:48:26 +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 1Y1NOI-0003fI-9f from Thomas_Schwinge@mentor.com ; Wed, 17 Dec 2014 14:48:22 -0800 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.181.6; Wed, 17 Dec 2014 22:48:20 +0000 From: Thomas Schwinge To: Ilya Verbin , Jakub Jelinek CC: , Kirill Yukhin , Andrey Turetskiy Subject: Re: [PATCH 4/4] OpenMP 4.0 offloading to Intel MIC: non-fallback testing In-Reply-To: <20141110143430.GB50497@msticlxl57.ims.intel.com> References: <20141021171323.GA47586@msticlxl57.ims.intel.com> <20141030114001.GA34120@msticlxl57.ims.intel.com> <20141106175540.GN5026@tucnak.redhat.com> <20141110143430.GB50497@msticlxl57.ims.intel.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Wed, 17 Dec 2014 22:53:00 -0000 Message-ID: <87a92l3nby.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2014-12/txt/msg01484.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 8746 Hi! On Mon, 10 Nov 2014 17:34:30 +0300, Ilya Verbin wrote: > On 06 Nov 18:55, Jakub Jelinek wrote: > > Looks mostly good, but: > >=20 > > > +# We need more things in site.exp, but automake completely controls = the > > > +# creation of that file; there's no way to append to it without mess= ing up > > > +# the dependancy chains. So we overrule automake. This rule is exa= ctly > > > +# what it would have generated, plus our own additions. > > > +site.exp: Makefile > > > + @echo 'Making a new site.exp file...' > > > + @echo '## these variables are automatically generated by make ##' >= site.tmp > > > + @echo '# Do not edit here. If you wish to override these values' >= >site.tmp > > > + @echo '# edit the last section' >>site.tmp > > > + @echo 'set srcdir $(srcdir)' >>site.tmp > > > +[...] > > > + @echo 'set target_triplet $(target_triplet)' >>site.tmp > > > + @echo 'set offload_targets "$(offload_targets)"' >>site.tmp > > > + @echo 'set offload_additional_options "$(offload_additional_options= )"' >>site.tmp > > > + @echo 'set offload_additional_lib_paths "$(offload_additional_lib_p= aths)"' >>site.tmp > > > + @echo '## All variables above are generated by configure. Do Not Ed= it ##' >>site.tmp > > > + @test ! -f site.exp || \ > > > + sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp > > > + @-rm -f site.bak > > > + @test ! -f site.exp || mv site.exp site.bak > > > + @mv site.tmp site.exp > >=20 > > I don't like this, that is too fragile. If automake is changed, we'll > > forget to update this. (The same problem exists elsewhere in GCC. But I certainly do agree that it's ugly.) > > If all you are about are the 3 additional variables, can't you instead > > put them into env vars and query them in the tcl code using getenv? > > Or append them into AM_RUNTESTFLAGS ? > > AM_RUNTESTFLAGS +=3D @something@ >=20 > Done, I put them into env vars. > --- a/libgomp/testsuite/Makefile.am > +++ b/libgomp/testsuite/Makefile.am > @@ -11,3 +11,8 @@ EXPECT =3D $(shell if test -f $(top_builddir)/../expect= /expect; then \ > _RUNTEST =3D $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \ > echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi) > RUNTEST =3D "$(_RUNTEST) $(AM_RUNTESTFLAGS)" > + > +# Used for support non-fallback offloading. > +export OFFLOAD_TARGETS =3D $(offload_targets) > +export OFFLOAD_ADDITIONAL_OPTIONS =3D $(offload_additional_options) > +export OFFLOAD_ADDITIONAL_LIB_PATHS =3D $(offload_additional_lib_paths) > --- a/libgomp/testsuite/lib/libgomp.exp > +++ b/libgomp/testsuite/lib/libgomp.exp > @@ -107,6 +107,25 @@ proc libgomp_init { args } { > # Compute what needs to be put into LD_LIBRARY_PATH > set always_ld_library_path ".:${blddir}/.libs" >=20=20 > + # Get offload-related variables from environment (exported by Makefi= le) > + set offload_targets [getenv OFFLOAD_TARGETS] > + set offload_additional_options [getenv OFFLOAD_ADDITIONAL_OPTIONS] > + set offload_additional_lib_paths [getenv OFFLOAD_ADDITIONAL_LIB_PATH= S] > +[...] I have another suggestion: on gomp-4_0-branch, we had already started using a libgomp-test-support.exp file for a similar purpose. I now changed your code on gomp-4_0-branch in r218845 as follows (though, not very much tested). The advantage here is that people who are not using GCC build-tree testing, but are directly invoking runtest, then don't have to set various environment variables, but instead just have to copy this one libgomp-test-support.exp file from the build tree to the testing tree. Does this make sense? commit de01639bf47e29a20959771e587fb6f30c372a45 Author: tschwinge Date: Wed Dec 17 22:45:05 2014 +0000 libgomp: Route offloading data through the libgomp-test-support.exp fil= e. =20=20=20=20 libgomp/ * testsuite/Makefile.am: Don't export OFFLOAD_TARGETS, OFFLOAD_ADDITIONAL_OPTIONS, and OFFLOAD_ADDITIONAL_LIB_PATHS... * testsuite/libgomp-test-support.exp.in: ..., and instead set offload_targets, offload_additional_options, and offload_additional_lib_paths here. Update all users. =20=20=20=20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@2188= 45 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog.gomp | 6 ++++++ libgomp/testsuite/Makefile.am | 5 ----- libgomp/testsuite/Makefile.in | 5 ----- libgomp/testsuite/lib/libgomp.exp | 8 +++----- libgomp/testsuite/libgomp-test-support.exp.in | 4 ++++ 5 files changed, 13 insertions(+), 15 deletions(-) diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp index 1fca220..9c23c80 100644 --- libgomp/ChangeLog.gomp +++ libgomp/ChangeLog.gomp @@ -1,5 +1,11 @@ 2014-12-17 Thomas Schwinge =20 + * testsuite/Makefile.am: Don't export OFFLOAD_TARGETS, + OFFLOAD_ADDITIONAL_OPTIONS, and OFFLOAD_ADDITIONAL_LIB_PATHS... + * testsuite/libgomp-test-support.exp.in: ..., and instead set + offload_targets, offload_additional_options, and + offload_additional_lib_paths here. Update all users. + * testsuite/libgomp.oacc-c++/c++.exp (check_effective_target_oacc_c): Remove, and ... * testsuite/libgomp.oacc-c/c.exp (check_effective_target_oacc_c): diff --git libgomp/testsuite/Makefile.am libgomp/testsuite/Makefile.am index 9cc103a..561b7e2 100644 --- libgomp/testsuite/Makefile.am +++ libgomp/testsuite/Makefile.am @@ -11,8 +11,3 @@ EXPECT =3D $(shell if test -f $(top_builddir)/../expect/e= xpect; then \ _RUNTEST =3D $(shell if test -f $(top_srcdir)/../dejagnu/runtest; then \ echo $(top_srcdir)/../dejagnu/runtest; else echo runtest; fi) RUNTEST =3D "$(_RUNTEST) $(AM_RUNTESTFLAGS)" - -# Used for support non-fallback offloading. -export OFFLOAD_TARGETS =3D $(offload_targets) -export OFFLOAD_ADDITIONAL_OPTIONS =3D $(offload_additional_options) -export OFFLOAD_ADDITIONAL_LIB_PATHS =3D $(offload_additional_lib_paths) diff --git libgomp/testsuite/Makefile.in libgomp/testsuite/Makefile.in index 78b6351..016d0d4 100644 --- libgomp/testsuite/Makefile.in +++ libgomp/testsuite/Makefile.in @@ -421,11 +421,6 @@ uninstall-am: uninstall uninstall-am =20 =20 -# Used for support non-fallback offloading. -export OFFLOAD_TARGETS =3D $(offload_targets) -export OFFLOAD_ADDITIONAL_OPTIONS =3D $(offload_additional_options) -export OFFLOAD_ADDITIONAL_LIB_PATHS =3D $(offload_additional_lib_paths) - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git libgomp/testsuite/lib/libgomp.exp libgomp/testsuite/lib/libgomp.= exp index 81545db..6600c25 100644 --- libgomp/testsuite/lib/libgomp.exp +++ libgomp/testsuite/lib/libgomp.exp @@ -111,13 +111,9 @@ proc libgomp_init { args } { # Compute what needs to be put into LD_LIBRARY_PATH set always_ld_library_path ".:${blddir}/.libs" =20 - # Get offload-related variables from environment (exported by Makefile) - set offload_targets [getenv OFFLOAD_TARGETS] - set offload_additional_options [getenv OFFLOAD_ADDITIONAL_OPTIONS] - set offload_additional_lib_paths [getenv OFFLOAD_ADDITIONAL_LIB_PATHS] - # Add liboffloadmic build directory in LD_LIBRARY_PATH to support # non-fallback testing for Intel MIC targets + global offload_targets if { [string match "*-intelmic-*" $offload_targets] || [string match "*-intelmicemul-*" $offload_targets] } { append always_ld_library_path ":${blddir}/../liboffloadmic/.libs" @@ -126,6 +122,7 @@ proc libgomp_init { args } { append always_ld_library_path ":${blddir}/../libstdc++-v3/src/.libs" } =20 + global offload_additional_lib_paths if { $offload_additional_lib_paths !=3D "" } { append always_ld_library_path "${offload_additional_lib_paths}" } @@ -215,6 +212,7 @@ proc libgomp_init { args } { =20 # Used for support non-fallback offloading. # Help GCC to find target mkoffload. + global offload_additional_options if { $offload_additional_options !=3D "" } { lappend ALWAYS_CFLAGS "additional_flags=3D${offload_additional_options}" } diff --git libgomp/testsuite/libgomp-test-support.exp.in libgomp/testsuite/= libgomp-test-support.exp.in index dcadad7..4586fbe 100644 --- libgomp/testsuite/libgomp-test-support.exp.in +++ libgomp/testsuite/libgomp-test-support.exp.in @@ -1,2 +1,6 @@ set cuda_driver_include "@CUDA_DRIVER_INCLUDE@" set cuda_driver_lib "@CUDA_DRIVER_LIB@" + +set offload_targets "@offload_targets@" +set offload_additional_options "@offload_additional_options@" +set offload_additional_lib_paths "@offload_additional_lib_paths@" Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUkgghAAoJEK3/DN1sMFFt+mMH/2OaU/xQujTG9R/29T5V1C8V VBb+t1RxjwfrFsDUlIlCo60PpHNVvQZh0kXvU82MEgIq84zrYodxpY3JbOHaggM+ cBUVy6FBzjLyEVrPDCupoqbrYib/7r03o+HbCMwKfRz3YWDHB+0y5EoRimxDsZls 4qDfUrdxxorY3KEeLILKYBIWHKLI42/sCApihXtMJHlOjwgu7+M6xB12r48zuUmD QGc+RGTtOXJ+IJPYc6E3kUiNY2pqvRXj6DKEZOly4uOx3E1Nl5itU4ivLew8gaNj +cXkw8CSKLy3pDFlwkTaawdEpq0rMbqIoXnPzoM5nUG/7LEWNq/nnlFqIMst+sA= =GdcJ -----END PGP SIGNATURE----- --=-=-=--