[Mobies-commit] [commit] r4221 - in UDM/trunk: . judm

endre at redhat3.isis.vanderbilt.edu endre at redhat3.isis.vanderbilt.edu
Sat Dec 28 06:38:46 CST 2013


Author: endre
Date: Sat Dec 28 06:38:46 2013
New Revision: 4221

Log:
judm build and test on MAC OS X.

Added:
   UDM/trunk/judm/Makefile.OSX
Modified:
   UDM/trunk/Makefile.OSX
   UDM/trunk/Makefile.OSX.incl
   UDM/trunk/judm/build.xml

Modified: UDM/trunk/Makefile.OSX
==============================================================================
--- UDM/trunk/Makefile.OSX	Sat Dec 28 06:38:40 2013	(r4220)
+++ UDM/trunk/Makefile.OSX	Sat Dec 28 06:38:46 2013	(r4221)
@@ -1,6 +1,6 @@
 include Makefile.OSX.incl
 
-SUBDIRS = src lib bin
+SUBDIRS = src lib bin judm
 
 all:	env	
 	@for dir in $(SUBDIRS);\
@@ -18,10 +18,13 @@
 	rm -f set-env.sh
 
 
+
 env:
 	rm -f set-env.sh
 	echo "export PCRE_LIBS="$(PCRE)"/.libs/" >>set-env.sh 
 	echo "export SWIG_LIB="$(SWIGLIB) >> set-env.sh
 	echo "export DYLD_LIBRARY_PATH="$(UDMHOME)"/lib:"$(XERCESCROOT)"/lib:"$(XALANCROOT)"/lib:"$(PCRE)"/.libs" >>set-env.sh
+	echo "export JVMD32="$(JVMD32) >>set-env.sh
+	echo "export UDM_PATH="$(UDMHOME) >>set-env.sh
 	chmod +x set-env.sh
 

Modified: UDM/trunk/Makefile.OSX.incl
==============================================================================
--- UDM/trunk/Makefile.OSX.incl	Sat Dec 28 06:38:40 2013	(r4220)
+++ UDM/trunk/Makefile.OSX.incl	Sat Dec 28 06:38:46 2013	(r4221)
@@ -1,7 +1,11 @@
 #CC=gcc
 CC=g++
 
+# ANT build tool is already on MAC OS X with XCODE
+ANT=ant
+
 #Xerces binary was available only for i386
+#Xerces source does not compile in MACOSX with --arch x86_64
 #Therefore the whole package is compiled for i386
 ARCH=i386
 #ARCH=x86_64
@@ -9,12 +13,14 @@
 BCFLAGS=-arch $(ARCH)
 
 
-#to be configured by the user
 #already on a Mac with XCode
 PYTHON=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/
 JDK_INCLUDE=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/
 
-#packages that are downloaded/installed manually 
+#################################################
+#packages that are downloaded/installed manually#
+#section to be configured by the user
+#################################################
 UDMHOME=~/trunk
 MINIZIP=~/devtools
 BOOST=~/devtools/boost_1_55_0
@@ -24,7 +30,12 @@
 PCRE=~/devtools/pcre-8.33
 XERCESCROOT=~/devtools/xerces-c_2_8_0-x86-macosx-gcc_4_0
 XALANCROOT=~/devtools/xalan-c-1.11/c
-#end of section configured by user
+#JAVA 1.6.0 is needed in order to have a JVM which is capable to load 32bit shared libraries (UdmSwig) (-d32 flag)
+#UdmSwig is a shared library compiled with i386
+JVMD32=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
+###################################
+#end of section configured by user#
+###################################
 
 SWIGLIB=$(SWIGDIR)/lib
 SWIG=$(SWIGDIR)/swig

Added: UDM/trunk/judm/Makefile.OSX
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ UDM/trunk/judm/Makefile.OSX	Sat Dec 28 06:38:46 2013	(r4221)
@@ -0,0 +1,22 @@
+include ../Makefile.OSX.incl
+
+all:	
+	rm -f build_judm.sh
+	echo "#!/bin/bash"> build_judm.sh
+	echo "source ../set-env.sh" >> build_judm.sh
+	echo $(ANT) >> build_judm.sh
+	chmod +x build_judm.sh
+	./build_judm.sh
+	
+test:
+	rm -f test_judm.sh
+	echo "#!/bin/bash"> test_judm.sh
+	echo "source ../set-env.sh" >> test_judm.sh
+	echo $(ANT) " test" >> test_judm.sh
+	chmod +x test_judm.sh
+	./test_judm.sh
+
+clean:
+	$(ANT) clean
+	rm -f build_judm.sh
+	rm -f test_judm.sh

Modified: UDM/trunk/judm/build.xml
==============================================================================
--- UDM/trunk/judm/build.xml	Sat Dec 28 06:38:40 2013	(r4220)
+++ UDM/trunk/judm/build.xml	Sat Dec 28 06:38:46 2013	(r4221)
@@ -5,6 +5,17 @@
 	<condition property="isWindows">
 		<os family="Windows" />
 	</condition>
+	
+	<condition property="isMac">
+		<os family="mac" />
+	</condition>
+
+	<condition property="isLinux">
+		<and>
+			<not><isset property="isWindows"/></not>
+			<not><isset property="isMac"/></not>
+		</and>
+	</condition>
 
 	<!-- Get the environment variables of UDM from Windows -->
 	<property environment="env" />
@@ -82,9 +93,12 @@
 	<target name="setenveclipse" if="isWindows">
 		<echo> "Windows platform" </echo>
 	</target>
-	<target name="setenvlinux" unless="isWindows">
+	<target name="setenvlinux" if="isLinux">
 		<echo> "Linux platform" </echo>
 	</target>
+	<target name="setenvmac" if="isMac">
+		<echo> "MAC OS X platform" </echo>
+	</target>
 
 	<!-- Get the environment variables of UDM from UNIX systems -->
 	<property environment="env" />
@@ -93,11 +107,22 @@
 	<property name="udm.bin.dir" location="${udm.dir}/bin" />
 	<property name="udm.etc.dir" location="${udm.src.dir}/etc" />
 	<property name="udm_3rdparty.dir" location="/usr" />
-	<property name="build.dir" location="build/build_linux" />
+	<condition property="build.dir" value="build/build_linux"><isset property="isLinux"/></condition>
+	<condition property="build.dir" value="build/build_macosx"><isset property="isMac"/></condition>
 	<property name="srcdir" location="${basedir}" />
 	<condition property="junit.dir" value="/usr/share/java/">
 		<available file="/usr/share/java/junit.jar"/>
 	</condition>
+	<condition property="jvm32d" value="${env.JVMD32}">
+		<and>
+			<available file="${env.JVMD32}"/>
+			<isset property="isMac"/>
+		</and>
+	</condition>
+
+
+
+	
 
 	<path id="compile.classpath">
 		<pathelement location="${judm.classes.dir}" />
@@ -108,7 +133,7 @@
 	</path>
 
 	<!-- Initialize directories and properties of the build -->
-	<target name="init" depends="setenveclipse, setenvlinux" description="Initialize directories.">
+	<target name="init" depends="setenveclipse, setenvlinux, setenvmac" description="Initialize directories.">
 		<tstamp />
 
 		<!-- Directory of the compilation -->
@@ -734,19 +759,60 @@
 		<echo> Test ${dspackage}... </echo>
 		<fail unless="dspackage" message="Missing parameter: dspackage" />
 
+		<!--  On Mac, we have to use a 32bit JVM because of UdmSwig being available only in 32bits mode. The path to this special java binary is expected in environment variable JVM32D  -->
+		<fail message=" Could not found 32bit Java Virtual Machine while running tests on Mac OS">
+			<condition>
+				<and>
+					<isset property="isMac"/>
+					<not> <isset property="jvm32d"/></not>
+				</and>
+			</condition>
+		</fail>
+		<!-- use a different JVM -->
+		<condition property="javacall" value="${jvm32d}">
+			<isset property="isMac"/>
+		</condition>
+		<condition property="javacall" value="java">
+				<not>
+					<isset property="isMac"/>
+				</not>
+		</condition>
+		<!--use the -d32 flag on mac and -d64 flag on other--> 
+		<condition property="javaversion" value="-d32">
+			<isset property="isMac"/>
+		</condition>
+		<condition property="javaversion" value="-d64">
+				<not>
+					<isset property="isMac"/>
+				</not>
+		</condition>
+
+		<echo> Using ${javacall} ${javaversion} for Java Virtual Machine </echo>
+
+		
+
 		<!-- on Windows, the PATH for the junit call is inherited with the assumption that scripts/VC9-env.bat was called before ant was invoked -->
+
+
 		<condition property="test.pathvar" value="UNNEEDED">
 			<isset property="isWindows"/>
 		</condition>
+
 		<property name="test.pathvar" value="PATH" />
 		<!-- Run junit tests -->
-		<junit fork="yes" dir="${build.dir}/${dspackage}">
+		<junit fork="yes" dir="${build.dir}/${dspackage}" jvm="${javacall}">
 			<!-- This is necessary for System.load("UdmSwig") to succeed -->
+			<jvmarg value="${javaversion}"/>
+			<!-- 
+			The classpath should be sufficient. 
+			This line broke the tests on Mac OS X.
+			I checked the below directories and none of them exists, at least while running ant test on Mac OSx
 			<jvmarg value="-Djava.library.path=${judm.dir}${path.separator}${judm.dir}/bin${path.separator}${udm.bin.dir}/../lib/.libs" />
+			-->
 			<jvmarg value="-Djava.util.logging.config.file=${udmswiglight.src.dir}/debug-logging.properties" />
-			<!-- We need to add the dir containing the DLLs that UdmSwig depends on
-				to the PATH rather than java.library.path.  -->
-			<env key="${test.pathvar}" path="${judm.dir}${path.separator}${judm.dir}/bin"/>
+            <!-- We need to add the dir containing the DLLs that UdmSwig depends on
+             to the PATH rather than java.library.path.  -->
+            <env key="${test.pathvar}" path="${judm.dir}${path.separator}${judm.dir}/bin"/>
 			<classpath>
 				<path refid="compile.classpath" />
 				<pathelement location="${build.dir}/${dspackage}/classes/main" />


More information about the Mobies-commit mailing list