Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-27-2014 #1
- Join Date
- Feb 2014
Help compiling programs.
Whenever I run the usual "configure", "make", "install" instructions, something always goes wrong and I'm sitting here with a bunch of files that are taking up hard drive space.
I've followed the README's to the letter and I can't figure out how to get the darn computer to compile the program.
I run the usual "./configure" and it'll work (whenever there's a configure file in the folder, I found that out the hard way), but my biggest problem is that when I do the "make" command, I get errors. (I type it just like they tell me, by writing "make" in the command line. No arguements, just the word.)
It always turns up as
"make: *** No targets specified and no makefile found. Stop."
Then when I try to tell it to look at a file named "Makefile.*"
It will always turn up something like
"make: Nothing to be done for Makefile.*"
I've looked at tutorial after tutorial, I do everything like they say and I can't get a single program to compile. What am I missing?
- 06-27-2014 #2
That's not much info to go on.
Have you installed the development tools and languages you need.
What source code package have you downloaded?
Are you sitting in the base directory of the source code, can you see the makefile?
Also you keep typing Makefile Unix is case sensitive and the typical name is makefile.
Add more details so others can help you.A lion does not lose sleep, over the opinion of sheep.
- 06-27-2014 #3
Which distro and which program?
Not all compiles use the standard cmmi but there will usually be a README or an INSTALL file which will give details. Are you sure the configure phase completed successfully or did it give messages about missing dependencies. Sometimes it's easy to miss as it generates so much output.
If it does give a message, install the missing dependency (typically the package will end in -dev or -devel depending on the distro) and re-run ./configure which you may have to do several times as it stops at the first problem each time.What do we want?
When do we want 'em?
Doesn't really matter does it!?
The Fifth Continent
- 06-27-2014 #4
- Join Date
- Apr 2012
- Virginia, USA
You have to read the output of the configure command very carefully. The configure command is what generates your makefile (typically).
Configure is used to inspect your machine by looking in the normal locations for libraries and compilers that the software needs to actually be built.
Often times, you are missing a library that is required for the software to be compiled successfully.
Check out: How to RDP from CentOS 6 using Network Level Auth That's an example I wrote of compiling rdesktop from source. That uses CentOS.
Let's compile something together on Debian: PyODBC. This is a library that allows python to use ODBC to connect to databases. I use this library to connect from Linux to MS SQL Server 2008. It's not available in a repo that I'm aware of. This is an example of compiling a Python package.
Download the zip file from here: https://pyodbc.googlecode.com/files/pyodbc-3.0.6.zip
Unzip it, cd into the directory it created.
On debian (and I believe Ubuntu), an easy way to get a lot of compiling-related packages is to install the package build-essential, so install that. If you're on an RPM based distro, you can use yum groupinstall ‘Development Tools’
That will install make, gcc, g++, and a handful of other useful packages. Installing build-essential or 'Development Tools' group package is considered a prerequisite for compiling most software.
Inspect the current directory. Most packaged python source archives have a file called setup.py. This is the file that is like the configure file for c++ or other source tarballs.
Anyway, let's go ahead and run python setup.py build We should get some output with the following error:
/root/dd/blks/pyodbc-3.0.6/src/pyodbc.h:48:17: fatal error: sql.h: No such file or directory
error: command 'gcc' failed with exit status 1
Our README.rst file tells us this software requires ODBC 3.0 or greater. The package is named unixODBC in both Debian and CentOS (it may be in the epel repo in CentOS, I cannot remember). To compile the software, we need to have the unixODBC-dev (debian) or unixODBC-devel (CentOS) package installed. That package provides the header files needed (in our case, sql.h) for gcc. To actually use this software, we'll need to install the unixODBC package.
After that, you can run python setup.py build and everything should be compiled fine. If you want to install the software (copy the compiled software into the typical location for your system) run python setup.py install