English 中文(简体)
How can I compile 64-bit Postgres bindings for Perl on Solaris?
原标题:

I m running 64-bit Solaris 10, and I have self-compiled Perl 5.10 and Postgresql 8.4.1 installed in /usr/local, both 64 bits. Solaris came with 32-bit Postgresql 8.1.4 installed in /usr, but it is not running. When I attempt to install DBD::Pg, it hits a problem because the libpq.so it finds is the 32-bit one in /usr/lib rather than the 64-bit one in /usr/local/pgsql/lib.

# /usr/local/bin/cpanp -i DBD::Pg
Installing DBD::Pg (2.15.1)
...
ld: fatal: file /usr/lib/libpq.so: wrong ELF class: ELFCLASS32

My first thought was to remove the bundled Postgres, but I ve read advice against that. I m sure everything would work if I started over with 32-bit Perl, but I d prefer to stick with what I have.

I noticed in the CPAN output that the makefile sets LD_RUN_PATH=/usr/lib prior to linking. That seems like something that should change, but I don t know how to change it (since it s all automated by CPAN), and I don t know what other side effects such a change might have. It looks like the correct directory, /usr/local/pgsql/lib, isn t on the path at all, so maybe just making that visible would resolve the problem even without hiding the 32-bit version, but I don t know how to do that, either.

How can I get this module compiled in the environment I have, or how can I change my environment so the module will compile as-is?

最佳回答

From http://cpansearch.perl.org/src/TURNSTEP/DBD-Pg-2.15.1/Makefile.PL

In brief:

By default Makefile.PL uses App::Info to find the location of the PostgreSQL library and include directories. However, if you want to control it yourself, define the environment variables POSTGRES_INCLUDE and POSTGRES_LIB, or define just POSTGRES_HOME. Note that if you have compiled PostgreSQL with SSL support, you must define the POSTGRES_LIB environment variable and add "-lssl" to it, like this:

export POSTGRES_LIB="/usr/local/pgsql/lib -lssl"
问题回答

暂无回答




相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...

热门标签