Friday, March 22, 2013

How do I install a command line tool after uncompressing it?

First, you need to cd into the directory created as a result of uncompressing via tar. Something along the lines of:
cd path-to-software/
Once in the directory, run the following command:
./configure
"./configure" will configure the software to ensure your system has the necessary functionality and libraries to successfully compile the package.

If you're doing this on a Mac and you get a missing "c compiler" type error then you probably just need to install Xcode's command line tools package. To do so, simply open Xcode, go to preferences then downloads. There is an "Install" link to add the command line tools. Once this has been completed, make sure to re-open your terminal window.

Then run:
make
"make" will compile all the source files into executable binaries.

The purpose of the make utility is to determine automatically which pieces of a large program need to be recompiled, and issue the commands to recompile them.

Then run:
sudo make install
From the documentation, "make install" will copy the executable file into a directory that users typically search for commands; copy any auxiliary files that the executable uses into the directories where it will look for them (e.g. /usr/local/bin/).

Lastly, most software packages have a README or INSTALL file you should probably take a look at. You can do so by running the following command:
cat README

No comments:

Post a Comment

About Me

My photo
I code. I figured I should start a blog that keeps track of the many questions and answers that are asked and answered along the way. The name of my blog is "One Q, One A". The name describes the format. When searching for an answer to a problem, I typically have to visit more than one site to get enough information to solve the issue at hand. I always end up on stackoverflow.com, quora.com, random blogs, etc before the answer is obtained. In my blog, each post will consist of one question and one answer. All the noise encountered along the way will be omitted.