Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Plugin for Fortran

(1/3) > >>

darmar:
Hello

I would like to make Code::Blocks more usable for Fortran language. I have started to develop FortranProject plugin. This plugin adds code browser for Fortran. Most of code was simply taken from CodeCompletion plugin and very simplified and adapted for Fortran. I tested it on Windows and Linux.
It would be nice if somebody tried this plugin and wrote his opinion or suggestions about it.

Now I am thinking about the compilation of Fortran files. It is easy to add some fortran compiler in CB as is described in http://wiki.codeblocks.org/index.php?title=Installing_Fortran_Compiler. And with Fortran77 it works. But in Fortran90, if modules are used, files depends on each other. As a result, files have to be compiled in particular order and the change in one file should force recompilation another one.

What can I do to solve this problem in CB?

Thanks for your opinion and suggestions.

[attachment deleted by admin]

ffmo:
Hi,

Thanks for sharing your plugin.

As to the compilation problem, you can try to give the module source higher priority in the 'Build' tab of the 'Propertity' dialog.

MortenMacFly:

--- Quote from: darmar on August 18, 2009, 09:49:31 am ---What can I do to solve this problem in CB?

--- End quote ---
In terms of a "module" I would suggest you create special targets for the modules actually being static libraries and then link everything together. This also allows you sharing of the modules without hassle. However - as ffmo said: The compilation priority would be another (good) choice.

darmar:
Thank you ffmo and MortenMacFly for your suggestions.
Now I think, that the plugin could follow these steps:
1) After parsing of files, the plugin should collect information about file dependencies using parsed information (I have started to work with it).
2) Sets file weights in order to compile in right order.
3) Two possibilities: a) Removes object files (*.o) of dependent files if the parsed file was changed. In this way the dependent files will be forced to recompile. b) Second possibility (may be) is to write some script which is run in the pre-compilation step. But this script should somehow access information from the plugin, and I don't know if it is possible.

What is your opinion?

Thank you in advance.

MortenMacFly:

--- Quote from: darmar on September 08, 2009, 07:44:44 pm ---3) Two possibilities: a) Removes object files (*.o) of dependent files if the parsed file was changed. In this way the dependent files will be forced to recompile. b) Second possibility (may be) is to write some script which is run in the pre-compilation step. But this script should somehow access information from the plugin, and I don't know if it is possible.

--- End quote ---
Can't you manage all that just with dependencies as it's done in C/C++, too? I mean: If you setup the module as external dependency through the project's (targets) option, then if the module has changed the main project will automatically be re-linked, re-compiled (if needed).

Can you provide a sample so that I can better understand?

Navigation

[0] Message Index

[#] Next page

Go to full version