[vtkusers] Newbie: building VTK on OSX
Vivek Dwivedi
vivekd at mail630.gsfc.nasa.gov
Wed Jun 21 07:35:42 EDT 2006
Dear All:
I am still getting a java.lang.UnsatisfiedLinkError: VTKInit when
running the Cone example. I am on a MAC G5 running 10.4.6 with the
latest Java. I have a feeling that I'm almost home except for some
small detail...
Any suggestions.
Below is the procedure that i have followed.
Everything does compile fine but I still cant run the examples.
Thanks
-vivek
1) Downloaded VTK-5.0.0 from vtk.org
2) ccmake ../vtk
BUILD_EXAMPLES ON
BUILD_SHARED_LIBS ON
CMAKE_BACKWARDS_COMPATIBILITY 2.4
CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX /usr/local
CMAKE_OSX_ARCHITECTURES ppc
CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk
VTK_DATA_ROOT VTK_DATA_ROOT-NOTFOUND
VTK_USE_CARBON OFF
VTK_USE_COCOA OFF
VTK_USE_PARALLEL OFF
VTK_USE_RENDERING ON
VTK_USE_RPATH ON
VTK_USE_X ON
VTK_WRAP_JAVA ON
VTK_WRAP_PYTHON OFF
VTK_WRAP_TCL OFF
I changed the following paths:
JAVA_INCLUDE_PATH
/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Headers
JAVA_INCLUDE_PATH2
/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Headers
JAVA_RUNTIME
/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands/java
//What is the path where the file GL/gl.h can be found
OPENGL_INCLUDE_DIR:PATH=/usr/X11R6/include
//OpenGL lib for OSX
OPENGL_gl_LIBRARY:STRING=-framework OpenGL
//AGL lib for OSX
OPENGL_glu_LIBRARY:STRING=-framework AGL
Created .tcshrc
added following lines
setenv DYLD_LIBRARY_PATH /Users/vivekd/VTK/bin
setenv CLASSPATH .:/Users/vivekd/VTK/bin/vtk.jar
Compiled Cone.java
as javac Cone.java
java Cone
I still get the following error:
[darthrender:Tutorial/Step1/Java] vivekd% java -classpath .:/Users/
vivekd/VTK/bin/vtk.jar Cone
Exception in thread "main" java.lang.UnsatisfiedLinkError: VTKInit
at vtk.vtkConeSource.VTKInit(Native Method)
at vtk.vtkObject.<init>(vtkObject.java:90)
at vtk.vtkAlgorithm.<init>(vtkAlgorithm.java:238)
at vtk.vtkPolyDataAlgorithm.<init>(vtkPolyDataAlgorithm.java:
58)
at vtk.vtkConeSource.<init>(vtkConeSource.java:114)
at Cone.main(Cone.java:33)
On Jun 16, 2006, at 11:20 AM, Vivek Dwivedi wrote:
> After getting everything compiled I tried running the Cone.java
> example using the following commands;
>
> javac -classpath /Users/vivekd/VTK/java/vtk/vtk.jar Cone.java
>
> java -classpath /Users/vivekd/VTK/java/vtk/vtk.jar Cone.java
> Exception in thread "main" java.lang.NoClassDefFoundError: Cone/java
>
>
> Any suggestions
>
> Thanks
>
>
> -Vivek
>
>
>
>
> On Jun 15, 2006, at 11:33 AM, Mike Jackson wrote:
>
>> Lets start over....
>> What Apple Hardware are you running?
>> What Version of OS X are you running?
>> Have you installed anything from "Fink"
>>
>> What source did you download, CVS or from the Web Site?
>>
>> I used "http://www.vtk.org/files/release/5.0/vtk-5.0.0.tar.gz" to get
>> the source. I have attached my CmakeCache.txt file to look at.
>>
>> This builds on OS X 10.4.6 running on a MacBook Pro.
>>
>> Let us know
>> Mike Jackson
>>
>> On 6/15/06, Vivek Dwivedi <vivekd at mail630.gsfc.nasa.gov> wrote:
>>>
>>> Hi all:
>>>
>>> I used the opengl paths that was recommended but during my build
>>> i get the
>>> following error:
>>>
>>> In file included from
>>> /Users/vivekd/VTK/Rendering/vtkOpenGLPolyDataMapper.h:26,
>>> from
>>> /Users/vivekd/VTK/Rendering/vtkGraphicsFactory.cxx:28:
>>> /Users/vivekd/VTK/Rendering/vtkOpenGL.h:24:43: error:
>>> GL/gl.h: No such file or directory
>>> /Users/vivekd/VTK/Rendering/vtkOpenGLPolyDataMapper.h:87:
>>> error: 'GLenum' has not been declared
>>> /Users/vivekd/VTK/Rendering/vtkOpenGLPolyDataMapper.h:98:
>>> error: 'GLenum' has not been declared
>>> /Users/vivekd/VTK/Rendering/vtkOpenGLRenderWindow.h:101:
>>> error: 'GLuint' has not been declared
>>> make[2]: ***
>>> [Rendering/CMakeFiles/vtkRendering.dir/vtkGraphicsFactory.o]
>>> Error 1
>>> make[1]: *** [Rendering/CMakeFiles/vtkRendering.dir/all]
>>> Error 2
>>>
>>>
>>> any suggestions would be great
>>>
>>>
>>> Thanks,
>>>
>>> -Vivek
>>>
>>>
>>>
>>>
>>>
>>> On Jun 15, 2006, at 10:19 AM, Glen Lehmann wrote:
>>> Hi Vivek,
>>>
>>> These paths are for the Carbon and Cocoa builds. I haven't
>>> looked at X11 on
>>> the Mac for a long, long while now and I don't recall if X11 is
>>> built
>>> against the framework OpenGL libraries or those found in /usr/lib/
>>> X11R6
>>> (can't check right now, I'm booted up in windows).
>>>
>>> My guess is that the X11 libraries you build VTK against will
>>> depend on what
>>> version of OS X you're running.
>>>
>>> Cheers,
>>>
>>> Glen
>>>
>>> On 15/06/06, Vivek Dwivedi <vivekd at mail630.gsfc.nasa.gov> wrote:
>>> >
>>> >
>>> > Hi all:
>>> >
>>> >
>>> > Are these paths for the cocoa build or for the X11 build?
>>> >
>>> >
>>> >
>>> > -Vivek
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > On Jun 13, 2006, at 8:02 AM, Glen Lehmann wrote:
>>> >
>>> >
>>> > Hi Greg,
>>> >
>>> >
>>> > What version of VTK are you trying to build?
>>> >
>>> >
>>> > You'll need to cvs check out either the main branch or the VTK-5-0
>>> > branch. I don't reccommend using the .zip/.gz downloads.
>>> >
>>> >
>>> > I've never seen CMake have a problem finding the OpenGl paths
>>> on a Mac
>>> > before. In your CMakeCache.txt the should be set to:
>>> >
>>> >
>>> > //Include for OpenGL on OSX
>>> >
>>> OPENGL_INCLUDE_DIR:PATH=/System/Library/Frameworks/OpenGL.framework
>>> >
>>> >
>>> > //OpenGL lib for OSX
>>> >
>>> OPENGL_gl_LIBRARY:FILEPATH=/System/Library/Frameworks/
>>> OpenGL.framework
>>> >
>>> >
>>> > //AGL lib for OSX
>>> >
>>> OPENGL_glu_LIBRARY:FILEPATH=/System/Library/Frameworks/AGL.framework
>>> >
>>> >
>>>
>>>
>>>
>>> _______________________________________________
>>> This is the private VTK discussion list.
>>> Please keep messages on-topic. Check the FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>>>
>>
>>
>> --
>> Mike Jackson
>> imikejackson _at_ gee-mail dot com
>> <CMakeCache.txt>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060621/4d1c311f/attachment.htm>
More information about the vtkusers
mailing list