LoginSignup
3
3

More than 5 years have passed since last update.

centos gnuplot ビルド

Last updated at Posted at 2018-02-11

centosにgnuplotをソースからコンパイルする

yumを使うと古いバージョンのgnuplotしかないので,自分でコンパイルしてインストールする方法。

必要なライブラリのインストール

gnuplotの出力形式として,pngやpngcairoを使いたかったので,ビルドの前に事前インストール。

$ su
# yum install pango-devel cairo-devel wxGTK-devel wxBase gd gd-devel
# exit

ダウンロード

http://www.gnuplot.info/
にてソースファイルをダウンロード。

現在の最新版は以下。
Version 5.2 (current)
Release 5.2.2 (November 2017)

https://sourceforge.net/projects/gnuplot/files/gnuplot/5.2.2/
gnuplot-5.2.2.tar.gz

解凍

$ tar -zxvf gnuplot-5.2.2.tar.gz

ビルド

$ cd gnuplot-5.2.2
$ sh ./configure --prefix=/home/hnishi/local
$ make 
$ make check
$ make install

configureのときに--prefixのオプションでインストール先のディレクトリを指定できる。
--prefixオプションを使用しない場合は,たぶん/usr/binとか/usr/local/binとかがデフォルトになっているので,スーパーユーザになってからmakeする。

インストール後,

$ /home/hnishi/local/bin/gnuplot

で実行可能。

パスの設定は,

https://qiita.com/hnishi/items/508b3cdbd237d1b5732a
とか,
http://rh7.hateblo.jp/entry/20100324/1269409310

追記

CentOS 5にversion5.0.5をインストールしようと思ったら以下のようなエラーが出た。

undefined reference to 'pango_layout_get_baseline'

CentOS5で利用できるyumのcairo, pangoライブラリのバージョンが古すぎるようである。
gnuplot-5.0.1 であれば,なんとかpngcairoが使えた。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3