Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 19, 2012, 02:48 AM   #1
ilantal
macrumors newbie
 
Join Date: Nov 2012
Location: Haifa, Israel
compiling VTK using Xcode

I have a Mac Air OSX 10.8.2 with Xcode 4.5.2 which I am trying to wrap VTK so I can use it within a Java program. This works on both Linux and Windows and I want to extend it to the Mac.
I use CMake 2.8.9 to Configure and Generate. I get the message that Filter ZLIB is ON which I assume is perfectly OK. Then I use Xcode on VTK.xcodeproj which tries to compile the project. I get errors like
Run custom shell script 'CMake PostBuild Rules' where CMakeScripts/vtkWrapJava_postBuildPhase.makeDebug doesn't exist.
This is indeed correct, so such file by that name exists. So how do I get around the problem? How do I tell it that I don't want a post build?

It seems like this is somehow connected to CMake, but I don't see anything obvious in CMake about a post build phase. CMake seems to have dozens of options so I could easily have one of them set incorrectly. None of them have any obvious connection to a post build phase.
Thanks,
Ilan
ilantal is offline   0 Reply With Quote
Old Dec 19, 2012, 08:31 AM   #2
wrldwzrd89
macrumors G4
 
wrldwzrd89's Avatar
 
Join Date: Jun 2003
Location: Solon, OH
You using build instructions here? If you are, the problem's almost certainly these two lines right here:
Code:
CMAKE_OSX_ARCHITECTURES:STRING=ppc;i386
export MACOSX_DEPLOYMENT_TARGET=10.4
Neither of those work properly on 10.8. Use instead:
Code:
CMAKE_OSX_ARCHITECTURES:STRING=i386
export MACOSX_DEPLOYMENT_TARGET=10.8
Also, VTK and Java 7 don't yet get along - use Java 6 instead.
__________________
iMac Intel (Rev H, 27"), 1TB HDD, 16GB RAM, 10.8.4
wrldwzrd89 is offline   0 Reply With Quote
Old Dec 31, 2012, 07:58 AM   #3
ilantal
Thread Starter
macrumors newbie
 
Join Date: Nov 2012
Location: Haifa, Israel
In the final analysis I couldn't get Xcode to compile properly the Java wrap. Instead I used ccmake and the Unix make and make install. That at least compiled properly.
As you pointed out Java 7 and VTK don't exactly live together in peace. I got a message saying it was trying to retrograde the 7 back to 6, but the retrograde failed.
What I need is some way to tell the VTK make to use 6 and not 7.
ilantal is offline   0 Reply With Quote
Old Dec 31, 2012, 08:09 AM   #4
wrldwzrd89
macrumors G4
 
wrldwzrd89's Avatar
 
Join Date: Jun 2003
Location: Solon, OH
Quote:
Originally Posted by ilantal View Post
In the final analysis I couldn't get Xcode to compile properly the Java wrap. Instead I used ccmake and the Unix make and make install. That at least compiled properly.
As you pointed out Java 7 and VTK don't exactly live together in peace. I got a message saying it was trying to retrograde the 7 back to 6, but the retrograde failed.
What I need is some way to tell the VTK make to use 6 and not 7.
Set JAVA_HOME to where Java 6 lives. That should help. To do that:

export JAVA_HOME=/path/to/JDK6/Home
__________________
iMac Intel (Rev H, 27"), 1TB HDD, 16GB RAM, 10.8.4
wrldwzrd89 is offline   1 Reply With Quote
Old Jan 1, 2013, 10:55 AM   #5
ilantal
Thread Starter
macrumors newbie
 
Join Date: Nov 2012
Location: Haifa, Israel
Thank you wrldwzrd89, that was a good idea:

Set JAVA_HOME to where Java 6 lives. That should help. To do that:
export JAVA_HOME=/path/to/JDK6/Home

The problem however is still there. I wonder if it might be because your idea set the path to java, but javac is being used to compile. Is there some sort of "export JAVAC_HOME=/path...."?
ilantal is offline   0 Reply With Quote
Old Jan 1, 2013, 11:05 AM   #6
wrldwzrd89
macrumors G4
 
wrldwzrd89's Avatar
 
Join Date: Jun 2003
Location: Solon, OH
Quote:
Originally Posted by ilantal View Post
Thank you wrldwzrd89, that was a good idea:

Set JAVA_HOME to where Java 6 lives. That should help. To do that:
export JAVA_HOME=/path/to/JDK6/Home

The problem however is still there. I wonder if it might be because your idea set the path to java, but javac is being used to compile. Is there some sort of "export JAVAC_HOME=/path...."?
Nope. JAVA_HOME refers to the home folder of the JDK - where javac lives (and java, in the JDK's private JRE).

For me, the correct JAVA_HOME value is:
Code:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
__________________
iMac Intel (Rev H, 27"), 1TB HDD, 16GB RAM, 10.8.4
wrldwzrd89 is offline   1 Reply With Quote
Old Jan 2, 2013, 12:38 AM   #7
ilantal
Thread Starter
macrumors newbie
 
Join Date: Nov 2012
Location: Haifa, Israel
Thanks for the continuing help. Obviously you are correct in that java -version and javac -version give the same result. To check which version is in fact used, I found this:

http://stackoverflow.com/questions/3...c-built-my-jar

Then I discovered that an old version of a previously compiled jar file was still hanging around. A stupid mistake, but typical. The error message about the newer Java version is now gone and I'll move on to the next stage.

BTW, the location of my jdk home is exactly the same as yours. I had found it as a result of your previous note, which was the crucial step I was missing.
ilantal is offline   0 Reply With Quote
Old Jan 2, 2013, 10:43 AM   #8
wrldwzrd89
macrumors G4
 
wrldwzrd89's Avatar
 
Join Date: Jun 2003
Location: Solon, OH
Quote:
Originally Posted by ilantal View Post
Thanks for the continuing help. Obviously you are correct in that java -version and javac -version give the same result. To check which version is in fact used, I found this:

http://stackoverflow.com/questions/3...c-built-my-jar

Then I discovered that an old version of a previously compiled jar file was still hanging around. A stupid mistake, but typical. The error message about the newer Java version is now gone and I'll move on to the next stage.

BTW, the location of my jdk home is exactly the same as yours. I had found it as a result of your previous note, which was the crucial step I was missing.
A tip for dealing with this: Many build scripts support a clean argument to nuke built classes and stale JARs. Try that.
__________________
iMac Intel (Rev H, 27"), 1TB HDD, 16GB RAM, 10.8.4
wrldwzrd89 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Compiling for Powerpc, how to? skinniezinho PowerPC Macs 12 Jun 21, 2013 04:10 AM
Moving from xcode 3.2 to xcode 4.5.2 compilation error for 'abs' macro in stdlib.h hrishidev Mac Programming 7 Jun 2, 2013 10:36 AM
compiling VTK on Mac Air ilantal OS X 10.8 Mountain Lion 3 Dec 18, 2012 07:04 AM
Cross compiling for windows using Xcode e-r-a-n Mac Programming 3 Dec 2, 2012 12:58 PM
C++ compiling issues Marcus89 Mac Programming 2 Sep 20, 2012 08:24 AM

Forum Jump

All times are GMT -5. The time now is 10:43 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC