Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28543 Discussions

Different Build results when Building at different times

Mike896
Beginner
376 Views

Hi

I use VS 2008.

I find sometimes I need to Build Solution two or three times then I can have correct comipled and linked results.

I mean I artificially delete some procedure needed to be called.

Then I compile. No errors!

Build once more or twice. then error appears.

Does anybody have this same question?

Mike

0 Kudos
8 Replies
TimP
Honored Contributor III
376 Views

Cases I have seen of non-repeatable compilation include:

1) out-of-memory problems. For example, maybe you were playing a video while compiling (or running a theaded compile), and so your compilation environment wasn't repeatable.

2) linker bugs; e.g. an accidental change in link order provoking a bug

3) memory errors (flaky RAM or disc) (did you defrag and run chkdsk, etc?) If you didn't check for this, put it at #1.

It's tough enough to deal with these situations even when they can be described a little more precisely than you have done.

0 Kudos
Les_Neilson
Valued Contributor II
376 Views
Quoting - Mike896
I find sometimes I need to Build Solution two or three times then I can have correct comipled and linked results.
I mean I artificially delete some procedure needed to be called.
Then I compile. No errors!
Build once more or twice. then error appears.


By "delete some procedures" perhaps you mean "delete the source code" ?
But of course the compiled "obj" file is still around and will still be linked in.
A "cleanfollowed bybuild" or a "rebuild"will remove the obj file(s) and then the link will fail.

Les

0 Kudos
tropfen
New Contributor I
376 Views

my problem with those situations is the following.

I have a project including a number of modules. If i change one module and start the program using the key F5, sometimes the compiler forgotts to recompile my changed module. My breakpoint then are somewhere but not where i want them to be. It is not helpfull.

But i have learnd. So if i have any funny situation like this, i do a compled rebuild.

This is not only happening when my computer is heavely used. It happens randomly. I havend had those situation with the release mode or standard debug mode (ctrl + F5).

Frank

0 Kudos
Mike896
Beginner
376 Views
Quoting - tropfen

my problem with those situations is the following.

I have a project including a number of modules. If i change one module and start the program using the key F5, sometimes the compiler forgotts to recompile my changed module. My breakpoint then are somewhere but not where i want them to be. It is not helpfull.

But i have learnd. So if i have any funny situation like this, i do a compled rebuild.

This is not only happening when my computer is heavely used. It happens randomly. I havend had those situation with the release mode or standard debug mode (ctrl + F5).

Frank

Recently, I do have this problem when debugging and I am confused. I thought I was wrong somewhere.

After hours of trial, I mean I mislead. I thought I was wrong for my very basic idea. I went to read textbook.

Ask around somewhere. Then back to debug again. I confuse again. Then I came here.

Now I understand.

I also don't know why it will not automatically recompile the source filed being modified, when hit Ctrl+F5.

CVF can do it. Well, I don't know if this problem is due to VS2008 or IVF.

Mike

0 Kudos
Les_Neilson
Valued Contributor II
376 Views
Quoting - Mike896

Recently, I do have this problem when debugging and I am confused. I thought I was wrong somewhere.

After hours of trial, I mean I mislead. I thought I was wrong for my very basic idea. I went to read textbook.

Ask around somewhere. Then back to debug again. I confuse again. Then I came here.

Now I understand.

I also don't know why it will not automatically recompile the source filed being modified, when hit Ctrl+F5.

CVF can do it. Well, I don't know if this problem is due to VS2008 or IVF.

Mike

In my days of programmingmainframe and mini computers I spent many a happy hour searching for bugs, staring at code I had edited (but forgotten to compile) or compiled (but forgot to link) and code I was convinced should work -until I showed it to a colleague whereupon I immediately saw what the problem was. Perhaps this is why I am lessexpectant (or dependent) ofthe compiler/IDE to automagically do things for me, and whyI sometimes feel my younger colleagues would benefit from a time pouring over an IBM OC7 hex dump listing (on second thoughts that last one is a bit cruel). A while back I sent them a copy of "Real programmers don't eat quiche" which caused a lot of mirth and has become a catch phrase in the office now.
My real point is I think the programmer should be the one in control and should therefore determine build order, dependencies etc. the tools are there to help, yes, but we should still know what is going on.

Les (who actually likes quiche!)

0 Kudos
Steven_L_Intel1
Employee
376 Views

I suspect that the issue is settings in Visual Studio which control whether or not source changes are saved when you do a Run. Please do this:

  1. In Visual Studio, select Tools > Options > Projects and Solutions > Build and Run
  2. Make sure that the settings look like this:
    • Before building > Save all changes
    • On Run, when projects are out of date > Prompt to build
    • On Run, when build or deployment errors occur > Prompt to launch
    • Other settings not listed may be whatever you want

0 Kudos
Mike896
Beginner
376 Views

I suspect that the issue is settings in Visual Studio which control whether or not source changes are saved when you do a Run. Please do this:

  1. In Visual Studio, select Tools > Options > Projects and Solutions > Build and Run
  2. Make sure that the settings look like this:
    • Before building > Save all changes
    • On Run, when projects are out of date > Prompt to build
    • On Run, when build or deployment errors occur > Prompt to launch
    • Other settings not listed may be whatever you want

I've checked the settings. They look like what you said.

Mike

0 Kudos
Mike896
Beginner
376 Views

I suspect that the issue is settings in Visual Studio which control whether or not source changes are saved when you do a Run. Please do this:

  1. In Visual Studio, select Tools > Options > Projects and Solutions > Build and Run
  2. Make sure that the settings look like this:
    • Before building > Save all changes
    • On Run, when projects are out of date > Prompt to build
    • On Run, when build or deployment errors occur > Prompt to launch
    • Other settings not listed may be whatever you want

Now, I have this problem again.

I have checked these settings, they are the same as you say.

As the previous reply by someone, the errors seem happen quite randomly. This take me hours to debug and finally I don't why the errors are gone.

As also replied by Les, he doesn't rely on IDE.

Is there a way that I can assure myself the built result is the right one?

Mike

0 Kudos
Reply