List Info

Thread: Emacs and GFortran




Emacs and GFortran
user name
2006-10-30 15:27:48
I do not know if we are speaking of the same thing.

I refer to the possibility to use Emacs like an IDE with
GFortran.

I will try to be more clear with this example.

-------------------------------------
$ cat hello.F
      program hello
      implicit none
      write(*,) 'Hello!'
      end
-------------------------------------

In Emacs:

M-x compile
g77 hello.F

----------------- *compilation* ----------------
-*- mode: compilation; default-directory: "/tmp/"
-*-
Compilation started at Mon Oct 30 15:59:21

g77 hello.F
hello.F: In program `hello':
hello.F:3:                                       <===
         write(*,) 'Hello!'
                 ^
Expression at (^) has incorrect data type or rank for its
context

Compilation exited abnormally with code 1 at Mon Oct 30
15:59:28
----------------

Now clicking with mouse-1 (on 'hello.F:3' in '<===')
jumps to line 3 so we
can examine where the compilation fails (Image a multifile
application
with thousands of line of code).


Now using GFortran


M-x compile
gfortran hello.F

----------------- *compilation* ----------------
-*- mode: compilation; default-directory: "/tmp/"
-*-
Compilation started at Mon Oct 30 16:10:09

gfortran hello.F
 In file hello.F:3

      write(*,) 'Hello!'                                    
           
             1
Error: Syntax error in WRITE statement at (1)

Compilation exited abnormally with code 1 at Mon Oct 30
16:10:12
------------------

But we cannot jump to the wrong line clicking with mouse, we
only know
that the error occurs at line 3 which we reach manually.


Obviously this happens even if one uses pure F95 code.


   Angelo.


On Mon, 30 Oct 2006, Stefan Monnier wrote:

> > I would ask if there is a way to integrate Emacs
with GFortran so that in
> > case of compiler error one can jump to the line
wher the error is born.
> 
> > This works with G77, GCC and G++ but not with
GFortran.
> 
> Does that mean that GFortran does not use the standard
GNU error format?
> That would be unfortunate (and may be better fixed on
GFortran's side).
> Could you show us some sample error/warning messages?
> 
> 
>         Stefan
> 



_______________________________________________
Emacs-devel mailing list
Emacs-develgnu.org
htt
p://lists.gnu.org/mailman/listinfo/emacs-devel
Emacs and GFortran
user name
2006-10-30 15:38:20
> I do not know if we are speaking of the same thing.

We are.

> hello.F:3:                                      
<===

This is the error message using the standard GNU format
"<file>:<filenb>:<txt>".

>  In file hello.F:3

This uses a gratuitously different format.  Please complain
to the GFortran
authors about it.  Maybe they have a good reason for it, of
course, in which
case we'd like to know about it.  But otherwise, they should
change it to
follow GNU standards.


        Stefan


_______________________________________________
Emacs-devel mailing list
Emacs-develgnu.org
htt
p://lists.gnu.org/mailman/listinfo/emacs-devel
Emacs and GFortran
user name
2006-10-30 15:38:20
> I do not know if we are speaking of the same thing.

We are.

> hello.F:3:                                      
<===

This is the error message using the standard GNU format
"<file>:<filenb>:<txt>".

>  In file hello.F:3

This uses a gratuitously different format.  Please complain
to the GFortran
authors about it.  Maybe they have a good reason for it, of
course, in which
case we'd like to know about it.  But otherwise, they should
change it to
follow GNU standards.


        Stefan


_______________________________________________
Emacs-devel mailing list
Emacs-develgnu.org
htt
p://lists.gnu.org/mailman/listinfo/emacs-devel
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )