Find the answer to your Linux question:
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 ...
  1. #1
    Just Joined! WindowsDude's Avatar
    Join Date
    May 2010
    Location
    Wintopia
    Posts
    12

    [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.

  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    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.

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    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:
    Code:
    echo $PATH
    You will get a colon-separated list of directories.

    So if the full path of mpicc is /network/bin/mpicc, just add this line to your ~/.bashrc file:
    Code:
    PATH=/network/bin:$PATH
    ~/.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:
    source ~/.bashrc
    Hope this helps!
    DISTRO=Arch
    Registered Linux User #388732

  4. #4
    Just Joined! WindowsDude's Avatar
    Join Date
    May 2010
    Location
    Wintopia
    Posts
    12
    Thank you !
    Path solved the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...