본문 바로가기
C++ 200제/코딩 IT 정보

GNUplot 설치 Linux ubuntu 12.04 및 x11 wxt 버그 수정

by vicddory 2017. 2. 21.

GNUplot 설치 Linux ubuntu 12.04 및 x11 wxt 버그 수정


GNUplot 설치할 때, 명령어 앞에는 항상 sudo 붙이세요.


작업 환경

  • 우분투 12.04 64bit (Linux 환경)
  • 임베디드 ARM 프로세서


Linux Ubuntu 12.04에서 기본적으로 설치되는 GNU Plot는 4.4 버전입니다. 아래 그림처럼 eps 파일 생성 시, 범례란에 비정상적인 공백이 들어가는 버그가 존재합니다.

그렇기에 현재는 GNUplot 설치 버전을 4.6 이상으로 올려주세요.



(범례란의 폭에 대한 버그)

Ubuntu GNUPLOT - 예제 화면Ubuntu GNUPLOT - 예제 화면



먼저, GNU Plot을 다운 받고(gnuplot development), 설치해줍니다.


1
2
3
./configure;
make;
sudo make install
cs


그러나, Linux GNUplot 설치 이후에 x11과 wxt를 사용할 수 없는 문제가 발생할지도 모릅니다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
gnuplot> set term 
Available terminal types:
 canvas   HTML Canvas object
 cgm      Computer Graphics Metafile
 context  ConTeXt with MetaFun (for PDF documents)
 corel    EPS format for CorelDRAW
 dumb     ascii art for anything that prints text
 dxf      dxf-file for AutoCad (default size 120x80)
 eepic    EEPIC -- extended LaTeX picture environment
 emf      Enhanced Metafile format
 emtex    LaTeX picture environment with emTeX specials
 epslatex LaTeX picture environment using graphicx package
 fig      FIG graphics language for XFIG graphics editor
 gpic     GPIC -- Produce graphs in groff using the gpic preprocessor
 hp2623A  HP2623A and maybe others
 hp2648   HP2648 and HP2647
 hpgl     HP7475 and relatives [number of pens] [eject]
 imagen   Imagen laser printer
 latex    LaTeX picture environment
 mf       Metafont plotting standard
 mif      Frame maker MIF 3.00 format
 mp       MetaPost plotting standard
 pcl5     HP Designjet 750C, HP Laserjet III/IV, etc. (many options)
cs



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Press return for more:
 postscript PostScript graphics, including EPSF embedded files (*.eps)
 pslatex    LaTeX picture environment with PostScript \specials
 pstex      plain TeX with PostScript \specials
 pstricks   LaTeX picture environment with PSTricks macros
 qms        QMS/QUIC Laser printer (also Talaris 1200 and others)
 regis      REGIS graphics language
 svg        W3C Scalable Vector Graphics driver
 tek40xx    Tektronix 4010 and others; most TEK emulators
 tek410x    Tektronix 410641074109 and 420X terminals
 texdraw    LaTeX texdraw environment
 tgif       TGIF X11 [mode] [x,y] [dashed] ["font" [fontsize]]
 tkcanvas   Tk/Tcl canvas widget [perltk] [interactive]
 tpic       TPIC -- LaTeX picture environment with tpic \specials
 unknown    Unknown terminal type - not a plotting device
 vttek      VT-like tek40xx terminal emulator
 xterm      Xterm Tektronix 4014 Mode
cs


set term으로 사용 가능한 컴포넌트를 확인해 보면 x11과 wxt가 없습니다.



GNUplot 설치, Linux(우분투ubuntu 12.04)[그누플롯 linux 설치] 우분투 12.04


리눅스 파일 중 하나인 .configure에서 빠진 것으로 보입니다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
% ./configure
(略)
checking for wx-config... no
configure: WARNING:
wxWidgets can't be found. You can try --with-wx-config-path to give the right path to wx-config.
The wxWidgets terminal will not be compiled.
(略)
** Configuration summary for gnuplot 4.6.0:
gnuplot will be compiled with the following terminals:
(略)
X Window System terminal: no (requires X libraries)
(略)
wxt terminal: no (requires C++, wxWidgets>2.6, cairo>0.9, pango>1.10)
(略)
cs


apt를 이용한 기본 GNUplot 설치(4.4)에선 찾아볼 수 있는데 컴파일 과정에서 해당 정보가 빠진 것 같습니다.


어쩔 수 없이 지원 가능한 패키지를 Linux에 설치합니다.


1
sudo apt-get install libwxgtk2.8-dev
cs



GNUplot 설치 Linux ubuntu 12.04 및 x11 wxt 버그 수정



이후엔 wx-config 누락 오류는 사라집니다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% ./configure |grep "WARNING"
configure: WARNING: GNU readline not found - falling back to builtin readline
configure: WARNING: zlib is required - see http://www.gzip.org/zlib/
configure: WARNING: libgd not found or too old, version >= 2.0 is required
configure: WARNING: Could not find support for lua using pkg-config.
configure: WARNING:
Package requirements (cairo >= 0.9.0 pango >= 1.10 pangocairo >= 1.10) were not met:
No package 'cairo' found
No package 'pango' found
No package 'pangocairo' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables CAIROPANGO_CFLAGS
and CAIROPANGO_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
configure: WARNING: The wxWidgets terminal will not be compiled.configure: WARNING:
Package requirements(cairo >= 1.2 cairo-pdf >= 1.2 pango >= 1.10 pangocairo >= 1.10 glib-2.0) were not met:
No package 'cairo' found
No package 'cairo-pdf' found
No package 'pango' found
No package 'pangocairo' found
No package 'glib-2.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables CAIROPDF_CFLAGS
and CAIROPDF_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
configure: WARNING: The cairo terminals will not be compiled.
cs


그러나, cairo와 pango가 없다는 문제가 발생합니다.

이로 인해 wxt가 여전히 빠집니다.


1
2
apt-cache search libpango
libpangomm-1.4-dev
cs


위의 Ubuntu 패키지를 추가로 설치하고 ./configure로 상황을 다시 확인해 봅시다.


1
2
3
4
% ./configure |grep "WARNING"
configure: WARNING: GNU readline not found - falling back to builtin readline
configure: WARNING: libgd not found or too old, version >= 2.0 is required
configure: WARNING: Could not find support for lua using pkg-config.
cs


Warning 메시지가 많이 줄었습니다. 이후엔 make와 make install을 다시 실행해 x11을 사용할 수 있습니다.


gnuplot 사이트에서 제공하는 데모 프로그램도 모두 실행해 볼 수 있는 상태가 됩니다.





gnuplot 리눅스 사용법



위의 사항을 정리해보면 이렇습니다. (x11과 wxt 누락 문제만 부분적으로 해결해 보려는 경우의 GNUplot 설치 방안)


1
2
3
4
5
6
7
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libwxgtk2.8-dev libpangomm-1.4-dev
 
% ./configure
make
sudo make install
cs


(Warning 메시지 전체를 해결해 보려는 경우)


1
2
3
4
5
6
sudo apt-get install libreadline6-dev libgd2-xpm-dev liblua5.1-0-dev
sudo ln -/usr/lib/i386-linux-gnu/pkgconfig/lua5.1.pc  /usr/lib/pkgconfig/lua.pc
 
./configure
make
sudo make install
cs


출처 - Install gnuplot 4.6 on Ubuntu 12.04(Precise)

GNUplot 설치 Linux ubuntu 12.04 및 x11 wxt 버그 수정

댓글