Installing DBD::Pg on XP with Cygwin and gcc
Hi. As a little home holiday project I'm trying to get PostgreSQL working on a sub-laptop running Win XP. I have ActiveState Perl 5.10.0 installed and was able to use ppm to install DBI 1.607. However the DBD::Pg ppm is not available at ActiveState, so I had to try downloading it from CPAN and building it myself. I have gcc 3.4.4 and GNU make 3.81 on the device. I have also installed PostgreSQL 8.3.5 and have confirmed the server is running and I can do simple SQL commands using psql. When I try to run 'perl Makefile.PL' at the shell prompt, I get a complaint: . . . WARNING! No libpq libraries were detected! You need to install the postgresql-libs package for your system, or set the POSTGRES_LIB environment variable to the correct place. Removing (Makefile) ~~~ I have attached the complete output of this command in mf.pl.out, the output of perl -V in PerlV.out, and the output of the 'set' command in the bash script where I ran the command in set.out. Does anyone here have experience installing PostgreSQL and DBD::Pg in a similar environment? Note that I do have files libpq.dll and libpq.lib under $POSTGRES_LIB. There is a README.win32, but it mostly assumes you are using MS VC++ and nmake. It doesn't cover my environment. Please let me know if you can help. -Will Set up gcc environment - 3.4.4 (cygming special, gdc 0.12, using dmd 0.125) Configuring DBD::Pg 2.11.7 Multiple copies of Driver.xst found in: c:/Perl/site/lib/auto/DBI/ c:/Perl/lib/auto/DBI/ at Makefile.PL line 162 PostgreSQL version: 80305 (default port: 5432) POSTGRES_HOME: c:\Program Files\PostgreSQL\8.3 POSTGRES_INCLUDE: c:\Program Files\PostgreSQL\8.3\include POSTGRES_LIB: c:\Program Files\PostgreSQL\8.3\lib OS: MSWin32 Checking if your kit is complete... Looks good Note (probably harmless): No library found for -lpq Note (probably harmless): No library found for -lsecur32 Note (probably harmless): No library found for -lkernel32 Note (probably harmless): No library found for -luser32 Note (probably harmless): No library found for -lgdi32 Note (probably harmless): No library found for -lwinspool Note (probably harmless): No library found for -lcomdlg32 Note (probably harmless): No library found for -ladvapi32 Note (probably harmless): No library found for -lshell32 Note (probably harmless): No library found for -lole32 Note (probably harmless): No library found for -loleaut32 Note (probably harmless): No library found for -lnetapi32 Note (probably harmless): No library found for -luuid Note (probably harmless): No library found for -lws2_32 Note (probably harmless): No library found for -lmpr Note (probably harmless): No library found for -lwinmm Note (probably harmless): No library found for -lversion Note (probably harmless): No library found for -lodbc32 Note (probably harmless): No library found for -lodbccp32 Note (probably harmless): No library found for -lmsvcrt Multiple copies of Driver.xst found in: c:/Perl/site/lib/auto/DBI/ c:/Perl/lib/auto/DBI/ at Makefile.PL line 258 Using DBI 1.607 (for perl 5.01 on MSWin32-x86-multi-thread) installed in c:/Perl/site/lib/auto/DBI/ Writing Makefile for DBD::Pg == WARNING! No libpq libraries were detected! You need to install the postgresql-libs package for your system, or set the POSTGRES_LIB environment variable to the correct place. Removing (Makefile) === Set up gcc environment - 3.4.4 (cygming special, gdc 0.12, using dmd 0.125) Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields', optimize='-O2', cppflags='-DWIN32' ccversion='', gccversion='3.4.4 (cygming special, gdc 0.12, using dmd 0.125)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++', ldflags ='-LC:\Perl\lib\CORE' libpth=\lib libs=-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lmsvcrt
Re: Installing DBD::Pg on XP with Cygwin and gcc
On Mon, Dec 29, 2008 at 11:00 AM, William Gordon Rutherdale will.rutherd...@utoronto.ca wrote: DBI 1.607. However the DBD::Pg ppm is not available at ActiveState, so I Get it from the trouchelle repo. See: http://cpan.uwinnipeg.ca/dist/DBD-Pg HTH, Douglas Wilson
Re: Installing DBD::Pg on XP with Cygwin and gcc
On Mon, Dec 29, 2008 at 11:00 AM, William Gordon Rutherdale will.rutherd...@utoronto.ca wrote: I have ActiveState Perl 5.10.0 installed and was able to use ppm to install DBI 1.607. However the DBD::Pg ppm is not available at ActiveState, so I had to try downloading it from CPAN and building it myself. I have gcc 3.4.4 and GNU make 3.81 on the device. I have also installed PostgreSQL 8.3.5 and have confirmed the server is running and I can do simple SQL commands using psql. One thing I did see, you're trying to use Windows Paths with Cygwin. As far as I know, you need to use Cygwin paths with Cygwin, not Windows paths, meaning POSTGRES_LIB=/cygdrive/c/Program Files/PostgreSQL. In particular, GNU make dislikes Windows-style paths. I don't really recommend using Cygwin to compile things for ActiveState, as you're basically trying to get two completely different toolchains to co-exist. Unless you have a lot of experience doing that, you're in for a world of hurt. Someone else has already mentioned the ActiveState repository that has a copy of DBD::Pg, that will be the easiest solution to your problem if you want to keep using ActiveState. POSTGRES_HOME: c:\Program Files\PostgreSQL\8.3 POSTGRES_INCLUDE: c:\Program Files\PostgreSQL\8.3\include POSTGRES_LIB: c:\Program Files\PostgreSQL\8.3\lib OS: MSWin32 Checking if your kit is complete... Looks good Note (probably harmless): No library found for -lpq Note (probably harmless): No library found for -lsecur32 Note (probably harmless): No library found for -lkernel32 Note (probably harmless): No library found for -luser32 Note (probably harmless): No library found for -lgdi32 Note (probably harmless): No library found for -lwinspool Note (probably harmless): No library found for -lcomdlg32 Note (probably harmless): No library found for -ladvapi32 Note (probably harmless): No library found for -lshell32 Note (probably harmless): No library found for -lole32 Note (probably harmless): No library found for -loleaut32 Note (probably harmless): No library found for -lnetapi32 Note (probably harmless): No library found for -luuid Note (probably harmless): No library found for -lws2_32 Note (probably harmless): No library found for -lmpr Note (probably harmless): No library found for -lwinmm Note (probably harmless): No library found for -lversion Note (probably harmless): No library found for -lodbc32 Note (probably harmless): No library found for -lodbccp32 Note (probably harmless): No library found for -lmsvcrt Cygwin won't know anything about most of the above Windows libraries, they come from Visual C++. In the pimp my own wares department, If you're looking for a natively compiled Perl for Windows with the popular DBD drivers already compiled and set up, you might consider Camelbox [1]. Thanks, Brian [1] http://code.google.com/p/camelbox/
(Fwd) Views on DBI 2.0
- Forwarded message from Marcin Guzowski mar...@guzowski.info - Date: Mon, 29 Dec 2008 05:14:17 -0800 (PST) From: Marcin Guzowski mar...@guzowski.info To: Tim Bunce tim.bu...@pobox.com Subject: Views on DBI 2.0 Hi Tim, We have developed a distributed system written in Perl that needs to maintain multiple db connections across multiple threads (across multiple processes). Unfortunately, we can't use current DBI 1.x module, because it's not threading-safe. AFAIR DBI 2.0 should fix this problem and could be used in multi-threaded apps, is that true? Have you any idea when DBI 2.0 will be out? Cheers, Marcin - End forwarded message -
Re: (Fwd) Views on DBI 2.0
Date: Mon, 29 Dec 2008 05:14:17 -0800 (PST) From: Marcin Guzowski mar...@guzowski.info We have developed a distributed system written in Perl that needs to maintain multiple db connections across multiple threads (across multiple processes). Unfortunately, we can't use current DBI 1.x module, because it's not threading-safe. AFAIR DBI 2.0 should fix this problem and could be used in multi-threaded apps, is that true? Have you any idea when DBI 2.0 will be out? I think the plan, to the extent there is a plan, is 'sometime after Perl 6 is available'. It is interesting to speculate 'When will Perl 6 be available'. -- Jonathan Leffler jonathan.leff...@gmail.com #include disclaimer.h Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org Blessed are we who can laugh at ourselves, for we shall never cease to be amused.
Re: (Fwd) Views on DBI 2.0
Tim Bunce wrote: - Forwarded message from Marcin Guzowski mar...@guzowski.info - Date: Mon, 29 Dec 2008 05:14:17 -0800 (PST) From: Marcin Guzowski mar...@guzowski.info To: Tim Bunce tim.bu...@pobox.com Subject: Views on DBI 2.0 Hi Tim, We have developed a distributed system written in Perl that needs to maintain multiple db connections across multiple threads (across multiple processes). Unfortunately, we can't use current DBI 1.x module, because it's not threading-safe. AFAIR DBI 2.0 should fix this problem and could be used in multi-threaded apps, is that true? Have you any idea when DBI 2.0 will be out? Cheers, Marcin - End forwarded message - Marcin: perhaps if you could elaborate on your architectural needs, it might be possible to discuss threaded options for DBI 1.x with you. FWIW: I've implemented a (heavyweight) Erlang-esque solution in DBIx::Threaded, and had hoped to improve upon it via Thread::Sociable (www.presicient.com/sociable). Alas, other commitments have forced me to suspend development of the latter, but it may possible to resurrect it. Also, recent announcements wrt Perl6's development may disappoint the threads enthusiasts among us. E.g., they've cut STM, and I suspect other threads related features may also be on the chopping block in the interest of delivering a GA language implementation in the next 18 months (Concurrency can be a harsh mistress...) Dean Arnold Presicient Corp.
Re: Installing DBD::Pg on XP with Cygwin and gcc
I tried that. It looked promising. However I was unable to get the package since at the time it had a status of NEW and was unavailable. -Will Douglas Wilson wrote: On Mon, Dec 29, 2008 at 11:00 AM, William Gordon Rutherdale will.rutherd...@utoronto.ca wrote: DBI 1.607. However the DBD::Pg ppm is not available at ActiveState, so I Get it from the trouchelle repo. See: http://cpan.uwinnipeg.ca/dist/DBD-Pg HTH, Douglas Wilson
Re: Installing DBD::Pg on XP with Cygwin and gcc
Okay, GNU make may be the point of incompatibility here. I'll play with that more. As I mentioned in another email, I got the ODBC driver and connected using DBD::ODBC. That was a little effort considering I'm not familiar with Windows configuration. I may look into the Camelbox solution later. Thanks, everyone, for the guidance. It made the setup doable: interesting enough to learn something but not excruciating. -Will Brian Manning wrote: One thing I did see, you're trying to use Windows Paths with Cygwin. As far as I know, you need to use Cygwin paths with Cygwin, not Windows paths, meaning POSTGRES_LIB=/cygdrive/c/Program Files/PostgreSQL. In particular, GNU make dislikes Windows-style paths. I don't really recommend using Cygwin to compile things for ActiveState, as you're basically trying to get two completely different toolchains to co-exist. Unless you have a lot of experience doing that, you're in for a world of hurt. Someone else has already mentioned the ActiveState repository that has a copy of DBD::Pg, that will be the easiest solution to your problem if you want to keep using ActiveState. Cygwin won't know anything about most of the above Windows libraries, they come from Visual C++. In the pimp my own wares department, If you're looking for a natively compiled Perl for Windows with the popular DBD drivers already compiled and set up, you might consider Camelbox [1]. Thanks, Brian [1] http://code.google.com/p/camelbox/