Edubuntu 14.04 x64 でclamav-0.98.3 tarball をビルド

Edubuntu 14.04 x64 でclamav-0.98.3 tarball をビルドしてみた。オブジェクトはできたが、ワーニングの嵐だ。大方キャストとか型の不一致なので、走らせていいものか悩ましいところ。

configure: Summary of detected features follows
              OS          : linux-gnu
              pthreads    : yes (-lpthread)
configure: Summary of miscellaneous  features
              check       : -lcheck  -pthread -Wl,--no-as-needed -lm -Wl,--as-needed -lrt (auto)
              fanotify    : yes
              fdpassing   : 1
              IPv6        : yes
configure: Summary of optional tools
              clamdtop    : -lncurses (auto)
              milter      : yes (disabled)
              clamsubmit  : yes
configure: Summary of engine performance features)
              release mode: yes
              jit         : no (disabled)
              mempool     : yes
configure: Summary of engine detection features
              bzip2       : ok
              zlib        : /usr
              unrar       : yes
              dmg and xar : yes, from /usr

のときstderrからリダイレクトしたワーニングをwcで数えてみると278 行

configure: Summary of detected features follows
              OS          : linux-gnu
              pthreads    : yes (-lpthread)
configure: Summary of miscellaneous  features
              check       : -lcheck  -pthread -Wl,--no-as-needed -lm -Wl,--as-needed -lrt (auto)
              fanotify    : yes
              fdpassing   : 1
              IPv6        : yes
configure: Summary of optional tools
              clamdtop    : -lncurses (auto)
              milter      : yes (disabled)
              clamsubmit  : yes
configure: Summary of engine performance features)
              release mode: yes
              jit         : yes (auto)
              mempool     : yes
configure: Summary of engine detection features
              bzip2       : ok
              zlib        : /usr
              unrar       : yes
              dmg and xar : yes, from /usr

のときstderrからリダイレクトしたワーニングをwcで数えてみると1814 行

Edubuntu 14.04 LTS でFreeCADのビルド

Edubuntu 14.04 LTS x64版でFreeCAD 次期リリース予定の0.14系をビルドする時のメモ。

Edubuntu 14.04 LTSをインストールしたばかりの状態のときに

sudo apt-get build-dep

で導入される依存関係

  autotools-dev build-essential cmake cmake-data debhelper dh-apparmor
  dpkg-dev g++ g++-4.8 gfortran gfortran-4.8 gir1.2-gtk-2.0 icu-devtools
  libatk1.0-dev libavcodec-dev libavformat-dev libavutil-dev
  libboost-atomic1.54-dev libboost-atomic1.54.0 libboost-chrono1.54-dev
  libboost-chrono1.54.0 libboost-date-time-dev libboost-date-time1.54-dev
  libboost-dev libboost-filesystem-dev libboost-filesystem1.54-dev
  libboost-filesystem1.54.0 libboost-graph-dev libboost-graph1.54-dev
  libboost-graph1.54.0 libboost-iostreams-dev libboost-iostreams1.54-dev
  libboost-iostreams1.54.0 libboost-program-options-dev
  libboost-program-options1.54-dev libboost-python-dev libboost-python1.54-dev
  libboost-regex-dev libboost-regex1.54-dev libboost-regex1.54.0
  libboost-serialization-dev libboost-serialization1.54-dev
  libboost-serialization1.54.0 libboost-signals-dev libboost-signals1.54-dev
  libboost-signals1.54.0 libboost-system1.54-dev libboost-test1.54-dev
  libboost-test1.54.0 libboost-thread-dev libboost-thread1.54-dev
  libboost1.54-dev libcairo-script-interpreter2 libcairo2-dev libcoin80
  libcoin80-dev libcv-dev libdc1394-22-dev libdrm-dev libeigen3-dev
  libexpat1-dev libf2c2 libf2c2-dev libfltk-cairo1.3 libfltk-forms1.3
  libfltk-gl1.3 libfltk-images1.3 libfltk1.3 libfltk1.3-dev libfontconfig1-dev
  libfreeimage-dev libfreeimage3 libfreetype6-dev libgdk-pixbuf2.0-dev
  libgfortran-4.8-dev libgl1-mesa-dev libgl2ps-dev libglib2.0-dev
  libglu1-mesa-dev libgtk2.0-dev libgts-0.7-5 libgts-bin libgts-dev
  libharfbuzz-dev libharfbuzz-gobject0 libice-dev libicu-dev libilmbase-dev
  libjasper-dev libjbig-dev libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev
  liblzma-dev liboce-foundation-dev liboce-foundation8 liboce-modeling-dev
  liboce-modeling8 liboce-ocaf-dev liboce-ocaf-lite-dev liboce-ocaf-lite8
  liboce-ocaf8 liboce-visualization-dev liboce-visualization8 libode-dev
  libode1 libopencv-calib3d-dev libopencv-core-dev libopencv-features2d-dev
  libopencv-flann-dev libopencv-highgui-dev libopencv-imgproc-dev
  libopencv-legacy-dev libopencv-ml-dev libopencv-objdetect-dev
  libopencv-ocl-dev libopencv-ocl2.4 libopencv-video-dev libopenexr-dev
  libpango1.0-dev libpcre3-dev libpcrecpp0 libpixman-1-dev libpng12-dev
  libpthread-stubs0-dev libpython-dev libpython2.7-dev libqt4-dev
  libqt4-dev-bin libqt4-opengl-dev libqtwebkit-dev libraw1394-dev libsm-dev
  libsoqt-dev-common libsoqt4-20 libsoqt4-dev libspnav-dev libspnav0
  libstdc++-4.8-dev libswscale-dev libtcl8.5 libtiff5-dev libtiffxx5 libtk8.5
  libtool libx11-dev libx11-xcb-dev libxau-dev libxcb-dri2-0-dev
  libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev
  libxcb-render0-dev libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev
  libxcb-xfixes0-dev libxcb1-dev libxcomposite-dev libxcursor-dev
  libxdamage-dev libxdmcp-dev libxerces-c-dev libxext-dev libxfixes-dev
  libxft-dev libxi-dev libxinerama-dev libxmu-dev libxmu-headers libxpm-dev
  libxrandr-dev libxrender-dev libxshmfence-dev libxss-dev libxt-dev
  libxxf86vm-dev libzipios++-dev libzipios++0c2a mesa-common-dev oce-draw
  po-debconf python-cxx-dev python-dev python2.7-dev qt4-dev-tools
  qt4-linguist-tools qt4-qmake swig swig2.0 tcl8.5 tcl8.5-dev tk8.5 tk8.5-dev
  x11proto-composite-dev x11proto-core-dev x11proto-damage-dev
  x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev
  x11proto-kb-dev x11proto-randr-dev x11proto-render-dev
  x11proto-scrnsaver-dev x11proto-xext-dev x11proto-xf86vidmode-dev
  x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev zlib1g-dev

apt-get build-dep だけでは解決されない依存関係にあるパッケージ

$ apt-cache show shibokenPackage: shiboken
Priority: optional
Section: universe/devel
Installed-Size: 1854
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Architecture: amd64
Version: 1.2.1-3build1
Depends: libc6 (>= 2.14), libgcc1 (>= 1:4.1.1), libqt4-xml (>= 4:4.7.0), libqt4-xmlpatterns (>= 4:4.7.0), libqtcore4 (>= 4:4.8.0), libstdc++6 (>= 4.4.0), libxml2 (>= 2.7.4), libxslt1.1 (>= 1.1.25)
Filename: pool/universe/s/shiboken/shiboken_1.2.1-3build1_amd64.deb
Size: 626160
MD5sum: 6a14ffb3840954374037fa6ce8685aa5
SHA1: 47c2062824ebda37c84e78184ce8f90300d8a058
SHA256: ad7a5e3979232dde9a9a59fe4898b105a5fa7bd4486bf4264a21fd4b8c36b986
Description-en: CPython bindings generator for C++ libraries
 Shiboken is a bindings generator for C++ libraries that outputs CPython
 source code. It collects information from library headers, and then
 merges modifications and handwritten code defined in the typesystem
 description.
 .
 Shiboken is the binding generator used to create the PySide bindings.
Description-md5: 33001ed1fff8558f414b5f6812c495b1
Homepage: http://www.pyside.org/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
$ apt-cache search shibokenlibshiboken-dev - development files for the shiboken bindings generator library
libshiboken-py3-1.2 - CPython3 bindings generator for C++ libraries - shared library
libshiboken1.2 - CPython bindings generator for C++ libraries - shared library
shiboken - CPython bindings generator for C++ libraries
shiboken-dbg - debugging symbols for shiboken and its library
shiboken-doc - CPython bindings generator for C++ libraries documentation
maho-maho@kasago432:~/src/freecad/Build-Freecad$ apt-cache show libshiboken-devPackage: libshiboken-dev
Priority: optional
Section: universe/libdevel
Installed-Size: 165
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Architecture: amd64
Source: shiboken
Version: 1.2.1-3build1
Depends: python-dev, libshiboken1.2 (= 1.2.1-3build1), libshiboken-py3-1.2 (= 1.2.1-3build1)
Filename: pool/universe/s/shiboken/libshiboken-dev_1.2.1-3build1_amd64.deb
Size: 21138
MD5sum: 628ce62abea9a07e110eb1799e6705f6
SHA1: 99a0548792ff27208c527a81648dbc41150e1079
SHA256: e41283891a08467a6ff4cceefe05c977a469ff46bec8fe4a1dee9d2e7fb00190
Description-en: development files for the shiboken bindings generator library
 Shiboken is a bindings generator for C++ libraries that outputs CPython
 source code. It collects information from library headers, and then
 merges modifications and handwritten code defined in the typesystem
 description.
 .
 This package contains the development files for the library.
Description-md5: 98e6f77fc817edc44e7c3f9a9d9de7f1
Homepage: http://www.pyside.org/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
$ apt-cache show libpyside-dev
Package: libpyside-dev
Priority: optional
Section: universe/libdevel
Installed-Size: 1204
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Architecture: amd64
Source: pyside
Version: 1.2.1-4build1
Replaces: libpyside0.3 (<< 0.4.0)
Depends: libpyside1.2 (= 1.2.1-4build1), libpyside-py3-1.2 (= 1.2.1-4build1), libqt4-dev (>= 4:4.7.0)
Breaks: libpyside0.3 (<< 0.4.0)
Filename: pool/universe/p/pyside/libpyside-dev_1.2.1-4build1_amd64.deb
Size: 103658
MD5sum: 7d93dc8f62741120cc8b36df37c43e1f
SHA1: 531745cf37eb735f5371d2b8d5d01f03a6866809
SHA256: f03f12a2129e4ade471e4f7617a97c4386cf1edd7dcd389c3d4c83087f2ab221
Description-ja: Qt 4 用 Python バインディング (開発用ファイル)
 Qt は、クロスプラットフォームな C++ アプリケーションフレームワークです。Qt の一番の特徴は、cmake-qt-gui標準的な GUI
 機能を提供する豊富なウィジェットセットです。
 .
 このパッケージは libpyside ライブラリの開発用ヘッダを提供します。
Description-md5: 6faf275ae65de581cef049209922a69a
Homepage: http://www.pyside.org/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
$ apt-cache show python-matplotlib
Package: python-matplotlib
Priority: optional
Section: universe/python
Installed-Size: 7653
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Architecture: amd64
Source: matplotlib
Version: 1.3.1-1ubuntu5
Depends: python-dateutil, python-matplotlib-data (>= 1.3.1-1ubuntu5), python-pyparsing, python-tz, python (<< 2.8), python (>= 2.7), python-numpy (>= 1:1.8.0), python-numpy-abi9, python-support (>= 0.90.0), libc6 (>= 2.14), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.8.0), libpng12-0 (>= 1.2.13-4), libstdc++6 (>= 4.6), libtcl8.6 (>= 8.6.0), libtk8.6 (>= 8.6.0)
Recommends: python-glade2, python-imaging, python-tk (>= 2.5.2-1.1)
Suggests: dvipng, gir1.2-gtk-3.0, ghostscript, inkscape, ipython (>= 0.6.3), librsvg2-common, python-cairo, python-configobj, python-excelerator, python-gobject, python-gtk2, python-matplotlib-doc, python-nose, python-qt4, python-scipy, python-sip, python-tornado, python-traits (>= 2.0), python-wxgtk2.8, texlive-extra-utils, texlive-latex-extra, ttf-staypuft
Filename: pool/universe/m/matplotlib/python-matplotlib_1.3.1-1ubuntu5_amd64.deb
Size: 1421320
MD5sum: 6a712780a745b4c7cda5a07f59874d58
SHA1: b6d423f66729ffb8721af1f323c9afc38ae7f655
SHA256: 9e8aa35315dce32a4c1979fdd8b4dbbdac360ca653ef5fe23a14df51146561e3
Description-en: Python based plotting system in a style similar to Matlab
 Matplotlib is a pure Python plotting library designed to bring
 publication quality plotting to Python with a syntax familiar to
 Matlab users. All of the plotting commands in the pylab interface can
 be accessed either via a functional interface familiar to Matlab
 users or an object oriented interface familiar to Python users.
Description-md5: 2fece2cb7cd156344f82cc6d7070bac0
Enhances: ipython
Homepage: http://matplotlib.org/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 3y
Task: ubuntustudio-video

デバックシンボルの導入

sudo apt-get install libboost-dbg libc6-dbg \
libcairo2-dbg libdc1394-22-dbg libdrm-nouveau2-dbg \
libdrm2-dbg libegl1-mesa-drivers-dbg libfltk1.3-dbg \
libfontconfig1-dbg libfreeimage3-dbg libgcc1-dbg \
libgdk-pixbuf2.0-0-dbg libgfortran3-dbg \
libgl1-mesa-dri-dbg libgl1-mesa-glx-dbg libgl2ps0-dbg \
libglib2.0-0-dbg libgtk2.0-0-dbg libgts-dbg \
libice6-dbg libicu52-dbg libjpeg-turbo8-dbg \
libjpeg8-dbg libpango1.0-0-dbg libpcre3-dbg \
libpixman-1-0-dbg libqt4-dbg libqt4-webkit-dbg \
libqtwebkit4-dbg libraw1394-11-dbg libsm6-dbg \
libstdc++6-4.8-dbg libtcl8.6-dbg libwayland-egl1-mesa-dbg \
libx11-xcb1-dbg libxau6-dbg libxcb-dri2-0-dbg \
libxcb-dri3-0-dbg libxcb-glx0-dbg libxcb-present0-dbg \
libxcb-randr0-dbg libxcb-render0-dbg libxcb-shape0-dbg \
libxcb-sync1-dbg libxcb-xfixes0-dbg libxcb1-dbg \
libxcomposite1-dbg libxcursor1-dbg libxdamage1-dbg \
libxdmcp6-dbg libxext6-dbg libxfixes3-dbg libxft2-dbg \
libxi6-dbg libxinerama1-dbg libxmu6-dbg libxpm4-dbg \
libxrandr2-dbg libxrender1-dbg libxss1-dbg libxt6-dbg \
libxxf86vm1-dbg python-dbg python-qt4-dbg python-tk-dbg \
xserver-xorg-core-dbg zlib1g-dbg

ビルド作業ディレクトリで実行する cmake のコマンドライン(QTのIDEプロジェクトを生成する場合の例)。

cmake -DCMAKE_BUILD_TYPE=Debug -G'KDevelop3 - Unix Makefiles' \
-DCOIN3D_DOC_PATH=/usr/share/doc/libcoin80-doc \
-DFREECAD_USE_EXTERNAL_PIVY=true ../FreeCAD_sf_master/

このとき、FreeCADのソースツリーにあるPivyコードを弄りたくない場合は、 FREECAD_USE_EXTERNAL_PIVY=true で、Pivyコードのビルドをさせないようにする。

FREECAD_USE_EXTERNAL_PIVY=true の問題点

FREECAD_USE_EXTERNAL_PIVY=true で、システムにインストールされたPython-pivy を参照するように指定してみたところ、なぜかドラフト・ワークベンチが起動しない。

Error: Pivy not found, Draft workbench will be disabled.

というエラーメッセージがターミナルにあった。そこでFreeCADのPythonコンソールを開いて、

import pivy

ステートメントを打ち込んでみると、トレースバックが帰ってきた。

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/username/src/freecad/Build-Freecad/bin/pivy/__init__.py", line 28, in <module>
    from coin import SoDB, SoNodeKit, SoInteraction
  File "/home/username/src/freecad/Build-Freecad/bin/pivy/coin.py", line 14, in <module>
    import _coin
ImportError: No module named _coin

といった具合に、内部コードのPATHを検索しているので、若干の修正が必要であるが、システムにインストールされているpythonインタープリタにて同様のエラーが再現される場合はシステムの環境設定に問題がある。
解決方法が見つかるまでの回避策として、FreeCADの起動オプションでモジュールのパスを指定する方法がある。

./FreeCAD -M /usr/lib/python2.7/dist-packages/

libcoin80-devを用いたときに内部Pivyコードで検討すること

libcoin60 にあった Inventor/scxml/ScXMLInvoke.h*1 が、libcoin80には存在しない。
もっともメソッド名が似ているヘッダファイルは Inventor/scxml/ScXMLInvokeElt.h*2 である。
そのほか、Inventor/elements/SoGLTexture3EnabledElement.h*3 が、廃止予定にあがっているとプリプロセッサが指摘してくる。
代わりにInventor/elements/SoMultiTextureEnabledElement.h*4をつかうようだ。

diff --git a/src/3rdParty/Pivy-0.5/coin_header_includes.h b/src/3rdParty/Pivy-0.
index af048fd..9cb9ed0 100644
--- a/src/3rdParty/Pivy-0.5/coin_header_includes.h
+++ b/src/3rdParty/Pivy-0.5/coin_header_includes.h
@@ -142,7 +142,14 @@
 #include <Inventor/elements/SoGLProjectionMatrixElement.h>
 #include <Inventor/elements/SoGLRenderPassElement.h>
 #include <Inventor/elements/SoGLShapeHintsElement.h>
-#include <Inventor/elements/SoGLTexture3EnabledElement.h>
+
+#if COIN_MAJOR_VERSION < 4 // For Deprecated
+ #include <Inventor/elements/SoGLTexture3EnabledElement.h>
+#else // use instead
+ #include <Inventor/elements/SoMultiTextureEnabledElement.h>
+ #include <Inventor/elements/SoLazyElement.h>
+#endif
+
 #include <Inventor/elements/SoGLTextureCoordinateElement.h>
 #include <Inventor/elements/SoGLTextureEnabledElement.h>
 #include <Inventor/elements/SoGLTextureImageElement.h>
@@ -665,10 +672,15 @@
 #include <Inventor/SoRenderManager.h>
 #include <Inventor/scxml/ScXMLEvent.h>
 #include <Inventor/scxml/ScXML.h>
-#include <Inventor/scxml/ScXMLInvoke.h>
+ #if COIN_MAJOR_VERSION > 3 // instead
+  #include <Inventor/scxml/ScXMLInvokeElt.h>
+ #else // obsolete
+  #include <Inventor/scxml/ScXMLInvoke.h>
+ #endif
 #include <Inventor/scxml/ScXMLObject.h>
 #include <Inventor/scxml/ScXMLStateMachine.h>
 #include <Inventor/scxml/ScXMLSubObject.h>
 #include <Inventor/scxml/SoScXMLEvent.h>
 #include <Inventor/scxml/SoScXMLStateMachine.h>
 #endif
+

ビルドエラーが出るファイル /FreeCAD_sf_master/src/3rdParty/Pivy-0.5/coin_wrap.cpp には

/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.36
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG 
 * interface file instead. 
 * ----------------------------------------------------------------------------- */

とあるので、生成方法を学習するまでは手出しできない。

ちなみに自動生成ファイルを検索してみると

 grep automatically\ generated -r ../FreeCAD_sf_master/src/3rdParty/Pivy/
../FreeCAD_sf_master/src/3rdParty/Pivy/soqt_wrap.cpp: * This file was automatically generated by SWIG (http://www.swig.org).
../FreeCAD_sf_master/src/3rdParty/Pivy/coin.py:# This file was automatically generated by SWIG (http://www.swig.org).
../FreeCAD_sf_master/src/3rdParty/Pivy/gui/soqt.py:# This file was automatically generated by SWIG (http://www.swig.org).
../FreeCAD_sf_master/src/3rdParty/Pivy/coin_wrap.cpp: * This file was automatically generated by SWIG (http://www.swig.org).

がヒットした。

脚注

GNU Shogi 1.4.1 で遊んでみた。

GNU Shogi 1.4.1 で遊んでみた。

矢倉囲いを組んで玉の安泰を築きあげ、棒銀にする初歩的な戦法で進めた。
飛車の前に居た自陣の歩を捌くことが出来ると、飛車が2筋から4筋まで縦横に機動的な動きをするようになる。

これで効率よく銀を援護できる環境が整い、陣形優勢のまま推し進める展開となったのがGNU Shogiに勝てた勝因だ。

終局面

# xshogi position file -- Sat Feb  1 02:16:27 2014
# gnushogi@localhost vs. maimi09@my-machiene
 . n . . . . . k l
 l . s . . . . p .
 . . . . .+R N+P .
 p p p+B . . . . p
 . . . P . . . . .
 . . P . p . . . P
 P P S G . . . . .
 . K G B . . . . .
 L N . . . . . N L
5 0 0 2 2 0 1 0
1 0 0 0 0 0 0 0
white to play

棋譜

# xshogi game file -- Sat Feb  1 02:15:54 2014
# gnushogi@localhost vs. maimi09@my-machiene

1. 7g7f 1c1d 2. 4i5h 5a6b 3. 3i4h 3c3d 4. 6g6f 8c8d 5. 7i6h 6a5b 
6. 2g2f 2b3c 7. 2f2e 3a2b 8. 3g3f 4a3b 9. 4h3g 9a9b 10. 6h7g 6b5a 
11. 6i7h 3c4b 12. 5g5f 2b3c 13. 5i6i 7a6b 14. 8h7i 5a4a 15. 3f3e 3c4d 
16. 3g2f 4d4e 17. 4g4f 4e5d 18. 7i6h 3d3e 19. 2f3e 2c2d 20. 2e2d P*2b 
21. 6i7i 6b5a 22. 1g1f 6c6d 23. 7i8h 5d6c 24. 5h6g 5c5d 25. 2h4h 9c9d 
26. 4f4e 7c7d 27. 4e4d 4c4d 28. 3e4d 5d5e 29. P*3c 2a3c 30. P*3d P*4g 
31. 4h3h 4g4h+ 32. 3h4h P*4g 33. 4h3h 4g4h+ 34. 3h4h 5e5f 35. 3d3c+ 3b3a 
36. P*4c 4b5c 37. 4d5c+ 5b5c 38. B*7a S*6i 39. 7h7i 5c5b 40. 7a8b+ P*4g 
41. 4h4g 5b4b 42. 4c4b+ 3a4b 43. 3c4b 5a4b 44. P*4c P*4f 45. 4g4f P*4e 
46. 4f4e 4a3a 47. 2d2c+ 6i7h+ 48. 7i7h 4b4c 49. 4e4c+ 6d6e 50. 6f6e 6c7b 
51. 8b6d 3a2a 52. N*3c Black wins 

X58A-UD3Rで、HDMIに音声出力が出来ない

GIGABYTE X58A-UD3R (Rev. 2.0)*1Edubuntu をインストールしてみたのだが、なぜかHDMIに音声出力が出来ない。
それもEdubuntu 12.04.2 64ビット版 DVD-Rで起動した時にはHDMIから音声出力が出来るのに、HDDにインストールしてHDDから起動すると音が出ないのである。

まずはHDDから起動した時のハードウェア情報をゲットしてみた。

$ LC_ALL=C sudo lshw -class multimedia
  *-multimedia            
       description: Audio device
       product: High Definition Audio Controller
       vendor: NVIDIA Corporation
       physical id: 0.1
       bus info: pci@0000:03:00.1
       version: a1
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: driver=snd_hda_intel latency=0
       resources: irq:17 memory:faffc000-faffffff
  *-multimedia
       description: Audio device
       product: 82801JI (ICH10 Family) HD Audio Controller
       vendor: Intel Corporation
       physical id: 1b
       bus info: pci@0000:00:1b.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: driver=snd_hda_intel latency=0
       resources: irq:54 memory:fbff8000-fbffbfff

ALSAバイス

$ LC_ALL=C aplay -l
 **** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC889 Analog [ALC889 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC889 Digital [ALC889 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

ALSAエイリアス

$ LC_ALL=C aplay -L
default
    Playback/recording through the PulseAudio sound server
sysdefault:CARD=Intel
    HDA Intel, ALC889 Analog
    Default Audio Device
front:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    Front speakers
surround40:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Intel,DEV=0
    HDA Intel, ALC889 Digital
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    Direct sample mixing device
dmix:CARD=Intel,DEV=1
    HDA Intel, ALC889 Digital
    Direct sample mixing device
dsnoop:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    Direct sample snooping device
dsnoop:CARD=Intel,DEV=1
    HDA Intel, ALC889 Digital
    Direct sample snooping device
hw:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    Direct hardware device without any conversions
hw:CARD=Intel,DEV=1
    HDA Intel, ALC889 Digital
    Direct hardware device without any conversions
plughw:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    Hardware device with all software conversions
plughw:CARD=Intel,DEV=1
    HDA Intel, ALC889 Digital
    Hardware device with all software conversions
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    HDMI Audio Output
dmix:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 0
    Direct sample mixing device
dsnoop:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 0
    Direct sample snooping device
hw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
plughw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 0
    Hardware device with all software conversions

DVDから起動したとき

edubuntu@edubuntu:~$ LC_ALL=C sudo lshw -class multimedia
  *-multimedia            
       description: Audio device
       product: High Definition Audio Controller
       vendor: NVIDIA Corporation
       physical id: 0.1
       bus info: pci@0000:03:00.1
       version: a1
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: driver=snd_hda_intel latency=0
       resources: irq:17 memory:faffc000-faffffff
  *-multimedia
       description: Audio device
       product: 82801JI (ICH10 Family) HD Audio Controller
       vendor: Intel Corporation
       physical id: 1b
       bus info: pci@0000:00:1b.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: driver=snd_hda_intel latency=0
       resources: irq:54 memory:fbff8000-fbffbfff
$ LC_ALL=C aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC889 Analog [ALC889 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC889 Digital [ALC889 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
$ LC_ALL=C aplay -L
default
    Playback/recording through the PulseAudio sound server
sysdefault:CARD=Intel
    HDA Intel, ALC889 Analog
    Default Audio Device
front:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    Front speakers
surround40:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Intel,DEV=0
    HDA Intel, ALC889 Digital
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    Direct sample mixing device
dmix:CARD=Intel,DEV=1
    HDA Intel, ALC889 Digital
    Direct sample mixing device
dsnoop:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    Direct sample snooping device
dsnoop:CARD=Intel,DEV=1
    HDA Intel, ALC889 Digital
    Direct sample snooping device
hw:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    Direct hardware device without any conversions
hw:CARD=Intel,DEV=1
    HDA Intel, ALC889 Digital
    Direct hardware device without any conversions
plughw:CARD=Intel,DEV=0
    HDA Intel, ALC889 Analog
    Hardware device with all software conversions
plughw:CARD=Intel,DEV=1
    HDA Intel, ALC889 Digital
    Hardware device with all software conversions
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    HDMI Audio Output
dmix:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Direct sample mixing device
dmix:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 0
    Direct sample mixing device
dsnoop:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Direct sample snooping device
dsnoop:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 0
    Direct sample snooping device
hw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
hw:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 0
    Direct hardware device without any conversions
plughw:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=7
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=8
    HDA NVidia, HDMI 0
    Hardware device with all software conversions
plughw:CARD=NVidia,DEV=9
    HDA NVidia, HDMI 0
    Hardware device with all software conversions

あまり違いがないような気がするのだけど・・・
なぜかHDDから起動したときに、サウンド設定をみるとS/PDIFが認識されていないようで、HDMIとアナログの2つしか選択しがない。


さて、どうしようかなぁ・・・


*1:GIGABYTEマザーボードにおけるリビジョンの確認は、基板四隅のうちPCI拡張スロット側の角に印字がある。情報源:「ユーザーズマニュアル」改版1002、12MJ-X58AU3R-1002R より。

スケッチャーにおいて、無効なデータムを指定するととても遅くなる。

ファイルSketchObjectPylmp.cppのファクションsetDatum()において、そのエラー判定は遅いようだ。
そしてオブジェクト数が増えるほどに、その処理はさらに重くなる。

問題が起きた環境。

私は、System X3105で走るEdubuntu 12.04.2環境上にて、git colen コマンドで取得したFreeCAD 0.13をビルドした。

問題の確認方法。

スケッチャー上で多角形を描いてから、全ての辺においてデータムを拘束する。
単辺を選択する。それが無効な値となるために、選択された単辺のデータムが「選択されていない辺を合計した長さよりも大きい値」となるように変更する。

問題の挙動。

エラーダイアログが表示されるまでの時間が長い。故に、ユーザは固まったように遅くなったウインドウとの対話を強いられる。
オブジェクトのデータムが増えるほどに深刻な問題となるであろう。

望ましい挙動。

無効な値が含まれているデータムの発見からエラーメッセージの提示までの処理時間が短く対話的であることが望ましい。

In Engrish

It will be very slowlly in Sketcher, if you specify an invalid datum.

Faction of setDatum() in file SketchObjectPylmp.cpp, the error determination that is slowlly.
To increase as the number of objects, the process will be heavier and more.

PyObject* SketchObjectPy::setDatum(PyObject *args)
{
    double Datum;
    int    Index;
    if (!PyArg_ParseTuple(args, "id", &Index, &Datum))
        return 0;

    int err=this->getSketchObjectPtr()->setDatum(Index, Datum);
    if (err) {
        std::stringstream str;
        if (err == -1)
            str << "Invalid constraint index: " << Index;
        else if (err == -3)
            str << "Cannot set the datum because the sketch contains conflicting constraints";
        else if (err == -2)
            str << "Datum " << Datum << " for the constraint with index " << Index << " is invalid";
        else if (err == -4)
            str << "Negative datum values are not valid for the constraint with index " << Index;
        else if (err == -5)
            str << "Zero is not a valid datum for the constraint with index " << Index;
        else
            str << "Unexpected problem at setting datum " << Datum << " for the constraint with index " << Index;
        PyErr_SetString(PyExc_ValueError, str.str().c_str());
        return 0;
    }

    Py_Return;
}

The environment in which the problem occurred.

On the environment in Edubuntu 12.04.2 running on IBM System X3105, I have to build FreeCAD 0.13 obtained by the command git colen. (see also in Japanese doc at http://d.hatena.ne.jp/maimi09/20130211 ).

OS: Ubuntu 12.04.2 LTS
Platform: 64-bit
Version: 0.13.1904 (Git)
Branch: master
Hash: 89fae529ffcf9810e30e562e51ef79bcc69ac332
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.1

How to check the problem.

From drawing a polygon on the Sketcher, constraining the datum in all edges.
Select a single edge. Changed to be "value greater than the total length of edges that are not selected" for it is an invalid value, a single datum of the selected edge.

Behavior of the problem.

Time taken to display an error dialog is long. Thus, the user is forced to interact with the window that was slowlly as frozen.
Will become a serious problem as the datum of the object increases.

Desirable behavior.

It is desirable that the processing time up to the presentation of an interactive error message is short from the discovery of datum that contains an invalid value.

THANKS for Your rearding.

Comodo Antivirus for Linux

Comodo Antivirus for Linux(Free Linux Antivirus, Antivirus Protection for Linux, Free Virus Protection)をダウンロードしてインストールしてみた。

選定のポイントは、64ビット版に対応していることである。また以下ディストリビジョンのバージョンに対応している。

Ubuntu対応が謳われており、Debパッケージで提供してあるのでdpkgコマンドでインストールを行ったバージョンの管理もできて、ある意味ではお気楽極楽なのである。

ハードウェアの必要条件は
CPU: 2 GHz
RAM: 2 GB
Disk: 40 GB
ということで、うちのSystem x3105でもなんとかクリアできそうだ。

Comodo Antivirusの常駐物は、省エネモードで10から15パーセント程度の負荷を水位しているようだ。

また、Comodo Antivirusでは、カーネルドライバーをインストールするようなので、Linuxカーネルをアップデートしたときは設定の見直しが必要となるかもしれない。

FreeCAD 0.13 のビルド

Ubuntu Linux系におけるFreeCAD 0.13系 のビルドに関するノート。
今回は、Ubuntu系であるEdubuntuの64ビット版にて、ビルドを行ってみた。

OSのバージョン選択

Ubuntu系でdebパッケージを作る場合は、debユーティリティの依存関係から(11.xx以下では、バージョンの陳腐化によって未対応となるので)12.04.1以降のシステムが望ましい。

またlibboostのバージョンは、1.48系を推奨とする。Ubuntu 12.10系においてlibboostのバージョンは、1.49系に移行している。

14.04α系において、libboostのバージョンは1.48系(リリース版は1.54系)となっている。しかし、libcoin60-devのパッケージがリポジトリから外されて代わりにlibcoin80-devが採用された。coinのバージョン番号が異なるだけではなくインクルードファイルのファイル名やヘッダファイル内の記述等々に仕様変更があったようで、src/3rdParty/Pivy-0.5/ 周りでビルドエラーがでる。つまりバイナリのオブジェクトを拝するにはコードに手を入れる必要がある。
あるいは、FreeCAD内部Pivyコードのビルドを諦めて、cmakeでコンパイルオプションを変えてバイパスさせてしまうしかない*1

cmake -DFREECAD_USE_EXTERNAL_PIVY=true

ということで、当面はUbuntu 12.04.x系のOSを選択する方が無難であろう。

依存パッケージのバージョン

その他にも確認すべきパッケージのバージョンを以下に示す。*2

パッケージ バージョン 公式サイト
Python >= 2.5.x http://www.python.org/
OpenCasCade >= 5.2 http://www.opencascade.org/
Qt >= 4.4.x*3 http://www.qtsoftware.com/
Coin3D >= 2.x < 3.0 http://www.coin3d.org/
ODE >= 0.10.x http://www.ode.org/
SoQt >= 1.2 http://www.coin3d.org/
Xerces-C++ >= 2.7.x < 3.0 http://xml.apache.org/xerces-c/
GTS(GNU Triangulated Surface Library) >= 0.7.x http://gts.sourceforge.net/
Zlib >= 1.x.x http://www.zlib.net/
Boost >= 1.33.x http://www.boost.org/
Eigen >= 3.0.1 http://eigen.tuxfamily.org/index.php?title=Main_Page

依存関係

ドキュメント*4でインストールが必要とされているパッケージ

build-essential
cmake
python
libtool
libcoin60-dev
libsoqt4-dev
libxerces-c-dev
libboost-dev
libboost-filesystem-dev
libboost-regex-dev
libboost-program-options-dev 
libboost-signals-dev
libboost-thread-dev
libqt4-dev
libqt4-opengl-dev
qt4-dev-tools
python-dev
gfortran
libeigen3-dev
libqtwebkit-dev
libode-dev
swig
libzipios++-dev

opencascadeは、正規版とコミュニティ版のいずれかをインストールする。 
なおUbuntu系メイン・リポジトリではコミュニティ版OCEを採用している。

コミュニティ版
liboce*-dev oce-draw
正規版
libopencascade-dev opencascade-draw

正規版を使う場合は、Cmakeの実行時にコミュニティ版が見つからないとケチつけるワーニングが出るが、無視してよい。

CMake Warning at CMakeLists.txt:218 (find_package):
  Could not find module FindOCE.cmake or a configuration file for package
  OCE.

  Adjust CMAKE_MODULE_PATH to find FindOCE.cmake or set OCE_DIR to the
  directory containing a CMake configuration file for OCE.  The file will
  have one of the following names:

    OCEConfig.cmake
    oce-config.cmake

Debパッケージ生成で求められる依存関係(Build-Depends)

debhelper (>= 7.0.50~), autotools-dev, libtool, automake, 
 autoconf, libboost-dev, libboost-date-time-dev, libboost-filesystem-dev,
 libboost-graph-dev, libboost-iostreams-dev, libboost-program-options-dev,
 libboost-regex-dev, libboost-serialization-dev, libboost-signals-dev,
 libboost-python-dev, python-dev, python-support,
 libqt4-dev, libxt-dev, libxext-dev, libxmu-dev, libxi-dev, libx11-dev,
 libcoin60-dev, libsoqt4-dev (>= 1.4.2~svn20090224), libeigen3-dev, libgl1-mesa-dev,
 zlib1g-dev, libxerces-c2-dev, libopencascade-foundation-dev, libopencascade-modeling-dev, 
 libopencascade-visualization-dev, python-cxx-dev, libswscale-dev, 
 libzipios++-dev, swig, gfortran, libqtwebkit-dev

FreeCAD 0.13のビルドでは、libboostのバージョン1.4.8以降を要求する。Ubuntu 12.04.x系では何故かlibboostのバージョン1.4.6となているので、自明適にバージョンを指定する必要がある。

そのほか、推奨されるパッケージ

Teigha File Converter
DWG形式のファイルをサポートするのに必要なファイルコンバータ。*5
pycollada
交換用ファイルフォーマットCOLLADA*6Pythonバインディング*7
python-matplotlib
Python based plotting system in a style similar to Matlab*8
libode-dev
Open Dynamics Engine*9 いわゆる物理計算エンジン。
pyOpenCL
PyOpenCL lets you access the OpenCL parallel computation API from Python.*10
nvidia-current
NVIDIA binary Xorg driver, kernel module and VDPAU library.*11
doxygen
Documentation system for C, C++, Java, Python and other languages
doxygen-doc
Documentation for doxygen*12
graphviz
豊富なグラフ描画ツールセット*13
PovRay
レイトレーシングエンジン*14。CGで見た目を確認するために必要なのだが、Ubuntuリポジトリでパッケージ提供のあるのはhardy、lucid、oneiricの3バージョンのみのようだ*15Ubuntu 12.xx.x系にインストールするには、本家サイトよりソースパッケージを取得してビルドする必要がある。
libspnav-dev
Library to access 3D-input-devices*16. FreeCADでは、3Dマウスでの入力を扱うことができる。 (for 3Dconnexion devices support like the Space Navigator or Space Pilot)
libsimage-dev
to make Coin to support additional image file formats.
python-pivy
needed for the 2D Drafting module.
python-qt4
needed for the 2D Drafting module.
checkinstall
to register your installed files into your system's package manager, so yo can easily uninstall later. 自前ビルドやtarbalパッケージのインストール管理ができるようにする代物のようだ。
libgts-dev
GNU Triangulated Surface Library(GTS)*17は、ポリゴン・メッシュの3D表面を扱う関数群を提供するライブラリ。

Ubuntu 12.04.x系での依存関係

つまりUbuntu 12.04.x系では、

sudo apt-get install autoconf automake autotools-dev \
build-essential cmake debhelper doxygen doxygen-doc \
gfortran graphviz libsimage-dev python-pivy \
libboost-date-time1.48-dev libboost-filesystem1.48-dev \
libboost-graph1.48-dev libboost-iostreams1.48-dev \
libboost-program-options1.48-dev libboost-regex1.48-dev \
libboost-serialization1.48-dev libboost-signals1.48-dev \
libboost-thread1.48-dev libboost1.48-dev python-qt4 \
libcoin60-dev libcoin60-doc libeigen3-dev libgl1-mesa-dev \
libode-dev liboce-foundation-dev liboce-modeling-dev \
liboce-visualization-dev oce-draw libqt4-dev \
libqt4-opengl-dev libqtwebkit-dev libsoqt4-dev libspnav-dev \
libswscale-dev libtool libxerces-c2-dev libgts-dev \
libzipios++-dev python python-cxx-dev python-dev python-qt4-dev \
python-matplotlib qt4-dev-tools swig zlib1g-dev \
python-qt4 python-tk

とかして、依存関係の解決を試みる。*18

ライブラリのデバック・シンボル

GDBを用いたデバックをする場合には、ライブラリのデバック・シンボルもインストールする必要がある。

sudo apt-get install libgfortran3-dbg libboost1.48-dbg \
libgl1-mesa-glx-dbg \libgl1-mesa-dri-dbg libqt4-dbg \
libqt4-webkit-dbg libgts-dbg zlib1g-dbg python-dbg \
python-qt4-dbg python-tk-dbg libgcc1-dbg libc6-dbg \
libstdc++6-4.6-dbg xserver-xorg-core-dbg

ソースコードの入手

https://github.com/FreeCAD/FreeCAD_sf_master から、Gitすると、PPAで配布しているラインと同等のリビジョン番号。ほぼ日刊アップデートの最新バージョン。ビルドしたバイナリで、リポジトリに上がっている日本語の翻訳も表示されるようだ。

git clone git://github.com/FreeCAD/FreeCAD_sf_master FreeCAD_sf_master

ほかに以下sourceforgeの本家リポジトリもあるが、内容はgithubと同期をとっているようだ。

git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad

コンフィギュレーション

作業ディレクトリを作って、作業ディレクトリに入る。

mkdir Build-Freecad
cd Build-Freecad

ここでCmake*19を実行してMakefileなどビルドの依存関係を生成する。
Cmakeにオプション -G を付加するとIDEのプロジェクトファイルも生成してくれる。たとえば 'CodeBlocks - Unix Makefiles' を指定するとCode::Blocks*20が利用できるようになり、コードのブラウズが容易になる。*21

Code::Blocksのインストールは

sudo apt-get codeblocks

とすればよい。

デバックシンボル付きでビルドする場合はCMakeのオプションに '-DCMAKE_BUILD_TYPE=Debug' を指定すればよい。gitの本流をビルドするからにはアプリケーションが落ちる場所を特定したり、新しいコードを追加したい気持ちがあるだろうからシンボルを生成してもらった方が都合よい。

cmake -DCMAKE_BUILD_TYPE=Debug -G'CodeBlocks - Unix Makefiles' ../${srcdir}

ビルド

いつものようにmakeを実行する。このとき-jオプションを付加すると、Makeが起動するジョブの数を指定できる。また-lオプションを指定すると、プロセッサの負荷が高い時に起動を抑制してくれる。たとえば0.9のように小数点で指定するとプロセッサの負荷が90%以上であるときには新たなジョブを立てないで負荷が下がるまで保留するように指定できるので、バッググラウンドプロセスでビルドするときは便利だ。

make -j 4 -l 0.9 all

あるいはcode::blocks上からビルド作業したい場合は

codeblocks FreeCAD_trunk.cbp

のようにして、code::blocksを起動させてからメニューやツールバーアイコンからビルドを実行させればよい。

ビルドエラー

64ビット版Linux上でビルドしていると、Meshモジュール周りのリンクでリンクエラーが発生する。ビルドエラーの要因は、Cmakeが生成するビルドルールのパスに32ビットライブラリのパスが含まれてしまっているからだ。余談になるが、もし32ビット/64ビット混在のビルド環境で64ビットオブジェクトを作ろうとすると32ビットライブラリをリンクしようとするかもしれない。

さて問題の修正であるが、Cmakeの経験が浅いので、本流を正攻法に直すことを考えることは割愛して、問題となるパス指定を上書きしてしまうスクリプトをビルドディレクトリで実行することにしよう。

grep i386-linux-gnu -r . -l |sed -e "s/^/sed -e 's\/i386-linux-gnu\/x86_64-linux-gnu\/g' -i /g" |dash

テスト

作業ディレクトリのbinにcdする。freecadにテスト用オプションを付加して実行すると、テストスクリプトが実行される。

cd bin
./FreeCAD -t0

このテストで100%合格となるには、プリンターが利用できる必要がある。

アプリの翻訳(ローカライズ

(日本語版のドキュメントは陳腐化してるので、)ローカライズのドキュメント英語版*22を参考にして作業をおこなう。

翻訳ファイルの更新

翻訳したいモジュールのディレクトリにcdして、以下のように翻訳ファイルあるパスを相対パスで指定すると、アプリのテキストと翻訳ファイルを同期させることができる。シェルのtab補完を利用すると便利。

pylupdate4 *.py -ts Giu/Resource/translate/HogeHoge-no-Module_fr.ts 

でも、上述のpylupdate4を実行すると、ほとんどの項目にobsoleteがついてlinguistでの翻訳作業ができなくなる。

旧式の方法
モジュールのGiuディレクトリにcdしてから

qmake -project

とかして、qtプロジェクトファイルを作っておく。

先ほどのqtプロジェクトファイルのあるディレクトリにcdして,

lupdate -ts Giu/Resource/translate/HogeHoge-no-Module_fr.ts

とかすると、ソースコードのテキストが翻訳ファイルに反映される。

翻訳作業

翻訳ファイルはXMLで記述されてあるので、テキストエディタよりもQT-linguist*23のような専用ユーティリティを利用する方がよい。

デスクトップ上のNautilus*24から翻訳ファイルを選択して右クリックのメニューからQT-linguistを起動すれば、作業したいファイルを読み込まれ編集できるようになる。またコマンドラインから同様の作業を行うならば、ターミナルのshellから、ソースツリーのパスに移動して、linguistに翻訳ファイルのパスをshellのタブ補完を駆使するなどして長々と指定して起動する。

QT-linguistには、フレーズファイルを作っておいてフレーズファイルから近い文章を選ぶ機能がある。ということでフレーズファイルをホームディレクトリに作成しておきCtrl+Tを押して翻訳結果を地道に登録してゆく方法もとれる。

翻訳作業が終わったら保存をして、さらにファイルメニューのリリースを選択するとビルドに用いられる翻訳ファイルが生成される。*25

git の差分ファイルを作る

Patchコマンドで使えるパッチは以下のようにする*26。ここで -- の後ろにファイル名を指定すると、指定されたファイルだけの差分を表示することができる。

git diff --no-prefix  -- *ja.ts >../FreeCAD$(date +%Y%m%d-%H%M%S%z).patch

3Dマウスの例

3Dマウスは、3次元空間にある物体の座標変換を指定するための入力デバイスである。FreeCADの設定ダイアログには、SpaceBallの文字列がみうけられるが、既にSpaceBallは旧世代の製品となって入手できない。後続製品には以下のようなものがあるが、動作の情報について当方は未確認である。
なお、FreeCADのWebドキュメント*27によれば 3Dconnexion の SpaceNavigator*28が利用できると記載されている。

3Dconnexion 3Dマウス SpaceNavigator SE (Standard Edition) SNSE

3Dconnexion 3Dマウス SpaceNavigator SE (Standard Edition) SNSE

3Dconnexion SpaceMouse Pro SMP

3Dconnexion SpaceMouse Pro SMP

3Dconnexion 3Dマウス SpaceExplorer USB SEU

3Dconnexion 3Dマウス SpaceExplorer USB SEU

ちなみに3Dconnexion SpaceNavigatorは、自由度6度の入力デバイスでUSBのあるPCに接続可能である。対応OSは

とされている。

脚注

*1:Problem compiling from source on Linux Mint (petra)

*2:FreeCADのオンラインマニュアルより

*3:オンラインマニュアルには4.1.xとあるが、ダイアログメッセージには4.4以降が必要という文面を見つけた。

*4:http://www.freecadweb.org/wiki/index.php?title=CompileOnUnix

*5:http://www.opendesign.com/guestfiles/TeighaFileConverter/

*6:http://www.collada.org/

*7:https://github.com/pycollada

*8:http://matplotlib.org/

*9:http://www.ode.org/

*10:http://mathema.tician.de/software/pyopencl

*11:pyOpenCLが依存を要求

*12:http://www.doxygen.jp/

*13:http://www.graphviz.org/

*14:http://www.povray.org/

*15:http://packages.ubuntu.com/search?keywords=povray

*16:http://spacenav.sourceforge.net/

*17:http://gts.sourceforge.net/

*18:この例では、Ubuntu 12.04.x系のリポジトリにpycolladaがないので含めていない。PyOpenCL、nvidia-currentは、実機にnVideaのグラフィックスを持っていないの含めていない。

*19:http://www.cmake.org/

*20:http://www.codeblocks.org/

*21:オプション -GKDevelop3 をつけるとKDEIDEが使えるらしいが、IDEからのビルドなどの使い方がよくわからなかった。なぜだかシャドービルドで依存関係が満たされない様子で途中でエラーとなる。

*22:http://www.freecadweb.org/wiki/index.php?title=Localisation

*23:http://qt-project.org/doc/qt-4.8/linguist-translators.html

*24:http://live.gnome.org/Nautilus

*25:lrelease コマンドでも同様のリリース作業が可能である。

*26:http://transitive.info/article/git/command/diff/

*27:http://www.freecadweb.org/wiki/index.php?title=3D_input_devices

*28:3Dconnexion SpaceNavigator 製品情報