DirectFB 1.0.1を ubuntu 8.04 (VMware上) で動かす:system=x11

DirectFB 1.0.1を ubuntu 8.04 (VMware上) で動かす:system=x11


ubuntuには、libdirectfb-1.0-0 がすでに入っています。
ここでは DirectFB を tar ballからinstall しますが、
libdirectfb-1.0-0に依存するものがある場合、それらはどうなるかを確認していません。
試される場合はご自身の責任でお試しください。
VMwareの場合は試す前にスナップショットをとっておくのもよいかもしれません。
~/.directfbrc には、system=x11 と書いておいて
開発用ライブラリのパッケージの追加と make install まで一気に実行。

$ sudo apt-get install libfreetype6-dev
$ sudo apt-get install libpng12-dev
$ sudo apt-get install libjpeg62-dev
$ sudo apt-get install libx11-dev
$ sudo apt-get install libxext-dev
$ tar xvzf DirectFB-1.0.1.tar.gz
$ cd DirectFB-1.0.1.tar.gz
$ ./configure
$ make
$ sudo make isntall

dfbinfo を動かしてみる。

$ dfbinfo

     =======================|  DirectFB 1.0.1  |=======================
          (c) 2001-2007  The DirectFB Organization (directfb.org)
          (c) 2000-2004  Convergence (integrated media) GmbH
        ------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2008-04-08 15:15)   ※1
(!) Direct/Util: opening '/dev/fb0' and '/dev/fb/0' failed

あれ?

※1のメッセージは、src/core/core.c の

     D_INFO( "DirectFB/Core: %s Application Core. ("BUILDTIME") %s%s\n",
             FUSION_BUILD_MULTI ? "Multi" : "Single",
             DIRECT_BUILD_DEBUG ? "[ DEBUG ]" : "",
             DIRECT_BUILD_TRACE ? "[ TRACE ]" : "" );

で出てるもの。ビルドした時間なんですね。
ああ、これはパッケージでインストールされているライブラリですね。


$ export LD_LIBRARY_PATH=/usr/local/lib

として再度 dfbinfoを実行。無事実行できた。

次に、サンプル(DirectFB-examples)を動かしてみる。

DirectFBのDownloadページの [Extras] には 1.0.1 とか、1.2.0 とかがあるので
ついつい取ってきて使ってしまいそうですが、DirectFB-examples-1.0.1以降では、
追加になったインターフェースを使った計測などもあり、
DirectFB-1.0.1ではコンパイルが通りません。
DirectFB-1.0.1のときは [Old] にある、DirectFB-examples-1.0.0を使いましょう。

ちなみに、DirectFB-examples-1.0.1をmakeすると、こんなエラーがでます。


$ make
…
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\"
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"DirectFB-examples\" -DVERSION=\"1.0.1\" 
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 
-DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDBOOL_H=1 -I.  
-DDATADIR=\"/usr/local/share/directfb-examples\" 
-DFONT=\"/usr/local/share/directfb-examples/fonts/decker.ttf\"  
-D_REENTRANT -I/usr/local/include/directfb   -D_GNU_SOURCE -Wall -O3 -pipe  
-Werror-implicit-function-declaration -MT df_dok.o -MD -MP -MF 
.deps/df_dok.Tpo -c -o df_dok.o df_dok.c
df_dok.c: In function ‘blit180’:
df_dok.c:911: error: ‘DSBLIT_ROTATE180’ undeclared (first use in this function)
df_dok.c:911: error: (Each undeclared identifier is reported only once
df_dok.c:911: error: for each function it appears in.)
df_dok.c: In function ‘common_load_image’:
df_dok.c:1199: error: implicit declaration of function ‘dfb_pixelformat_name’
df_dok.c:1199: 警告: format ‘%s’ expects type ‘char *’, but argument 7 has type ‘int’
df_dok.c:1199: 警告: format ‘%s’ expects type ‘char *’, but argument 7 has type ‘int’
df_dok.c: In function ‘main’:
df_dok.c:1261: error: ‘DFBSurfaceRenderOptions’ undeclared (first use in this function)
df_dok.c:1261: error: expected ‘;’ before ‘render_options’
df_dok.c:1618: 警告: format ‘%s’ expects type ‘char *’, but argument 6 has type ‘int’
df_dok.c:1626: error: ‘IDirectFBSurface’ has no member named ‘SetMatrix’
df_dok.c:1628: error: ‘render_options’ undeclared (first use in this function)
df_dok.c:1628: error: ‘DSRO_MATRIX’ undeclared (first use in this function)
df_dok.c:1632: error: ‘DSRO_ANTIALIAS’ undeclared (first use in this function)
df_dok.c:1635: error: ‘DSRO_SMOOTH_UPSCALE’ undeclared (first use in this function)
df_dok.c:1635: error: ‘DSRO_SMOOTH_DOWNSCALE’ undeclared (first use in this function)
df_dok.c:1637: error: ‘IDirectFBSurface’ has no member named ‘SetRenderOptions’
make[2]: *** [df_dok.o] エラー 1

サンプルで使う画像データなどの参照パスなどいろいろ面倒な設定があるようなので、
installまでしてしまい、パフォーマンス計測を行う df_dok を動かしてみる。

~/.directfbrc は system=x11


$ tar xvzf DirectFB-examples-1.0.0
$ cd DirectFB-examples-1.0.0
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
$ ./configure
$ make
$ sudo make install
$ df_dok

     =======================|  DirectFB 1.0.1  |=======================
          (c) 2001-2007  The DirectFB Organization (directfb.org)
          (c) 2000-2004  Convergence (integrated media) GmbH
        ------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2009-04-20 16:31)
(*) Direct/Thread: Running 'X11 Input' (INPUT, 28202)...
(*) DirectFB/Input: X11 Input 0.1 (directfb.org)
(*) DirectFB/Genefx: MMX detected and enabled
(*) DirectFB/Graphics: MMX Software Rasterizer 0.6 (directfb.org)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(*) X11/Display: Using XShm.
(*) Direct/Interface: Loaded 'PNG' implementation of 'IDirectFBImageProvider'.
(*) Direct/Interface: Loaded 'FT2' implementation of 'IDirectFBFont'.
(*) Direct/Interface: Loaded 'GIF' implementation of 'IDirectFBImageProvider'.

Benchmarking with 256x256 in 24bit mode... (32bit)

Anti-aliased Text                              3.002 secs ( 1467.821 KChars/sec)
Anti-aliased Text (blend)                      3.000 secs (  243.600 KChars/sec)
Fill Rectangle                                 3.000 secs (  996.147 MPixel/sec)
Fill Rectangle (blend)                         3.027 secs (  151.553 MPixel/sec)
Fill Rectangles [10]                           3.059 secs ( 1006.927 MPixel/sec)
Fill Rectangles [10] (blend)                   3.098 secs (  148.080 MPixel/sec)
Fill Triangles                                 3.001 secs (  778.526 MPixel/sec)
Fill Triangles (blend)                         3.011 secs (  133.857 MPixel/sec)
Draw Rectangle                                 3.000 secs (  143.000 KRects/sec)
Draw Rectangle (blend)                         3.000 secs (   16.066 KRects/sec)
Draw Lines [10]                                3.000 secs (  373.333 KLines/sec)
Draw Lines [10] (blend)                        3.003 secs (   80.586 KLines/sec)
Fill Spans                                     3.000 secs (  865.075 MPixel/sec)
Fill Spans (blend)                             3.033 secs (  144.771 MPixel/sec)
Blit                                           3.000 secs ( 1190.570 MPixel/sec)
Blit colorkeyed                                3.011 secs (  507.136 MPixel/sec)
Blit destination colorkeyed                    3.008 secs (  653.617 MPixel/sec)
Blit with format conversion                    3.014 secs (  197.869 MPixel/sec)
Blit with colorizing                           3.012 secs (  139.253 MPixel/sec)
Blit from 32bit (blend)                        3.033 secs (  177.182 MPixel/sec)
Blit from 32bit (blend) with colorizing        3.003 secs (   69.835 MPixel/sec)
Stretch Blit                                   3.000 secs (  692.037 MPixel/sec)
Stretch Blit colorkeyed                        3.001 secs (  405.123 MPixel/sec)

ちゃんと動きました。




トップページへ




鮫洲曙町会ホームページ