Rendering学習日記

日々、3DCGの世界は進歩しています。勉強して理解したことをまとめていきます。RenderMan互換レンダラーやグローバル・イルミネーション。いろんなことに好奇心を持って、面白くなる。目指せShader書き!!
ありがとうございます。

cgkit2.0.0 works under Fedora28

Fedora28でcgkit2.0.0+python2.7でビルドできました。boost-develをインストール。他checkenv.py で確認する。 py_slot.h,43行目snameに空白スペースを入れる"_" sname " py_geoms1.cpp,145行166行boost::python::make_tupleにしてbuildできました。ありがとうございます。


[@localhost ~]$ pip install cgkit==2.0.0
Collecting cgkit==2.0.0
Could not find a version that satisfies the requirement cgkit==2.0.0 (from versions: )
No matching distribution found for cgkit==2.0.0

Python Computer Graphics Kit v2.0.0
https://sourceforge.net/projects/cgkit/files/cgkit/cgkit-2.0.0/cgkit-2.0.0-py2k.tar.gz/download

[@localhost ~]$ sudo pip install pygame
Collecting pygame
Installing collected packages: pygame
Successfully installed pygame-1.9.4

[@localhost ~]$ sudo pip install ode
Collecting ode
Successfully installed ode-0.2.0

[mac@localhost ~]$ sudo pip install pyserial
Collecting pyserial
Installing collected packages: pyserial
Successfully installed pyserial-3.4

http://www.pythonware.com/products/pil/
[@localhost Imaging-1.1.7]$ sudo python setup.py install
Writing /usr/lib64/python2.7/site-packages/PIL/PIL-1.1.7-py2.7.egg-info
creating /usr/lib64/python2.7/site-packages/PIL.pth

[@localhost utilities]$ python checkenv.py
----------------------------------------------------------------------
Python 2.7.15 (default, Sep 21 2018, 23:26:48)
[GCC 8.1.1 20180712 (Red Hat 8.1.1-5)]
Platform: linux2
----------------------------------------------------------------------
Python version: 2.7........... OK
PyProtocols................... is installed
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 boost_python runtime or OpenGL)
could not be found.

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

$ cd supportlib
$ # ...create & modify cpp_config.cpp if necessary...
$ scons
$ cd .. # if you were still in the supportlib directory
$ sudo python setup.py install

以下、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 にしてbuildできました。
Thank you(^.^)

$viewer.py demo3.py
out.jpg
  • -
  • -

64bit Windows10 install

とりいそぎ、メモ:
ありがとうございます。

Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\Downloads>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z


C:\Users\Downloads>pip install Pillow-3.4.2-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\pillow-3.4.2-cp27-cp27m-win_amd64.whl
Installing collected packages: Pillow
Successfully installed Pillow-3.4.2
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\Downloads>python -m pip install --upgrade pip
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Successfully uninstalled pip-8.1.1
Successfully installed pip-9.0.1

C:\Users\Downloads>pip freeze
Pillow==3.4.2

C:\Users\Downloads>pip install pygame-1.9.2b1-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\pygame-1.9.2b1-cp27-cp27m-win_amd64.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.2b1

C:\Users\sensei\Downloads>pip freeze
Pillow==3.4.2
pygame==1.9.2b1

C:\Users\Downloads>pip install PyOpenGL-3.1.1-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\pyopengl-3.1.1-cp27-cp27m-win_amd64.whl
Installing collected packages: PyOpenGL
Successfully installed PyOpenGL-3.1.1

C:\Users\Downloads>pip install ode-0.13.1-cp27-cp27m-win_amd64.whl
Processing c:\users\sensei\downloads\ode-0.13.1-cp27-cp27m-win_amd64.whl
Installing collected packages: ode
Successfully installed ode-0.13.1

C:\Users\Downloads>pip install cgkit-2.0.0-cp27-none-win_amd64.whl
Processing c:\users\sensei\downloads\cgkit-2.0.0-cp27-none-win_amd64.whl
Installing collected packages: cgkit
Successfully installed cgkit-2.0.0

C:\Users\Downloads>python -m pip install --upgrade pip


Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

>viewer.py demo1.py

>viewer.py demo3.py

>render.py -rprman demo1.py
Exporting main.rib...
1 passes...
Compiling shaders...
gldistantlight: compiled.
glmaterial: compiled.
glpointlight: compiled.
glspotlight: compiled.
spotlight3ds: compiled.
Preprocessing time: 0s
Rendering "out.tif" (frame 0)...
Rendering time: 0s

>sho out.tif
  • -
  • -

Python27とcgkit install (Windows7 32bit)

Python2.7.10をインストールするとpipもインストールされました。とても便利になりました。
pythonのモジュールはwhlが多くなってきました。

>pip install hoge****.whl

のような感じで簡単にインストールできます。

■Python2.7.10をインストールした後、
Windowsの環境変数Pathに以下を追記します。
気をつけて行います。既存のパスの最後に付けます

;C:\Python27;C:\Python27\Scripts

■ここで再起動します。

■次に、以下からダウンロードします。

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

Pillow-2.8.2-cp27-none-win32.whl
pygame-1.9.2a0-cp27-none-win32.whl
ode-0.13.1-cp27-none-win32.whl
PyOpenGL-3.1.1a1-cp27-none-win32.whl
cgkit-2.0.0-cp27-none-win32.whl

をダウンロードします。
またVpythonを使いたいならば
VPython-5.74-cp27-none-win32.whl

Microsoftから
VCForPython27.msiをダウンロードして
インストールします。

以下は、試したログです。
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

D:\Aplication>pip install Pillow-2.8.2-cp27-none-win32.whl
Processing d:\aplication\pillow-2.8.2-cp27-none-win32.whl
Installing collected packages: Pillow
Successfully installed Pillow-2.8.2

D:\Aplication>pip freeze
Pillow==2.8.2
pyglet==1.2.2
pyprocessing==0.1.3.22

D:\Aplication>pip install pygame-1.9.2a0-cp27-none-win32.whl
Processing d:\aplication\pygame-1.9.2a0-cp27-none-win32.whl
Installing collected packages: pygame
Successfully installed pygame-1.9.2a0

D:\Aplication>pip install ode-0.13.1-cp27-none-win32.whl
Processing d:\aplication\ode-0.13.1-cp27-none-win32.whl
Installing collected packages: ode
Successfully installed ode-0.13.1

D:\Aplication>pip install cgkit-2.0.0-cp27-none-win32.whl
Processing d:\aplication\cgkit-2.0.0-cp27-none-win32.whl
Installing collected packages: cgkit
Successfully installed cgkit-2.0.0

D:\Aplication>pip install PyOpenGL-3.1.1a1-cp27-none-win32.whl
Processing d:\aplication\pyopengl-3.1.1a1-cp27-none-win32.whl
Installing collected packages: PyOpenGL
Successfully installed PyOpenGL-3.1.1a1
■ここは時間かかります。しばらく待ちます。


■ここからVpythonのインストールです。
最初、エラーでインストールできませんでした。

D:\Aplication>pip install VPython-5.74-cp27-none-win32.whl
Processing d:\aplication\vpython-5.74-cp27-none-win32.whl
Collecting fonttools (from VPython==5.74)
Downloading FontTools-2.4.tar.gz (323kB)
100% |################################| 327kB 369kB/s
Collecting TTFQuery (from VPython==5.74)
Downloading TTFQuery-1.0.5.tar.gz
Collecting Polygon2 (from VPython==5.74)
Downloading Polygon2-2.0.7.zip (73kB)
100% |################################| 77kB 561kB/s
Collecting numpy (from fonttools->VPython==5.74)
Downloading numpy-1.9.2.tar.gz (4.0MB)
100% |################################| 4.0MB 79kB/s
Installing collected packages: numpy, fonttools, TTFQuery, Polygon2, VPython
Running setup.py install for numpy
Complete output from command C:\Python27\python.exe -c "import setuptools, t
okenize;__file__='c:\\windows\\temp\\pip-build-2wkd41\\numpy\\setup.py';exec(com
pile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __f
ile__, 'exec'))" install --record c:\windows\temp\pip-hob8vx-record\install-reco
rd.txt --single-version-externally-managed --compile:
non-existing path in 'numpy\\distutils': 'site.cfg'
non-existing path in 'numpy\\f2py': 'docs'
non-existing path in 'numpy\\f2py': 'f2py.1'
F2PY Version 2
blas_opt_info:
blas_mkl_info:
libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Py
thon27\\libs']
NOT AVAILABLE

openblas_info:
libraries openblas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python2
7\\libs']
NOT AVAILABLE

atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\
\libs']
NOT AVAILABLE

atlas_3_10_blas_info:
libraries satlas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\
\libs']
NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['C:\\Python27\\lib', 'C:\\
', 'C:\\Python27\\libs']
NOT AVAILABLE

atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['C:\\Python27\\lib', 'C:\\', '
C:\\Python27\\libs']
NOT AVAILABLE

blas_info:
libraries blas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\\l
ibs']
NOT AVAILABLE

blas_src_info:
NOT AVAILABLE

NOT AVAILABLE

non-existing path in 'numpy\\lib': 'benchmarks'
lapack_opt_info:
openblas_lapack_info:
libraries openblas not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python2
7\\libs']
NOT AVAILABLE

lapack_mkl_info:
mkl_info:
libraries mkl,vml,guide not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Py
thon27\\libs']
NOT AVAILABLE

NOT AVAILABLE

atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas,tatlas not found in C:\Python27\lib
libraries lapack_atlas not found in C:\Python27\lib
libraries tatlas,tatlas not found in C:\
libraries lapack_atlas not found in C:\
libraries tatlas,tatlas not found in C:\Python27\libs
libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_3_10_threads_info
NOT AVAILABLE

atlas_3_10_info:
libraries satlas,satlas not found in C:\Python27\lib
libraries lapack_atlas not found in C:\Python27\lib
libraries satlas,satlas not found in C:\
libraries lapack_atlas not found in C:\
libraries satlas,satlas not found in C:\Python27\libs
libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_3_10_info
NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in C:\Python27\lib
libraries lapack_atlas not found in C:\Python27\lib
libraries ptf77blas,ptcblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries ptf77blas,ptcblas,atlas not found in C:\Python27\libs
libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_threads_info
NOT AVAILABLE

atlas_info:
libraries f77blas,cblas,atlas not found in C:\Python27\lib
libraries lapack_atlas not found in C:\Python27\lib
libraries f77blas,cblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries f77blas,cblas,atlas not found in C:\Python27\libs
libraries lapack_atlas not found in C:\Python27\libs
numpy.distutils.system_info.atlas_info
NOT AVAILABLE

lapack_info:
libraries lapack not found in ['C:\\Python27\\lib', 'C:\\', 'C:\\Python27\
\libs']
NOT AVAILABLE

lapack_src_info:
NOT AVAILABLE

NOT AVAILABLE

running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler
options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler
options
running build_src
build_src
building py_modules sources
creating build
creating build\src.win32-2.7
creating build\src.win32-2.7\numpy
creating build\src.win32-2.7\numpy\distutils
building library "npymath" sources
No module named msvccompiler in numpy.distutils; trying from distutils
Running from numpy source directory.
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1603:
UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1612:
UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
warnings.warn(BlasNotFoundError.__doc__)
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1615:
UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
warnings.warn(BlasSrcNotFoundError.__doc__)
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1505:
UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1516:
UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
warnings.warn(LapackNotFoundError.__doc__)
c:\windows\temp\pip-build-2wkd41\numpy\numpy\distutils\system_info.py:1519:
UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
warnings.warn(LapackSrcNotFoundError.__doc__)
C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution opt
ion: 'define_macros'
warnings.warn(msg)
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat).
Get it from http://aka.ms/vcpython27

----------------------------------------
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\wi
ndows\\temp\\pip-build-2wkd41\\numpy\\setup.py';exec(compile(getattr(tokenize, '
open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install
--record c:\windows\temp\pip-hob8vx-record\install-record.txt --single-version-
externally-managed --compile" failed with error code 1 in c:\windows\temp\pip-bu
ild-2wkd41\numpy

■エラーが出ました!!!
MicrosoftがPython 2.7用のコンパクトなVC++ 9.0コンパイラMicrosoft Visual C++ Compiler for Python 2.7を配布しています。
Microsoftから
VCForPython27.msiをダウンロードして
インストールします。
■ここを参考にしました。ありがとうございます。
http://www.regentechlog.com/2014/04/13/build-python-package-on-windows/




仕切りなおします。再度チャレンジ!
D:\Aplication>pip install VPython-5.74-cp27-none-win32.whl
Processing d:\aplication\vpython-5.74-cp27-none-win32.whl
Collecting fonttools (from VPython==5.74)
Using cached FontTools-2.4.tar.gz
Collecting TTFQuery (from VPython==5.74)
Using cached TTFQuery-1.0.5.tar.gz
Collecting Polygon2 (from VPython==5.74)
Using cached Polygon2-2.0.7.zip
Collecting numpy (from fonttools->VPython==5.74)
Using cached numpy-1.9.2.tar.gz
Installing collected packages: numpy, fonttools, TTFQuery, Polygon2, VPython
Running setup.py install for numpy
Running setup.py install for fonttools
Running setup.py install for TTFQuery
Running setup.py install for Polygon2
Successfully installed Polygon2-2.0.7 TTFQuery-1.0.5 VPython-5.74 fonttools nump
y-1.9.2

■内容を確認します
D:\Aplication>pip freeze
cgkit==2.0.0
FontTools==2.4
numpy==1.9.2
ode==0.13.1
Pillow==2.8.2
Polygon2==2.0.7
pygame==1.9.2a0
pyglet==1.2.2
PyOpenGL==3.1.1a1
pyprocessing==0.1.3.22
TTFQuery==1.0.5
VPython==5.74

●ありがとうございます。
  • -
  • -
<< 13/184 >>