Thread: Tripping up on my first attempt at building PG from source

Tripping up on my first attempt at building PG from source

From
"Richard Broersma"
Date:
I just bought a new Ubuntu Laptop so that I could tryout and hopefully
offer support for a few of my favorite pgfoundry projects.

Would anyone be able to give any dirction on what I need to do to get
passed this error?

***********************************
My first attempt with building from source ended with the following:
***********************************

# ./configure
...
checking for gcc... gcc
checking for C compiler default output file name... configure: error:
C compiler cannot create executables
See `config.log' for more details.

*************************************************
Viewing the config.log shows the following error:
*************************************************
gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
configure:2218: $? = 0
configure:2220: gcc -V </dev/null >&5
gcc: '-V' option must have argument
configure:2223: $? = 1
configure:2246: checking for C compiler default output file name
configure:2249: gcc    conftest.c  >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:2252: $? = 1
configure: failed program was:
| /* confdefs.h.  */
|
| #define PACKAGE_NAME "PostgreSQL"
| #define PACKAGE_TARNAME "postgresql"
| #define PACKAGE_VERSION "8.3.1"
| #define PACKAGE_STRING "PostgreSQL 8.3.1"
| #define PACKAGE_BUGREPORT "pgsql-bugs@postgresql.org"
| #define PG_VERSION "8.3.1"
| #define DEF_PGPORT 5432
| #define DEF_PGPORT_STR "5432"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:2291: error: C compiler cannot create executables
See `config.log' for more details.


--
Regards,
Richard Broersma Jr.

Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

Re: Tripping up on my first attempt at building PG from source

From
"Joshua D. Drake"
Date:

On Wed, 2008-06-04 at 22:54 -0700, Richard Broersma wrote:
> I just bought a new Ubuntu Laptop so that I could tryout and hopefully
> offer support for a few of my favorite pgfoundry projects.
>
> Would anyone be able to give any dirction on what I need to do to get
> passed this error?

You don't have any build tools install. Try:

apt-get install binutils gcc autoconf flex

Sincerely,

Joshua D. Drake



Re: Tripping up on my first attempt at building PG from source

From
Tom Lane
Date:
"Richard Broersma" <richard.broersma@gmail.com> writes:
> Would anyone be able to give any dirction on what I need to do to get
> passed this error?

> /usr/bin/ld: crt1.o: No such file: No such file or directory

Seems you've got an incomplete installation.  On my Fedora machine,
crt1.o is provided by the glibc-devel RPM ... dunno how Ubuntu
splits things up.

            regards, tom lane

Re: Tripping up on my first attempt at building PG from source

From
"Richard Broersma"
Date:
On Wed, Jun 4, 2008 at 11:20 PM, Joshua D. Drake <jd@commandprompt.com> wrote:
> You don't have any build tools install. Try:
>
> apt-get install binutils gcc autoconf flex

Thanks gentlemen, I will give these ideas a try.


--
Regards,
Richard Broersma Jr.

Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

Re: Tripping up on my first attempt at building PG from source

From
Dimitri Fontaine
Date:
Le jeudi 05 juin 2008, Joshua D. Drake a écrit :
> You don't have any build tools install. Try:
> apt-get install binutils gcc autoconf flex

Or even better:
  apt-get build-dep postgresql-8.3

--
dim

Attachment

Re: Tripping up on my first attempt at building PG from source

From
Craig Ringer
Date:
Tom Lane wrote:
> "Richard Broersma" <richard.broersma@gmail.com> writes:
>> Would anyone be able to give any dirction on what I need to do to get
>> passed this error?
>
>> /usr/bin/ld: crt1.o: No such file: No such file or directory
>
> Seems you've got an incomplete installation.  On my Fedora machine,
> crt1.o is provided by the glibc-devel RPM ... dunno how Ubuntu
> splits things up.

$ dpkg -S /usr/lib/crt1.o
libc6-dev: /usr/lib/crt1.o

... so you're missing the libc6-dev package. However, you'll find
there's lots else missing too, since you appear to have just installed
gcc but no supporting libraries etc.

You need to install at least the `build-essential' package, which will
pull in all the core headers and libraries. You may also need other
library -dev packages. As Ubuntu packages PostgreSQL, the easiest way to
get everything you need is to tell it to install all the build
dependencies of the postgresql source package:

sudo apt-get build-dep postgresql

When you configure your custom postgresql build make sure to use a
--prefix that points it somewhere sensible. DO NOT configure it with
--prefix=/usr. A good option is to use something like
--prefix=/opt/postgresql83 so the whole app is neatly self contained.

An alternative might be to `apt-get source postgresql' then modify the
package and rebuild it by running 'debian/rules binary' from the package
source dir. However, depending on the changes you're going to make this
might be more hassle than it's worth.

--
Craig Ringer

Re: Tripping up on my first attempt at building PG from source

From
"Richard Broersma"
Date:
On Thu, Jun 5, 2008 at 2:15 AM, Craig Ringer
<craig@postnewspapers.com.au> wrote:
> sudo apt-get build-dep postgresql

Thanks, this works perfectly now!

--
Regards,
Richard Broersma Jr.

Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug