Author Topic: Priority weight getting reset  (Read 2398 times)

Offline gib

  • Multiple posting newcomer
  • *
  • Posts: 42
Priority weight getting reset
« on: August 03, 2019, 06:06:59 am »
Hello,
I'm using CB 16.01 on Ubuntu (this is the version that Ubuntu provided).  I am building a Fortran library (with gfortran) made up of about 15 files.  Since the files use modules (stored in .mod files) generated in the compilation of other files, it is necessary to ensure the correct sequence of compilation by setting the priority weights.  What I've noticed is that from time to time a priority weight is reset to the default value (50).  Because the .mod files are not deleted in a clean, this led to baffling build failures until I found out what was happening.  I wonder if this resetting of the weights is a known issue.

As a related question, can the dependencies feature be used to set the compilation order?

Another minor editting question: annoyingly often, when moving the cursor to column 1, I accidentally click on the vertical line with '-' boxes, causing the whole subroutine code to be replaced by a '+' box.  After clicking the + I need to scroll down to find the point where I was working.  There may be a way to turn off this behaviour, but I can't search for it in the settings because I don't know what it's called.

Thanks
Gib
« Last Edit: August 03, 2019, 08:03:42 am by gib »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Priority weight getting reset
« Reply #1 on: August 03, 2019, 11:37:32 am »
Quote
I'm using CB 16.01 on Ubuntu (this is the version that Ubuntu provided).  I am building a Fortran library (with gfortran) made up of about 15 files.  Since the files use modules (stored in .mod files) generated in the compilation of other files, it is necessary to ensure the correct sequence of compilation by setting the priority weights.  What I've noticed is that from time to time a priority weight is reset to the default value (50).  Because the .mod files are not deleted in a clean, this led to baffling build failures until I found out what was happening.  I wonder if this resetting of the weights is a known issue.
I do not use fortran so i do not know what .mod files are, and how they are generated and how this all interacts with codeblocks... Can you give a minimal example project? Or reproduce this with a c project?

Quote
Another minor editting question: annoyingly often, when moving the cursor to column 1, I accidentally click on the vertical line with '-' boxes, causing the whole subroutine code to be replaced by a '+' box.  After clicking the + I need to scroll down to find the point where I was working.  There may be a way to turn off this behaviour, but I can't search for it in the settings because I don't know what it's called.
I am sorry, but i do not think there is such a option. You can try the key combination Alt+left arrow key to jump back where you were working

Offline gib

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Priority weight getting reset
« Reply #2 on: August 03, 2019, 12:48:27 pm »
I just installed CB 17.12 on a Windows machine, and it seems that there are some useful changes.  Now a clean does remove the .mod files, and the priority weights for the 3 source files in my simple test were automatically given values 0,1,2, ensuring the correct sequence of compilation.  Maybe the resetting issue will also be fixed.  (I assume the behaviour will be the same on Linux.)

I am attaching the 3 source files and the project file so that you can see what Fortran modules are, in case you are interested.  The .mod files get created in the same place as the .o files (obj\Release in this case.)  If you clean then try to compile amod.f90 you'll see that the compilation fails because the file bmod.mod, needed by the 'use bmod' statement is missing.  Building the whole program works fine because the sequence is bmod.f90, amod.f90, main.f90.