[vtkusers] Compiling VTK on OSX with .jnilib extensions

Michael Jackson mike.jackson at bluequartz.net
Wed Oct 27 10:34:21 EDT 2010


If you have applied Apple's latest java update there seems to be a  
problem with a symlink to the jni.h header. There are a few recent  
posts (as recent as yesterday) on this list with the solution. Maybe  
that will help you.

Here is the quote from that email:
----- david.gobbi at gmail.com Said........
Ah, reading what you said about symlinks in your email, I realized
that if people just copy files between the two directories that I
mentioned in my email, they will copy over the symlinks instead of
copying to the directory that the symlinks point to.  To be clear,
what people should do is copy

/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/ 
JavaVM.framework/Versions/CurrentJDK/Headers/*

to

/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers/

or just change CMakeCache.txt to use the SDK's include directory.

- David

___________________________________________________________
Mike Jackson                      www.bluequartz.net


On Oct 27, 2010, at 10:28 AM, Thiébault Benoît wrote:

> Hi everyone,
>
> It seems nobody has a solution for this problem... Here is a more  
> detailed explanation of the issues I face in creating an OSGi bundle  
> for VTK under OSX: http://dev.artenum.com/blog/ben/posts/osgi_vtk_and_macosx
>
> I am sure that this would be very useful to many users, as it would  
> allow them to develop Eclipse RCP applications using VTK.
>
> I tried to do change the dylib extension to jnilib extensions  
> myself, but I barely know CMake and I am sure there is a simpler way  
> (that works...) to do it.
>
> What I have done so far is first to identify what files in the build  
> directory are referring to .dylib files. For this, I used the command:
> grep -r -H ".dylib" .|awk -F':' '{print $1}'|sort|uniq|grep -v  
> "^Binary"
>
> The first file, CMakeCache.txt indicates path to system libraries,  
> so I excluded it from the list.
> I then replaced all .dylib occurrences by .jnilib extension. Yeah, I  
> know, that's very brutal... if only it could have worked :-)
> The compilation fails at 8%:
> In file included from /Users/ben/Downloads/vtk-5.6.1/buildJnilib/ 
> Common/vtkAbstractArrayJava.cxx:7:
> /Users/ben/Downloads/vtk-5.6.1/Common/vtkJavaUtil.h:20:17: error:  
> jni.h: No such file or directory
> In file included from /Users/ben/Downloads/vtk-5.6.1/buildJnilib/ 
> Common/vtkAbstractArrayJava.cxx:7:
> /Users/ben/Downloads/vtk-5.6.1/Common/vtkJavaUtil.h:24: error:  
> ‘JNIEXPORT’ does not name a type
> /Users/ben/Downloads/vtk-5.6.1/Common/vtkJavaUtil.h:26: error:  
> expected initializer before ‘void’
> /Users/ben/Downloads/vtk-5.6.1/Common/vtkJavaUtil.h:27: error:  
> expected initializer before ‘char’
> /Users/ben/Downloads/vtk-5.6.1/Common/vtkJavaUtil.h:28: error:  
> ‘JNIEXPORT’ does not name a type
> /Users/ben/Downloads/vtk-5.6.1/Common/vtkJavaUtil.h:30: error:  
> ‘JNIEXPORT’ does not name a type
> /Users/ben/Downloads/vtk-5.6.1/Common/vtkJavaUtil.h:32: error:  
> ‘JNIEXPORT’ does not name a type
> ...
>
> Can somebody help?
>
> Thank you
> Ben
>
>
> Le 19 oct. 2010 à 10:25, Thiébault Benoît a écrit :
>
>> Hi everyone,
>>
>> I'm trying to embed VTK in an OSGi bundle. I already successfully  
>> created a bundle that supports Linux and I am now concentrating on  
>> MacOSX.
>> It seems OSGi cannot deal with .dylib libraries and thus I would  
>> like to compile VTK with CMake creating .jnilib extensions.
>> Renaming the libraries is not sufficient, as their dependencies are  
>> stored with respect to the .dylib file.
>>
>> For instance:
>>> otool -L libvtkCommonJava.jnilib
>> libvtkCommonJava.jnilib:
>> 	libvtkCommonJava.5.6.dylib (compatibility version 5.6.0, current  
>> version 5.6.1)
>> 	libvtkCommon.5.6.dylib (compatibility version 5.6.0, current  
>> version 5.6.1)
>> 	libvtksys.5.6.dylib (compatibility version 5.6.0, current version  
>> 5.6.1)
>> 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current  
>> version 125.2.0)
>> 	/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current  
>> version 7.9.0)
>>
>> Can anyone point me what to do in CMake files to modify the library  
>> extensions?
>>
>> Kind regards,
>>
>> Ben
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list