forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Module dependencies

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Clay



Joined: 20 Mar 2014
Posts: 17

PostPosted: Mon Mar 02, 2020 11:07 pm    Post subject: Module dependencies Reply with quote

I'm trying to use Plato Project to manage our program (1000 source files, a couple hundred of them are modules). I add the *.f95 files to the project, rebuild dependencies, and rebuild the executable... but the project fails to compile the modules first. This leads to a ton of failed compiles. Is there a special trick to get dependencies in modules to kick in?

Some dependencies are layered (use ModuleA, which uses ModuleB, which uses ModuleC, ...) but no cycles.

As a follow up, if I repeatedly rebuild, rebuild, rebuild over and over, eventually all of the required MOD files accumulate and the executable builds. But I thought that managing this was what dependency mapping was supposed to handle for me?
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2184
Location: Sydney

PostPosted: Tue Mar 03, 2020 5:12 am    Post subject: Reply with quote

Have you tried the Build > Rebuild Dependency option ?
If you have, is this not working for your set of files, or if not it should help.

Also, look at File dependency help in FTN95 > Plato help, as this does refer to your case of large numbers of files.

Let us know how you go as the help implies that Rebuild should do what is required.

( The other option is to write your own rebuild_my_project.bat with all files listed in the correct order !! This always works for me, including my variety of compilation options for different types of files, such as selective use of /opt for compute intensive or /debug for data input )
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1335

PostPosted: Tue Mar 03, 2020 12:06 pm    Post subject: Reply with quote

To read about some noteworthy points on how Plato generates and uses file dependencies, please search for "dependencies" in the FTN95 help file.

"Clean" does not rebuild the dependency table. The dependency table is generated and used only if "Enable Dependency Checking" is selected in the Plato "Project" pull-down menu.

Since, in a large project such as yours, dependency checking can take quite a bit of time, the following procedure may be helpful:

1. For the first complete build, turn "Enable Dependency Checking" on so that the dependency table can be generated.

2. For subsequent builds, in which source code changes are made but without affecting the dependencies, turn "Enable Dep ..." off.

3. If you make changes to the sources that result in adding or deleting modules, or changing USE statements, turn "Enable Dep ..." on for just the first complete build undertaken after such changes.

An alternative to using Plato's build capability is to generate and use a makefile, which is what I use most often for larger projects.
Back to top
View user's profile Send private message
Clay



Joined: 20 Mar 2014
Posts: 17

PostPosted: Tue Mar 03, 2020 3:17 pm    Post subject: Reply with quote

Thank you for the feedback! Let me further clarify my question:

When a module is compiled, two files are created:
*.MOD stays in the source folder and *.OBJ goes into the build folder created by the project.

Here is the sequence of steps I take:
1 - delete all *.obj manually or using Clean
2 - delete all *.mod manually
3 - Rebuild Dependencies
4 - Rebuild project

Observation:
Compilation order *does not* compile modules in an order that provides the *.MOD files when the subs/functions that use them get compiled. In other words, the dependency map is not correctly sorting my modules early enough in the sequence. If I rebuild the project over and over, eventually all of the *.MOD files accummulate in the source folder and I'm able to build an executable. (This takes several iterations because of the fact that a lot of my modules use other modules.)

Question:
Does that mean my project is too big for Plato's Project to handle, or is there something I can do to get the correct dependencies automatically?

Historically we have maintained manual batch files to keep the order straight, but this is tedious and error prone. I was hoping that Silverfrost / Plato offered an automated option for keeping track of dependencies. I think I'm hearing that for projects as big as mine that I have to manage these details myself. Bummer!

Thanks again for any help.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6404
Location: Salford, UK

PostPosted: Tue Mar 03, 2020 3:52 pm    Post subject: Reply with quote

Plato should manage to create the list of dependencies but evidently your project has proved to be too complex.

You should be able to get around the problem by repeatedly clicking on "Build". But once you use "Clean" you will be back to square one.

At worst you can click on "Compile" for the files that contain the modules or perhaps look at the list of dependent files listed in your project.ini file.

In the project.ini file, each source file has a "Handle" and the [Dependents] section lists the dependencies...

2=1*

means that file 2 is dependent on a module in file 1.
* means a module dependency, otherwise it would be an INCLUDE file dependency.

It is important to note that INCLUDEd files must not be added to the project since they are not separately compiled. Plato automatically lists these for you in the Project Explorer window.
Back to top
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1381
Location: Aerospace Valley

PostPosted: Thu Mar 12, 2020 1:14 am    Post subject: Reply with quote

paul wrote:
Quote:
You should be able to get around the problem by repeatedly clicking on "Build".

forgive me for saying this Paul but that statement isn't exactly full of obvious robust logic
... if at first you don' succeed just keep on clickin' !
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group