You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by William Colen <co...@apache.org> on 2017/05/28 01:56:49 UTC

Building UIMA C++ from source in Ubuntu

Hi,

I managed to compile UIMA C++ from source in a Mac.

Now I am trying in Ubuntu 16.04.
It is a fresh install. I compiled all recommended dependencies manually.

I am getting issues with the configure command:

./configure --prefix=/home/ubuntu/uima-deps/libs/uima-cpp
--with-jdk=/usr/lib/jvm/java-8-openjdk-amd64/include/
--with-apr=/home/ubuntu/uima-deps/libs/apr
--with-icu=/home/ubuntu/uima-deps/libs/icu
--with-xerces=/home/ubuntu/uima-deps/libs/xerces
--with-activemq=/home/ubuntu/uima-deps/libs/activemq-cpp
--with-apr-util=/home/ubuntu/uima-deps/libs/apr-util

(...)
checking activemq/exceptions/ExceptionDefines.h usability... yes
checking activemq/exceptions/ExceptionDefines.h presence... yes
checking for activemq/exceptions/ExceptionDefines.h... yes
configure: Apache Portable Runtime (APR Util ) library configuration
checking for APR-util... yes
checking jni.h usability... no
checking jni.h presence... no
checking for jni.h... no
configure: error: Unable to find JDK Headers


I double checked the contents of /usr/lib/jvm/java-8-openjdk-amd64/include/ and
tried with the Oracle JDK as well and got the same error.

Anybody managed to compile with Java 8 on Ubuntu?

Thank you,
William

Re: Building UIMA C++ from source in Ubuntu

Posted by Roberto Carlos Toledano Gómez <rc...@gmail.com>.
I send you a script that build uimacpp in precise, trusty, xenial, It build
and install in some prefix(/usr as default) uimacpp.

Prerequitise:
                         sudo apt-get -y --force-yes install autoconf
automake libtool libapr1-dev libaprutil1-dev libxerces-c-dev libicu-dev
default-jre libactivemq-cpp-dev libc6-dev.

I have too the ubuntu development package for trusty(14.04) an
xenial(16.04) for uimacpp and activemq-cpp. If you like i can send you.

Regards

2017-06-11 11:29 GMT-04:00 William Colen <wi...@gmail.com>:

> Hi,
>
> Following Richard's recomendation I could build it after a workaround in
> configure.ac:
>
> https://github.com/apache/uima-uimacpp/blob/trunk/configure.ac#L322
>
>
> #########################################################################
> #
> # check for Java JDK
> #
>
> AC_ARG_WITH([jdk], AC_HELP_STRING([--with-jdk],
>                                       [use local JDK (uses
> /opt/IBMJava2-142/include by default)]),
>                [UIMA_JDK_INCLUDE="-I$withval $withva/linux"
>                            # added  $withva/linux
>                 JDK_TEST_INCLUDE="$UIMA_JDK_INCLUDE"],
>                     [UIMA_JDK_INCLUDE="-I/opt/IBMJava2-142/include"
>                      JDK_TEST_INCLUDE="-I/opt/IBMJava2-142/include"])
>
>
>
> I don't know enough Automake to fix it correctly.
>
> Anyway, after that the configure command passed, but now it fails in make:
>
> https://gist.github.com/wcolen/cc241c07dad938b3e340e595aac2f35d
>
>
> Thank you
> William
>
> 2017-05-28 13:35 GMT-03:00 Marshall Schor <ms...@schor.com>:
>
> > Hi William,
> >
> > On my linux system, I see the default java is the openjdk (but at version
> > 1.6).
> > It is not a JDK, but rather, a JRE, and is missing the include
> directories.
> >
> > You need have a JDK (preferably from Oracle or IBM) installed on your
> > system,
> > and Java 1.7 is the right level (not 1.8), because that allows the result
> > to be
> > run with both Java 7 and 8 :-).
> >
> > Thanks! -Marshall
> >
> >
> > On 5/27/2017 9:56 PM, William Colen wrote:
> > > Hi,
> > >
> > > I managed to compile UIMA C++ from source in a Mac.
> > >
> > > Now I am trying in Ubuntu 16.04.
> > > It is a fresh install. I compiled all recommended dependencies
> manually.
> > >
> > > I am getting issues with the configure command:
> > >
> > > ./configure --prefix=/home/ubuntu/uima-deps/libs/uima-cpp
> > > --with-jdk=/usr/lib/jvm/java-8-openjdk-amd64/include/
> > > --with-apr=/home/ubuntu/uima-deps/libs/apr
> > > --with-icu=/home/ubuntu/uima-deps/libs/icu
> > > --with-xerces=/home/ubuntu/uima-deps/libs/xerces
> > > --with-activemq=/home/ubuntu/uima-deps/libs/activemq-cpp
> > > --with-apr-util=/home/ubuntu/uima-deps/libs/apr-util
> > >
> > > (...)
> > > checking activemq/exceptions/ExceptionDefines.h usability... yes
> > > checking activemq/exceptions/ExceptionDefines.h presence... yes
> > > checking for activemq/exceptions/ExceptionDefines.h... yes
> > > configure: Apache Portable Runtime (APR Util ) library configuration
> > > checking for APR-util... yes
> > > checking jni.h usability... no
> > > checking jni.h presence... no
> > > checking for jni.h... no
> > > configure: error: Unable to find JDK Headers
> > >
> > >
> > > I double checked the contents of /usr/lib/jvm/java-8-openjdk-
> amd64/include/
> > and
> > > tried with the Oracle JDK as well and got the same error.
> > >
> > > Anybody managed to compile with Java 8 on Ubuntu?
> > >
> > > Thank you,
> > > William
> > >
> >
> >
>

Re: Building UIMA C++ from source in Ubuntu

Posted by William Colen <wi...@gmail.com>.
Hi,

Following Richard's recomendation I could build it after a workaround in
configure.ac:

https://github.com/apache/uima-uimacpp/blob/trunk/configure.ac#L322


#########################################################################
#
# check for Java JDK
#

AC_ARG_WITH([jdk], AC_HELP_STRING([--with-jdk],
                                      [use local JDK (uses
/opt/IBMJava2-142/include by default)]),
               [UIMA_JDK_INCLUDE="-I$withval $withva/linux"
                           # added  $withva/linux
                JDK_TEST_INCLUDE="$UIMA_JDK_INCLUDE"],
                    [UIMA_JDK_INCLUDE="-I/opt/IBMJava2-142/include"
                     JDK_TEST_INCLUDE="-I/opt/IBMJava2-142/include"])



I don't know enough Automake to fix it correctly.

Anyway, after that the configure command passed, but now it fails in make:

https://gist.github.com/wcolen/cc241c07dad938b3e340e595aac2f35d


Thank you
William

2017-05-28 13:35 GMT-03:00 Marshall Schor <ms...@schor.com>:

> Hi William,
>
> On my linux system, I see the default java is the openjdk (but at version
> 1.6).
> It is not a JDK, but rather, a JRE, and is missing the include directories.
>
> You need have a JDK (preferably from Oracle or IBM) installed on your
> system,
> and Java 1.7 is the right level (not 1.8), because that allows the result
> to be
> run with both Java 7 and 8 :-).
>
> Thanks! -Marshall
>
>
> On 5/27/2017 9:56 PM, William Colen wrote:
> > Hi,
> >
> > I managed to compile UIMA C++ from source in a Mac.
> >
> > Now I am trying in Ubuntu 16.04.
> > It is a fresh install. I compiled all recommended dependencies manually.
> >
> > I am getting issues with the configure command:
> >
> > ./configure --prefix=/home/ubuntu/uima-deps/libs/uima-cpp
> > --with-jdk=/usr/lib/jvm/java-8-openjdk-amd64/include/
> > --with-apr=/home/ubuntu/uima-deps/libs/apr
> > --with-icu=/home/ubuntu/uima-deps/libs/icu
> > --with-xerces=/home/ubuntu/uima-deps/libs/xerces
> > --with-activemq=/home/ubuntu/uima-deps/libs/activemq-cpp
> > --with-apr-util=/home/ubuntu/uima-deps/libs/apr-util
> >
> > (...)
> > checking activemq/exceptions/ExceptionDefines.h usability... yes
> > checking activemq/exceptions/ExceptionDefines.h presence... yes
> > checking for activemq/exceptions/ExceptionDefines.h... yes
> > configure: Apache Portable Runtime (APR Util ) library configuration
> > checking for APR-util... yes
> > checking jni.h usability... no
> > checking jni.h presence... no
> > checking for jni.h... no
> > configure: error: Unable to find JDK Headers
> >
> >
> > I double checked the contents of /usr/lib/jvm/java-8-openjdk-amd64/include/
> and
> > tried with the Oracle JDK as well and got the same error.
> >
> > Anybody managed to compile with Java 8 on Ubuntu?
> >
> > Thank you,
> > William
> >
>
>

Re: Building UIMA C++ from source in Ubuntu

Posted by Marshall Schor <ms...@schor.com>.
Hi William,

On my linux system, I see the default java is the openjdk (but at version 1.6). 
It is not a JDK, but rather, a JRE, and is missing the include directories.

You need have a JDK (preferably from Oracle or IBM) installed on your system,
and Java 1.7 is the right level (not 1.8), because that allows the result to be
run with both Java 7 and 8 :-).

Thanks! -Marshall


On 5/27/2017 9:56 PM, William Colen wrote:
> Hi,
>
> I managed to compile UIMA C++ from source in a Mac.
>
> Now I am trying in Ubuntu 16.04.
> It is a fresh install. I compiled all recommended dependencies manually.
>
> I am getting issues with the configure command:
>
> ./configure --prefix=/home/ubuntu/uima-deps/libs/uima-cpp
> --with-jdk=/usr/lib/jvm/java-8-openjdk-amd64/include/
> --with-apr=/home/ubuntu/uima-deps/libs/apr
> --with-icu=/home/ubuntu/uima-deps/libs/icu
> --with-xerces=/home/ubuntu/uima-deps/libs/xerces
> --with-activemq=/home/ubuntu/uima-deps/libs/activemq-cpp
> --with-apr-util=/home/ubuntu/uima-deps/libs/apr-util
>
> (...)
> checking activemq/exceptions/ExceptionDefines.h usability... yes
> checking activemq/exceptions/ExceptionDefines.h presence... yes
> checking for activemq/exceptions/ExceptionDefines.h... yes
> configure: Apache Portable Runtime (APR Util ) library configuration
> checking for APR-util... yes
> checking jni.h usability... no
> checking jni.h presence... no
> checking for jni.h... no
> configure: error: Unable to find JDK Headers
>
>
> I double checked the contents of /usr/lib/jvm/java-8-openjdk-amd64/include/ and
> tried with the Oracle JDK as well and got the same error.
>
> Anybody managed to compile with Java 8 on Ubuntu?
>
> Thank you,
> William
>


Re: Building UIMA C++ from source in Ubuntu

Posted by Richard Eckart de Castilho <re...@apache.org>.
Hi William,

I ran into this problem was when when I was trying to set up the Jenkins build job for UIMACPP.

I believe it was fixed by adding the CPPFLAGS as you can see below:

> #!/bin/sh
> set -e
> 
> PREFIX=`pwd`/dependencies
> TARGET=`pwd`/target
> 
> mkdir -p "$PREFIX"
> mkdir -p "$TARGET"
> 
> # Build xerces
> curl -C- -o xerces-c-3.1.4.zip http://www.apache.org/dist/xerces/c/3/sources/xerces-c-3.1.4.zip
> unzip -n xerces-c-3.1.4.zip
> cd xerces-c-3.1.4
> ./configure --prefix="$PREFIX"
> make install
> cd ..
> 
> # Build ICU
> rm -f icu4c-58_2-src.tgz
> curl -C- -L -o icu4c-58_2-src.tgz http://download.icu-project.org/files/icu4c/58.2/icu4c-58_2-src.tgz
> tar -xzf icu4c-58_2-src.tgz
> cd icu/source
> ./configure --prefix="$PREFIX"
> make install
> cd ../..
> 
> # Build APR
> #curl -C- -o apr-1.5.2.tar.gz http://www.apache.org/dist/apr/apr-1.5.2.tar.gz
> curl -C- -o apr-1.4.8.tar.gz http://archive.apache.org/dist/apr/apr-1.4.8.tar.gz
> tar -xzf apr-1.4.8.tar.gz
> cd apr-1.4.8
> ./configure --prefix="$PREFIX"
> make install
> cd ..
> 
> # Now build UIMA
> ./configure --prefix="$TARGET" --with-xerces="$PREFIX" --with-apr="$PREFIX" --with-icu="$PREFIX" --without-activemq --with-jdk="$JAVA_HOME/include" CPPFLAGS="-I${JAVA_HOME}/include/linux"
> make check
> make install


You can probably log in to the Apache Jenkins and make changes to the build job:

https://builds.apache.org/view/S-Z/view/UIMA/job/UIMA-CPP-SDK

Cheers,

-- Richard

> On 28.05.2017, at 03:56, William Colen <co...@apache.org> wrote:
> 
> Hi,
> 
> I managed to compile UIMA C++ from source in a Mac.
> 
> Now I am trying in Ubuntu 16.04.
> It is a fresh install. I compiled all recommended dependencies manually.
> 
> I am getting issues with the configure command:
> 
> ./configure --prefix=/home/ubuntu/uima-deps/libs/uima-cpp
> --with-jdk=/usr/lib/jvm/java-8-openjdk-amd64/include/
> --with-apr=/home/ubuntu/uima-deps/libs/apr
> --with-icu=/home/ubuntu/uima-deps/libs/icu
> --with-xerces=/home/ubuntu/uima-deps/libs/xerces
> --with-activemq=/home/ubuntu/uima-deps/libs/activemq-cpp
> --with-apr-util=/home/ubuntu/uima-deps/libs/apr-util
> 
> (...)
> checking activemq/exceptions/ExceptionDefines.h usability... yes
> checking activemq/exceptions/ExceptionDefines.h presence... yes
> checking for activemq/exceptions/ExceptionDefines.h... yes
> configure: Apache Portable Runtime (APR Util ) library configuration
> checking for APR-util... yes
> checking jni.h usability... no
> checking jni.h presence... no
> checking for jni.h... no
> configure: error: Unable to find JDK Headers
> 
> 
> I double checked the contents of /usr/lib/jvm/java-8-openjdk-amd64/include/ and
> tried with the Oracle JDK as well and got the same error.
> 
> Anybody managed to compile with Java 8 on Ubuntu?
> 
> Thank you,
> William