Thread: Problem configuring Postgres under Cygwin

Problem configuring Postgres under Cygwin

From
Kjell-Olav Bjerknes
Date:
Hi.

I searched the archives and seen a lot of people having this problem, but
not yet seen an answer that makes me able to configure postgres from
source.
Since I want to use PostGIS I need to build from source...

I have installed on a winXP:

postgresql-7.2.3-1
cygipc-1.11-1.tar.bz2
cygwin-1.3.14-1

The ipc-daemon is running, ( initdb works....)

I run this command:

$ ./configure --enable-multibyte --with-CXX --prefix=/usr --sysconfdir=/etc
--docdir=/usr/doc/postgresql-7.2.3

And get this output on screen:

[snip]
checking for default soft limit on number of connections... 32
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
using CFLAGS=-O2
checking whether the C compiler (gcc -O2 ) works... no
configure: error: installation or configuration problem: C compiler cannot
create executables.

The config.log shows this:

[snip]
configure:1318: checking whether gcc accepts -g
configure:1361: checking whether the C compiler (gcc -O2 ) works
configure:1377: gcc -o conftest -O2   conftest.c -lcygipc 1>&5
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../../i686-pc-cygwin/bin/ld:
cannot find -lcygipc
collect2: ld returned 1 exit status
configure: failed program was:

#line 1372 "configure"
#include "confdefs.h"

main(){return(0);}

Does anyone have any clue???

Clue?::
The Cygwin is freshly installed and it gave me some trouble trying to
initdb conserning the permission on postgres.exe.
(FATAL 1:  /usr/bin/postgres: could not locate executable, bailing out...)
I had to:
    $ chown 544 /usr/bin
    $ chmod 755 /usr/bin
and reinstall the packages....
prioir chmod:
-rwx------    1 kob      None        87552 Aug 25 02:18 postgres.exe
after chmod:
-rwxr-xr-x    1 kob      None        87552 Aug 25 02:18 postgres.exe

Could it be some other directories that needs to chmod/chown?


Kjell-Olav




Re: Problem configuring Postgres under Cygwin

From
Jason Tishler
Date:
Kjell-Olav,

On Thu, Oct 31, 2002 at 04:11:47PM +0100, Kjell-Olav Bjerknes wrote:
> And get this output on screen:
> [snip]
> configure: error: installation or configuration problem: C compiler cannot create executables.
> [snip]
>
> The config.log shows this:
>
> [snip]
> configure:1361: checking whether the C compiler (gcc -O2 ) works
> configure:1377: gcc -o conftest -O2   conftest.c -lcygipc 1>&5
> /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../../i686-pc-cygwin/bin/ld: cannot find -lcygipc
> collect2: ld returned 1 exit status
> configure: failed program was:

The above implies that either libcygipc.a is not installed (in the
normal place) on your system or that the default library search path has
changed in the gcc 3.x package.

Please perform the following and report back to the list:

    $ ls -l /usr/local/lib/libcygipc.a
    -rwxrwxrwx    1 Administ Domain U    26912 Nov 26  2001 /usr/local/lib/libcygipc.a

    $ echo 'main(){return(0);}' >conftest.c
    $ gcc -v -o conftest conftest.c -lcygipc
    Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
    gcc version 2.95.3-5 (cygwin special)
    [snip]
    /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/collect2.exe -Bdynamic --dll-search-prefix=cyg -o conftest.exe
/usr/lib/crt0.o-L/usr/local/lib -L/usr/lib -L/usr/lib/w32api -L/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5
/mnt/c/DOCUME~1/jatis/LOCALS~1/Temp/cchqAaau.o-lcygipc -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc 

Note that I'm still using the gcc 2.95.3-5 package and with this package
"-L/usr/local/lib" is automatically passed during linking.  Maybe this
is not the case in the gcc 3.x package?

Jason

Re: Problem configuring Postgres under Cygwin

From
Date:
Hi..

Thanks for helping:

ls -l /usr/local/lib/libcygipc.a output:

-rw-r--r--    1 kob      None        26912 Nov 27  2001
/usr/local/lib/libcygipc.a

This seems like the Cygwin installer has given wrong permissions on all
the files..

gcc -v -o conftest conftest.c -lcygipc output:

Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs
Configured with: /netrel/src/gcc-3.2-1/configure
--enable-languages=c,c++,f77,ja
va --enable-libgcj --enable-threads=posix --with-system-zlib --enable-nls
--with
out-included-gettext --enable-interpreter --disable-sjlj-exceptions
--disable-ve
rsion-specific-runtime-libs --enable-shared --build=i686-pc-linux
--host=i686-pc
-cygwin --target=i686-pc-cygwin --enable-haifa --prefix=/usr
--exec-prefix=/usr
--sysconfdir=/etc --libdir=/usr/lib --includedir=/nonexistent/include
--libexecd
ir=/usr/sbin
Thread model: posix
gcc version 3.2 20020818 (prerelease)
[snip]
 /usr/lib/gcc-lib/i686-pc-cygwin/3.2/collect2.exe -Bdynamic
--dll-search-prefix=
cyg -o conftest.exe /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../crt0.o
/usr/lib
/gcc-lib/i686-pc-cygwin/3.2/crtbegin.o
-L/usr/lib/gcc-lib/i686-pc-cygwin/3.2 -L/
usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../..
/cygdrive/c/DOCUME~1/KOB~1.SAN/LOCAL
S~1/Temp/ccotfJYK.o -lcygipc -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32
-lshe
ll32 -lgcc /usr/lib/gcc-lib/i686-pc-cygwin/3.2/crtend.o
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../../i686-pc-cygwin/bin/ld:
cannot fi
nd -lcygipc
collect2: ld returned 1 exit status

kjell-olav


> Kjell-Olav,
>
> On Thu, Oct 31, 2002 at 04:11:47PM +0100, Kjell-Olav Bjerknes wrote:
>> And get this output on screen:
>> [snip]
>> configure: error: installation or configuration problem: C compiler
>> cannot create executables. [snip]
>>
>> The config.log shows this:
>>
>> [snip]
>> configure:1361: checking whether the C compiler (gcc -O2 ) works
>> configure:1377: gcc -o conftest -O2   conftest.c -lcygipc 1>&5
>> /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../../i686-pc-cygwin/bin/ld:
>> cannot find -lcygipc collect2: ld returned 1 exit status
>> configure: failed program was:
>
> The above implies that either libcygipc.a is not installed (in the
> normal place) on your system or that the default library search path has
> changed in the gcc 3.x package.
>
> Please perform the following and report back to the list:
>
>     $ ls -l /usr/local/lib/libcygipc.a
>     -rwxrwxrwx    1 Administ Domain U    26912 Nov 26  2001
> /usr/local/lib/libcygipc.a
>
>     $ echo 'main(){return(0);}' >conftest.c
>     $ gcc -v -o conftest conftest.c -lcygipc
>     Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
> gcc version 2.95.3-5 (cygwin special)
>     [snip]
>     /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/collect2.exe -Bdynamic
> --dll-search-prefix=cyg -o conftest.exe /usr/lib/crt0.o
> -L/usr/local/lib -L/usr/lib -L/usr/lib/w32api
> -L/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5
> /mnt/c/DOCUME~1/jatis/LOCALS~1/Temp/cchqAaau.o -lcygipc -lgcc
> -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc
>
> Note that I'm still using the gcc 2.95.3-5 package and with this package
> "-L/usr/local/lib" is automatically passed during linking.  Maybe this
> is not the case in the gcc 3.x package?
>
> Jason




Re: Problem configuring Postgres under Cygwin

From
Jason Tishler
Date:
On Thu, Oct 31, 2002 at 06:10:12PM +0100, kob@norkart.no wrote:
> Thanks for helping:

No problem -- actually, you are helping me.

> ls -l /usr/local/lib/libcygipc.a output:
>
> -rw-r--r--    1 kob      None        26912 Nov 27  2001 /usr/local/lib/libcygipc.a

Good, your cygipc installation is fine.

> This seems like the Cygwin installer has given wrong permissions on
> all the files...

The above is a separate and unrelated issue.

> gcc -v -o conftest conftest.c -lcygipc output:
>
> Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs
> [snip]
>  /usr/lib/gcc-lib/i686-pc-cygwin/3.2/collect2.exe -Bdynamic
> --dll-search-prefix=
> cyg -o conftest.exe /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../crt0.o
> /usr/lib
> /gcc-lib/i686-pc-cygwin/3.2/crtbegin.o
> -L/usr/lib/gcc-lib/i686-pc-cygwin/3.2 -L/
> usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../..
> /cygdrive/c/DOCUME~1/KOB~1.SAN/LOCAL
> S~1/Temp/ccotfJYK.o -lcygipc -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32
> -lshe
> ll32 -lgcc /usr/lib/gcc-lib/i686-pc-cygwin/3.2/crtend.o
> /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../../i686-pc-cygwin/bin/ld:
> cannot fi
> nd -lcygipc
> collect2: ld returned 1 exit status

The above implies that Cygwin gcc 3.x is not automatically searching for
libraries in /usr/local/lib.  BTW, I just tried under Linux gcc 3.x and
it does not search /usr/local/lib either.

You can try the following workaround:

    $ ln -s /usr/local/lib/libcygipc.a /usr/lib

while I try to figure out the best long-term solution.

Any help is greatly appreciated.

Thanks,
Jason

Re: Problem configuring Postgres under Cygwin

From
"Norman Vine"
Date:
Jason Tishler writes:
>
> The above implies that Cygwin gcc 3.x is not automatically searching for
> libraries in /usr/local/lib.  BTW, I just tried under Linux gcc 3.x and
> it does not search /usr/local/lib either.
>
> You can try the following workaround:
>
>     $ ln -s /usr/local/lib/libcygipc.a /usr/lib
>
> while I try to figure out the best long-term solution.
>
> Any help is greatly appreciated.

With the latest Cygwin I have been configuring succesfully using

CC="gcc-2 -L/usr/local/lib" CXX="c++-2 -L/usr/local/lib"
./configure  --enable-multibyte --with-python --with-perl --with-CXX --prefix=/usr --sysconfdir=/etc
--docdir=/usr/doc/postgresql-- 
-no-create --no-recursion

I imagine the same will be required for gcc 3.2

Cheers

Norman


Re: Problem configuring Postgres under Cygwin

From
Jason Tishler
Date:
Norman,

On Thu, Oct 31, 2002 at 12:51:50PM -0500, Norman Vine wrote:
> Jason Tishler writes:
> > You can try the following workaround:
> >
> >     $ ln -s /usr/local/lib/libcygipc.a /usr/lib
> >
> > while I try to figure out the best long-term solution.
>
> With the latest Cygwin I have been configuring succesfully using
>
> CC="gcc-2 -L/usr/local/lib" CXX="c++-2 -L/usr/local/lib"
> ./configure  --enable-multibyte --with-python --with-perl --with-CXX --prefix=/usr --sysconfdir=/etc
--docdir=/usr/doc/postgresql-- 
> -no-create --no-recursion
>
> I imagine the same will be required for gcc 3.2

The above is a better workaround, then mine.

Thanks,
Jason

Re: Problem configuring Postgres under Cygwin

From
Jason Tishler
Date:
On Thu, Oct 31, 2002 at 03:20:49PM -0500, Jason Tishler wrote:
> The above is a better workaround, then mine.
                                  ^^^^^^

Let's try again:

    The above is a better workaround than mine.

Jason

Re: Problem configuring Postgres under Cygwin

From
Jason Tishler
Date:
Kjell-Olav,

On Thu, Oct 31, 2002 at 12:50:55PM -0500, Jason Tishler wrote:
> On Thu, Oct 31, 2002 at 06:10:12PM +0100, kob@norkart.no wrote:
> > Thanks for helping:
>
> No problem -- actually, you are helping me.

Would you be willing to try another workaround?

> > gcc -v -o conftest conftest.c -lcygipc output:
> >
> > Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs
> > [snip]
> > /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../../i686-pc-cygwin/bin/ld: cannot find -lcygipc
> > collect2: ld returned 1 exit status
>
> The above implies that Cygwin gcc 3.x is not automatically searching
> for libraries in /usr/local/lib.  BTW, I just tried under Linux gcc
> 3.x and it does not search /usr/local/lib either.
>
> You can try the following workaround:
>
>     $ ln -s /usr/local/lib/libcygipc.a /usr/lib

If so then, then delete the above symlink and then configure as follows:

    $ LDFLAGS=-L/usr/local/lib configure --enable-multibyte ...
      ^^^^^^^^^^^^^^^^^^^^^^^^

By reading configure, it seems that defining LDFLAGS as above should
enable PostgreSQL 7.2.3 to configure successfully under gcc 3.x.  Does
it?

> while I try to figure out the best long-term solution.

Actually, I checked PostgreSQL CVS and I think that PostgreSQL 7.3 and
later will no longer have this problem.

Thanks,
Jason

Re: Problem configuring Postgres under Cygwin

From
Kjell-Olav Bjerknes
Date:
Hi..

This worked great.

I tried first the symlink: ln -s /usr/local/lib/libcygipc.a /usr/lib
it startet to configure, but failed ..

Then when I tried the: LDFLAGS=-L/usr/local/lib configure --enable-multibyte..............
The configuring suceeded..

thanks,

Kjell-Olav




-----Opprinnelig melding-----
Fra:    Jason Tishler [SMTP:jason@tishler.net]
Sendt:    1. november 2002 18:09
Til:    kob@norkart.no
Kopi:    pgsql-cygwin@postgresql.org
Emne:    Re: [CYGWIN] Problem configuring Postgres under Cygwin

Kjell-Olav,

On Thu, Oct 31, 2002 at 12:50:55PM -0500, Jason Tishler wrote:
> On Thu, Oct 31, 2002 at 06:10:12PM +0100, kob@norkart.no wrote:
> > Thanks for helping:
>
> No problem -- actually, you are helping me.

Would you be willing to try another workaround?

> > gcc -v -o conftest conftest.c -lcygipc output:
> >
> > Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs
> > [snip]
> > /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../../i686-pc-cygwin/bin/ld: cannot find -lcygipc
> > collect2: ld returned 1 exit status
>
> The above implies that Cygwin gcc 3.x is not automatically searching
> for libraries in /usr/local/lib.  BTW, I just tried under Linux gcc
> 3.x and it does not search /usr/local/lib either.
>
> You can try the following workaround:
>
>     $ ln -s /usr/local/lib/libcygipc.a /usr/lib

If so then, then delete the above symlink and then configure as follows:

    $ LDFLAGS=-L/usr/local/lib configure --enable-multibyte ...
      ^^^^^^^^^^^^^^^^^^^^^^^^

By reading configure, it seems that defining LDFLAGS as above should
enable PostgreSQL 7.2.3 to configure successfully under gcc 3.x.  Does
it?

> while I try to figure out the best long-term solution.

Actually, I checked PostgreSQL CVS and I think that PostgreSQL 7.3 and
later will no longer have this problem.

Thanks,
Jason


Re: Problem configuring Postgres under Cygwin

From
Jason Tishler
Date:
Kjell-Olav,

On Mon, Nov 04, 2002 at 08:30:13AM +0100, Kjell-Olav Bjerknes wrote:
> I tried first the symlink: ln -s /usr/local/lib/libcygipc.a /usr/lib
> it startet to configure, but failed ..

Oops.  Sorry, for the above bad advice.

> Then when I tried the: LDFLAGS=-L/usr/local/lib configure --enable-multibyte..............
> The configuring suceeded..

I'm very glad that the above works.

> thanks,

Thank you!  I really appreciate you trying the above.

Since I maintain 4 public Cygwin packages and about 30 private ones for
works, I've been a little hesitant to upgrade gcc.

Jason

--
GPG key available on key servers or http://www.tishler.net/jason/gpg.txt

Attachment

installation

From
Florian Litot
Date:
Hi
i would like to install cywin with postgresql but i would like only the
necessary on the package
can you tell me what i need
thanks


Re: installation

From
Jason Tishler
Date:
On Mon, Nov 04, 2002 at 01:50:43PM +0100, Florian Litot wrote:
> i would like to install cywin with postgresql but i would like only the
> necessary on the package
> can you tell me what i need

Unfortunately, some have promised this information, but no one has
delivered yet.  Would you like to contribution this to the Cygwin
PostgreSQL community?  If so, then search the archives for the minimum
commands necessary to run PostgreSQL.  If the list is correct, then
you just needs to map this command list into a package list.

Thanks,
Jason

--
GPG key available on key servers or http://www.tishler.net/jason/gpg.txt

Attachment

Re: Problem configuring Postgres under Cygwin

From
Peter Eisentraut
Date:
Jason Tishler writes:

>     $ LDFLAGS=-L/usr/local/lib configure --enable-multibyte ...
>       ^^^^^^^^^^^^^^^^^^^^^^^^
>
> By reading configure, it seems that defining LDFLAGS as above should
> enable PostgreSQL 7.2.3 to configure successfully under gcc 3.x.  Does
> it?

Yep.

> > while I try to figure out the best long-term solution.
>
> Actually, I checked PostgreSQL CVS and I think that PostgreSQL 7.3 and
> later will no longer have this problem.

Yep.

--
Peter Eisentraut   peter_e@gmx.net


Re: Problem configuring Postgres under Cygwin

From
Jason Tishler
Date:
Peter,

On Mon, Nov 04, 2002 at 08:24:27PM +0100, Peter Eisentraut wrote:
> Jason Tishler writes:
>
> >     $ LDFLAGS=-L/usr/local/lib configure --enable-multibyte ...
> >       ^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > By reading configure, it seems that defining LDFLAGS as above should
> > enable PostgreSQL 7.2.3 to configure successfully under gcc 3.x.
> > Does it?
>
> Yep.
>
> > > while I try to figure out the best long-term solution.
> >
> > Actually, I checked PostgreSQL CVS and I think that PostgreSQL 7.3
> > and later will no longer have this problem.
>
> Yep.

Thanks for you confirmation.

Jason

--
GPG key available on key servers or http://www.tishler.net/jason/gpg.txt

Attachment