Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I hope my message will get read soon and somebody will give me a solution. I use fortran to do simulation and gfortran is the compiler I use. Recently I migrated from Ubuntu 10.10 to 12.10.

After installing gfortran then I tried to compile and run my fortran programs then the problem started. I successfully compiled the program but I am unable to execute it. (I work in a directory in shared partition, not in HOME directory). When I compiled the program and run it within HOME directory, everything worked fine. On my Ubuntu 10.10, I was able to compile and execute fortran program from everywhere not only within HOME directory.

This is what I do for compiling and executing fortran program:

gfortran hello.f90 -o hello # to compile it
./hello # to execute it

I'm blind about PATH or anything like it (this has to do with it, I suspect) so please give me direction.

share|improve this question
    
Do you get any sort of message when attempting to run the executable in the shared partition? A likely cause would seem to be that the partition is mounted with the noexec option. –  chronitis Dec 18 '12 at 9:33

1 Answer 1

On the file that you produced do:

ls -l ./hello 

It's likely the file does not have execute permissions. You may see something like this:

-rw-rw-r-- 1 mark mark 2 Dec 18 11:37 hello

but what you need is something like this:

-rwxrwxr-x 1 mark mark 135163 Dec 18 11:39 hello

To get to this state use the command:

chmod gu+x ./hello

This command gives group and user execute permissions. Then try the above ls command again. See if you can execute it now.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.