public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [wwwdocs] gcc-14/changes.htm - Offloading: -lm/-lgfortran is autolinked
@ 2023-06-16 13:43 Tobias Burnus
  2023-06-16 16:24 ` Gerald Pfeifer
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Burnus @ 2023-06-16 13:43 UTC (permalink / raw)
  To: gcc-patches, Gerald Pfeifer, Thomas Schwinge

[-- Attachment #1: Type: text/plain, Size: 964 bytes --]

Thomas recently improved the offload experience by avoiding to use, e.g.

   gfortran -O3 -fopenmp qcd.f90 -lblas -foffload-options="-lgfortran -lm"

as libm and libgfortran now automatically get linked as 'gfortran' links
-lgfortran and -lm on the host (only those libraries, not others). Thus,
the commandline now looks much more natural:

   gfortran -O3 -fopenmp qcd.f90 -lblas

→ https.//gcc.gnu.org/r14-1807-g4bcb46b3ade179 for the code change.

Attached patch documents it in the release notes.
I loved to hear comments, suggestions, improvements (or even appraisals).

If not, I just will commit it eventually as is - and it has to be improved
later on ...

Tobias
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Attachment #2: off-dev.diff --]
[-- Type: text/x-patch, Size: 1006 bytes --]

gcc-14/changes.htm - Offloading: -lm/-lgfortran is autolinked

diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html
index c403c94f..96653f05 100644
--- a/htdocs/gcc-14/changes.html
+++ b/htdocs/gcc-14/changes.html
@@ -51,6 +51,15 @@ a work-in-progress.</p>
       was extended.
     </li>
   </ul>
+  </li>
+  <li>For offload-device code generated via OpenMP and OpenACC, the math
+      library and the Fortran runtime library will now automatically be linked,
+      when the user or compiler links them on the host side. Thus, it is no
+      longer required to explicitly pass <code>-lm</code> and/or
+      <code>-lgfortran</code> to the offload-device linker using the <a
+      href="https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-foffload-options"
+      ><code>-foffload-options=</code></a> flag.
+  </li>
 </ul>
 <!-- .................................................................. -->
 <h2 id="languages">New Languages and Language specific improvements</h2>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [wwwdocs] gcc-14/changes.htm - Offloading: -lm/-lgfortran is autolinked
  2023-06-16 13:43 [wwwdocs] gcc-14/changes.htm - Offloading: -lm/-lgfortran is autolinked Tobias Burnus
@ 2023-06-16 16:24 ` Gerald Pfeifer
  0 siblings, 0 replies; 2+ messages in thread
From: Gerald Pfeifer @ 2023-06-16 16:24 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: gcc-patches, Thomas Schwinge

On Fri, 16 Jun 2023, Tobias Burnus wrote:
> Thomas recently improved the offload experience by avoiding to use, e.g.
> 
>   gfortran -O3 -fopenmp qcd.f90 -lblas -foffload-options="-lgfortran -lm"
> 
> as libm and libgfortran now automatically get linked as 'gfortran' links
> -lgfortran and -lm on the host (only those libraries, not others). Thus,
> the commandline now looks much more natural:
> 
>   gfortran -O3 -fopenmp qcd.f90 -lblas

Nice!

> Attached patch documents it in the release notes.
> I loved to hear comments, suggestions, improvements (or even appraisals).

Looks good to me. (Personally I would have written "the math and 
Fortran runtime libraries", which is shorter, but pretty much a matter 
of preference. IOW, keep it as is unless you like it better, too. :-)

One idea might be to show the two invocations - before and after - in the 
release notes as well, at the end of that new entry. Totally up to you, 
too.


For the benefit of the doubt: Okay, thank you!

Gerald

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-16 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-16 13:43 [wwwdocs] gcc-14/changes.htm - Offloading: -lm/-lgfortran is autolinked Tobias Burnus
2023-06-16 16:24 ` Gerald Pfeifer

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).