Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Lexers for Fortran (77)

(1/3) > >>

MortenMacFly:
Dear Code::Blocks-Team,

don't panic - I don't really like Fortran but I am forced to use it in a few of my projects. I've written lexers for Fortran77 which I would be willing to provide (lexer_f77.sample, lexer_f77.xml). I wonder if:
1.) You'd be interested in this at all?
2.) Where/how I should upload these files?

I am planning furthermore a compiler plugin for G77 which would allow Code::Blocks full Fortran development. This should (normally) be easy to to -> just use the GCC plugin and replace GCC with G77...?!

With regards,

Morten.

Ps: Keep up the good work!

thomas:
Don't think that is necessary. If you have gcc installed with Fortran, then gcc should actually compile your Fortran files right away, as gcc is only a compiler frontend (gcc calls g++ or g77 or whatever it needs to compile a certain file).

But replacing gcc with g77 should be fine, too. g77 is to support all of gcc's standard options and parameters, so it should just work.

Something that may be interesting, though, may be a compiler plugin that also offers Fortran-specific options :)

EDIT:
I have never used Fortran, nor do I have it installed here, but try this:



I would not be surprised at all if gcc just compiles after that. If so, all that needs to be done in code::blocks to support Fortran is include your syntax schema and make code::blocks treat .F files as source.

rickg22:
OK, first of all:

1) Does it work on your machine? Have you tested it?

2) Submit a patch at sourceforge (the links are on the left).

3) We'll tell you when we get it implemented.

MortenMacFly:
Dear rickg22,

Concerning the lexer files:
> 1) Does it work on your machine? Have you tested it?
Yes, it works and yes, I've tested it thoroughly.
> 2) Submit a patch at sourceforge (the links are on the left).
I've done this by now.
> 3) We'll tell you when we get it implemented.
Ok. I stay tuned - there is no hurry.

Concerning hint with CPP environment variable (...) from above:
This rocks! It was indeed possible using this trick to compile the fortran files. However, there are still open "issues":
1.) One is required to install the F77 package from MinGW. GCC only does not work (missing the f2c library).
2.) Linking fails with:
D:\Devel\CodeBlocks\lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
This is true if linking without the "-lg2c" switch. However - even if I add this switch under "Other linker options" it still does not link. I am working on this - If I find a reason I'll tell. I believe that I am only missing a bit here. Is there a way to see the full compile/link command issued by Code::Blocks IDE?

With regards

Morten.

Ps.: I cannot stop to repeat: Code::Blocks rocks!!!

Urxae:

--- Quote from: MortenMacFly on August 18, 2005, 09:05:00 am ---Concerning hint with CPP environment variable (...) from above:
This rocks! It was indeed possible using this trick to compile the fortran files. However, there are still open "issues":
1.) One is required to install the F77 package from MinGW. GCC only does not work (missing the f2c library).

--- End quote ---
Well, you can hardly expect Code::Blocks or MinGW.org to bundle support for every obscure language (no offence) into the default install. Most people don't need Fortran, those that do need it just have to install support for it separately.


--- Quote ---2.) Linking fails with:
D:\Devel\CodeBlocks\lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
This is true if linking without the "-lg2c" switch. However - even if I add this switch under "Other linker options" it still does not link. I am working on this - If I find a reason I'll tell. I believe that I am only missing a bit here.

--- End quote ---
It looks like the linker thinks you want to compile a Windows GUI program, but your object files disagree and want to be a console program. Is your target set to "Console program" in your project properties?


--- Quote ---Is there a way to see the full compile/link command issued by Code::Blocks IDE?

--- End quote ---
Settings -> Compiler -> tab "Other" -> Compiler Logging -> Full command line :)

Navigation

[0] Message Index

[#] Next page

Go to full version