Results 1 to 4 of 4
WindowsDude is back on the dark side of the web, the linux world, and he has encountered yet another impassable problem !
There's a compiler mpicc, probably installed on the ...
- 05-14-2010 #1
[SOLVED] Can't find command, but program is installed?
WindowsDude is back on the dark side of the web, the linux world, and he has encountered yet another impassable problem !
There's a compiler mpicc, probably installed on the network at some location let's say /network/bin
So when I write mpicc main.c I get the "can't find command" (or similar) error. Somehow it's supposed to work anyway. I think I need one of those magic
commands to make it work. But the question is; which word will make it all happen? (I thought the DOS days were over!)
I guess I could use the full path (provided that that binary really is in that folder), but I want to bind that executable at that location to the much shorter mpicc.
- 05-14-2010 #2
Path still rules! Either add the location to your path,
or specify it on the command line. For serious compiling, use a Makefile.
The Makefile defines the path to your favorite compiler, among
other things, and you compile with "make <whatever>"
and the job is done.
Put your compiler in your path in .bashrc, or put a symlink to it
into /usr/bin or some other directory that is on your standard
path.
- 05-14-2010 #3
Alrighty.
So when you run, for instance, the command "perl", what actually happens? Well, the shell basically searches the elements of your $PATH environment variable for a program called "perl", and runs it.
So basically, you need to add the directory of mpicc to your PATH variable.
To check the current variable of your PATH, you can run this command:
You will get a colon-separated list of directories.Code:echo $PATH
So if the full path of mpicc is /network/bin/mpicc, just add this line to your ~/.bashrc file:
~/.bashrc is automatically loaded whenever you open a terminal or log in, so you just need to open a new terminal for it to take effect. Or, in the current terminal, you can run the command:Code:PATH=/network/bin:$PATH
Hope this helps!Code:source ~/.bashrc
DISTRO=Arch
Registered Linux User #388732
- 05-15-2010 #4


