Liquid(コンパイル編): Part 1

Liquid のコンパイルに挑戦しました。ひとまずは動きます。初めてのことばかりで悪戦苦闘したけど、収穫多し!

結論

確認させてください

以下の事にご理解いただける方のみ、この先は読み進めてもらいたいと思います。もしも仮に「パソコンがぶっ壊れた!」とかなってしまったら、それはとても悲しいことですから。
  • 学生が行ったことですので完璧な結果ではなく、不具合があるかもしれません。
  • この一連の作業によって生じるトラブル等には責任を持てません。

環境を整える

以下の環境でコンパイルを行いました。 (レンダラーには Installer とつけました。これは setup.exe を使ったという意味です)
  • Microsoft Windows XP Professional SP2 (32bit)
  • Microsoft Visual Studio 2005 Professional Edition SP1
  • Microsoft Windows Server 2003 SP1 Platform SDK
  • Pixie RenderMan Renderer v2.2.5 (Installer)
  • Aqsis version 1.4.2 (Installer)
  • 3delight 8.0.1 (Installer) 試用版
  • Autodesk Maya 8.5

Liquidのソースを入手

SourceForge.net から Liquid のソースを入手します。今回、僕がダウンロードしたファイルは Liquid_2.3.3_src.zip です。保存先はお任せします。(本当はSVNで入手したかったのですが、ログインパスワードを求められた際に何を入力すればいいのかがわからなかったので以下のリンク先から入手しました。

ディレクトリ構造のチェック

ファイルを解凍したら、ディレクトリ構造のチェックをします。でも、この行動は個人的に状況を把握するためにやっているだけですので、9割方の人はやる必要はないとは思います。(本当は tree /f と打ったものをブログに載せようと思ったのですが、テキスト量が多過ぎたので tree の結果を載せました。 そうするとこんな感じの結果がコマンドコロンプト内に表示されました。
D:.
├─bin
│  ├─win32lib
│  └─win64lib
├─devkit
│  └─examples
├─displayDrivers
│  ├─3Delight
│  │  ├─win32
│  │  └─win64
│  ├─air
│  │  └─win32
│  └─pixie
│      ├─win32
│      └─win64
├─doc
│  └─html
├─html
│  └─images
├─icons
├─include
│  └─boost
│      ├─algorithm
│      │  └─string
│      │      └─detail
│      ├─bind
│      ├─config
│      │  ├─abi
│      │  ├─compiler
│      │  ├─platform
│      │  └─stdlib
│      ├─detail
│      ├─function
│      │  └─detail
│      ├─iterator
│      │  └─detail
│      ├─mpl
│      │  ├─aux_
│      │  │  ├─config
│      │  │  ├─preprocessed
│      │  │  │  ├─bcc
│      │  │  │  ├─bcc551
│      │  │  │  ├─dmc
│      │  │  │  ├─gcc
│      │  │  │  ├─msvc60
│      │  │  │  ├─msvc70
│      │  │  │  ├─mwcw
│      │  │  │  ├─no_ctps
│      │  │  │  ├─no_ttp
│      │  │  │  └─plain
│      │  │  └─preprocessor
│      │  └─limits
│      ├─pending
│      ├─preprocessor
│      │  ├─arithmetic
│      │  ├─array
│      │  ├─config
│      │  ├─control
│      │  │  └─detail
│      │  │      ├─dmc
│      │  │      ├─edg
│      │  │      └─msvc
│      │  ├─debug
│      │  ├─detail
│      │  │  └─dmc
│      │  ├─facilities
│      │  ├─iteration
│      │  │  └─detail
│      │  │      ├─bounds
│      │  │      └─iter
│      │  ├─list
│      │  │  └─detail
│      │  │      ├─dmc
│      │  │      └─edg
│      │  ├─logical
│      │  ├─punctuation
│      │  ├─repetition
│      │  │  └─detail
│      │  │      ├─dmc
│      │  │      ├─edg
│      │  │      └─msvc
│      │  ├─seq
│      │  │  └─detail
│      │  ├─slot
│      │  │  └─detail
│      │  └─tuple
│      ├─range
│      │  └─detail
│      │      └─vc6
│      ├─type_traits
│      │  └─detail
│      └─utility
├─linux
├─mel
├─osx
├─renderers
├─ribLib
├─scripts
├─shaders
│  └─src
├─src
│  ├─liquidMaya.xcodeproj
│  ├─MSVC2005
│  │  ├─displayDriver3delight
│  │  ├─displayDriverAir
│  │  ├─displayDriverAqsis
│  │  ├─displayDriverPixie
│  │  ├─liquidBin
│  │  └─RILIB
│  └─MSVC6
│      ├─displayDriver3delight
│      ├─displayDriverAir
│      ├─displayDriverAqsis
│      ├─displayDriverPixie
│      └─RILIB
└─W32Installer
フォルダが沢山ありますね。初心者にはとてもきつい光景です・・・・・・。 そう、僕はプログラミングが全くできない、いわゆる初心者なのです(笑 さて、それはさておき、displayDrivers というディレクトリありますが、これってなんなのでしょうか。RIBファイルの中には、display という項目(?)で画面に表示するのか、ファイルに保存するのかを決めたり、チャンネル数(rgba)について設定できたりするみたいですけど、それに関係してくるのでしょうか。謎ですね・・・・・・。

とりあえず!

とりあえず、src/MSVC2005 へ移動します。 そして、tree /f でファイルの確認しました。 表示された内容は次の通りでした。
D:.
│  liquid.ncb
│  liquid.sln
│  liquid.vcproj
│  ReadMe.txt
│
├─displayDriver3delight
│      displayDriver3delight.vcproj
│
├─displayDriverAir
│      displayDriverAir.vcproj
│
├─displayDriverAqsis
│      displayDriverAqsis.vcproj
│
├─displayDriverPixie
│      displayDriverPixie.vcproj
│
├─liquidBin
│      liquidBin.vcproj
│
└─RILIB
        RILIB.vcproj
README.txt があったのでそれに目を通します。
Note for compiling with MSVC2005 1st note: Projects comes with a generic RIB library to avoid linking problem. 2nd note: if you want to compile the generic RIB library, you'll need to create an empty unistd.h in your MSVC standard include directory (due to the bison/flex file generator), and install zlib headers and libs. 3rd note: to load liquid on x64, zlibwapi.dll needs to be in one of the lib paths, the file is here: liquid\bin\win64lib
こういうことをやってると、英語がちょっとずつわかっていく・・・・・・、かもしれませんね。 僕は英語が全然読めないので、とても遠い未来の話に思えますけどね(笑

1st note 書いてあることわからない。リンクの問題がどうとか?

2nd note unistd.h を作って、include フォルダに入れてください? それと、zlibのヘッダーファイルとライブラリを入れてください?

3rd note 64bit版についての記述・・・、かな? 僕のWindowsは32bitなのでここは飛ばしました。 とりあえず、 src/MSVC2005/liquid.vcproj を開きました。 Liquid(コンパイル編): Part 2へ続く。