Errors during 'make' of Python 2.2.2 - /usr/local/include a non-system directory?!

Robin Munn rmunn at pobox.com
Wed Feb 12 11:18:51 EST 2003


Zorba <ghostagain at operamail.com> wrote:
> I'm not new to Python - I've used it for about a year now on Windows
> and for CGI scripting - but I *am* new to building and using it on
> Linux. I've only recently installed my first Linux, SuSE 8.1, and
> today I built Python. But I haven't gotten farther than 'make' because
> there were a couple of errors during make that I'm curious/concerned
> about.
> 
> The first is this:
> 
> cc1: warning: changing search order for system directory
> "/usr/local/include"
> cc1: warning:   as it has already been specified as a non-system
> directory
> 
> Not sure what to make of this, or how to fix it, since Linux is still
> so new to me. Suggestions?

My suggestion is not to worry about this one. I got that several times
on my Linux machine when I was compiling various programs from source
code. All this means is that gcc (or whatever C compiler you're using,
but it's almost always gcc) is trying to warn you of a situation that
*might* cause errors. Here's what's going on: gcc builds a search path
for include files, and when a C program does something like "include
<stdio.h>", that search path is searched through in order. The first
stdio.h file found will be the one that's used. Now there are certain
directories like /usr/include and /usr/local/include that are considered
system-wide include directories. This is where the standard C library
puts its version of stdio.h, for instance. If you want to add other
directories to the include-file search path, the usual way to do it is
via the -I command-line option to gcc: "gcc -I/home/rmunn/include ..."
or some such thing. Those directories are added to the search path in
the order they are specified, and (I think) after the system directories
in search order. Thus, "include <stdio.h>" will always find the right
stdio.h, and not some other include file with the same name. The warning
about "changing search order for system directory" is trying to tell you
that "-I/usr/local/include" was passed on the command line to gcc, which
means that it is no longer one of the first entries in the include-file
search path; its new position in the search path now depends on exactly
where on the command line that -I option was placed. Most of the time,
this is not something you'll especially need to worry about. The reason
that gcc warns you about this is so that, in the remote case of a name
conflict between a system include file like stdio.h and an include file
in one of the directories specified on the command line, it is possible
that the non-system include file was picked up first in the search path.

*Whew*. That was a long paragraph, and more relevant to C than Python,
I'm afraid. But I hope this helps you understand better how gcc on Linux
deals with include files.

> 
> The other errors seem centered around dbm modules:
> 
> WARNING: building of extension "dbm" failed: command 'gcc' failed with
> exit
> status 1
> building 'bsddb' extension
> WARNING: removing "bsddb" since importing it failed
> 
> Again, I'm not sure how seriously to take this. I do use shelves a lot
> when I'm working with Python on Windows. What are these errors telling
> me, and should I do anything about it?

I don't know the answer to this one, I'm afriad. The only thing I can
suggest is looking to see whether you have the BSD DB libraries
installed on your system. If you don't, I believe you can download them
from Sleepycat Software: http://www.sleepycat.com/

-- 
Robin Munn <rmunn at pobox.com>
http://www.rmunn.com/
PGP key ID: 0x6AFB6838    50FF 2478 CFFB 081A 8338  54F7 845D ACFD 6AFB 6838




More information about the Python-list mailing list