MantisBT - CMake
View Issue Details
0004605CMakeCMakepublic2007-03-15 11:382007-05-24 17:39
Sean McBride 
Bill Hoffman 
urgentmajoralways
closedfixed 
 
 
0004605: CMake sometimes uses JavaEmbedding.framework, but should never
Two of my VTK dashboards are failing:

http://www.vtk.org/Testing/Sites/RogueResearchi386/MacOSXTiger-i386-carbon/20070314-0300-Nightly/BuildError.html [^]
http://www.vtk.org/Testing/Sites/RogueResearchPPC/MacOSXTiger-ppc-carbon/20070314-0300-Nightly/BuildError.html [^]

Both are running 10.4.9, one is PPC one is Intel. Both are using CMake from CVS of 2007-03-15.

The problem is JavaEmbedding.framework. This framework is deprecated and basically should never be used. On a 10.4 system the framework still exists, but is ppc only:

lipo -info /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/JavaEmbedding.framework/Versions/A/JavaEmbedding

reports:

Non-fat file: /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/JavaEmbedding.framework/Versions/A/JavaEmbedding is architecture: ppc

Apple has said it will never be Intel native. Thus no intel build can ever link against it.

Now I'm not a java expert by any stretch, but my understanding (mostly thanks to David Cole and others on the VTK list) is as follows...

The bug is probably in CMake's FindJNI.cmake or FindJava.cmake. It should never be picking "-framework JavaEmbedding", but sometimes it still does.

The thing that finds it and sets it into the JAVA_AWT_INCLUDE_PATH is a search for the header file "jawt.h" -- if that header file is there, then it sets the include path variable, but it does not set JAVA_AWT_LIBRARY. So everything compiles fine, but then there's nothing to link to.

Where is the jawt.h header?

find /Developer/SDKs/MacOSX10.4u.sdk -name jawt.h

reports:

/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/JavaEmbedding.framework/Versions/A/Headers/jawt.h
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Headers/jawt.h
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Headers/jawt.h
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jawt.h

find /Developer/SDKs/MacOSX10.3.9.sdk -name jawt.h

reports:

/Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/JavaEmbedding.framework/Versions/A/Headers/jawt.h
/Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Headers/jawt.h
/Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jawt.h

So perhaps it is a simple as CMake needing to hardcode an exception to never use the one in JavaEmbedding.framework.
No tags attached.
? FindJNI.cmake (5,065) 1969-12-31 19:00
https://public.kitware.com/Bug/file/966/FindJNI.cmake
Issue History

Notes
(0007030)
David Cole   
2007-03-31 12:14   
I tried the attached patch (FindJNI.cmake) on caladan and it correctly avoids picking up "JavaEmbedding" using this patch on that PPC Mac. I'm fairly confident it will address the issue on Intel macs, too, but have not tried it... Not sure if this is the ideal way to fix this issue, but it does allow building Java wrapped VTK on the mac *by default* without making any special adjustments in ccmake or an initial cache for a script...
(0007132)
Sean McBride   
2007-04-04 12:39   
I took today's CMake code, added your patch, bootstrapped CMake, then did a build of VTK that would fail without your patch.

Now it works! This was on an Intel iMac in 10.5.

Once CMake is updated, I will update our vtk dashboards, this should get rid of _all_ of the red.
(0007134)
Bill Hoffman   
2007-04-04 13:43   
$ cvs commit -m "BUG: fix for bug 4605" FindJNI.cmake
Checking for path: /cvsroot/CMake/CMake/Modules
Unrestricted user: hoffman
/cvsroot/CMake/CMake/Modules/FindJNI.cmake,v <-- FindJNI.cmake
new revision: 1.32; previous revision: 1.31
(0007214)
Sean McBride   
2007-04-10 12:13   
I updated our 10.4 PPC and 10.4 Intel dashboards with the patched CMake, and now there is no more red in our vtk builds.

I'd say this can be closed, and am closing it. Thanks to all.