Skip to content
This repository was archived by the owner on Sep 29, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions vtk/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
mkdir build
cd build

set PYLIB=python27.lib
REM Remove dot from PY_VER for use in library name
set MY_PY_VER=%PY_VER:.=%
set PYLIB=python%MY_PY_VER%.lib

cmake .. -G "NMake Makefiles" ^
-Wno-dev ^
Expand All @@ -22,7 +24,8 @@ cmake .. -G "NMake Makefiles" ^
-DPYTHON_INCLUDE_PATH=%PREFIX%\\include ^
-DPYTHON_LIBRARY=%PREFIX%\\libs\\%PYLIB% ^
-DVTK_INSTALL_PYTHON_MODULE_DIR=%PREFIX%\\Lib\\site-packages ^
-DModule_vtkRenderingMatplotlib=ON
-DModule_vtkRenderingMatplotlib=ON ^
-DVTK_PYTHON_VERSION=%PY_VER:~0,1%

cmake --build . --target INSTALL --config Release
if errorlevel 1 exit 1
33 changes: 20 additions & 13 deletions vtk/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ mkdir build
cd build

if [ `uname` == Linux ]; then
CC=gcc44
CXX=g++44
PY_LIB="libpython${PY_VER}.so"
# Note: VTK 7 requires gcc >= 4.2
CC=gcc
CXX=g++
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave here gcc44 and g++44. Those are the versions we're using right now in centos5.


# use globs to take into account all possible suffixes: m, u, d
PY_LIB=`ls "${PREFIX}/lib/libpython${PY_VER}"*.so | head -n 1`
PY_INC=`ls -d "${PREFIX}/include/python${PY_VER}"* | head -n 1`

cmake .. \
-DCMAKE_C_COMPILER=$CC \
Expand All @@ -21,26 +25,27 @@ if [ `uname` == Linux ]; then
-DBUILD_SHARED_LIBS=ON \
-DVTK_WRAP_PYTHON=ON \
-DPYTHON_EXECUTABLE=${PYTHON} \
-DPYTHON_INCLUDE_PATH=${PREFIX}/include/python${PY_VER} \
-DPYTHON_LIBRARY=${PREFIX}/lib/${PY_LIB} \
-DPYTHON_INCLUDE_PATH=${PY_INC} \
-DPYTHON_LIBRARY=${PY_LIB} \
-DVTK_INSTALL_PYTHON_MODULE_DIR=${SP_DIR} \
-DModule_vtkRenderingMatplotlib=ON \
-DVTK_USE_X=ON
-DVTK_USE_X=ON \
-DVTK_PYTHON_VERSION=${PY_VER:0:1}
fi

if [ `uname` == Darwin ]; then
CC=cc
CXX=c++
PY_LIB="libpython${PY_VER}.dylib"
SDK_PATH="/Developer/SDKs/MacOSX10.6.sdk"

# use globs to take into account various possble suffixes: m, u, d
PY_LIB=`ls ${PREFIX}/lib/libpython${PY_VER}*.dylib | head -n 1`
PY_INC=`ls -d ${PREFIX}/include/python${PY_VER}* | head -n 1`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this option?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the following warning during the build

CMake Warning:
  Manually-specified variables were not used by the project:

    VTK_USE_TK

There did seem to still be places in the VTK 7 source code that check VTK_USE_TK, though, so I will go ahead and put it back in.

It looks like the VTK_USE_CARBON flag can safely be removed as Carbon support was removed from VTK7.


cmake .. \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
-DVTK_REQUIRED_OBJCXX_FLAGS='' \
-DVTK_USE_CARBON=OFF \
-DVTK_USE_TK=OFF \
-DIOKit:FILEPATH=${SDK_PATH}/System/Library/Frameworks/IOKit.framework \
-DVTK_USE_COCOA=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
Expand All @@ -52,11 +57,13 @@ if [ `uname` == Darwin ]; then
-DBUILD_SHARED_LIBS=ON \
-DVTK_WRAP_PYTHON=ON \
-DPYTHON_EXECUTABLE=${PYTHON} \
-DPYTHON_INCLUDE_PATH=${PREFIX}/include/python${PY_VER} \
-DPYTHON_LIBRARY=${PREFIX}/lib/${PY_LIB} \
-DPYTHON_INCLUDE_PATH=${PY_INC} \
-DPYTHON_LIBRARY=${PY_LIB} \
-DVTK_INSTALL_PYTHON_MODULE_DIR=${SP_DIR} \
-DModule_vtkRenderingMatplotlib=ON \
-DVTK_USE_X=OFF
-DVTK_USE_X=OFF \
-DVTK_PYTHON_VERSION=${PY_VER:0:1}

fi

make -j${CPU_COUNT}
Expand Down
6 changes: 3 additions & 3 deletions vtk/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package:
name: vtk
version: 6.3.0
version: 7.0.0

source:
url: http://www.vtk.org/files/release/6.3/VTK-6.3.0.tar.gz
fn: vtk-6.3.0.tar.gz
url: http://www.vtk.org/files/release/7.0/VTK-7.0.0.tar.gz
fn: vtk-v7.0.0.tar.gz
patches:
- dlls.patch [win]
- apple.patch [osx]
Expand Down
18 changes: 9 additions & 9 deletions vtk/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

# This simple example shows how to do basic rendering and pipeline
# creation.

import vtk
# The colors module defines various useful colors.
from vtk.util.colors import tomato

# This creates a polygonal cylinder model with eight circumferential
# facets.
cylinder = vtk.vtkCylinderSource()
cylinder.SetResolution(8)

# The mapper is responsible for pushing the geometry into the graphics
# library. It may also do color mapping, if scalars or other
# attributes are defined.
cylinderMapper = vtk.vtkPolyDataMapper()
cylinderMapper.SetInputConnection(cylinder.GetOutputPort())

# The actor is a grouping mechanism: besides the geometry (mapper), it
# also has a property, transformation matrix, and/or texture map.
# Here we set its color and rotate it -22.5 degrees.
Expand All @@ -26,7 +26,7 @@
cylinderActor.GetProperty().SetColor(tomato)
cylinderActor.RotateX(30.0)
cylinderActor.RotateY(-45.0)

# Create the graphics structure. The renderer renders into the render
# window. The render window interactor captures mouse events and will
# perform appropriate camera or actor manipulation depending on the
Expand All @@ -36,21 +36,21 @@
renWin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)

# Add the actors to the renderer, set the background and size
ren.AddActor(cylinderActor)
ren.SetBackground(0.1, 0.2, 0.4)
renWin.SetSize(200, 200)

# This allows the interactor to initalize itself. It has to be
# called before an event loop.
iren.Initialize()

# We'll zoom in a little by accessing the camera and invoking a "Zoom"
# method on it.
ren.ResetCamera()
ren.GetActiveCamera().Zoom(1.5)
renWin.Render()

# Start the event loop.
iren.Start()