Newbie Linux Compiling problem

hazard666

Senior member
Jun 5, 2001
707
0
0
I seem to be having a problem compiling programs, whenever I typeb]cd /*directory* [/b] and then make , it gives me the following error:

[root@localhost gnx]# make
make: *** No targets specified and no makefile found. Stop.

although in the Install file it says to type cd /*directory* then make and then make install

What am I doing wrong?
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
*directory* shouldn't be taken literally - it's the name of the directory created when you unpacked the source tarball.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Then do an ls in that directory - there should be a file Makefile in there. If not, then either a) you're in the wrong place, b) you haven't run ./configure to build the Makefile, which is often necessary, or c) the package needs you to run autoconf and automake - this is common with CVS and other bleeding edge releases. The latter case is pretty unlikely, and I don't remember the exact sequence of commands you need to build the files. But packages will often include an autogen.sh script to automate the process if that's the case.
 

hazard666

Senior member
Jun 5, 2001
707
0
0
I have tried that and this is what I get afterwards:

[root@localhost gnx]# ls
acinclude.m4 ChangeLog configure.files INSTALL NEWS stamp-h.in
aclocal.m4 config.h.in configure.in libtool* QNX.kcsrc subdirs
admin/ config.log configure.in.in Makefile.am README VERSION
AUTHORS configure* COPYING Makefile.in src/
[root@localhost gnx]# make
make: *** No targets specified and no makefile found. Stop.
[root@localhost gnx]#

It shows that there IS a makefile, so I don't understand what's wrong.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: hazard666
I always run /configure before make and make install
Which explains why you have a config.log file. Probably configure didn't complete successfully - it usually creates a config.h and a Makefile as its final steps.

 

EmperorRob

Senior member
Mar 12, 2001
968
0
0
make 's default filename is Makefile. Not Makefile.in or Makefile.cvs so make sure there is a plain old "Makefile".
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Ya generally the correct steps are:

./configure
make
make install

But it doesn't always work out that well. And that can be a real pain. Lots of packages miss different steps or have you do something completely different.

Go ahead and try to restart from scratch. use the "make clean" command, although that isn't always a option. And go ahead and delete the config.cache. That way when you re-run ./configure it will redo everything instead of trying to pull the information from the cache it made before.

Make sure that ./configure finishes it all the way. It's not unusual for it to quit with a error as it tests different aspects of your system. Usually when it quits it is due to a missing dependancy (usually a missing library file). If it quits you probably wont be able to do a make.

Read thru the README and see it has any special options, or steps you have to go thru for your system. Sometimes you'll get a package that is designed for windows or one of the BSDs and you have to do something special to get it to work.

Also check out ./configure --help. Lots of times it has special options described in their were you can turn on and turn off different features in the program as a work around for avoiding certain depedances or bugs.

What are you actually trying to install?
 

hazard666

Senior member
Jun 5, 2001
707
0
0
I am experiencing this problem with nearly all sources I try to compile. I always run ./configure like I mentioned above and also have tried clean a few times when they didn't work. I have deleted the initial source two times and redownload them and tried to run the install again but it always winds up with the same problem. I am not at home right now, but from what I remember, one of the last messages I recieve after running ./configure is error invalid $PATH in config or config.log, I cannot remember thoroughly.
 

hazard666

Senior member
Jun 5, 2001
707
0
0
I also forgot to mention that I have tried to compile every source both in normal user/ su and logged in as root.
 

chsh1ca

Golden Member
Feb 17, 2003
1,179
0
0
For one, start with less INSTALL. Always read the installation docs before you try and compile anything. There are sometimes site-specific instructions you have to setup first.

And ./configure by itself isn't a good idea unless you want whatever app you're compiling strewn about your system. I realise many people like it this way, but I prefer everything in its own nice little directories. :)
 

hazard666

Senior member
Jun 5, 2001
707
0
0
I always read both the README and INSTALL files, these are the instructions for one particular program I am trying to compile:

1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.

Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.

2. Type `make' to compile the package.

3. Optionally, type `make check' to run any self-tests that come with
the package.

4. Type `make install' to install the programs and any data files and
documentation.

5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.

I have ran the compile again and this is what I get:

[root@localhost gaim]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... yes
checking for working aclocal-1.4... missing
checking for working autoconf... missing
checking for working automake-1.4... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking for sed... /bin/sed
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
[root@localhost gaim]# less install
install: No such file or directory
[root@localhost gaim]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... yes
checking for working aclocal-1.4... missing
checking for working autoconf... missing
checking for working automake-1.4... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking for sed... /bin/sed
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
You don't appear to have any development tools installed.
Specifically, a C compiler, which is pretty necessary for... um... compiling stuff.

BTW, try less ./INSTALL
For the sake of clarity among new users, I should point out that you don't need the ./ here. That's only for commands.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Most likely his problem reading the INSTALL doc is that he typed install instead of INSTALL, Linux is case sensitive.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH



Ya make sure that you can get gcc in your $PATH.

It is the normal c compiler for linux, it forms the heart if of the operating system if the linux kernel is the brain. Those others cc, cc, and cl, are just other C compilers. Of course C is the programming language everything is written in.

There are more then likely 3 reasons for this type of error.

1. The $PATH variable is misconfigured. Type in "echo $PATH" to find that out. The path is basicly the directories in the order of were the OS looks for executable. If gcc is in /usr/bin/ and there is no /usr/bin in the PATH, the OS ain't gonna find it.

2. The package for gcc in your OS is not installed. Gcc should either be in /bin or in /usr/bin. If you can't find it anywere, (/bin, /usr/bin, /usr/local/bin, /sbin, /usr/sbin, /usr/local/sbin, or the normal directories you can find executables...) THe you are just going to hav to install it.

3. The software you are trying to install is simply broken. If you type in "gcc -v" this will return the version number and other information on gcc. If you get a response then gcc is probably gonna work. IF not the problem is probably one of the 2 above. Try going to ./configure --help and see if there is any options you can use to force configure to know were the gcc executable is located.

This gcc missing is a fairly serious error, without it you have a snowball's chance in hell of ever compiling something. If you compiled stuff in the past, and you can still compile something now even after all this trouble, then its a possiblity the package is broken. How ever this is unlikely if it a "stable" package. This usually means that it's been tested on several different OS's and with different people and it works ok. IF it is a "developement" or "unstable" then the chances of it breaking is pretty likely.

What are you trying to install?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
it forms the heart if of the operating system if the linux kernel is the brain

Not really, calling it the heart implies it's required which is hardly true. If anything it's the screwdriver that puts it all together, after you're done you don't need the screwdriver anymore unless you need to take it apart and rebuild part of it again.

Those others cc, cc, and cl, are just other C compilers

cc is the generic c compiler name, it's usually symlinked to gcc on Linux.

Of course C is the programming language everything is written in.

Except for everything in KDE and anything that uses QT=)

My box also has 242 perl scripts in /usr/bin and /usr/sbin and 36 python scripts, C is hardly the language everything is done in.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Well, C is what 90% of the operating system itself is written in, and so is the kerne. Perl and Python and other languages are commonly used to, and are very important, but thats not realy relevent to compiling programs unless part of the install is automated using these scripting languages.

Gcc is not needed by the operating system to run day to day. And you can get by without it easily, but if it wasn't for the GNU compiler linux probably wouldn't be were it is today. Linus specific choose to take on the GNU/GPL crap just for the gcc compiler in the first place, and that was pretty much the main reason. The rest of the gnu stuff didn't realy impress him a whole lot. So that's why I refer to it as the "heart" if the Linux kernel is the "brain". It is not needed for the running of the OS, but it was and is a major componate of the OS non-the-less.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Well, C is what 90% of the operating system itself is written in, and so is the kerne. Perl and Python and other languages are commonly used to, and are very important, but thats not realy relevent to compiling programs unless part of the install is automated using these scripting languages.

I only mentioned perl and python because they're easy to pull out from find output with file, like I mentioned KDE and QT are all C++ which are two of the most popular pieces of Linux software right now. I believe Mozilla is almost all C++ too, but don't quote me on that.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
All *boxes and waimea are written in C++, Sawfish uses lisp for configuration, I'm pretty sure that a large percentage of C programs use C++ shortcuts that don't necessarily make the program "written in C++", but does make them need c++ installed (don't I remember hearing that the linux kernel was like this?).

grep -ra libstdc++ /usr/bin/ | wc -l
83

dunno if greping binaries for the string "libstdc++" is a valid way of finding programs that are written in c++, but hey, 83, that's gotta say something :p
 

hazard666

Senior member
Jun 5, 2001
707
0
0
I am running the "stock" mandrake 9 installwith only third party drivers installed, I am trying to install Gaim and since I am a TOTAL linux newbie, where would I install C compiler? Would I be able to simply install it through rpmdrake?
Sorry for sounding so oblivious