[vtkusers] How to build Qt-4.5.x and vtk-5.3.x for Mac OS X 10.5.5 with 64-bit Cocoa support
Elvis Dowson
elvis.dowson at mac.com
Tue Oct 21 18:10:53 EDT 2008
Hi,
I just downloaded the latest version of Qt-4.5.x and managed
to get it to compile under Mac OS X 10.5.5 with 64-bit Cocoa support.
You will need Clinton's patch, to make QVTKWidget compile correctly
for 64-bit Cocoa support.
Best regards,
Elvis Dowson
Technote: How to build Qt-4.5.x and vtk-5.3.x for Mac OS X 10.5.5 with
64-bit Cocoa support
Procedure
Step 01: Download the latest version of Qt-4.5.x via rsync
The following command will list all the rsync modules available from
the TrollTech server
rsync rsync://rsync.trolltech.com/
For example, to get Qt for all platform snapshots with rsync, choose a
directory in which to install the distribution (your-qt-repository),
and run the command:
rsync -avz rsync://rsync.trolltech.com/qt-all-4.5 <your-qt-repository>
Step 02: Patch vtk sources
Patch the QVTKWidget plugin sources by running the following command
from the VTK/GUISupport/Qt/ folder
patch < qvtkcocoasupport.patch
Step 03: Configure and build Qt-4.5.x
In order to configure Qt-4.5.x for Mac OS X 10.5.5 type the following
command
./configure -platform macx-g++ -opengl -cocoa -arch x86_64 -qt-gif -
prefix /Developer/Applications/Qt-4.5.0
Type the following command to build Qt-4.5.x
make -j 2
Step 04: Update environment variables
Update your ~/.profile file with the following environment variables
# environment variables for vtk-5.x
export VTK_DIR=/Users/elvis/Tool/vtk-5.x/install/cocoa-shared/lib/
vtk-5.3
export VTK_LIB_DIR=/Users/elvis/Tool/vtk-5.x/install/cocoa-shared/lib/
vtk-5.3
export VTK_DATA_ROOT=/Users/elvis/Tool/vtk-5.x/data/
# environment variables for qt-4.4.3
export QTROOT=/Developer/Applications/Qt-4.5.0
export QT_PLUGIN_PATH=/Developer/Applications/Qt-4.5.0/plugins/designer
# the path is initially set to "/usr/bin:/bin:/usr/sbin:/sbin:/usr/
local/bin:/usr/X11/bin"
export PATH=$PATH:$QTROOT/bin
# environment variables for Tcl Tk
export TCL_LIBRARY=/usr/local/lib/libtcl8.5.dylib
export TK_LIBRARY=/usr/local/lib/libtk8.5.dylib
export TCLLIBPATH="$TCLLIBPATH \"/Users/elvis/Tool/vtk-5.x/install/
cocoa-shared/lib/vtk-5.3\" \"/Users/elvis/Tool/vtk-5.x/install/cocoa-
shared/lib/vtk-5.3/Tcl\""
# the path is initially set to "/usr/bin:/bin:/usr/sbin:/sbin:/usr/
local/bin:/usr/X11/bin"
export PATH=$PATH:$QTROOT/bin
export DYLD_LIBRARY_PATH=$VTK_LIB_DIR:$VTKDESIGNER_LIB_DIR:
$GCF_LIB_DIR:$GRASS_LIB_DIR:$DYLD_LIBRARY_PATH
Step 05: Install qt-4
Once everything is built, type the following command to install Qt-4.5.0
sudo make install
Qt will be installed into /Developer/Applications/Qt-4.5.0
Step 06: Configure and build vtk
Use the following settings for CMake
BUILD_SHARED_LIBS=ON
VTK_USE_CARBON=OFF
VTK_USE_COCOA=ON
CMAKE_INSTALL_PREFIX=/Users/elvis/Tool/vtk-5.x/install/cocoa-shared
CMAKE_OSX_ARCHITECTURES=x86_64
VTK_USE_64BIT_IDS=ON
VTK_USE_GUISUPPORT=ON
VTK_USE_QVTK=ON
DESIRED_QT_VERSION=4
Step 07: Check if the vtk libraries have been correctly built for x86
64-bit architecture
cd bin
file libvtkCommon.dylib
libvtkCommon.dylib: Mach-O 64-bit dynamically linked shared library
x86_64
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081022/249b321e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qvtkcocoasupport.patch
Type: application/octet-stream
Size: 5007 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081022/249b321e/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081022/249b321e/attachment-0001.htm>
More information about the vtkusers
mailing list