Question:

Why would a program run in one folder and not another?

by  |  earlier

0 LIKES UnLike

I am compiling and running two versions of a program in two different folders. I made changes to the second version and it wouldn't run correctly (it runs for days instead of about 2 minutes), so started using diff to find any differences between the makefile, C files, input files, configuration files and run scripts and changing them until there were no differences. When I did this diff said that the two executable differ, even though the same compiler and options are used (no difference in make files).

After all of this the first version runs fine still, and the second version doesn't. I even went through and checked the all the file sizes and permissions and they all match. I don't understand how everything can be the same, yet they compile and run differently.

The program is a scientific software running in a linux environment (CentOS) and I am trying to make modifications to it.

 Tags:

   Report

2 ANSWERS


  1. The compilations probably differ as to compile date/time, which may well be embedded in the executable.  See if what diff reports as different looks like a reasonable date/time stamp.

    When a program runs differently in two different places, I start to suspect configuration, especially files in the directory.  Without knowing what happens differently, I can't be of more help than that.

    Hope that's some help.


  2. Permissions on the folder.

    The folder needs execute permissions for the person/group that you intend to run it.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.