<< 3/56 >>

To switch python2 under Linux Fedora 32

How to change default Python version on Linux/Fedora 28

under Fedora32

# alternatives --install /usr/bin/python python /usr/bin/python3.7 2
# alternatives --install /usr/bin/python python /usr/bin/python2.7 1

sudo alternatives --config python

2 プログラムがあり 'python' を提供します。

選択 コマンド
-----------------------------------------------
* 1 /usr/bin/python3.7
+ 2 /usr/bin/python2.7

Enter を押して現在の選択 [+] を保持するか、選択番号を入力します:1

$ alternatives --list | grep -i python
python manual /usr/bin/python3.7


------------------------------------------------------
setup.pyを用いてインストールしたモジュールのアンインストール方法

python setup.py install --record install.txt

sudo cat inst.txt | sudo xargs rm -rf
------------------------------------------------------
to burn ISO image example:

samp:出力例
$ mkisofs -r -J -V "airCD" -o air_image.iso /run/media/mac/A12C-3EDA/

------------------------------------------------------
to edit gnome boxes example:

$ cd .config
$ cd libvirt/qemu/
samp:出力例
$ virsh edit centos6.8
-----------------------------------------------------
glibc version check

$ /lib/x86_64-linux-gnu/libc.so.6
or
# rpm -q glibc
# yum list installed | grep glibc

Thank You.
  • -
  • -

Sitex Air Renderer and Python cgkit

11年前の記事Happy Buddha!
http://rman.sakura.ne.jp/sb/log/eid62.html

python2.7でcgkitを扱う。sitex airでレンダリング。Happy Buddha
Happy Buddha

cgkitの良いところは、RIBで出力した設定を挿入して、レンダラーに合わせて設定できるところ。Airspace(windows only)を使って、shaderやlightの設定を、レンダリングして、スクリプトを参考にcgkitに挿入した。

以下、スクリプトbuddha_air.py
ありがとうございます。

######################################################################
# Main file for rendering the landscape image
######################################################################
# sitex air renderer and python2.7 cgkit

g=Globals(rib="""Option "occlusion" "prepass" [1]

# the prepass uses indirect attributes for the occlusion call

Attribute "indirect" "maxerror" [0.1]
Attribute "indirect" "integer nsamples" 64
Attribute "indirect" "maxhitdist" 6
Attribute "indirect" "maxpixeldist" 10
Imager "background" "color background" [0.2 0.4 0.6]

Option "searchpath" "shader" "C:/Program Files (x86)/AIR//shaders:C:/Program Files (x86)/AIR//usershaders:&"
Imager "VBgEnvironment"
"float Intensity" [1]
"string EnvironmentName" ["C:/Program Files (x86)/AIR/texture/DebevecGroveProbe.tx"]
"string EnvironmentSpace" ["world"]
"float EnvironmentBlur" [0]
#UseFrames 0
Environment "envMap"
"string MapName" ["C:/Program Files (x86)/AIR/texture/DebevecGroveProbe.tx"]
"float MapIntensity" [1]
"float MapBlur" [0.01]
"float MapSamples" [4]
"string MapSpace" ["world"]
"float RotateX" [90]
"float RotateY" [0]
"float RotateZ" [0]
"float ReflectionVisibility" [1]
"float ReflectionIntensity" [1]
"float ReflectionAddBlur" [0]
"float IndirectVisibility" [1]
"float IndirectIntensity" [1]
"float IndirectAddBlur" [0]
"float CameraVisibility" [0]
"float CameraIntensity" [1]
"float CameraAddBlur" [0]
""",
resolution = (320, 240),
#pixelsamples=(4,4),
#shadingrate=0.25,
#pixelfilter=("gaussian",(2,2)),
up = (0,1,0),
background = (0.2,0.2,0.2)
)

######################################################################
# Camera
######################################################################

# Load the external camera (if it exists), otherwise use the camera for
# the final image
if os.path.exists("camera.py"):
load("camera.py")
else:
TargetCamera(
name = "Camera",
pos = (0.0729126, 0.641438, -2.2),
target = (0, 0, 0),
fov = 30
)

GLPointLight(
intensity = 0.1,
pos = (-50,30, -20),
diffuse = (1, 1, 1)
)

# ...and a distant light

dis=RMLightSource(name = "distant_0",shader=RMShader("distantlight",intensity=0.4))
dis.shader.declare('string shadowname="raytrace"')
dis.shader.declare('uniform point from=(-15,30,-30)')

# ...and a env light

env=RMLightSource(name = "env01",shader= RMShader("envlight"))
env.shader.declare('uniform color lightcolor=(.9,.9,1)')
env.shader.declare('uniform color shadowcolor=(.05,.05,0)')

# ...no indirect

# models and darktree shader

r=RIBArchive(
name ="butu_center",
filename = './butu.rib',
pos = (0,0,0)
)

r.rib='Attribute "visibility" "trace" [1]\nAttribute "visibility" "int transmission" [1]\nSurface "DarkTreeSurface"\n "string DarkTreeShader" ["C:/Users/yokamak/Documents/cgkit/DTRep_thumb/tx_stone/pvStone_Tan_Brown.dsts"]\n "float Diffuse" [1]\n "float Specular" [1]\n "float Reflection" [1]\n "float ReflectionSamples" [1]\n "float ReflectionBlur" [0]\n "string ReflectionName" ["raytrace"]\n "string ReflectionSpace" ["current"]\n "float Incandescence" [1]\n "float Use2DCoordinates" [0]\n "float[2] Texture2dSize" [1 1]\n "float[2] Texture2dOrigin" [0 0]\n "float Texture2dAngle" [0]\n "float Pattern3dSize" [1]\n "float[3] Pattern3dOrigin" [0 0 0]\n "string Pattern3dSpace" ["shader"]\n "float BumpScale" [1]\n "float TimeScale" [1]\n "string ColorTweak1Name" ["Color 1"]\n "color ColorTweak1" [0.682 0.556 0.513]\n "string ColorTweak2Name" ["Coor 2"]\n "color ColorTweak2" [0.545 0.466 0.439]\n "string ColorTweak3Name" ["Color 3"]\n "color ColorTweak3" [0.533 0.435 0.419]\n "string ColorTweak4Name" ["Color 4"]\n "color ColorTweak4" [0.654 0.65 0.545]\n "string ColorTweak5Name" ["Color 5"]\n "color ColorTweak5" [0.494 0.411 0.352]\n "string ColorTweak6Name" ["Water"]\n "color ColorTweak6" [0 0.192 0.388]\n "string FloatTweak1Name" ["Diffuse"]\n "float FloatTweak1" [1]\n "string FloatTweak2Name" ["Specular"]\n "float FloatTweak2" [0.75]\n "string FloatTweak3Name" ["Glossiness"]\n "float FloatTweak3" [0.35]\n "string FloatTweak4Name" ["Seed"]\n "float FloatTweak4" [1]\n "string FloatTweak5Name" ["Dark Specular"]\n "float FloatTweak5" [1]\n "string FloatTweak6Name" ["Light Specular"]\n "float FloatTweak6" [0]\n "string FloatTweak7Name" ["Dark Gloss"]\n "float FloatTweak7"\n'


t=RIBArchive(
name ="butu_left",
filename = './butu.rib',
pos = (0.5,0,0)
)

t.rib='Attribute "visibility" "trace" [1]\nAttribute "visibility" "int transmission" [1]\nSurface "DarkTreeSurface"\n "string DarkTreeShader" ["C:/Program Files (x86)/AIR/viztools/darktree/metalGoldTarnish.dsts"]\n "float Diffuse" [1]\n "float Specular" [1]\n "float Reflection" [1]\n "float ReflectionSamples" [1]\n "float ReflectionBlur" [0]\n "string ReflectionName" ["raytrace"]\n "string ReflectionSpace" ["current"]\n "float Incandescence" [1]\n "float Use2DCoordinates" [0]\n "float[2] Texture2dSize" [1 1]\n "float[2] Texture2dOrigin" [0 0]\n "float Texture2dAngle" [0]\n "float Pattern3dSize" [1]\n "float[3] Pattern3dOrigin" [0 0 0]\n "string Pattern3dSpace" ["shader"]\n "float BumpScale" [1]\n "float TimeScale" [1]\n "string ColorTweak1Name" ["Gold 1"]\n "color ColorTweak1" [0.913 0.85 0.615]\n "string ColorTweak2Name" ["Gold 2"]\n "color ColorTweak2" [0.878 0.701 0.349]\n "string ColorTweak3Name" ["Rust 1"]\n "color ColorTweak3" [0.294 0.211 0.172]\n "string FloatTweak1Name" ["Tarnish"]\n "float FloatTweak1" [0]\n "string FloatTweak2Name" ["Reflectivity"]\n "float FloatTweak2" [0.2]\n "string FloatTweak3Name" ["Input Seed"]\n "float FloatTweak3" [133]\n "string FloatTweak4Name" ["Glossiness"]\n "float FloatTweak4" [0.05]\n "string FloatTweak5Name" ["Metal Hightlight"]\n "float FloatTweak5" [0.75]\n "string FloatTweak6Name" [""]\n "float FloatTweak6" [0.5]\n "string FloatTweak7Name" [""]\n "float FloatTweak7" [0.5]\n'



s=RIBArchive(
name ="butu_right",
filename = './butu.rib',
pos = (-0.5,0,0)
)

s.rib='Attribute "visibility" "trace" [1]\nAttribute "visibility" "int transmission" [1]\n Surface "DarkTreeSurface"\n "string DarkTreeShader" ["C:/Users/yokamak/Documents/cgkit/DTRep_thumb/ba_shader/MetallicPaintShader.dsts"]\n "float Diffuse" [1]\n "float Specular" [1]\n "float Reflection" [1]\n "float ReflectionSamples" [1]\n "float ReflectionBlur" [0]\n "string ReflectionName" ["raytrace"]\n "string ReflectionSpace" ["current"]\n "float Incandescence" [1]\n "float Use2DCoordinates" [0]\n "float[2] Texture2dSize" [1 1]\n "float[2] Texture2dOrigin" [0 0]\n "float Texture2dAngle" [0]\n "float Pattern3dSize" [1]\n "float[3] Pattern3dOrigin" [0 0 0]\n "string Pattern3dSpace" ["shader"]\n "float BumpScale" [1]\n "float TimeScale" [1]\n "string ColorTweak1Name" ["Paint Color"]\n "color ColorTweak1" [0.247 0.572 0.929]\n "string ColorTweak2Name" ["Paint Color 2"]\n "color ColorTweak2" [0 0.289 1]\n "string ColorTweak3Name" ["Rust 1"]\n "color ColorTweak3" [0.294 0.211 0.172]\n "string ColorTweak4Name" ["Rust 2"]\n "color ColorTweak4" [0.439 0.239 0.203]\n "string ColorTweak5Name" ["Rust 3"]\n "color ColorTweak5" [0.313 0.266 0.239]\n "string ColorTweak6Name" ["Rust 4"]\n "color ColorTweak6" [0.556 0.301 0.066]\n "string FloatTweak1Name" ["Reflectivity"]\n "float FloatTweak1" [0.35]\n "string FloatTweak2Name" ["Metallic Specular"]\n "float FloatTweak2" [0.55]\n "string FloatTweak3Name" ["CC Specular"]\n "float FloatTweak3" [0.5]\n "string FloatTweak4Name" ["CC Gloss"]\n "float FloatTweak4" [0.9]\n "string FloatTweak5Name" ["Random Seed"]\n "float FloatTweak5" [95]\n "string FloatTweak6Name" ["Glossiness"]\n "float FloatTweak6" [0.15]\n "string FloatTweak7Name" ["Seed"]\n "float FloatTweak7" [6]\n'

pl = RMMaterial(
surface = RMShader("VWood"),
color = (1, 1, 1))

pl2 = RMMaterial(
surface = RMShader("VPhysicalMetal"),
color = (1, 1, 1))

glm=GLMaterial(diffuse=(0.8, 0.7, 0.7))

p01=Plane(
lx = 50,
ly = 50,
pos = (0,0,0.6),
rot= mat3().fromEulerXYZ(0, radians(180), 0)
)
p01.rib='Attribute "visibility" "trace" [1]\nAttribute "visibility" "shadow" [1]\n Surface "VShinyTile2D"\n "float Diffuse" [0.9]\n "float DiffuseRoughness" [0.3]\n "float Specular" [0.5]\n "float SpecularRoughness" [0.01]\n "float SpecularSharpness" [0.8]\n "float Reflection" [4.0]\n "float ReflectionSamples" [2]\n "float ReflectionBlur" [0]\n "string ReflectionName" ["raytrace"]\n "string ReflectionSpace" ["current"]\n "float[2] TileSize" [0.01 0.01]\n "float TileStagger" [0]\n "float TileColorVary" [0.1]\n "float GrooveWidth" [0.001]\n "float GrooveDepth" [0.008]\n "color GrooveColor" [0.98 0.98 0.98]\n "float BumpHeight" [0]\n "float BumpWidth" [0.0005]\n "float[2] TextureSizeXY" [0.25 0.25]\n "float[2] TextureOriginXY" [0 0]\n "float TextureAngle" [0]\n "string Projection" ["st"]\n "string ProjectionSpace" ["shader"]\n "float[16] ProjectionTransform" [1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1]'

#p01.rib='Attribute "visibility" "trace" [1]\nAttribute "visibility" "shadow" [1]\nSurface "VMetal"\n'

p02=Plane(
lx = 50,
ly = 50,
pos = (0,-0.44,0),
rot= mat3().fromEulerXYZ(radians(-90), 0, 0),
material = pl2
)
p02.rib='Attribute "visibility" "trace" [1]\nAttribute "visibility" "shadow" [1]\n'

  • -
  • -

Installed python cgkit and sitex air renderer under Windows10

最後のPython2.7の64bit版をwindows10にインストールしました。
python cgkitをインストールし、旧RenderMan互換レンダラーであるsitex air rendererを利用することにしました。

■手順
以下からいくつかのライブラリをダウンロードします。

http://www.lfd.uci.edu/~gohlke/pythonlibs/


■pipの設定
>python -m pip install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pip
Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB)
|################################| 1.4MB 591kB/s
Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Successfully installed pip-20.0.2

■pygameインストール
>pip install pygame-1.9.6-cp27-cp27m-win_amd64.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing c:\users\yokamak\downloads\pygame-1.9.6-cp27-cp27m-win_amd64.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.6

■odeインストール
>pip install ode-0.15.2-cp27-cp27m-win_amd64.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing c:\users\yokamak\downloads\ode-0.15.2-cp27-cp27m-win_amd64.whl
Installing collected packages: ode
Successfully installed ode-0.15.2

■PyOpenGLインストール
>pip install PyOpenGL-3.1.5-cp27-cp27m-win_amd64.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing c:\users\yokamak\downloads\pyopengl-3.1.5-cp27-cp27m-win_amd64.whl
Installing collected packages: PyOpenGL
Successfully installed PyOpenGL-3.1.5

■cgkitインストール
>pip install cgkit-2.0.0-cp27-none-win_amd64.whl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing c:\users\yokamak\downloads\cgkit-2.0.0-cp27-none-win_amd64.whl
Installing collected packages: cgkit
Successfully installed cgkit-2.0.0

■インストールしたものの内容確認
C:\Users\yokamak\Downloads>pip freeze
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
cgkit==2.0.0
ode==0.15.2
pygame==1.9.6
PyOpenGL==3.1.5

■PILのダミーをインストール、自動的にPillowがインストール
>pip install "PIL-2.0+dummy-py2.py3-none-any.whl"
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing c:\users\yokamak\downloads\pil-2.0+dummy-py2.py3-none-any.whl
Collecting Pillow>=2.0
Downloading Pillow-6.2.2-cp27-cp27m-win_amd64.whl (1.9 MB)
|################################| 1.9 MB 3.0 MB/s
Installing collected packages: Pillow, PIL
Successfully installed PIL-2.0+dummy Pillow-6.2.2

■python cgkitの動作確認。

\cgkit>viewer.py demo1.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html

\cgkit>viewer.py demo2.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html

\cgkit>viewer.py demo3.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html


■テクスチャを貼るシーンのロード失敗。Pillowは対応しない。

\cgkit>viewer.py simplescene.py
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Texname: 1
Loading "uvmap.png"...
Traceback (most recent call last):
File "C:\Python27\Scripts\viewer.py", line 699, in
viewer.run()
File "C:\Python27\lib\site-packages\cgkit\tool.py", line 198, in run
self.action()
File "C:\Python27\Scripts\viewer.py", line 384, in action
self.draw(self.cam, self.width, self.height)
File "C:\Python27\Scripts\viewer.py", line 676, in draw
renderer.paint(root)
File "C:\Python27\lib\site-packages\cgkit\glmaterial.py", line 105, in loadTexData
self._passPILImage(img)
File "C:\Python27\lib\site-packages\cgkit\glmaterial.py", line 141, in _passPILImage
self.texData(w, h, format, GL_UNSIGNED_BYTE, img.tostring())
File "C:\Python27\lib\site-packages\PIL\Image.py", line 779, in tostring
"tostring() has been removed. Please call tobytes() instead."
NotImplementedError: tostring() has been removed. Please call tobytes() instead.

■レンダリングの確認、scitex air rendererを使用する。

\cgkit>render.py -rair demo1.py
Exporting main.rib...
1 passes...
Compiling shaders...
Preprocessing time: 0s
Rendering "out.tif" (frame 0)...
Rendering time: 2s

\cgkit>render.py -rair demo2.py
Exporting main.rib...
1 passes...
Compiling shaders...
Preprocessing time: 0s
Rendering "out.tif" (frame 0)...
Rendering time: 1s

■PILの削除
\cgkit>pip uninstall PIL
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Found existing installation: PIL 2.0+dummy
Uninstalling PIL-2.0+dummy:
Would remove:
c:\python27\lib\site-packages\pil-2.0+dummy.dist-info\*
Proceed (y/n)? y
Successfully uninstalled PIL-2.0+dummy

■内容確認
\cgkit>pip list
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Package Version
---------- -------
cgkit 2.0.0
ode 0.15.2
Pillow 6.2.2
pip 20.0.2
pygame 1.9.6
PyOpenGL 3.1.5
setuptools 41.2.0

■Pillowの削除
\cgkit>pip uninstall Pillow
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Found existing installation: Pillow 6.2.2
Uninstalling Pillow-6.2.2:
Would remove:
c:\python27\lib\site-packages\pil\*
c:\python27\lib\site-packages\pillow-6.2.2.dist-info\*
Proceed (y/n)? y
Successfully uninstalled Pillow-6.2.2

■内容確認
\cgkit>pip list
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Package Version
---------- -------
cgkit 2.0.0
ode 0.15.2
pip 20.0.2
pygame 1.9.6
PyOpenGL 3.1.5
setuptools 41.2.0

■PILのインストール
最後にpython cgkitは、pillowではなくてPILでないとテクスチャがはりつけられないので、Windows用のbinary installした。
thank you. ありがとうございます。

PIL-1.1.7.win-amd64-py2.7.exe

■Windows Compiled Libraries
以下からダウンロード

https://github.com/lightkeeper/lswindows-lib/blob/master/amd64/python/PIL-1.1.7.win-amd64-py2.7.exe?raw=true

sitex air rendererのダウンロード


http://www.sitexgraphics.com/html/download.html

python cgkitのサンプル


cgkitサイトのtutorialからdemoファイルを入手します。
http://cgkit.sourceforge.net/tutorials/demo1.html
http://cgkit.sourceforge.net/tutorials/demo2.html
http://cgkit.sourceforge.net/tutorials/demo3.html


コマンドプロンプトから
 > viewer.py demo3.py

マウス alt+左ドラッグでカメラ目線。

sitex air rendererでレンダリングの確認
 > render.py -rair demo3.py


以下は
http://cgkit.sourceforge.net/tutorials/renderman.html
 > render.py -rair simplescene.py

cgkiA.jpg
ありがとうございます。
  • -
  • -

Manjaro Linux18 python cgkit install

Manjaro Linux 18 (Arch linux) in Thunderbolt3 SSD



ノートPC,LG gram 13Z980-NA77JにThunderbolt3 SSD archgon X70 240GBを外付けで使って認識しました。Windows10高速スタートアップを切り、shiftキーを押しながら「再起動」から「デバイスの選択」、「Nvme0」選択して、再起動するManjaro Linuxが起動しています。
$ sudo hdparm -t /dev/nvme0n1
/dev/nvme0n1:
HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
Timing buffered disk reads: 2184 MB in 3.00 seconds = 727.63 MB/sec

■ハードウェア確認。
$ sudo pacman -S bolt
$ sudo pacman -S hardinfo
$ sudo pacman -S lshw
$ sudo pacman -S gsmartcontrol
$ sudo lshw -class disk -class storage
$ sudo fdisk -l

$ sudo hdparm -t /dev/nvme0n1
$ sudo smartctl -a /dev/nvme0n1

$ sudo pacman -Syu

■日本語入力
$ sudo pacman -S --needed qt5-translations
$ sudo pacman -S fcitx-mozc fcitx-gtk2 fcitx-gtk3 fcitx-qt5 kcm-fcitx

$ nano .xprofile
以下を記入保存。
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx

■python cgkit installの準備。
$ sudo pacman -S python2-pygame python2-opengl python2-pyserial ode tk
$ sudo pacman -S boost boost-libs scons

AURに登録されているパッケージをインストールするためのパッケージを導入します。yay(Yet another Yogurt)をインストールします。

$ sudo pacman -S git
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si

$ yay -S python2-pyode

■PIL1.1.7インストール
Manjaro Linuxはpython3が基本なので、ユーザのhomeにダミーディレクトリを作成します。
$ mkdir ~/bin
$ ln -s /usr/bin/python2 ~/bin/python
$ ln -s /usr/bin/python2-config ~/bin/python-config
$ export PATH=~/bin:$PATH
これでpython2.7が起動します。

毎回、python2を使うためには、
開いたターミナルで$ export PATH=~/bin:$PATHをします。

PIL1.1.7をダウンロード。
http://www.pythonware.com/products/pil/

$ cd Downloads/
$ tar xvf Imaging-1.1.7.tar.gz

$ python setup.py build_ext -i
$ sudo python setup.py install

■PyProtocolsインストール
http://peak.telecommunity.com/PyProtocols.html
http://peak.telecommunity.com/dist/

$ unzip PyProtocols-0.9.3.zip
$ sudo python setup.py --without-speedups install

■python cgkit2.0インストール
cgkitを入手します。
https://sourceforge.net/projects/cgkit/files/cgkit/
以下はcgkitのインストールです。
$ cd ../
~/Downloads$ tar xvf cgkit-2.0.0-py2k.tar.gz

環境を確認します。
$ cd cgkit-2.0.0/
$ cd utilities/
$ python checkenv.py
以下を実行します。
$ cd ../
$ cd supportlib/
$ scons
しばらく待ちます。
scons: done building targets.

$ cd ../
$ python setup.py build
■Build時のエラー対処
[solved]
py_slot.h,43行目snameの両側に空白スペースを入れる "_" sname "

[solved]
py_geoms1.cpp,line:145行 and line:166行 boost::python::make_tuple に変更します。


$ sudo python setup.py install

cgkitサイトのtutorialからdemoファイルを入手します。
http://cgkit.sourceforge.net/tutorials/demo1.html
http://cgkit.sourceforge.net/tutorials/demo2.html
http://cgkit.sourceforge.net/tutorials/demo3.html
http://cgkit.sourceforge.net/tutorials/renderman.html

$ viewer.py demo3.py
マウス alt+左ドラッグを使うために
Manjaro Linux xfceの場合
設定→ウインドウマネージャー(詳細)→アクセシビィリティ→
ウインドウを掴んだり移動するために使うキーを「None」にします。
  • -
  • -

arch linux







xfce4-terminal


sudo pacman -S python2-pygame python2-opengl python2-pyserial ode tk

AURに登録されているパッケージをインストールするためのパッケージを導入します
ここではyay(Yet another Yogurt)をインストールします

$ sudo pacman -S git
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si


$ yay -S python2-pyode
:: Checking for conflicts...
:: Checking for inner conflicts...
[Repo Make: 1] pyrex-0.9.9-5
[Aur: 1] python2-pyode-20100322-1

==> Remove make dependencies after install? [y/N] y
:: Downloaded PKGBUILD (1/1): python2-pyode
1 python2-pyode (Build Files Exist)
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> Diffs to show?
==> i
:: Parsing SRCINFO (1/1): python2-pyode
依存関係を解決しています...
衝突するパッケージがないか確認しています...

パッケージ (1) pyrex-0.9.9-5

合計ダウンロード容量: 0.24 MiB
合計インストール容量: 1.80 MiB

:: インストールを行いますか? [Y/n] y
:: パッケージを取得します...
pyrex-0.9.9-5-any 244.5 KiB 203K/s 00:01 [######################] 100%
(1/1) キーリングのキーを確認 [######################] 100%
(1/1) パッケージの整合性をチェック [######################] 100%
(1/1) パッケージファイルのロード [######################] 100%
(1/1) ファイルの衝突をチェック [######################] 100%
(1/1) 空き容量を確認 [######################] 100%
:: パッケージの変更を処理しています...
(1/1) インストール pyrex [######################] 100%
:: トランザクション後のフックを実行...
(1/1) Arming ConditionNeedsUpdate...
==> パッケージを作成: python2-pyode 20100322-1 (2018年11月10日 13時11分23秒)
==> ソースを取得...
-> ダウンロード PyODE-snapshot-2010-03-22.tar.bz2...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 397 100 397 0 0 710 0 --:--:-- --:--:-- --:--:-- 708
100 55651 100 55651 0 0 26500 0 0:00:02 0:00:02 --:--:-- 77078
==> source で md5sums ファイルを検証...
PyODE-snapshot-2010-03-22.tar.bz2 ... 成功
==> Cleaning up...
==> パッケージを作成: python2-pyode 20100322-1 (2018年11月10日 13時11分26秒)
==> ランタイムの依存関係を確認...
==> ビルドタイムの依存関係を確認...
==> ソースを取得...
-> PyODE-snapshot-2010-03-22.tar.bz2 を見つけました
==> source で md5sums ファイルを検証...
PyODE-snapshot-2010-03-22.tar.bz2 ... 成功
==> 既存の $srcdir/ ディレクトリを削除...
==> ソースを展開...
-> PyODE-snapshot-2010-03-22.tar.bz2 を bsdtar で展開
==> ソースの準備ができました。
==> パッケージを作成: python2-pyode 20100322-1 (2018年11月10日 13時11分28秒)
==> ランタイムの依存関係を確認...
==> ビルドタイムの依存関係を確認...
==> 警告: 既存の $srcdir/ ツリーを使用
==> build() を開始...
INFO: found in /usr/include
INFO: Creating ode_trimesh.c
pyrexc -o ode_trimesh.c -I. -Isrc src/ode.pyx
/home/mak/.cache/yay/python2-pyode/src/PyODE-snapshot-2010-03-22/src/mass.pyx:263:18: Warning: 'not None' will become the default in a future version of Pyrex. Use 'or None' to allow passing None.
INFO: Creating ode_notrimesh.c
pyrexc -o ode_notrimesh.c -I. -Isrc src/ode.pyx
/home/mak/.cache/yay/python2-pyode/src/PyODE-snapshot-2010-03-22/src/mass.pyx:263:18: Warning: 'not None' will become the default in a future version of Pyrex. Use 'or None' to allow passing None.
INFO: Installing with trimesh support.
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/xode
copying xode/errors.py -> build/lib.linux-x86_64-2.7/xode
copying xode/transform.py -> build/lib.linux-x86_64-2.7/xode
copying xode/body.py -> build/lib.linux-x86_64-2.7/xode
copying xode/joint.py -> build/lib.linux-x86_64-2.7/xode
copying xode/node.py -> build/lib.linux-x86_64-2.7/xode
copying xode/parser.py -> build/lib.linux-x86_64-2.7/xode
copying xode/geom.py -> build/lib.linux-x86_64-2.7/xode
copying xode/__init__.py -> build/lib.linux-x86_64-2.7/xode
running build_ext


==> package() を開始...
INFO: found in /usr/include
INFO: ode_trimesh.c is up to date
INFO: ode_notrimesh.c is up to date
INFO: Installing with trimesh support.
running install
running build
running build_py
running build_ext
running install_lib
creating /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr
creating /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib
creating /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7
creating /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages
copying build/lib.linux-x86_64-2.7/ode.so -> /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages
creating /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode
copying build/lib.linux-x86_64-2.7/xode/errors.py -> /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode
copying build/lib.linux-x86_64-2.7/xode/transform.py -> /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode
copying build/lib.linux-x86_64-2.7/xode/body.py -> /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode
copying build/lib.linux-x86_64-2.7/xode/joint.py -> /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode
copying build/lib.linux-x86_64-2.7/xode/node.py -> /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode
copying build/lib.linux-x86_64-2.7/xode/parser.py -> /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode
copying build/lib.linux-x86_64-2.7/xode/geom.py -> /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode
copying build/lib.linux-x86_64-2.7/xode/__init__.py -> /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode
byte-compiling /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode/errors.py to errors.pyc
byte-compiling /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode/transform.py to transform.pyc
byte-compiling /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode/body.py to body.pyc
byte-compiling /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode/joint.py to joint.pyc
byte-compiling /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode/node.py to node.pyc
byte-compiling /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode/parser.py to parser.pyc
byte-compiling /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode/geom.py to geom.pyc
byte-compiling /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/xode/__init__.py to __init__.pyc
running install_egg_info
Writing /home/mak/.cache/yay/python2-pyode/pkg/python2-pyode/usr/lib/python2.7/site-packages/PyODE-1.2.0-py2.7.egg-info
==> インストールを整理...
-> libtool ファイルを削除...
-> 不要なファイルを削除...
-> スタティックライブラリファイルを削除しています...
-> バイナリとライブラリから不要なシンボルを削除...
-> man と info ページを圧縮...
==> パッケージの問題をチェック...
==> パッケージを作成 "python2-pyode"...
-> .PKGINFO ファイルを生成...
-> .BUILDINFO ファイルを生成...
-> .MTREE ファイルを生成...
-> パッケージの圧縮...
==> fakeroot 環境を終了。
==> 作成完了: python2-pyode 20100322-1 (2018年11月10日 13時11分41秒)
==> Cleaning up...
パッケージをロード...
依存関係を解決しています...
衝突するパッケージがないか確認しています...

パッケージ (1) python2-pyode-20100322-1

合計インストール容量: 0.53 MiB

:: インストールを行いますか? [Y/n]
(1/1) キーリングのキーを確認 [######################] 100%
(1/1) パッケージの整合性をチェック [######################] 100%
(1/1) パッケージファイルのロード [######################] 100%
(1/1) ファイルの衝突をチェック [######################] 100%
(1/1) 空き容量を確認 [######################] 100%
:: パッケージの変更を処理しています...
(1/1) インストール python2-pyode [######################] 100%
:: トランザクション後のフックを実行...
(1/1) Arming ConditionNeedsUpdate...
依存関係を確認しています...

パッケージ (1) pyrex-0.9.9-5

合計削除容量: 1.80 MiB

:: 以上のパッケージを削除しますか? [Y/n]
:: パッケージの変更を処理しています...
(1/1) 削除 pyrex [######################] 100%
:: トランザクション後のフックを実行...
(1/1) Arming ConditionNeedsUpdate...
------------------------------------------------
特定のファイルが含まれているパッケージを検索
ファイルデータベースを同期してください:

# pacman -Fy
ファイルが含まれているパッケージを検索するには:


$ pacman -Fs libz.so
core/zlib 1:1.2.11-3
usr/lib/libz.so
~]$

[mak@localhost ~]$ pacman -Fs libjpeg.so
extra/jre8-openjdk-headless 8.u192-1
usr/lib/jvm/java-8-openjdk/jre/lib/amd64/libjpeg.so
extra/libjpeg-turbo 2.0.0-1
usr/lib/libjpeg.so
community/darktable 2:2.4.4-2
usr/lib/darktable/plugins/imageio/format/libjpeg.so
[mak@localhost ~]$ pacman -Fs libfreetype.so
extra/freetype2 2.9.1-1
usr/lib/libfreetype.so
[mak@localhost ~]$ pacman -S zlib libjpeg-turbo freetype2
エラー: root 権限がないとこの操作は実行できません。
[mak@localhost ~]$ sudo pacman -S zlib libjpeg-turbo freetype2
警告: zlib-1:1.2.11-3 は最新です -- 再インストール
警告: libjpeg-turbo-2.0.0-1 は最新です -- 再インストール
警告: freetype2-2.9.1-1 は最新です -- 再インストール
依存関係を解決しています...
衝突するパッケージがないか確認しています...

パッケージ (3) freetype2-2.9.1-1 libjpeg-turbo-2.0.0-1 zlib-1:1.2.11-3

合計インストール容量: 4.43 MiB
最終的なアップグレード容量: 0.00 MiB

:: インストールを行いますか? [Y/n] y


http://www.pythonware.com/products/pil/

cd Downloads/
tar xvf Imaging-1.1.7.tar.gz

/usr/binでターミナルを開きます
sudo mv python python.orig
[mak@localhost bin]$ sudo ln -s python2 python


python setup.py build_ext -i

/temp.linux-x86_64-2.7/_imagingmath.o
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now build/temp.linux-x86_64-2.7/_imagingmath.o -L/usr/local/lib -L/usr/lib -L/usr/lib -lpython2.7 -o /home/mak/Downloads/Imaging-1.1.7/PIL/_imagingmath.so
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.7.15 (default, Jun 27 2018, 13:05:28)
[GCC 8.1.1 20180531]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available

*** Warning: zlib 1.2.11 may contain a security vulnerability.
*** Consider upgrading to zlib 1.2.3 or newer.
*** See: http://www.kb.cert.org/vuls/id/238678
http://www.kb.cert.org/vuls/id/680620
http://www.gzip.org/zlib/advisory-2002-03-11.txt

--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.

To check the build, run the selftest.py script.

$ sudo python setup.py install
running install_scripts
copying build/scripts-2.7/pildriver.py -> /usr/bin
copying build/scripts-2.7/pilfont.py -> /usr/bin
copying build/scripts-2.7/pilfile.py -> /usr/bin
copying build/scripts-2.7/pilconvert.py -> /usr/bin
copying build/scripts-2.7/pilprint.py -> /usr/bin
changing mode of /usr/bin/pildriver.py to 755
changing mode of /usr/bin/pilfont.py to 755
changing mode of /usr/bin/pilfile.py to 755
changing mode of /usr/bin/pilconvert.py to 755
changing mode of /usr/bin/pilprint.py to 755
running install_egg_info
Writing /usr/lib/python2.7/site-packages/PIL/PIL-1.1.7-py2.7.egg-info
creating /usr/lib/python2.7/site-packages/PIL.pth
Imaging-1.1.7]$

Imaging-1.1.7]$ python
Python 2.7.15 (default, Jun 27 2018, 13:05:28)
[GCC 8.1.1 20180531] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Image
>>> import Tkinter
>>>
[mak@localhost Imaging-1.1.7]$ python -m Tkinter



$ python checkenv.py
----------------------------------------------------------------------
Python 2.7.15 (default, Jun 27 2018, 13:05:28)
[GCC 8.1.1 20180531]
Platform: linux2
----------------------------------------------------------------------
Python version: 2.7........... OK
PyProtocols................... missing

PyProtocols is not installed. This package is required as soon as you are
using the cgkit scene management stuff (for example, as soon as you want
to use the viewer or render tool). You can get PyProtocols at this site:
http://peak.telecommunity.com/PyProtocols.html

PyOpenGL...................... is installed
PIL........................... is installed
pygame........................ pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
is installed
PyODE......................... is installed
PySerial...................... is installed
cgkit (base).................. missing
cgkit (C++ lib)............... failed

The cgkit supportlib could not be imported. One possible reason for that
is that shared libraries (such as the b oost_python runtime or OpenGL)
could not be found.

cgkit (all)................... failed


http://peak.telecommunity.com/PyProtocols.html
http://peak.telecommunity.com/dist/
$ unzip PyProtocols-0.9.3.zip

sudo python setup.py --without-speedups install

sudo pacman -S boost boost-libs scons

scons

n file included from wrappers/py_arrayslots1.cpp:5:
wrappers/py_arrayslots1.cpp: 関数 ‘void class_ArraySlots()’ 内:
wrappers/py_slot.h:43:75: エラー: unable to find string literal operator ‘operator""sname’ with ‘const char [11]’, ‘long unsigned int’ arguments
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^~~~~~~~~~~

wrappers/py_slot.h:43:75: 備考: in definition of macro ‘ARRAYSLOT’
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^~~~~~~~~~~

wrappers/py_slot.h:43:75: エラー: unable to find string literal operator ‘operator""sname’ with ‘const char [11]’, ‘long unsigned int’ arguments
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^~~~~~~~~~~

wrappers/py_slot.h:43:75: 備考: in definition of macro ‘ARRAYSLOT’
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^~~~~~~~~~~

error: command 'gcc' failed with exit status 1


wrappers/py_geoms1.cpp: メンバ関数 ‘boost::python::api::object _VariableIterator::next()’ 内:
wrappers/py_geoms1.cpp:145:24: エラー: could not convert ‘std::make_tuple(_Elements&& ...) [with _Elements = {std::__cxx11::basic_string, std::allocator >&, const support3d::VarStorage&, const support3d::VarType&, const int&}](info.support3d::PrimVarInfo::storage, info.support3d::PrimVarInfo::type, info.support3d::PrimVarInfo::multiplicity)’ from ‘std::tuple, std::allocator >, support3d::VarStorage, support3d::VarType, int>’ to ‘boost::python::api::object’
return make_tuple(name, info.storage, info.type, info.multiplicity);
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wrappers/py_geoms1.cpp: 関数 ‘boost::python::api::object findVariable(support3d::GeomObject*, std::__cxx11::string)’ 内:
wrappers/py_geoms1.cpp:166:22: エラー: could not convert ‘std::make_tuple(_Elements&& ...) [with _Elements = {std::__cxx11::basic_string, std::allocator >&, support3d::VarStorage&, support3d::VarType&, int&}](info->support3d::PrimVarInfo::storage, info->support3d::PrimVarInfo::type, info->support3d::PrimVarInfo::multiplicity)’ from ‘std::tuple, std::allocator >, support3d::VarStorage, support3d::VarType, int>’ to ‘boost::python::api::object’
return make_tuple(name, info->storage, info->type, info->multiplicity);
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command 'gcc' failed with exit status 1


$ sudo python setup.py install


Sum of Photometric type-related color channels and ExtraSamples doesn't match SamplesPerPixel. Defining non-color channels as ExtraSamples.
  • -
  • -

python cgkit has been installed on my Zorin-OS-12.4-Core-64

Virtualboxにubuntu系のZorinOSをインストールしました。
はじめにRenderMan互換rendererのpixieをインストールしました。詳しくは前の記事に書きました。
http://rman.sakura.ne.jp/sb/log/eid528.html

以下をインストールします。
$ sudo apt install python-dev
$ sudo apt install python-opengl
$ sudo apt install python-pygame
$ sudo apt install libboost-python-dev
$ sudo apt install python-pyode
$ sudo apt install libode-dev
$ sudo apt install python-serial
$ sudo apt install python-protocols
$ sudo apt install scons

ubuntuのpackageのpython-pilはインストールしません。
64bitの環境でcgkitでのテクスチャがうまく使えないので
PIL1.1.7をダウンロードしてきます。
http://www.pythonware.com/products/pil/

以下、pil1.1.7をubuntu系でインストールするための設定です。
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib

$ sudo apt install python-tk tk8.5-dev tcl8.5-dev tk8.5 tcl8.5
ここでtkinterが動くか確認します。大文字のTになっています。
$ python -m Tkinter

pil1.1.7を解凍します。
$ cd Downloads/
$ tar xvf Imaging-1.1.7.tar.gz
$ cd Imaging-1.1.7/

setup.pyの以下の部分にpathを書き加えます。
$ nano setup.py

TCL_ROOT = "/usr/include/tcl8.5/"
JPEG_ROOT = "/usr/lib/x86_64-linux-gnu/"
ZLIB_ROOT = "/usr/lib/x86_64-linux-gnu/"
TIFF_ROOT = None
FREETYPE_ROOT = "/usr/lib/x86_64-linux-gnu/"
LCMS_ROOT = None

pil1.1.7をビルドします。

python setup.py build_ext -i

pil1.1.7をインストールします。ログを記録します。
sudo python setup.py install --record files.txt

アンインストールするときは以下を使います。
cat files.txt | xargs rm -rf

running install_scripts
copying build/scripts-2.7/pilfile.py -> /usr/local/bin
copying build/scripts-2.7/pilprint.py -> /usr/local/bin
copying build/scripts-2.7/pilfont.py -> /usr/local/bin
copying build/scripts-2.7/pildriver.py -> /usr/local/bin
copying build/scripts-2.7/pilconvert.py -> /usr/local/bin
changing mode of /usr/local/bin/pilfile.py to 775
changing mode of /usr/local/bin/pilprint.py to 775
changing mode of /usr/local/bin/pilfont.py to 755
changing mode of /usr/local/bin/pildriver.py to 775
changing mode of /usr/local/bin/pilconvert.py to 775
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/PIL/PIL-1.1.7.egg-info
creating /usr/local/lib/python2.7/dist-packages/PIL.pth
writing list of installed files to 'files.txt'

PIL1.1.7が動くか確認します。
~/Downloads/Imaging-1.1.7$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Image
>>>
ctrl+dで抜けます。

こちらでも確認します。
$ python selftest.py
--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from ./PIL
--------------------------------------------------------------------
--- PIL CORE support ok
--- TKINTER support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
*** LITTLECMS support not installed
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.

cgkitは--- ZLIB (PNG/ZIP) support okでないとテクスチャが渡せません。

cgkitを入手します。
https://sourceforge.net/projects/cgkit/files/cgkit/
以下はcgkitのインストールです。
$ cd ../
~/Downloads$ tar xvf cgkit-2.0.0-py2k.tar.gz

環境を確認します。
$ cd cgkit-2.0.0/
$ cd utilities/
$ python checkenv.py
----------------------------------------------------------------------
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609]
Platform: linux2
----------------------------------------------------------------------
Python version: 2.7........... OK
PyProtocols................... is installed
PyOpenGL...................... is installed
PIL........................... is installed
pygame........................ is installed
PyODE......................... is installed
PySerial...................... is installed
cgkit (base).................. missing
cgkit (C++ lib)............... failed

The cgkit supportlib could not be imported. One possible reason for that
is that shared libraries (such as the boost_python runtime or OpenGL)
could not be found.

cgkit (all)................... failed

cgkitだけがインストールされてないので
以下を実行します。
$ cd ../
$ cd supportlib/
$ scons
しばらく待ちます。
scons: done building targets.
$ cd ../
$ sudo python setup.py install
しばらく待ちます。
running install_scripts
copying build/scripts-2.7/postbake.py -> /usr/local/bin
copying build/scripts-2.7/seqmv.py -> /usr/local/bin
copying build/scripts-2.7/seqrm.py -> /usr/local/bin
copying build/scripts-2.7/viewer.py -> /usr/local/bin
copying build/scripts-2.7/seqcp.py -> /usr/local/bin
copying build/scripts-2.7/convert3d.py -> /usr/local/bin
copying build/scripts-2.7/info3d.py -> /usr/local/bin
copying build/scripts-2.7/seqls.py -> /usr/local/bin
copying build/scripts-2.7/render.py -> /usr/local/bin
changing mode of /usr/local/bin/postbake.py to 755
changing mode of /usr/local/bin/seqmv.py to 755
changing mode of /usr/local/bin/seqrm.py to 755
changing mode of /usr/local/bin/viewer.py to 755
changing mode of /usr/local/bin/seqcp.py to 755
changing mode of /usr/local/bin/convert3d.py to 755
changing mode of /usr/local/bin/info3d.py to 755
changing mode of /usr/local/bin/seqls.py to 755
changing mode of /usr/local/bin/render.py to 755
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/cgkit-2.0.0.egg-info
... finished setup
インストール完了です。
$ cd utilities/
mak@zorinos:~/Downloads/cgkit-2.0.0/utilities$ python checkenv.py
----------------------------------------------------------------------
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609]
Platform: linux2
----------------------------------------------------------------------
Python version: 2.7........... OK
PyProtocols................... is installed
PyOpenGL...................... is installed
PIL........................... is installed
pygame........................ is installed
PyODE......................... is installed
PySerial...................... is installed
cgkit (base).................. 2.0.0 (Nov 09 2018)
cgkit (C++ lib)............... OK
cgkit (all)................... OK

pythonで確認します。
$ python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from cgkit.all import *
>>>

cgkitサイトのtutorialかdemoを入手します。
http://cgkit.sourceforge.net/tutorials/demo1.html
http://cgkit.sourceforge.net/tutorials/demo2.html
http://cgkit.sourceforge.net/tutorials/demo3.html
http://cgkit.sourceforge.net/tutorials/renderman.html
$viewer.py demo3.py

---------------------------------------------------------
cgkitのインストール時にエラーが出る場合
以下を参考にしてください。
以下、error:
In file included from wrappers/py_arrayslots1.cpp:5:0:
wrappers/py_arrayslots1.cpp: In function ‘void class_ArraySlots()’:
wrappers/py_slot.h:43:75: error: unable to find string literal operator ‘operator""sname’ with ‘const char [11]’, ‘long unsigned int’ arguments
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^
wrappers/py_slot.h:43:75: note: in definition of macro ‘ARRAYSLOT’
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^~~~~~~~~~~
wrappers/py_slot.h:43:75: error: unable to find string literal operator ‘operator""sname’ with ‘const char [11]’, ‘long unsigned int’ arguments
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^
wrappers/py_slot.h:43:75: note: in definition of macro ‘ARRAYSLOT’
e ARRAYSLOT(sname,stype) class_<_ArraySlotIterator >("_"sname"_Iterator", init&>()) \
^~~~~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
---------------------------------------

[solved]
py_slot.h,43行目snameの両側に空白スペースを入れる "_" sname "

[solved]
py_geoms1.cpp,line:145行 and line:166行 boost::python::make_tuple に変更します。
  • -
  • -

Bodhi Linux and Pixie Renderer install under gnome boxes

Ubuntu系のLinux 64bitでPixie Rendererを動かしました。
RIBが使える唯一のRenderMan互換rendererになるかもしれません。
Dispersion.jpg
Fedora28のgnome boxesにBodhi Linux5.0 64bitをインストールしました。
ダウンロードしたのは、bodhi-5.0.0-apppack-64.iso (1.5GB)
Pixie Rendererをビルドしました。
Pixie Rendererをダウンロードしてきます。
https://sourceforge.net/projects/pixie/

解凍します。
$ tar xvf Pixie-src-2.2.6.tgz
$ cd Pixie/
$ ./configure
...
ellipsis (省略)
...
errorが出ますので、以下、いくつかインストールします。
管理者権限で、
$ sudo -i

~# apt install update

~# apt install bison
~# apt install flex
~# apt install build-essential

~# apt install libtiff-dev
~# apt install libpng-dev
~# apt install libopenexr-dev
~# apt install fluid
~# apt install libcairo2-dev libxft-dev libxinerama-dev

*****************************************
次に、以下のpatchをあてます。https://sourceforge.net/projects/pixie/のticketにあります。
ファイル名pixie-2.2.6-gcc6.patchをダウンロードします。
https://sourceforge.net/p/pixie/patches/23/
上記から入手してください。
上のパッチを解凍したPixie/src/commonに保存します。
以下を実行します。

$ cd src/common
$ patch < pixie-2.2.6-gcc6.patch
patching file global.h

パッチをあてないでmakeすると以下のようなエラーが出ます。

In file included from ../common/algebra.h:188,
from file.cpp:33:
../common/mathSpec.h: 関数 ‘void fresnel(const float*, const float*, float, float&, float&, float*, float*)’ 内:
../common/mathSpec.h:548:30: エラー: ‘max’ was not declared in this scope
const SCALAR_TYPE g = SQRT(max(t,0));
^~~
../common/mathSpec.h:548:30: 備考: suggested alternative: ‘fmax’
const SCALAR_TYPE g = SQRT(max(t,0));
^~~
fmax
../common/mathSpec.h:553:9: エラー: ‘min’ was not declared in this scope
Kr = min(Kr,1);
^~~
../common/mathSpec.h:553:9: 備考: suggested alternative: ‘sin’
Kr = min(Kr,1);
^~~
sin
In file included from ../common/algebra.h:199,
from file.cpp:33:
../common/mathSpec.h: 関数 ‘void fresnel(const double*, const double*, double, double&, double&, double*, double*)’ 内:
../common/mathSpec.h:548:30: エラー: ‘max’ was not declared in this scope
const SCALAR_TYPE g = SQRT(max(t,0));
^~~
../common/mathSpec.h:548:30: 備考: suggested alternative: ‘fmax’
const SCALAR_TYPE g = SQRT(max(t,0));
^~~
fmax
../common/mathSpec.h:553:9: エラー: ‘min’ was not declared in this scope
Kr = min(Kr,1);
^~~
../common/mathSpec.h:553:9: 備考: suggested alternative: ‘sin’
Kr = min(Kr,1);
^~~
sin
make[3]: *** [Makefile:317: file.lo] エラー 1


*************************************************
$ cd ../../ でPixieフォルダに戻ります。
$ ./configure を実行します。
------------------------------------------------
---> FLTK not found.
---> You can download it from www.fltk.org
---> show will not be built.
------------------------------------------------
Installation info:
PIXIEHOME: /opt/pixie
Documentation: /opt/pixie/doc
Shaders: /opt/pixie/shaders
RIBs: /opt/pixie/ribs
Textures: /opt/pixie/textures
Displays: /opt/pixie/displays
Procedurals: /opt/pixie/procedurals
Modules: /opt/pixie/modules
------------------------------------------------
To build Pixie:
>make
>make install
Terminus Est

FLTK not found.は無視します。他にエラーがなければいよいよmakeです。

$ make

エラーがいくつか出てきます。テキストエディタで(gzFile)を記入していきます。

In file included from rendererContext.cpp:77:0:
ribOut.h: In member function ‘void CRibOut::vout(const char*, __va_list_tag*)’:
ribOut.h:240:61: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzwrite(gzFile, voidpc, unsigned int)’
if (outputCompressed) gzwrite(outFile,scratch,l);
^
ribOut.h: In member function ‘void CRibOut::out(const char*, ...)’:
ribOut.h:261:61: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzwrite(gzFile, voidpc, unsigned int)’
if (outputCompressed) gzwrite(outFile,scratch,l);
^
rendererContext.cpp: In member function ‘virtual void CRendererContext::RiError(int, int, const char*)’:
rendererContext.cpp:4706:20: warning: format not a string literal and no format arguments [-Wformat-security]
fprintf(out,tmp);
^
Makefile:485: recipe for target 'rendererContext.lo' failed
make[4]: *** [rendererContext.lo] Error 1
make[4]: Leaving directory '/home/yokamak/Download/Pixie/src/ri'


ファイルribOut.h
240行目
if (outputCompressed) gzwrite((gzFile)outFile,scratch,l);240
261行目
if (outputCompressed) gzwrite((gzFile)outFile,scratch,l);261
(gzFile)を追記します。

$ makeします。


rib.l: In function ‘int riblex(YYSTYPE*)’:
rib.l:211:5: error: ‘riblval’ was not declared in this scope
\"[^\"]*\" { riblval->string = rstrdup(ribtext+1,CRenderer::globalMemory); riblval->string[strlen(riblval->string)-1] = '\0'; return RIB_TEXT;}
^~~~~~~
rib.l:211:5: note: suggested alternative: ‘ribval’
\"[^\"]*\" { riblval->string = rstrdup(ribtext+1,CRenderer::globalMemory); riblval->string[strlen(riblval->string)-1] = '\0'; return RIB_TEXT;}
^~~~~~~
ribval
In file included from rib.y:2835:0:
rib.l:212:44: error: ‘riblval’ was not declared in this scope
[+-]?([0-9]+|([0-9]*(\.[0-9]+)?)([eE][+-]?[0-9]+)?) { /*sscanf(ribtext,"%f",&riblval->real);*/ riblval->real = (float) atof(ribtext); return RIB_FLOAT; }
^~~~~~~
rib.l:212:44: note: suggested alternative: ‘ribval’
[+-]?([0-9]+|([0-9]*(\.[0-9]+)?)([eE][+-]?[0-9]+)?) { /*sscanf(ribtext,"%f",&riblval->real);*/ riblval->real = (float) atof(ribtext); return RIB_FLOAT; }
^~~~~~~
ribval
In file included from rib.y:2835:0:
rib.l:213:44: error: ‘riblval’ was not declared in this scope
[+-]?([0-9]+|([0-9]+(\.[0-9]*)?)([eE][+-]?[0-9]+)?) { /*sscanf(ribtext,"%f",&riblval->real);*/ riblval->real = (float) atof(ribtext); return RIB_FLOAT; }
^~~~~~~
rib.l:213:44: note: suggested alternative: ‘ribval’
[+-]?([0-9]+|([0-9]+(\.[0-9]*)?)([eE][+-]?[0-9]+)?) { /*sscanf(ribtext,"%f",&riblval->real);*/ riblval->real = (float) atof(ribtext); return RIB_FLOAT; }
^~~~~~~
ribval
In file included from rib.y:2835:0:
rib.l:216:3: error: ‘riblval’ was not declared in this scope
#\!.* { riblval->string = rstrdup(ribtext+2,CRenderer::globalMemory); return RIB_STRUCTURE_COMMENT; }
^~~~~~~
rib.l:216:3: note: suggested alternative: ‘ribval’
#\!.* { riblval->string = rstrdup(ribtext+2,CRenderer::globalMemory); return RIB_STRUCTURE_COMMENT; }
^~~~~~~
ribval
In file included from rib.y:2835:0:
rib.l:226:29: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzclose(gzFile)’
gzclose(ribin);
^
In file included from rib.y:2835:0:
rib.l:246:29: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzclose(gzFile)’
gzclose(ribin);
^
In file included from rib.y:2835:0:
lex.rib.cpp: In function ‘int yy_get_next_buffer()’:
rib.l:20:77: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzread(gzFile, voidp, unsigned int)’
YY_INPUT(buf, retval, maxlen) if ( (retval = gzread(ribin,buf,maxlen)) < 0) \
^
lex.rib.cpp:2636:3: note: in expansion of macro ‘YY_INPUT’
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
^~~~~~~~
rib.y: In function ‘void ribParse(const char*, void (*)(const char*, ...))’:
rib.y:2943:17: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzclose(gzFile)’
gzclose(ribin);
^
Makefile:485: recipe for target 'rib.lo' failed
make[4]: *** [rib.lo] Error 1

上記のエラーは、https://sourceforge.net/projects/pixie/のticketに書いてあります。

--- gentoo/media-gfx/pixie/pixie-2.2.6-r1.ebuild 2012-03-10 10:19:20.000000000 +0100
+++ myrep/media-gfx/pixie/pixie-2.2.6-r1.ebuild 2015-01-26 04:47:00.000000000 +0100
@@ -55,6 +55,9 @@
# parallelism can break the regeneration process, with resulting
# missing shaders.
rm "${S}"/shaders/*.sdr
+
+ # FIX: flex does not translate variable name in custom YY_DECL
+ sed -i -e '/define YY_DECL/ s/yylval/riblval/' src/ri/rib.l
}

src_configure() {


以下を実行します。
$ sed -i -e '/define YY_DECL/ s/yylval/riblval/' src/ri/rib.l


続けて
$ makeします。

In file included from rib.y:2835:0:
rib.l: In function ‘int riblex(YYSTYPE*)’:
rib.l:226:29: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzclose(gzFile)’
gzclose(ribin);
^
In file included from rib.y:2835:0:
rib.l:246:29: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzclose(gzFile)’
gzclose(ribin);
^
In file included from rib.y:2835:0:
lex.rib.cpp: In function ‘int yy_get_next_buffer()’:
rib.l:20:77: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzread(gzFile, voidp, unsigned int)’
YY_INPUT(buf, retval, maxlen) if ( (retval = gzread(ribin,buf,maxlen)) < 0) \
^
lex.rib.cpp:2636:3: note: in expansion of macro ‘YY_INPUT’
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
^~~~~~~~
rib.y: In function ‘void ribParse(const char*, void (*)(const char*, ...))’:
rib.y:2943:17: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzclose(gzFile)’
gzclose(ribin);
^
Makefile:485: recipe for target 'rib.lo' failed
make[4]: *** [rib.lo] Error 1
make[4]: Leaving directory '/home/yokamak/Download/Pixie/src/ri'
Makefile:328: recipe for target 'all' failed
make[3]: *** [all] Error 2


ファイルrib.l :20行目
#define YY_INPUT(buf, retval, maxlen) if ( (retval = gzread((gzFile)ribin,buf,maxlen)) < 0)

:226行目と :246行目
gzclose((gzFile)ribin);

続けて
$ makeします。

rib.y: In function ‘void ribParse(const char*, void (*)(const char*, ...))’:
rib.y:2943:17: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzclose(gzFile)’
gzclose(ribin);
^
Makefile:485: recipe for target 'rib.lo' failed
make[4]: *** [rib.lo] Error 1

ファイルrib.y
:2943行目
#ifdef HAVE_ZLIB
gzclose((gzFile)ribin);
#else

続けて
$ makeします。

ribOut.cpp: In destructor ‘virtual CRibOut::~CRibOut()’:
ribOut.cpp:165:20: error: cannot convert ‘FILE* {aka _IO_FILE*}’ to ‘gzFile {aka gzFile_s*}’ for argument ‘1’ to ‘int gzclose(gzFile)’
gzclose(outFile);
^
Makefile:485: recipe for target 'ribOut.lo' failed

ファイルribOut.cpp
:165行目
gzclose((gzFile)outFile);

続けて
$ makeします。

make[3]: Leaving directory '/home/yokamak/Download/Pixie/src/sdrinfo'
Making all in show
make[3]: Entering directory '/home/yokamak/Download/Pixie/src/show'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/yokamak/Download/Pixie/src/show'
make[3]: Entering directory '/home/yokamak/Download/Pixie/src'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/yokamak/Download/Pixie/src'
make[2]: Leaving directory '/home/yokamak/Download/Pixie/src'
Making all in doc
make[2]: Entering directory '/home/yokamak/Download/Pixie/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/yokamak/Download/Pixie/doc'
make[2]: Entering directory '/home/yokamak/Download/Pixie'
make[2]: Leaving directory '/home/yokamak/Download/Pixie'
make[1]: Leaving directory '/home/yokamak/Download/Pixie'

make完了!!!
管理者権限で、
$ sudo -i
# make install

これで/opt/pixie/にインストールされました。shaderをコンパイルしなおします。

root@bodhi:/home/yokamak/Download/Pixie# cd /opt/pixie/shaders/
root@bodhi:/opt/pixie/shaders# /opt/pixie/bin/sdrc *.sl
Compiling ambientindirect.sl
Compiling ambientlight.sl
Compiling ambientocclusion.sl
Compiling arealight.sl
Compiling constant.sl
Compiling distantlight.sl
Compiling fog.sl
Compiling glass.sl
Compiling matte.sl
Compiling metal.sl
Compiling mirror.sl
Compiling mtorDirectionalLight.sl
Compiling mtorLambert.sl
Compiling mtorPhong.sl
Compiling normdir.sl
Compiling paintedmatte.sl
Compiling paintedplastic.sl
Compiling plastic.sl
Compiling pointlight.sl
Compiling rayarea.sl
Compiling raydistant.sl
Compiling raypoint.sl
Compiling shadowarea.sl
Compiling shadowdistant.sl
Compiling shadowpoint.sl
Compiling shadowspot.sl
Compiling spotlight.sl
root@bodhi:/opt/pixie/shaders# logout (ctrl+dで)

最後にPixie RendererのPATHを編集します。
yokamak@bodhi:~/Download/Pixie$ cd ~
yokamak@bodhi:~$ nano .profile
以下を記入
export PIXIEHOME=/opt/pixie/
export PATH=$PATH:$PIXIEHOME/bin
export SHADERS=$PIXIEHOME/shaders

$ source .profileを実行。
以下のaqsis rendererのsimple.ribを実行してみます。
$ rndr -d simple.rib
##RenderMan RIB-Structure 1.0
FrameBegin 1
Display "simple.tif" "framebuffer" "rgba"
Format 640 480 -1
ShadingRate 1
Projection "perspective" "fov" [30]
FrameAspectRatio 1.33
Identity
# Default distant headlight
LightSource "distantlight" 1
# Camera transformation
Translate 0 0 5
WorldBegin
Identity
AttributeBegin
Color [1.0 0.6 0.0] # A nice orange color
Surface "plastic" "Ka" [1] "Kd" [0.5] "Ks" 1 "roughness" 0.1
TransformBegin
Rotate 90 1 0 0 # Rotate +z to +y. "Up" in default camera coordinates is +y,
Sphere 1 -1 1 360 # but the Sphere primitive has its poles on the z axis.
TransformEnd
AttributeEnd
WorldEnd
FrameEnd

simple.jpg
  • -
  • -

Linux設定メモ

2018/10/23
■Linux設定メモ

ホームディレクトリのフォルダ名を日本語から英語に変更する
$ LANG=C xdg-user-dirs-gtk-update

nautilus-open-terminal
フォルダ内右クリックで[端末の中に開く]

cannot restore segment prot after reloc permission denied
SELinuxのライブラリに対するセキュリティ属性が適切に設定されていない……lightflowPM.soなどのセキュリティ属性を変更する。
rootユーザで
chcon -c -v -R -u system_u -r object_r -t textrel_shlib_t xxx.so


バッテリー確認
$ upower -d

実行形式
$ chmod -R 755 simplescene*

フォルダ削除 一つ上の場所で
# sudo rm -rf gcc-2.95/

Virtualbox dvd-r読み書き用に元ユーザを参加させる
$ sudo gpasswd -a mac vboxusers

フォルダのコピー
$ cp -r gcc-2.95 ~/Documents/
$ sudo cp -r gcc-2.95 /usr/local

Linuxバージョン確認
$ cat /proc/version

/lib/x86_64-linux-gnu/libc.so.6

削除
sudo rpm -e VirtualBox-5.2-5.2.18_124319_fedora26-1.x86_64
インストール
sudo rpm -ivh VirtualBox-5.2-5.2.20_125813_fedora26-1.x86_64.rpm


DVD書込み
growisofs -Z /dev/cdrom -R -J /home/mac/Downloads/isodata/

ありがとうございます。
最初の書込み(R/RW共通),上書きの場合(RWのみ)
growisofs -Z /dev/dvd -R -J ファイル and/or ディレクトリ(群)

追加書込みの場合(R/RW共通)
growisofs -M /dev/dvd -R -J ファイル and/or ディレクトリ(群)

gcc
http://ftp.tsukuba.wide.ad.jp/software/gcc/

glibc確認、下記のコマンドを実行する。
ls -l /lib/libc-*

dnf -v grouplist

http://ftp.jaist.ac.jp/pub/Linux/

Macでisoイメージの作成。
ディスクユーティリティーのコマンドは以下の通り。 isoにしたいディレクトリをDIRの部分に指定する。
hdiutil makehybrid -iso -joliet -o sample.iso DIR

Fedora8 virtualbox guestaddインストール後、起動しない。
unable to load Selinux カーネルパニック 起動しない。
シングルモード起動時 selinux=0 singleで起動。
/etc/selinux/configを編集。
SELINUX=disabledに変更
再起動、guest addition toolが動きました。ありがとうございます。

ロック画面のまま、ログインウィンドウが表示されない場合は、
Ctrl + Alt + F1 でコマンドラインを表示

■共有フォルダ設定、VirtualboxのゲストOS上で
# gpasswd --add {ユーザ名} vboxsf
ユーザをvboxsfグループに追加します。

■VirtualBox共有フォルダ
ubuntu系
sudo nano /etc/modules
cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
vboxsf
--------------

ゲストOSに$mkdir <マウントポイント名>
フォルダを作る。

$sudo mount.vboxsf <設定したホストOSでの共有ファイル名> /home/<ログインに使う名前>/<マウントポイント名>

■その他
tkinter確認
$ python -m Tkinter

iv install
$ sudo apt install openimageio-tools

■論理cpu数 確認
$ grep processor /proc/cpuinfo | wc -l

##ISO ファイル(CDイメージ)を作成する方法##
ファイルやフォルダからisoファイルを作成する場合
# mkisofs -r -J -V <ラベル> -o <ディレクトリ名>
(例)# mkisofs -r -J -V "Mydata" -o imagecd.iso /home/hoge/
  • -
  • -

Lightflow C API sample cornell box

main8.cpp
#includeの両側に半角スペースが入っています。


#include < Lightflow/LfLocalSceneProxy.h >

int main()
{
LfLocalSceneProxy* s = new LfLocalSceneProxy();
LfArgList list;
LfTransform trs;

list.Reset();
list << "trace-depth" << LfInt( 6 );
list << "radiosity-samples" << LfInt( 400 );
list << "radiosity-threshold" << 0.1;
list << "radiosity-reuse-distance" << 0.25, 0.4, 0.01;
list << "photon-count" << LfInt( 300000 );
list << "photon-clustering-count" << LfInt( 2000 ) << LfInt( 100 );
s->NewInterface( "default", list );

// the "trace-depth" attribute controls the maximal number of ray-traced
// light bounces.
// the "radiosity-depth" attribute controls the maximal number of
// radiosity iterations, that is to say the number of bounces of the indirect
// illumination.
// the "radiosity-samples" attribute sets the amount of rays that are
// used to sample the light space at every surface location. Normally
// values between 200 and 500 produce good results. Note that this parameter
// is very influent on the rendering time, since light sampling is one
// of the most time consuming tasks.
// "radiosity-threshold" sets the maximal error bound in the radiosity
// estimation. A value of 0.1 means that the error is allowed to be 10%
// of the real value.
// "radiosity-reuse-distance" sets the screen, maximum and minimum distance
// from different sampling locations. This parameter is the only one that
// must be set accordingly to the scene size. The smaller these values are,
// the better the result will be, but usually a good value for the
// screen distance is from 0.2 to 0.5, while a good value for the
// maximum distance is everything greater than one fifth of the length
// of the visible surfaces.
// In this case we are modeling a room with sides 2 unities long, hence
// a value of 0.4 will prove to be good enough. The minimum distance
// should be an order of magnitude less.
// should be an order of magnitude less.
// The "photon-count" parameter controls the amount of photons that are
// spread into the scene to compute the global illumination. Obviously
// more photons means better approximations and longer times.


list.Reset();
list << "position" << LfPoint( 0, 0, 0.98 );
list << "direction" << LfVector3( 0, 0, -1 );
list << "angle" << 0.0 << PI / 2.0;
list << "radius" << 0.05;
list << "samples" << LfInt( 7 );
list << "color" << LfColor( 8, 8, 8 );
s->LightOn( s->NewLight( "soft-conic", list ) );

// We simulate an area light with a conic light that produces soft
// shadows. The spreading angle of the light is set to 90 degrees
// (PI / 2 in radians) to obtain the same light distribution of a patch
// light source. We could also put a real "patch" light, with a well
// defined surface, but the computation times would have been longer.
// Check the class documentation to see how area lights work, and how
// fake soft shadows may be obtained with the "soft" and "soft-conic" types.


list.Reset();
list << "kc" << LfColor( 3, 3, 3 );
list << "shadowing" << 0.0;
LfInt neon = s->NewMaterial( "matte", list );

list.Reset();
list << "kdr" << LfColor( 0.9, 0.9, 0.9 );
list << "ksr" << LfColor( 0.5, 0.5, 0.5 );
list << "km" << 0.07;
list << "shinyness" << 1.0;
list << "radiosity" << LfInt( 1 );
list << "caustics" << LfInt( 0 ) << LfInt( 0 );
LfInt whitewash = s->NewMaterial( "generic", list );

list.Reset();
list << "kdr" << LfColor( 0.8, 0.1, 0.1 );
list << "ksr" << LfColor( 0.5, 0.5, 0.5 );
list << "km" << 0.07;
list << "shinyness" << 1.0;
list << "radiosity" << LfInt( 1 );
list << "caustics" << LfInt( 0 ) << LfInt( 0 );
LfInt redwash = s->NewMaterial( "generic", list );

list.Reset();
list << "kdr" << LfColor( 0.2, 0.3, 0.8 );
list << "ksr" << LfColor( 0.5, 0.5, 0.5 );
list << "km" << 0.07;
list << "shinyness" << 1.0;
list << "radiosity" << LfInt( 1 );
list << "caustics" << LfInt( 0 ) << LfInt( 0 );
LfInt bluewash = s->NewMaterial( "generic", list );

list.Reset();
list << "kdr" << LfColor( 0.9, 0.9, 0.9 );
list << "ksr" << LfColor( 0.5, 0.5, 0.5 );
list << "km" << 0.07;
list << "shinyness" << 1.0;
list << "radiosity" << LfInt( 1 );
list << "caustics" << LfInt( 0 ) << LfInt( 0 );
list << "visibility" << LfInt( 1 );
LfInt trnswash = s->NewMaterial( "generic", list );

list.Reset();
list << "fresnel" << LfInt( 1 );
list << "IOR" << 9.0;
list << "kr" << LfColor( 1, 1, 1 );
list << "kt" << LfColor( 1, 1, 1 );
list << "kd" << 0.0;
list << "km" << 0.02;
list << "shinyness" << 1.0;
list << "radiosity" << LfInt( 0 );
list << "caustics" << LfInt( 2 ) << LfInt( 2 );
LfInt metal = s->NewMaterial( "physical", list );

list.Reset();
list << "fresnel" << LfInt( 1 );
list << "IOR" << 1.57;
list << "kdr" << LfColor( 0, 0, 0 );
list << "kdt" << LfColor( 0, 0, 0 );
list << "ksr" << LfColor( 1, 1, 1 ) << LfColor( 0.5, 0.8, 1 );
list << "kst" << LfColor( 1, 1, 1 ) << LfColor( 1, 0.6, 0.2 );
list << "kr" << LfColor( 1, 1, 1 );
list << "kt" << LfColor( 1, 1, 1 );
list << "km" << 0.02;
list << "shinyness" << 1.0;
list << "radiosity" << LfInt( 0 );
list << "caustics" << LfInt( 2 ) << LfInt( 2 );
LfInt glass = s->NewMaterial( "generic", list );


s->MaterialBegin( whitewash );

list.Reset();
list << "points"
<< LfVector3( -0.25, -0.25, 0.995 ) << LfVector3( 0.25, -0.25, 0.995 )
<< LfVector3( -0.25, 0.25, 0.995 ) << LfVector3( 0.25, 0.25, 0.995 );
s->AddObject( s->NewObject( "patch", list ));

list.Reset();
list << "points"
<< LfVector3( -0.25, 0.25, 0.99 ) << LfVector3( 0.25, 0.25, 0.99 )
<< LfVector3( -0.25, 0.25, 1.00 ) << LfVector3( 0.25, 0.25, 1.00 );
s->AddObject( s->NewObject( "patch", list ));

list.Reset();
list << "points"
<< LfVector3( -0.25, -0.25, 0.99 ) << LfVector3( -0.25, -0.25, 1.00 )
<< LfVector3( 0.25, -0.25, 0.99 ) << LfVector3( 0.25, -0.25, 1.00 );
s->AddObject( s->NewObject( "patch", list ));

list.Reset();
list << "points"
<< LfVector3( 0.25, -0.25, 0.99 ) << LfVector3( 0.25, -0.25, 1.00 )
<< LfVector3( 0.25, 0.25, 0.99 ) << LfVector3( 0.25, 0.25, 1.00 );
s->AddObject( s->NewObject( "patch", list ));

list.Reset();
list << "points"
<< LfVector3( -0.25, -0.25, 0.99 ) << LfVector3( -0.25, 0.25,
0.99 )
<< LfVector3( -0.25, -0.25, 1.00 ) << LfVector3( -0.25, 0.25, 1.00 );
s->AddObject( s->NewObject( "patch", list ));

s->MaterialEnd();

s->MaterialBegin( neon );

list.Reset();
list << "points"
<< LfVector3( -0.25, -0.25, 0.99 ) << LfVector3( 0.25, -0.25, 0.99 )
<< LfVector3( -0.25, 0.25, 0.99 ) << LfVector3( 0.25, 0.25, 0.99 );
s->AddObject( s->NewObject( "patch", list ));

s->MaterialEnd();

s->MaterialBegin( trnswash );

list.Reset();
list << "points"
<< LfVector3( -1, -1, -1 ) << LfVector3( 1, -1, -1 )
<< LfVector3( -1, -1, 1 ) << LfVector3( 1, -1, 1 );
s->AddObject( s->NewObject( "patch", list ));

s->MaterialEnd();

s->MaterialBegin( whitewash );

list.Reset();
list << "points"
<< LfVector3( -1, -1, -1 ) << LfVector3( -1, 1, -1 )
<< LfVector3( 1, -1, -1 ) << LfVector3( 1, 1, -1 );
s->AddObject( s->NewObject( "patch", list ));

list.Reset();
list << "points"
<< LfVector3( -1, -1, 1 ) << LfVector3( 1, -1, 1 )
<< LfVector3( -1, 1, 1 ) << LfVector3( 1, 1, 1 );
s->AddObject( s->NewObject( "patch", list ));

list.Reset();
list << "points"
<< LfVector3( -1, 1, -1 ) << LfVector3( -1, 1, 1 )
<< LfVector3( 1, 1, -1 ) << LfVector3( 1, 1, 1 );
s->AddObject( s->NewObject( "patch", list ));

s->MaterialEnd();

s->MaterialBegin( redwash );

list.Reset();
list << "points"
<< LfVector3( -1, -1, -1 ) << LfVector3( -1, -1, 1 )
<< LfVector3( -1, 1, -1 ) << LfVector3( -1, 1, 1 );
s->AddObject( s->NewObject( "patch", list ));

s->MaterialEnd();

s->MaterialBegin( bluewash );

list.Reset();
list << "points"
<< LfVector3( 1, -1, -1 ) << LfVector3( 1, 1, -1 )
<< LfVector3( 1, -1, 1 ) << LfVector3( 1, 1, 1 );
s->AddObject( s->NewObject( "patch", list ));

s->MaterialEnd();


s->MaterialBegin( glass );

s->TransformBegin( trs.Translation( LfVector3( -0.45, 0, -0.1 ) ) );

list.Reset();
list << "radius" << 0.35;
s->AddObject( s->NewObject( "sphere", list ) );

s->TransformEnd();

s->MaterialEnd();


s->MaterialBegin( metal );

s->TransformBegin( trs.Translation( LfVector3( 0.45, 0.4, -0.65 ) )
);

list.Reset();
list << "radius" << 0.35;
s->AddObject( s->NewObject( "sphere", list ) );

s->TransformEnd();

s->MaterialEnd();


list.Reset();
list << "file" << "cornell.tga";
LfInt saver = s->NewImager( "tga-saver", list );

s->ImagerBegin( saver );

list.Reset();
list << "eye" << LfPoint( 0, -2.99, 0 );
list << "aim" << LfPoint( 0, 0, 0 );
LfInt camera = s->NewCamera( "pinhole", list );

s->ImagerEnd();

s->Render( camera, 300, 300 );

delete s;
}


$ /usr/local/gcc-2.95/bin/g++ -I ./include -lLightflow main8.cpp -o simplescene8
$ ./simplescene8
$ convert cornell.tga cornell.jpg
$ eog cornell.jpg
cornell.jpg
  • -
  • -

Lightflow C API sample ocean

main6.cpp
#includeの両側に半角スペースが入っています。


#include < Lightflow/LfLocalSceneProxy.h >
int main()
{
LfLocalSceneProxy* s = new LfLocalSceneProxy();
LfArgList list;
LfTransform trs;

// Specify some rendering settings. These values are used by
// all the built-in types, so they are grouped under a unique
// interface, named "default".
list.Reset();
list << "trace-depth" << LfInt( 5 );
list << "lighting-depth" << LfInt( 3 );
s->NewInterface( "default", list );

// Make a bright, bright light to model the sun.
list.Reset();
list << "position" << LfPoint( 0, 900, 100 );
list << "color" << LfColor( 60000.0, 60000.0, 60000.0 );
s->LightOn( s->NewLight( "point", list ) );


// Model the water waves with a fractal pattern.
s->TransformBegin( trs.Scaling( LfVector3( 10, 5, 5 ) ) );

list.Reset();
list << "basis" << "sin";
list << "scale" << 2.0;
list << "depth" << 0.1;
list << "turbulence.distortion" << 1.0;
list << "turbulence.omega" << 0.1 << 0.3;
list << "turbulence.lambda" << 2.0;
list << "turbulence.octaves" << LfInt( 5 );
LfInt waterbumps = s->NewPattern( "multifractal", list );

// the "basis" value describes the fractal basis, that here is set to
// "sin", as waves have a sinusoidal origin.
// "scale" represents the width of the waves. This factor is then
// multiplied by the scaling transform we put before.
// "depth" represents the depth of the waves, when used to displace a
// surface.
// the "turbulence." keywords are turbulence parameters, that are
// explained in the "multifractal" documentation.

s->TransformEnd();

// Model water with a material.
list.Reset();
list << "fresnel" << LfInt( 1 ) << LfFloat(0.3) << LfFloat(0.0);
list << "IOR" << 1.33;
list << "kr" << LfColor( 1, 1, 1 );
list << "kt" << LfColor( 1, 1, 1 );
list << "kd" << 0.0;
list << "km" << 0.03;
list << "shinyness" << 0.5;
list << "displacement" << waterbumps;
LfInt water = s->NewMaterial( "physical", list );

// the choosed type is "physical", because this provides physical
// parameters, very good to model liquids, glasses and metals.
// note the use of the waterbumps pattern as a displacement.


// Model the ocean fundals in a similar way.
list.Reset();
list << "basis" << "sin";
list << "scale" << 10.0;
list << "depth" << 0.5;
list << "turbulence.distortion" << 1.0;
list << "turbulence.omega" << 0.1 << 0.3;
list << "turbulence.lambda" << 2.0;
list << "turbulence.octaves" << LfInt( 5 );
LfInt earthbumps = s->NewPattern( "multifractal", list );

list.Reset();
list << "kr" << LfColor( 0.8, 0.75, 0.7 );
list << "displacement" << earthbumps;
LfInt earth = s->NewMaterial( "diffuse", list );


// Here starts the sky.
// It contains a lot of volumetric clouds, especially at the horizon,
// so it is a bit complex.

// Volumetric clouds are modeled with an interior and a pattern that modulates its density.
s->TransformBegin( trs.Scaling( LfVector3( 100, 100, 100 ) ) );
s->TransformBegin( trs.Translation( LfVector3( 0, 0, -0.5 ) ) );

list.Reset();
list << "value"
<< 0.0 << 1.0 << 1.0
<< 0.3 << 0.0 << 0.0;
list << "scale" << 1.0;
list << "turbulence.distortion" << 1.0;
list << "turbulence.omega" << 0.5 << 0.8;
list << "turbulence.lambda" << 2.0;
list << "turbulence.octaves" << LfInt( 3 );
LfInt cloudpattern = s->NewPattern( "multifractal", list );

// Make the output distribution go from 1 to 0.1 to model clouds.

s->TransformEnd();
s->TransformEnd();

list.Reset();
list << "kr" << LfColor( 2.0, 0.8, 0.4 );
list << "kaf" << LfColor( 0.6, 0.8, 0.4 ) * 0.035;
list << "density" << 1.0;
list << "density" << cloudpattern;
list << "sampling" << 0.07;
list << "shadow-caching" << LfPoint( -1000, -1000, -1 ) << LfPoint(1000, 1000, 100 );
list << "density-caching" << LfInt( 2048 ) << LfPoint( -1000, -1000, -1 ) << LfPoint( 1000, 1000, 100 );
list << "density-caching" << LfInt( 2048 ) << LfPoint( -1.2, -1.2, -1.2 ) << LfPoint( 1.2, 1.2, 1.2 );
LfInt cloudinterior = s->NewInterior( "cloud", list );

// Note that our scene will have a radius of 1000 unities, and our
// camera would be at its center, so with a sampling factor of 0.07 we
// allow 70 samples per ray: an enormous quantity! This will make our
// scene render slowly, but the caches will give a help. Obviously if
// you remove these volumetric clouds the rendering will be much faster.
// Here we don't care about speed however, since we want only to
// produce a single, astonishing image...


// Now model the fundal, a blue sky made of flat clouds that will be
// wrapped on a sphere.

list.Reset();
list << "color"
<< 0.2 << LfColor( 0.8, 0.9, 1.0 ) << LfColor( 0.8, 0.9, 1.0 )
<< 1.0 << LfColor( 0.2, 0.4, 0.9 ) << LfColor( 0.2, 0.4, 0.9 );
LfInt skypattern1 = s->NewPattern( "linear-v", list );

s->TransformBegin( trs.Scaling( LfVector3(80, 80, 10) ) );

list.Reset();
list << "color"
<< 0.2 << LfColor( 0.2, 0.4, 0.9 ) << LfColor( 0.2, 0.4, 0.9 )
<< 1.0 << LfColor( 0.2, 0.3, 0.7 ) << LfColor( 0.2, 0.3, 0.7 );
list << "scale" << 1.1;
list << "turbulence.distortion" << 1.0;
list << "turbulence.omega" << 0.5 << 0.8;
LfInt skypattern2 = s->NewPattern( "multifractal", list );

s->TransformEnd();

list.Reset();
list << "pattern" << skypattern1;
list << "gradient"
<< 0.3 << skypattern1 << skypattern1
<< 1.0 << skypattern2 << skypattern2;
LfInt skypattern = s->NewPattern( "blend", list );

// Note that we actually created two patterns, and we merged them
// together with a "blend".
// The first pattern is a linear gradient that will span the V
// direction of the parametric surface we will attach it to.
// In this case we will use it on a sphere, where the V direction is
// the one which connects the north and south poles (that is to say a
// line of constant U and varying V is a meridian).
// This gradient associates a color to each parallel of the sphere,
// going from bright blue near the horizon to dark blue near the
// azimuth.
// The second pattern is again a "multifractal", which we use to model
// very distant clouds. Note that we stretch it with a scaling, so that
// the clouds will look wide and thin.
// The "blend" pattern finally blends the two. It uses the pattern
// specified with "pattern" to mix more patterns. In particular it
// defines a pattern-gradient that smoothly interpolates between
// different patterns. In this case we use the linear pattern both to
// model the distribution of the gradient and to model the gradient
// itself.
// The numeric value of the linear pattern has not been specified
// (with a value-gradient), and so it goes from 0 to 1, as default.
// Thus the "blend" will make a transition that goes from a clear
// and bright sky near the horizon (at the V value of 0.3) to a cloudy
// sky near the azimuth (at the V value of 1.0).

// Create the sky material.
s->InteriorBegin( cloudinterior );

list.Reset();
list << "kc" << LfColor(1.0, 1.0, 1.0);
list << "kc" << skypattern;
list << "shadowing" << LfFloat(0.0);
LfInt sky = s->NewMaterial( "matte", list );

s->InteriorEnd();

// "matte" is a material made to create matte objects, that are not
// shaded by light, but that emit a uniform color. In this case this
// color is first set to white (1, 1, 1) and then scaled by the skypattern.
// The result will be the skypattern itself.


// Create a water disc.
s->MaterialBegin( water );

list.Reset();
list << "radius" << 1000.0;
s->AddObject( s->NewObject( "disc", list ));

s->MaterialEnd();


// Create an under-water disc made of earth.
s->TransformBegin( trs.Translation( LfVector3( 0, 0, -10 ) ) );

s->MaterialBegin( earth );

list.Reset();
list << "radius" << 1000.0;
s->AddObject( s->NewObject( "disc", list ));

s->MaterialEnd();

s->TransformEnd();


// Create the sky sphere.
s->TransformBegin( trs.Scaling( LfVector3( 1, 1, 0.1 ) ) );

s->MaterialBegin( sky );

list.Reset();
list << "radius" << 1000.0;
s->AddObject( s->NewObject( "sphere", list ));

s->MaterialEnd();

s->TransformEnd();


list.Reset();
list << "file" << "ocean.tga";
LfInt saver = s->NewImager( "tga-saver", list );

s->ImagerBegin( saver );

list.Reset();
list << "eye" << LfPoint( 0, -8, 4 );
list << "aim" << LfPoint( 0, 0, 4 );
list << "aa-samples" << LfInt( 2 ) << LfInt( 5 );
LfInt camera = s->NewCamera( "pinhole", list );

s->ImagerEnd();

s->Render( camera, 400, 300 );

delete s;
}

$ /usr/local/gcc-2.95/bin/g++ -I ./include -lLightflow main6.cpp -o simplescene6
$ ./simplescene6
$ convert ocean.tga ocean.jpg
$ eog ocean.jpg
ocean.jpg
  • -
  • -

<< 3/56 >>