public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Thomas Schwinge <thomas@codesourcery.com>
Cc: Ilya Verbin <iverbin@gmail.com>,
	Bernd Schmidt <bernds@codesourcery.com>,
	       Richard Biener <richard.guenther@gmail.com>,
	       Jan Hubicka <hubicka@ucw.cz>,
	gcc-patches@gcc.gnu.org,
	       Joseph Myers <joseph@codesourcery.com>
Subject: Re: nvptx offloading patches [3/n], RFD
Date: Wed, 18 Feb 2015 12:35:00 -0000	[thread overview]
Message-ID: <20150218123518.GM1746@tucnak.redhat.com> (raw)
In-Reply-To: <87vbize7zi.fsf@schwinge.name>

On Wed, Feb 18, 2015 at 01:09:53PM +0100, Thomas Schwinge wrote:
> On Wed, 18 Feb 2015 12:34:38 +0100, Jakub Jelinek <jakub@redhat.com> wrote:
> > On Wed, Feb 18, 2015 at 10:12:19AM +0100, Thomas Schwinge wrote:
> > > Do you literally have »nvptx-newlib symlinked into the gcc tree as
> > > newlib«?  If yes, then that should explain the problem: as I wrote in
> > > <http://news.gmane.org/find-root.php?message_id=%3C87egq8mir1.fsf%40schwinge.name%3E>,
> > > you need to »add a symbolic link to nvptx-newlib's newlib directory to
> > > the directory containing the GCC sources«, so not link [GCC]/newlib ->
> > > [newlib-nvptx], but [GCC]/newlib -> [newlib-nvptx]/newlib.  Does that
> > > resolve the issue?
> 
> (It did.)  Can you suggest a better wording, to make this more clear in
> the documentation?

Your wording is fine, but should be listed on wiki/Offloading and
doc/install.texi perhaps too?

> > offloading fails:
> > 
> > /usr/src/gcc/objnvptxinst/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/5.0.0//accel/nvptx-none/mkoffload @/tmp/cce9PdmR
> > x86_64-pc-linux-gnu-accel-nvptx-none-gcc: error: language lto not recognized
> > x86_64-pc-linux-gnu-accel-nvptx-none-gcc: error: language lto not recognized
> > mkoffload: fatal error: /usr/src/gcc/objnvptxinst/usr/local/bin/x86_64-pc-linux-gnu-accel-nvptx-none-gcc returned 1 exit status
> > compilation terminated.
> > lto-wrapper: fatal error: /usr/src/gcc/objnvptxinst/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/5.0.0//accel/nvptx-none/mkoffload returned 1 exit status
> > compilation terminated.
> > /usr/bin/ld: lto-wrapper failed
> > collect2: error: ld returned 1 exit status
> > 
> > Is --enable-languages=c,c++,fortran,lto required when configuring the
> > offload compiler?  It isn't required for intelmic.
> 
> Yes, exactly.  I assume the reason is that x86_64-intelmicemul-linux-gnu
> defaults to supporting LTO, and due to this also defaults to building the
> LTO front end.  I'll enhance the nvptx offloading documentation
> accordingly.  Maybe we should add some "magic" to build the LTO front end
> if --enable-as-accelerator-for=[...] has been specified?

Toplevel configure.ac has:
  # If LTO is enabled, add the LTO front end.
  if test "$enable_lto" = "yes" ; then
    case ,${enable_languages}, in
      *,lto,*) ;;
      *) enable_languages="${enable_languages},lto" ;;
    esac
    if test "${build_lto_plugin}" = "yes" ; then
      configdirs="$configdirs lto-plugin"
    fi
  fi
so IMHO we want similar snippet for the --enable-as-accelerator-for= case,
perhaps right below this one.  Not building lto FE for the accelerator
compilers make them completely useless, thus I think we really want to do
that automatically.

> Note that I recently added another prerequisite patch for nvptx
> offloading to <https://gcc.gnu.org/wiki/Offloading#nvptx_Offloading>:
> <http://news.gmane.org/find-root.php?message_id=%3C546CF508.9010807%40codesourcery.com%3E>.
> If that is not applied, you'll get run-time errors because in
> libgomp/plugin/plugin-nvptx.c:GOMP_OFFLOAD_get_table, cuModuleGetFunction
> can't find main$_omp_fn$0 and similar symbols.

Can you adjust that to add a cgraph flag alongside of the offloadable
instead and use that instead of the attribute?

	Jakub

  reply	other threads:[~2015-02-18 12:35 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-01 11:58 Bernd Schmidt
2014-11-03 22:28 ` Jeff Law
2014-11-04 12:38   ` nvptx offloading patches [3/n], i386 bits RFD Bernd Schmidt
2014-11-04 18:58     ` Uros Bizjak
2014-11-04 21:50     ` Jeff Law
2014-11-05  0:23       ` Bernd Schmidt
2014-11-14 18:42         ` Bernd Schmidt
2015-02-04 11:38 ` nvptx offloading patches [3/n], RFD Jakub Jelinek
2015-02-09 10:20   ` Richard Biener
2015-02-16 21:08     ` Jakub Jelinek
2015-02-16 21:35       ` Richard Biener
2015-02-16 21:44         ` Jakub Jelinek
2015-02-17 10:00           ` Richard Biener
2015-02-18 10:00             ` Jakub Jelinek
2015-02-25  8:51               ` Patch ping Jakub Jelinek
2015-02-25  9:30                 ` Richard Biener
2015-02-25 16:51                   ` Jakub Jelinek
2015-02-18  9:05           ` nvptx offloading patches [3/n], RFD Thomas Schwinge
2015-02-17 13:32       ` Ilya Verbin
2015-02-17 15:39         ` Jakub Jelinek
2015-02-17 16:21           ` Joseph Myers
2015-02-17 16:40             ` Jakub Jelinek
2015-02-18  9:12               ` Thomas Schwinge
2015-02-18 10:27                 ` Jakub Jelinek
2015-02-18 11:34                 ` Jakub Jelinek
2015-02-18 12:10                   ` Thomas Schwinge
2015-02-18 12:35                     ` Jakub Jelinek [this message]
2015-02-19 10:50                       ` If we're building an offloading compiler, always enable the LTO front end (was: nvptx offloading patches [3/n], RFD) Thomas Schwinge
2015-02-19 10:53                         ` Jakub Jelinek
2015-02-20  9:42                           ` Thomas Schwinge
2015-02-19 10:20               ` nvptx offloading patches [3/n], RFD Bernd Schmidt
2015-02-19 12:02                 ` Offloading compilers' support libraries (was: nvptx offloading patches [3/n], RFD) Thomas Schwinge
2015-02-19 12:11                   ` Offloading compilers' support libraries Bernd Schmidt
2015-02-19 12:19                     ` Thomas Schwinge
2015-02-20 15:35                       ` Ilya Verbin
2015-02-20 19:59                         ` Ilya Verbin
2015-02-26 19:35                           ` Ilya Verbin
2015-02-20  9:33                 ` Offloading compilers' libgcc installation (was: nvptx offloading patches [3/n], RFD) Thomas Schwinge
2015-02-20 19:32                   ` Ilya Verbin
2015-03-10 12:35                     ` Offloading compilers' libgcc installation Thomas Schwinge
2015-04-27 16:15                       ` Thomas Schwinge
2015-04-27 16:16                         ` Jakub Jelinek

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=20150218123518.GM1746@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=bernds@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=iverbin@gmail.com \
    --cc=joseph@codesourcery.com \
    --cc=richard.guenther@gmail.com \
    --cc=thomas@codesourcery.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).