ソラマメブログ
アクセスカウンタ
読者登録
メールアドレスを入力して登録する事で、このブログの新着エントリーをメールでお届けいたします。解除は→こちら
現在の読者数 1人
プロフィール
rikachann Aabye
rikachann Aabye
きままに遊んでます。
最近はものつくりをやりたいと思ってます。
なかなか思うように作れませんが試行錯誤の毎日です
よろしくね。

2009年11月01日

玄箱HGでOpenSim(Fedora11)その6

前回に引き続き、玄箱HGへのOpenSimの導入のメモです。
今回は

6、opensimのソース展開、コンパイル

です。

まず opensimのソースを「OpenSimulator」のサイトからwindows機ダウンロードにします
左の欄のRunningOpenSim→Get OpenSim
Please note:の文章の中の「 http://dist.opensimulator.org」をクリックIndexリストの中から opensim-0.6.5.1-release.tar.gz をクリックしてダウンロード

コンパイル用のディレクトリー作成
[rika@orion ~]$ mkdir opensim


FFFTPでrika/opensim/に転送

[rika@orion ~]$ cd opensim
[rika@orion opensim]$ ls
opensim-0.6.5.1-release.tar.gz

展開します
[rika@orion opensim]$ tar xvzf opensim-0.6.5.1-release.tar.gz

[rika@orion opensim]$ ls
opensim-0.6.5.1-release opensim-0.6.5.1-release.tar.gz
[rika@orion opensim]$ cd opensim-0.6.5.1-release

ビルド用スクリプト実行
[rika@orion opensim-0.6.5.1-release]$ ./runprebuild.sh

nantによるコンパイル
[rika@orion opensim-0.6.5.1-release]$ nant
NAnt 0.86 (Build 0.86.2898.0; beta1; 2007/12/08)
Copyright (C) 2001-2007 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///home/rika/opensim/opensim-0.6.7-release/OpenSim.build
Target framework: Mono 2.0 Profile
Target(s) specified: build

中略

BUILD SUCCEEDED

Total time: 8.5 seconds.


BUILD SUCCEEDED

Total time: 1705.1 seconds.

[rika@orion opensim-0.6.5.1-release]$

コンパイル無事に終了しました

binディレクトリーに移動
[rika@orion opensim-0.6.5.1-release]$ cd bin

OpenSim.iniファイルのコピー
[rika@orion bin]$ cp OpenSim.ini.example OpenSim.ini

[rika@orion bin]$ mono OpenSim.exe
 う~~ん エラーです^^;
Exception: Mono.Data.SqliteClient.SqliteExecutionException: SQL logic error or missing database

Sqliteはあきらめて mysqlにしちゃいます^^;(安易過ぎる^^

Mysqlのインストールと設定を行います。

rootになります
[rika@orion bin]$ su -
パスワード:

mysqlqをインストールします。
[root@orion ~]# yum install mysql-server

mysqlサーバーの起動
[root@orion ~]# /etc/rc.d/init.d/mysqld start

自動起動の設定
[root@orion ~]# chkconfig mysqld on
[root@orion ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off

パスワードの設定
[root@orion ~]# mysql_secure_installation
すべて 空ENTERですが下のような入力待ちになったらパスワードを設定します

Set root password? [Y/n]    空ENTER
New password:          パスワード入力
Re-enter new password:    再度パスワード入力
この後の入力待ちも空ENTER

mysqlに入ります
[root@orion ~]# mysql -u root -p
Enter password:      先ほど設定したパスワードを入力
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.1.37 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select host,user,password from mysql.user;
+-----------+------+------------------+
| host | user | password |
+-----------+------+------------------+
| localhost | root | 32ed1c0d79b33b32 |
+-----------+------+------------------+
1 row in set (0.01 sec)

データベースの作成
mysql> create database opensim;
Query OK, 1 row affected (0.01 sec)

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| opensim |
+--------------------+
3 rows in set (0.01 sec)

mysql> quit
Bye
[root@orion ~]#

ユーザーrikaに戻ります
root@orion ~]# exit
logout
[rika@orion bin]$

OpenSim.iniをmysql用に編集します。
 ID=opensimからrootに Password=****の****にはMysqlのパスワード設定

  ; ##
; ## STORAGE
; ##

; *** Prim Storage - only leave one storage_plugin uncommented ***
; --- Null stores nothing - effectively disabling persistence:
;storage_plugin = "OpenSim.Data.Null.dll"

; --- To use sqlite as region storage:
;storage_plugin = "OpenSim.Data.SQLite.dll"                 ;を先頭につける
;storage_connection_string="URI=file:OpenSim.db,version=3";     ;を先頭につける

; --- To use MySQL storage, supply your own connectionstring (this is only an example):
; note that the supplied account needs create privilegies if you want it to auto-create needed tables.
storage_plugin="OpenSim.Data.MySQL.dll"                    先頭の;をはずす
storage_connection_string="Data Source=localhost;Database=opensim;User ID=root;Password=*****;";   先頭の;をはずし IDとパスワード変更
; If you want to use a different database/server for estate data, then
; uncomment and change this connect string. Defaults to the above if not set
estate_connection_string="Data Source=localhost;Database=opensim;User ID=root;Password=*****;";    先頭の;をはずし IDとパスワード変更


  こちらもついでに変更

  ; Choose one of the physics engines below
;physics = basicphysics                  ;を先頭につける
;physics = POS
physics = OpenDynamicsEngine             先頭の;をはずす
;physics = modified_BulletX

 mysqlの設定を続けます

 [StandAlone]
accounts_authenticate = true
welcome_message = "Welcome to OpenSimulator"

; Asset database provider
;asset_plugin = "OpenSim.Data.SQLite.dll"            ;を先頭につける
asset_plugin = "OpenSim.Data.MySQL.dll" ; for mysql    先頭の;をはずす
; asset_plugin = "OpenSim.Data.NHibernate.dll" ; for nhibernate

; the Asset DB source. This only works for sqlite, mysql, and nhibernate for now
; Asset source SQLite example
; asset_source = "URI=file:Asset.db,version=3"         ;を先頭につける

; Asset Source NHibernate example (DIALECT;DRIVER;CONNECTSTRING)
; asset_source = "SQLiteDialect;SqliteClientDriver;URI=file:Asset.db,version=3"
; Asset Source MySQL example
asset_source = "Data Source=localhost;Database=opensim;User ID=root;Password=****;"     先頭の;をはずし IDとパスワード変更

; Inventory database provider
; inventory_plugin = "OpenSim.Data.SQLite.dll"        ;を先頭につける
inventory_plugin = "OpenSim.Data.MySQL.dll"          先頭の;をはずす
; inventory_plugin = "OpenSim.Data.NHibernate.dll" ; for nhibernate

; Inventory source SQLite example
; inventory_source = "URI=file:inventoryStore.db,version=3"    ;を先頭につける
; Inventory Source NHibernate example (DIALECT;DRIVER;CONNECTSTRING)
; inventory_source = "SQLiteDialect;SqliteClientDriver;URI=file:Inventory.db,version=3"
; Inventory Source MySQL example
inventory_source = "Data Source=localhost;Database=opensim;User ID=root;Password=****;"     先頭の;をはずし IDとパスワード変更


; User Data Database provider
;
; Multiple providers can be specified by separating them with commas (whitespace is unimportant)
; If multiple providers are specified then if a profile is requested, each is queried until one
; provides a valid profile, or until all providers have been queried.
; Unfortunately the order of querying is currently undefined (it may not be the order in which
; providers are specified here). This needs to be fixed
;
;userDatabase_plugin = "OpenSim.Data.SQLite.dll"          ;を先頭につける   
userDatabase_plugin = "OpenSim.Data.MySQL.dll"         先頭の;をはずす
; userDatabase_plugin = "OpenSim.Data.NHibernate.dll" ; for nhibernate

; User source SQLite example
;user_source = "URI=file:userprofiles.db,version=3"         ;を先頭につける   
; User Source NHibernate Example (DIALECT;DRIVER;CONNECTSTRING)
; user_source = "SQLiteDialect;SqliteClientDriver;URI=file:User.db,version=3"
; User Source MySQL example
user_source = "Data Source=localhost;Database=opensim;User ID=root;Password=****;"   先頭の;をはずし IDとパスワード変更
--------------変更はここまで------------------

OpenSimを実行します。
[rika@orion bin]$ mono OpenSim.exe

実行の途中で sim名 アバター名 パスワードを設定します

DEFAULT REGION CONFIG: Region Name [OpenSim Test]: rika_island
DEFAULT REGION CONFIG: Grid Location (X Axis) [1000]:
DEFAULT REGION CONFIG: Grid Location (Y Axis) [1000]:
DEFAULT REGION CONFIG: Internal IP Address for incoming UDP client connections [0.0.0.0]:
DEFAULT REGION CONFIG: Internal IP Port for incoming UDP client connections [9000]:
DEFAULT REGION CONFIG: External Host Name [127.0.0.1]:
DEFAULT REGION CONFIG: First Name of Master Avatar [Test]: rika
DEFAULT REGION CONFIG: Last Name of Master Avatar [User]: kayama
DEFAULT REGION CONFIG: (Sandbox Mode Only)Password for Master Avatar account [test]: アバターのパスワードを設定


う~~~ん エラーでとまります。

Exception: System.DllNotFoundException: ode
at (wrapper managed-to-native) Ode.NET.d:InitODE ()

エラーの解決には「東京情報大学ネットワークシステム研究室(NSL)」さんのサイトの「OpenSim/Troblesshooting」を参考にしました

powerPC用のlibode.soをコンパイルします。
こちらのODEサイトからソースをダウンロード(windows機)します
左の欄のdownloadをクリック
Source CodeのVersion-numbered source releasesをクリックして、ode-0.11.1.tar.gzをクイックしてダウンロード

展開用のディレクトリーodeを作成
[rika@orion bin]$ cd ~
[rika@orion ~]$ cd opensim
[rika@orion opensim]$ mkdir ode
[rika@orion opensim]$

FFFTPで odeディレクトリーに上記ファイルを転送

[rika@orion opensim]$ cd ode
[rika@orion ode]$ ls
ode-0.11.1.tar.gz

展開します
[rika@orion ode]$ tar zxvf ode-0.11.1.tar.gz
[rika@orion ode]$ cd ode-0.11.1

コンパイルします
[rika@orion ode-0.11.1]$ ./configure --with-trimesh=gimpact --enable-shared
[rika@orion ode-0.11.1]$ make
ルートになってインストール
[rika@orion ode-0.11.1]$ su
パスワード:
[root@orion ode-0.11.1]# make install
[root@orion ode-0.11.1]# /sbin/ldconfig
ライブラリーは参照してないみたいなので libode.soを上書きコピーします
[root@orion bin]# cp /home/rika/opensim/ode/ode-0.11.1/ode/src/.libs/libode.so /home/rika/opensim/opensim-0.6.5.1-release/bin/

ユーザーrikaに戻ってもう一度起動
[root@orion bin]# exit
exit
[rika@orion bin]$ mono OpenSim.exe

また エラーー
** (OpenSim.exe:12794): WARNING **: The following assembly referenced from /home/rika/opensim/opensim-0.6.5.1-release/bin/NHibernate.dll could not be loaded:
Assembly: System.Data.OracleClient (assemblyref_index=4)
Version: 2.0.0.0
Public Key: b77a5c561934e089

Oracleのデータベースのファイルが必要みたいなのでmono-data-oracle をインストール

[rika@orion bin]$ su
パスワード:
[root@orion bin]# yum install mono-data-oracle

ユーザーrikaに戻ってもう一度起動
[root@orion bin]# exit
exit
[rika@orion bin]$ mono OpenSim.exe

やりました~~ やっと Region 入力待ちになりました
15:31:32 - Failed generating terrain map: System.DllNotFoundException: openjpeg-dotnet.dll
at (wrapper managed-to-native) OpenMetaverse.Imaging.OpenJPEG:DotNetAllocDecoded (OpenMetaverse.Imaging.OpenJPEG/MarshalledImage&)
at OpenMetaverse.Imaging.OpenJPEG.Encode (OpenMetaverse.Imaging.ManagedImage image, Boolean lossless) [0x00000]
at OpenMetaverse.Imaging.OpenJPEG.EncodeFromImage (System.Drawing.Bitmap bitmap, Boolean lossless) [0x00000]
at OpenSim.Region.CoreModules.World.WorldMap.MapImageModule.WriteJpeg2000Image (System.String gradientmap) [0x00000]
15:31:32 - [SCENE]: Registering with InterregionCommsIn
15:31:32 - [PRIM INVENTORY]: Starting scripts in scene
15:31:32 - [SCENE]: Loading land objects from storage
15:31:33 - [UDPSERVER]: Opening UDP socket on 0.0.0.0 9000.
15:31:33 - [UDPSERVER]: UDP socket bound, getting ready to listen
15:31:33 - [UDPSERVER]: Listening on port 9000
15:31:33 - [SUN]: Sun Settings Update: Fixed Sun? : False
15:31:33 - [SUN]: Sun Settings Update: Sun Hour : 3.155
15:31:33 - [SUN]: PosTime : 1257121893
15:31:33 - [RegionReady]: Disabled
15:31:33 - [!]:STARTUP COMPLETE
Currently selected region is rika_island
15:31:33 - [STARTUP]: Startup took 1m 25s
Region (rika_island) #

あれ よく見るとJPEGがおかしいようです^^;
いちど opensimを抜けます

Region (rika_island) # shutdown

エラーの解決には「東京情報大学ネットワークシステム研究室(NSL)」さんのサイトの「OpenSim/Troblesshooting」を再度参考にしました

powerPC用のlibopenjpeg-dotnet-2.1.3.0-dotnet-1.soが必要みたいです^^;

ルートになります
[rika@orion bin]$ su
パスワード:

ダウンロードのためのsubversionをインストールします
[root@orion libsl]# yum install subversion

ユーザーに戻り インストールディレクトリ作成

[root@orion ~]# exit
exit
[rika@orion libsl]$ cd ~/opensim
[rika@orion opensim]$ mkdir libopenjpeg
[rika@orion opensim]$ cd libopenjpeg
[rika@orion libopenjpeg]$
[rika@orion libopenjpeg]$ svn co svn://openmetaverse.org/libsl libsl
ちょっと 気の遠くなるような ファイルがダウンロードされます^^; 汗

中略
U libsl/libopenmetaverse/branches/0.7-devel/HttpServer
Ctrl +Zを入力
[1]+ 停止 svn co svn://openmetaverse.org/libsl libsl外部項目 (リビジョン 19869) をチェックアウトしました。

コンパイルディレクトリーに移動
[rika@orion libopenjpeg]$ cd libsl/libopenmetaverse/trunk/openjpeg-dotnet
[rika@orion openjpeg-dotnet]$ make
作成されたlibopenjpeg-dotnet-2.1.3.0-dotnet-1-i686.soをopensim/binに上書きコピー
[rika@orion openjpeg-dotnet]$ cp libopenjpeg-dotnet-2.1.3.0-dotnet-1-i686.so /home/rika/opensim/opensim-0.6.5.1-release/bin
cp: `/home/rika/opensim/opensim-0.6.5.1-release/bin/libopenjpeg-dotnet-2.1.3.0-dotnet-1-i686.so' を上書きしてもよろしいですか(yes/no)? y
[rika@orion openjpeg-dotnet]$ [rika@orion openjpeg-dotnet]$

opensim/binディレクトリーに戻ります
[rika@orion openjpeg-dotnet]$ cd ~/opensim/opensim-0.6.5.1-release/bin/
[rika@orion bin]$

次に OpenMetaverse.dll.configを編集します
最後の行の  cpu="x86" を削除します

[rika@orion bin]$ vi OpenMetaverse.dll.config

<configuration>
<dllmap os="osx" dll="openjpeg-dotnet.dll" target="libopenjpeg-dotnet-2.1.3.0-dotnet-1.dylib" />
<dllmap os="!windows,osx" cpu="x86-64,ia64" dll="openjpeg-dotnet.dll" target="libopenjpeg-dotnet-2.1.3.0-dotnet-1-x86_64" />
<dllmap os="!windows,osx" dll="openjpeg-dotnet.dll" target="libopenjpeg-dotnet-2.1.3.0-dotnet-1-i686" />
</configuration>

やっと インストールできました^^
Currently selected region is rika_island
17:42:40 - [STARTUP]: Startup took 1m 24s
Region (rika_island) #

ビュアーのプロパティ設定に
-loginuri http://192.168.1.28:9000/ -loginpage http://192.168.1.28:9000/?method=login
を追加します
玄箱のIPアドレスが192.168.1.28のときの設定です

玄箱HGでOpenSim(Fedora11)その6

地域のハンドシェイクを待ってます....でハングアップ^^;

ってことで 次回に続きます^^

同じカテゴリー(玄箱HG(Fedora11))の記事画像
玄箱HGでOpenSim0.7rc2にアップ
OpenSim玄箱Fedora11で0.6.8up
玄箱HGでOpenSim(Fedora11)補足します
玄箱HGでOpenSim(Fedora11)その7
玄箱HGでOpenSim(Fedora11)その4
玄箱HGでOpenSim(Fedora11)その3
同じカテゴリー(玄箱HG(Fedora11))の記事
 玄箱HGでOpenSim0.7rc2にアップ (2010-07-11 19:06)
 OpenSim玄箱Fedora11で0.6.8up (2010-01-04 15:39)
 玄箱HGでOpenSim(Fedora11)補足します (2009-12-12 20:46)
 玄箱HGでOpenSim(Fedora11)その7 (2009-11-01 21:20)
 玄箱HGでOpenSim(Fedora11)その5 (2009-10-30 21:56)
 玄箱HGでOpenSim(Fedora11)その4 (2009-10-25 22:20)
Posted by rikachann Aabye at 18:12│Comments(0)玄箱HG(Fedora11)
上の画像に書かれている文字を入力して下さい
 
<ご注意>
書き込まれた内容は公開され、ブログの持ち主だけが削除できます。