Bug 35276 - Doc should described how to compile mixed-language programs
Summary: Doc should described how to compile mixed-language programs
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.4.0
: P3 enhancement
Target Milestone: ---
Assignee: sandra
URL:
Keywords: documentation
Depends on:
Blocks: 89078
  Show dependency treegraph
 
Reported: 2008-02-21 10:04 UTC by Francois-Xavier Coudert
Modified: 2021-11-05 21:14 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-02-21 10:07:41


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francois-Xavier Coudert 2008-02-21 10:04:14 UTC
I think "Part I: Invoking GNU Fortran" of the gfortran documentation should have a section on "Compiling (and linking) mixed-language programs". Whether this should be a section or a subsection I don't know, but it's really a commonly asked question and we ought to have explanations and examples of that in the doc.
Comment 1 Francois-Xavier Coudert 2008-02-21 10:07:41 UTC
I've posted explanations and examples on comp.lang.fortran that might be used as a starting point: http://groups.google.com/group/comp.lang.fortran/msg/a62f1aa0c1592838

Linking to C++ and other languages might also be interesting. Also, when documentation about our calling conventions is written, we can link these two parts.

PS: Maybe we should also add information on how to create shared libraries of gfortran-compiled Fortran code? Or is that too generic to be in our doc?
Comment 2 Thomas Koenig 2017-10-22 14:18:54 UTC
I think we can close this. The preferred way is to
use C interop. Anybody mind if I close this?
Comment 3 Dominique d'Humieres 2017-10-22 14:29:54 UTC
> I think we can close this. The preferred way is to
> use C interop. Anybody mind if I close this?

Or "is there important things to add to 7 Mixed-Language Programming?".
Comment 4 Jürgen Reuter 2019-01-21 19:58:17 UTC
It seems that at least Thomas and Dominique believe that this can be closed.
Comment 5 Eric Gallager 2019-01-22 00:40:18 UTC
(In reply to Jürgen Reuter from comment #4)
> It seems that at least Thomas and Dominique believe that this can be closed.

with which status?
Comment 6 Thomas Koenig 2019-03-31 20:59:57 UTC
(In reply to Eric Gallager from comment #5)
> (In reply to Jürgen Reuter from comment #4)
> > It seems that at least Thomas and Dominique believe that this can be closed.
> 
> with which status?

We need to extend that chapter with the new status for gcc 9 after
Paul's fixes have all gone in.

After that, I we should close this as FIXED.
Comment 7 Eric Gallager 2019-06-30 04:16:52 UTC
(In reply to Thomas Koenig from comment #6)
> (In reply to Eric Gallager from comment #5)
> > (In reply to Jürgen Reuter from comment #4)
> > > It seems that at least Thomas and Dominique believe that this can be closed.
> > 
> > with which status?
> 
> We need to extend that chapter with the new status for gcc 9 after
> Paul's fixes have all gone in.
> 
> After that, I we should close this as FIXED.

Have Paul's fixes all gone in yet?
Comment 8 Eric Gallager 2021-11-03 20:12:24 UTC
Sandra Loosemore and Martin Liska have been discussing how to update the fortran docs on gcc-patches lately; cc-ing them
Comment 9 sandra 2021-11-03 20:37:26 UTC
Well, it looks to me like we currently do not document exactly how to link mixed-language programs, although chapter 7 does cover related concepts like what you have to do to initialize libgfortran if you are linking e.g. a fortran library with a main in some other language.  I think this topic does belong in chapter 7 and not any other part of the manual, and that we should not close it.  I'll add it to my queue.
Comment 10 GCC Commits 2021-11-05 21:08:50 UTC
The master branch has been updated by Sandra Loosemore <sandra@gcc.gnu.org>:

https://gcc.gnu.org/g:452a0afbace650d7c0f2811e2b47e62dcd18e1fd

commit r12-4959-g452a0afbace650d7c0f2811e2b47e62dcd18e1fd
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Fri Nov 5 14:01:03 2021 -0700

    Fortran: Add more documentation for mixed-language programming [PR35276]
    
    2021-11-05  Sandra Loosemore  <sandra@codesourcery.com>
    
            PR fortran/35276
    
            gcc/fortran/
            * gfortran.texi (Mixed-Language Programming): Talk about C++,
            and how to link.
Comment 11 sandra 2021-11-05 21:14:25 UTC
Should be fixed now.  I added paragraphs about both C++ compatibility and how to link.