You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by bu...@apache.org on 2020/03/04 15:36:42 UTC

[uima-uimacpp] branch rc/uimacpp-3.0.0 updated: [UIMA-6190] Run the JNI test on OSX

This is an automated email from the ASF dual-hosted git repository.

burn pushed a commit to branch rc/uimacpp-3.0.0
in repository https://gitbox.apache.org/repos/asf/uima-uimacpp.git


The following commit(s) were added to refs/heads/rc/uimacpp-3.0.0 by this push:
     new d653031  [UIMA-6190] Run the JNI test on OSX
d653031 is described below

commit d6530313c5d599655cb57889ededa7267803ac02
Author: Burn Lewis <bu...@gmail.com>
AuthorDate: Wed Mar 4 10:35:01 2020 -0500

    [UIMA-6190] Run the JNI test on OSX
---
 src/test/fvt.sh      |  9 +++++++--
 src/test/fvtTestfile |  2 +-
 uimacpp-make-sdk.sh  | 42 +++++++++++++++++++-----------------------
 3 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/src/test/fvt.sh b/src/test/fvt.sh
index 88315b5..a81e9cb 100755
--- a/src/test/fvt.sh
+++ b/src/test/fvt.sh
@@ -48,15 +48,20 @@ export RM=rm
 
 if [ $UIMA_HOME ]
 then
-    export UIMACPPTEST_JNI="java "-Duima.home=$UIMA_HOME" "-Duima.datapath=$UIMA_DATAPATH" "-Djava.util.logging.config.file=$UIMA_HOME/config/Logger.properties" "-Duima.use_jul_as_default_uima_logger" -DNoOp -DUimaBootstrapSuppressClassPathDisplay -Dorg.apache.uima.jarpath="$UIMA_HOME/lib" -jar "$UIMA_HOME/lib/uimaj-bootstrap.jar" org.apache.uima.tools.RunAE data/descriptors/javaaggregate.xml data/segmenterinput"
+    export UIMACPPTEST_JNI="java -Duima.home=$UIMA_HOME -Duima.datapath=$UIMA_DATAPATH -Djava.util.logging.config.file=$UIMA_HOME/config/Logger.properties -Duima.use_jul_as_default_uima_logger -DNoOp -DUimaBootstrapSuppressClassPathDisplay -Dorg.apache.uima.jarpath=$UIMA_HOME/lib -jar $UIMA_HOME/lib/uimaj-bootstrap.jar org.apache.uima.tools.RunAE data/descriptors/javaaggregate.xml data/segmenterinput"
 else
   export UIMACPPTEST_JNI="@echo UIMA_HOME is not set. JNI test was not run."
 fi
 
+# On Mac OSX if the installed java is protected the DYLD_LIBRARY_PATH environment variable is not
+# passed to the JNI test and the UIMA libraries will fail to load.
+# Instead use a private java or disable SIP.
 UNAME=`uname -s`
 if [ "$UNAME" = "Darwin" ]
 then
-   export UIMACPPTEST_JNI="@echo JNI not working on DARWIN yet. JNI test was not run."
+	echo "***"
+	echo "*** WARNING *** The JNI test may fail if using an installed java and System Integrity Protection is enabled"
+	echo "***"
 fi
 
 make -f fvtTestfile $1
diff --git a/src/test/fvtTestfile b/src/test/fvtTestfile
index f100190..a188719 100644
--- a/src/test/fvtTestfile
+++ b/src/test/fvtTestfile
@@ -62,4 +62,4 @@ xmideserialization:
 	$(RM) oots2.xmi
 
 jni:
-	$(UIMACPPTEST_JNI)
+	$(DEBUG_FVT)$(UIMACPPTEST_JNI)
diff --git a/uimacpp-make-sdk.sh b/uimacpp-make-sdk.sh
index e2579a4..51538e6 100755
--- a/uimacpp-make-sdk.sh
+++ b/uimacpp-make-sdk.sh
@@ -43,14 +43,14 @@ mkdir -p "$TARGET"
 
 # Linux / Mac OSX customizations
 # If ActiveMQ falsely believes OpenSSL is installed use: AMQARG=--disable-ssl
-# or if it is installed elsewhere use (e.g. on OSX):     AMQARG=--with-openssl=/usr/local/opt/openssl
+# On Mac OpenSSL is usually installed in /usr/local/opt/openssl
 
 UNAME=`uname -s`
 if [ "$UNAME" = "Darwin" ]; then
 	LIBEXT=dylib
 	INCDIR=darwin
 	ICUARG=MacOSX
-	AMQARG=
+	AMQARG=--with-openssl=/usr/local/opt/openssl
 else
 	LIBEXT=so
 	INCDIR=linux
@@ -143,7 +143,7 @@ if [ ! -f "${APR}.tar.gz" ]; then
 fi
 if [ ! -f "$APR/build/apr_rules.out" ]; then
     cd $APR
-	echo Building APR
+    echo Building APR
     ./configure --prefix="$PREFIX"
     make install
     cd ..
@@ -154,36 +154,32 @@ fi
 if [ -z $TESTONLY ]; then
     # Build APR-UTIL
     if [ ! -f "${APRUTIL}.tar.gz" ]; then
-	wget http://mirrors.ocf.berkeley.edu/apache/apr/${APRUTIL}.tar.gz
-	tar -xf ${APRUTIL}.tar.gz
+        wget http://mirrors.ocf.berkeley.edu/apache/apr/${APRUTIL}.tar.gz
+        tar -xf ${APRUTIL}.tar.gz
     fi
     if [ ! -f ${APRUTIL}/apu-config.out ]; then
-	cd $APRUTIL
-	echo Building APR-UTIL
-	./configure --prefix=$PREFIX --with-apr=$PREFIX/bin/apr-1-config
-	make install
-	cd ..
+        cd $APRUTIL
+        echo Building APR-UTIL
+        ./configure --prefix=$PREFIX --with-apr=$PREFIX/bin/apr-1-config
+        make install
+        cd ..
     else
-	echo "APR-UTIL previously built"
+        echo "APR-UTIL previously built"
     fi
 
     # Build ActiveMQ-C++
     if [ ! -f ${AMQCPP}-src.tar.gz ]; then
-	wget http://archive.apache.org/dist/activemq/activemq-cpp/${AMQVERSION}/${AMQCPP}-src.tar.gz
-	tar -xf ${AMQCPP}-src.tar.gz
+        wget http://archive.apache.org/dist/activemq/activemq-cpp/${AMQVERSION}/${AMQCPP}-src.tar.gz
+        tar -xf ${AMQCPP}-src.tar.gz
     fi
     if [ ! -f ${AMQCPP}/src/main/.libs/libactivemq-cpp.${LIBEXT} ]; then
-	cd $AMQCPP
-	echo Building ActiveMQ
-        if [ "$UNAME" = "Darwin" ]; then
-           LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" ./configure $AMQARG --prefix=$PREFIX --with-apr=$PREFIX/bin/apr-1-config
-        else
-           ./configure $AMQARG --prefix=$PREFIX --with-apr=$PREFIX/bin/apr-1-config
-        fi
-	make install
-	cd ..
+        cd $AMQCPP
+        echo Building ActiveMQ
+        ./configure $AMQARG --prefix=$PREFIX --with-apr=$PREFIX/bin/apr-1-config
+        make install
+        cd ..
     else
-	echo "ActiveMQ C++" previously built
+        echo "ActiveMQ C++" previously built
     fi
 fi