problem running executable
I have compiled a Fortran file and created an executable file.x
It should run just by entering file.x to the terminal in that directory (ive done it in another linux machine) Instead i get bash:file.x:command not found I tried also the commands: ./file.x sh file.x chmod +x file.x Do U think i should add this directory somewhere? How? It sounds like a stupid question but what should I do?? Thanx for your patience. |
Usually to get a program run with bash (which you seem to be running), you do these things:
- make sure the file is chmod'ed executable using Code:
chmod +x file.x Code:
/path/to/file.x |
When i try ./file.x I get
bash:./file.x:cannot execute binary file with the command chmod +x im sure it is executable other suggestions? |
Try ls -l to make sure it is actually executable (by you)
|
i get the following:
-rwxr-xr-x 1 kostis users 286352 2007-03-05 18:49 file.x and it has a different color from all the other objects in the directory that means it is actually executable right?? What could be the problem then?? |
Any possibility that it is not really executable? I think that the error message has to do with permissions, but I don't know what bash does when the file is not actually an executable binary.
Also, just to eleminate variables, you might try running it as root. |
I also tried to run it as superuser and i still get
-bash: /home/kostis/MYPROJECT/CODE/1d/run/file.x: cannot execute binary file the file is executable for sure since it runs on a remote computer without any changes, and i think executable files should run everywhere right? do u think distribution has something to do any other suggestions?? |
What is the remote computer running?
|
its a university computer UNIX cluster
the computer uses Fedora while I use SUSE but my file.x is recognized as executable |
that may be your problem,
what type of processor are you using and waht type is the UNIX cluster using? eg a program compiled on a SPARC processer (likley if the UNIX cluster hardware came form Sun microsystems) will not run on a x86 (most desktop PC) based machine. and somthing compiled on an x86 processor wont run on a sparc (or a PPC, siliconTech or any other flavour of processor ) edit: are you sure that the uni cluster is running fedora (linux) or coudl it be running any of the propiartry UNIXes like solaris |
Well the truth is that i dont know how to see this (can U tell me how?)
when i log in with ssh i get the following message: Compaq Tru64 UNIX V5.1B (Rev. 2650); Its just a simple and small .f90 file Do u think there might be a solution to this?? Thanx |
The indication "Tru64" suggests that it's actually a 64-bit machine. If the program was compiled on that platform, and you only have a 32-bit machine (ie x86 based), you'll need to recompile it on your machine.
Try running both "uname -a" and "cat /etc/*release /etc/*version" on both your machine and the remote cluster (logged in through ssh) and post the outcome. |
the remote gives:
OSF1 gemma V5.1 2650 alpha while mine gives: Linux linux 2.6.13-15-default #1 Tue Sep 13 14:56:15 UTC 2005 i686 i686 i386 GNU/Linux LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-ia32:core-3.0-ia32" SUSE LINUX 10.0 (i586) VERSION = 10.0 looks different uh?? What can I do?? |
If you have the source code, you can recompile on the local machine (might have to make a few tweaks, but it shouldn't be too hard).
|
it seems that the UNIX cluster is using alpha processors
thease are nothing like the generic X86 procsesors taht most desktop maschines have... the only real option is to recompile, do you have the soucre code for the program (or can you get it?) |
All times are GMT -5. The time now is 12:48 AM. |