Topic: Probably another dumb question

I get my build done, but if I make a change in the source and try to recompile/build, I get this:

==============================================================================
Generating Makefile... Okay
==============================================================================
Compiling ..\..\EnergyPlus-Dev\WeatherData\Misc-Utilities\FixStatEPW.f90
Generating target.exe
c:/program files (x86)/simply fortran 3/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file target.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
Error: Last command making (target.exe) returned a bad status
Error: Deleting (target.exe): Permission denied
Error: Make execution terminated

* Failed *

I've tried running as adminstrator.  Trying to delete in a command window tells me permission denied.  What do I need to do?

Linda

-----
Linda

Re: Probably another dumb question

Linda,

This issue occurs the compiler can't currently write the executable file because the operating system is blocking the process.  Usually, the cause is one of the following:

  • Your program is still running

  • A virus scanner has the executable locked for scanning

The first is easy to check.  If you open the Windows Task Manager and go to the Details tab, you should be able to locate any instances of target.exe that are running and attempt to kill them.  If your program isn't ending itself, look into why that may be.  Are you using any parallel extensions like OpenMP or Coarrays?  Are you sure the program actually terminates?

When I have the above issue, I find that running my Fortran in an "External Console," available in Project Options, tends to make it entirely clear that my program has exited because the Windows Command Prompt window is no longer open.

The second issue is harder to bypass.  If you're using a non-Microsoft virus scanner, you're going to have issues.  Do you know if you have a virus scanner running?

Jeff Armstrong
Approximatrix, LLC

Re: Probably another dumb question

I was running it in a command window, not from within Simply Fortran.

Certainly looked like it terminated.  I did not check task manager.

Virus scanner -- I have Norton 360 running.  But it usually doesn't interfere.  (I sometimes have similar problems with the Intel Compiler and Visual Studio -- largely have them fixed by nullifying the manifest file creation).

I would really rather call it something different than target but had a problem (same/similar) there too.

Linda

-----
Linda

4 (edited by lklawrie 2021-10-28 16:31:20)

Re: Probably another dumb question

Tried deleting the exes i made yesterday from File Explorer. Said I needed admin permission to delete.  (I am admin on my computer). 

It did delete the final one I made yesterday.

Deleting from command window says access is denied.

Frustrating.

-----
Linda

Re: Probably another dumb question

Linda,

If you can't even delete it from the command window or Explorer, it is the operating system blocking you (or the virus scanner, though Norton doesn't usually cause this problem).  I would check the Task Manager next time to make sure the program isn't still running.

Are you using anything like coarrays or OpenMP?

Jeff Armstrong
Approximatrix, LLC

6 (edited by lklawrie 2021-10-30 18:55:14)

Re: Probably another dumb question

Jeff,

I looked thru Task Manager.  I could not, at the time, reboot my machine as I was in the middle of running another program.

So, this morning I finally rebooted AND when I went to look just now to see if I could delete those -- they are all gone.

And then I did a build to the name I want it to be and it deleted the last target and made that one.

I love computers.

-----
Linda