« 箱根駅伝 | メイン | 仕事始め »

2007年01月03日

●Vine Linux4.0にPostgreSQL7.4.14をインストールしてみました。

自宅サーバー入れ替え用に、Vine Linux4.0をインストールしていたマシンがあったので
PostgreSQL7.4.14をインストールしてみました。
PostgreSQLは今まで何回もインストールしたことがあったのですが、
今回はすんなり行かなかったのでメモしておきます。

ソースをDLして、./configureをしてみたのですがまず以下のようなエラーが発生しました。

configure: error: readline library not found
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.

なんかreadlineってものを入れるか、configureでwithoutにしてくださいとのことでした。
むかついたので、readlineを以下のようにインストールしてみました。
(readline自体はGoogleで検索すればみつかります。以下の例は、ダウンロードしたものを
/usr/local/srcにおいてあります。)

[root src]# tar zxvf readline-4.3.tar.gz
[root src]]# cd readline-4.3
[root readline-4.3]# ./configure
[root readline-4.3]# make
[root readline-4.3]# make install

リンクを作成しておきます。
[root readline-4.3]# ldconfig

これで行けると思ったらまたエラーが。┐(´∇`)┌

configure: error: zlib library not found
If you have zlib already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-zlib to disable zlib support.

readlineの時と同じようなエラーだったのでまた同様にしてみました。

root src]#tar zxvf zlib-1.2.3.tar.gz
[root src]# cd zlib-1.2.3
[root zlib-1.2.3]# ./configure -shared
[root zlib-1.2.3]# make
[root zlib-1.2.3]# make install

リンクを作成しておきます。
[root zlib-1.2.3]# ldconfig

今度こそ行けると思ったんですがまたもやNGです。orz

checking test program... failed
configure: error:
*** Could not execute a simple test program. This may be a problem
*** related to locating shared libraries. Check the file 'config.log'
*** for the exact reason.

なんなんだろう。
私は、ライブラリのパスに問題があるのかと思い以下のようにしました。
(LD_LIBRARY_PATHに/usr/local/libを追加してみました。)

[postgres@hogehoge postgres]$ vi .bashrc
PATH="$PATH":/usr/local/pgsql/bin
export POSTGRES_HOME=/usr/local/pgsql
export PGLIB=$POSTGRES_HOME/lib
export PGDATA=$POSTGRES_HOME/data
export MANPATH="$MANPATH":$POSTGRES_HOME/man
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":$PGLIB:/usr/local/lib

[postgres@hogehoge postgres]$ source .bashrc

すると、今度は問題なくconfigureに成功しました!
で、make installまでも問題ありませんでした。
あぁ。久しぶりにlinuxを触ったなぁ。疲れた。

トラックバックURL

このエントリーのトラックバックURL:
http://kororin.com/cgi-bin/mt32/mt-tb.cgi/232

コメントする

(初めてのコメントの時は、コメントが表示されるためにこのブログのオーナーの承認が必要になることがあります。承認されるまでコメントは表示されませんのでしばらくお待ちください)