Hi, 2014-12-18 16:27 GMT+01:00 Thomas Schwinge <tho...@codesourcery.com>: > Hi! > > On Thu, 30 Oct 2014 14:40:01 +0300, Ilya Verbin <iver...@gmail.com> wrote: >> This patch allows to run non-fallback 'make check-target-libgomp'. It >> passes to >> the host compiler additional -B options with the paths to the offload >> compilers, >> since non-installed host compiler doesn't know where to find mkoffload tools. >> Also in case of intelmic offload targets it appends paths to liboffloadmic >> lib. > >> --- a/libgomp/configure.ac >> +++ b/libgomp/configure.ac >> @@ -280,9 +280,13 @@ else >> multilib_arg= >> fi >> >> +# Get accel target and path to install tree of accel compiler >> +offload_additional_options= >> +offload_additional_lib_paths= >> offload_targets= >> if test x"$enable_offload_targets" != x; then >> for tgt in `echo $enable_offload_targets | sed -e 's#,# #g'`; do >> + tgt_dir=`echo $tgt | grep '=' | sed 's/.*=//'` >> tgt=`echo $tgt | sed 's/=.*//'` >> case $tgt in >> *-intelmic-* | *-intelmicemul-*) >> @@ -295,10 +299,20 @@ if test x"$enable_offload_targets" != x; then >> else >> offload_targets=$offload_targets,$tgt_name >> fi >> + if test x"$tgt_dir" != x; then >> + offload_additional_options="$offload_additional_options >> -B$tgt_dir/libexec/gcc/\$(target_alias)/\$(gcc_version) -B$tgt_dir/bin" >> + >> offload_additional_lib_paths="$offload_additional_lib_paths:$tgt_dir/lib64:$tgt_dir/lib" >> + else >> + offload_additional_options="$offload_additional_options >> -B\$(libexecdir)/gcc/\$(target_alias)/\$(gcc_version) -B\$(bindir)" >> + >> offload_additional_lib_paths="$offload_additional_lib_paths:$toolexeclibdir" >> + fi >> done >> fi > > Hmm, maybe I'm seeing a problem where there isn't one, but in case I'm > not: how will this work if there is more than one offloading compiler > configured? Won't you get conflicting -B paths added to > offload_additional_options in this case? > >> --- a/libgomp/testsuite/lib/libgomp.exp >> +++ b/libgomp/testsuite/lib/libgomp.exp >> @@ -169,6 +186,10 @@ proc libgomp_init { args } { >> >> # Disable color diagnostics >> lappend ALWAYS_CFLAGS "additional_flags=-fdiagnostics-color=never" >> + >> + # Required to support non-fallback testing of '#pragma omp target'. >> + # Help GCC to find target mkoffload. >> + lappend ALWAYS_CFLAGS "additional_flags=${offload_additional_options}" >> } > > What we're doing in OpenACC offloading testing (gomp-4_0-branch), is in > the libgomp.oacc-c/c.exp (etc.) file cycle through all the available > offloading devices, and then in there -- I think -- such options should > be set, that are specific to one particular offloading device/compiler? > > > Grüße, > Thomas
I have not tested a compiler, configured to support 2 different offloading targets, so there might be some corner cases. In this place I don't see any problems, at least for the case with installed offloading compilers. One -B allows to find mkoffload in lto-wrapper:compile_offload_image. This function tries to open all paths + '/accel/target_name/mkoffload' suffix. So, there should be no conflicts. Another -B allows mkoffload to find target driver. It tries to open 'host_name-accel-target_name-gcc', so, there also should be no conflicts. However, I still did not tried to enable 'make check' with non-installed offloading compilers. Probably such target specific paths can help there. -- Ilya