uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Epstein <eaepst...@gmail.com>
Subject Re: [UIMA C++ Framework] making examples
Date Fri, 13 Aug 2010 12:58:05 GMT
David,

The MeetingAnnotatorCPP.xml sample in UIMA C++ gets the type definitions from
	<typeSystemDescription>
	  <imports>
	    <import location="TutorialTypeSystem.xml"/>
	  </imports>
	</typeSystemDescription>
where the TutorialTypeSystem.xml is in the same directory.

UIMA types are only defined in XML files. Java classes generated by
Jcasgen are only used by Java annotator or application code as an
optional way to access the CAS.

Jcasgen classes are not used by UIMA C++ at all.

Eddie


On Fri, Aug 13, 2010 at 7:02 AM, David García
<david.garcian@barcelonamedia.org> wrote:
>  Eddie,
>
> I already tested C++ component with runAECpp tool, but I got the same error.
> Maybe I didn't explain my doubt clearly.
>
> In the UIMA C++ SDK examples, for example in MeetingAnnotator, I find C++
> implementation in /uimacpp/examples/tutorial/src/MeetingAnnotator.cpp
> I compile this C++ component. This C++ component also have its descriptor in
> /uimacpp/examples/tutorial/descriptors/MeetingAnnotatorCPP.xml.
> But, MeetingAnnotator is using, as in its descriptor is specified, next
> types:
>
> org.apache.uima.tutorial.RoomNumber
> org.apache.uima.tutorial.TimeAnnot
> org.apache.uima.tutorial.DateAnnot
> org.apache.uima.tutorial.Meeting
>
> and I don't know where are the files that implement these types. Where are
> they placed? They are not in the examples.
>
> In Java UIMA examples there are the UIMA components implementations, the
> descriptors, and the Java source files with the types. I can't find the
> classes that implement the types in UIMA C++ SDK examples.
> For example in /apache-uima/examples/src/org/apache/uima/tutorial/  I can
> find the classes which define the types of the examples.
>
> So my doubt is, where should I place my Java classes defining the types that
> are being used by my C++ UIMA component?
> Because this is the error I'm getting. My C++ component can't load the types
> because I suppose the component doesn't know where to find them. I haven't
> setted anywhere where to find the Java classes defining the types.
>
>
> In MeetingAnnotator component:
>
>    roomNumberT =
>  crTypeSystem.getType("org.apache.uima.tutorial.RoomNumber");
>
> How the component is suposed to find the Java class
> org.apache.uima.tutorial.RoomNumber?
> I am missing this step, how to 'link' the classes defining the types used by
> the C++ component and the C++ component itself.
>
>
> David
>
> El 12/08/2010 21:03, Eddie Epstein escribió:
>>
>> David,
>>
>> Here are the steps recommended for testing/integrating a new C++
>> component:
>>
>> First, test the component using the C++ driver, runAECpp.sh. The
>> environment will have to be setup for UIMACPP, and LD_LIBRARY_PATH
>> will have to include any additional application libs as well.
>> Type runAECpp.sh to get help on use. Note that import by name is note
>> supported for this application. This will verify that the c++
>> component is working.
>>
>> Next, try the same test with a Java driver, runAE.sh. The syntax is
>> the same, or pretty close to the same. THis will verify the C++
>> component is working when accessed thru the JNI.
>>
>> Finally, starting integrating the c++ component with other components.
>>
>> Eddie
>>
>> On Thu, Aug 12, 2010 at 4:57 AM, David García
>> <david.garcian@barcelonamedia.org>  wrote:
>>>
>>>  Hi Eddie,
>>>
>>> sorry, I fixed that error. It was a problem with the path in
>>> UIMACPP_HOME.
>>>
>>> The error I get is:
>>>
>>> Caused by: org.apache.uima.uimacpp.UimacppException: null;
>>>        org.apache.uima.uimacpp.InternalTafException:
>>> Error number  : 1005
>>> Recoverable   : No
>>> Error         : : typeSystemInit() Error getting Type objects
>>>  (1005)
>>>        at
>>>
>>> org.apache.uima.uimacpp.UimacppEngine.throwJTafException(UimacppEngine.java:499)
>>>        at
>>> org.apache.uima.uimacpp.UimacppEngine.initialize(UimacppEngine.java:262)
>>>        at
>>>
>>> org.apache.uima.uimacpp.UimacppEngine.createJTafTAE(UimacppEngine.java:226)
>>>        at
>>>
>>> org.apache.uima.uimacpp.UimacppAnalysisComponent.initialize(UimacppAnalysisComponent.java:152)
>>>        ... 23 more
>>>
>>>
>>> As I told you in a previous mail, I implemented the component in C++,
>>> created the proper descriptor file for a C++ component. Then, I created a
>>> UIMA Java Eclipse project, and I generated the Type System Definition by
>>> clicking on JCasGen button in Type System tab of the Component
>>> Descriptor.
>>> Next, I generated the pear from this Eclipse Java project, installed it
>>> and
>>> run the pipeline with the C++ component together with other Java UIMA
>>> components.
>>>
>>> Regards,
>>> David
>>>
>>> El 12/08/2010 10:23, David García escribió:
>>>>
>>>>   Hi Eddie,
>>>>
>>>> you were right. Now the C++ component is being used by the UIMA
>>>> pipeline.
>>>>
>>>> Now, when I launch the UIMA pipeline, I still get a
>>>> ResourceInitializationException. The message reads:
>>>>
>>>> java.lang.UnsatisfiedLinkError: no uima in java.library.path
>>>>
>>>> Eventually, I have tested the component by implementing it in Java and
>>>> reducing its functionality, in order to check if the descriptor was
>>>> causing this error.
>>>> In Java it works right, but, I got this very same error when, adapting
>>>> the descriptor file to Java, I forgot to change tag
>>>> <frameworkImplementation>org.apache.uima.cpp</frameworkImplementation>
>>>> to
>>>>
>>>>
>>>> <annotatorImplementationName>org.barcelonamedia.uima.DeSRAnnotator</annotatorImplementationName>
>>>>
>>>>
>>>> Regards,
>>>> David
>>>>
>>>> El 10/08/2010 13:51, Eddie Epstein escribió:
>>>>>
>>>>> Hi David,
>>>>>
>>>>> The LD_LIBRARY_PATH should only include directories, not specific
>>>>> files. Try removing DeSR.so from the path.
>>>>>
>>>>> Eddie
>>>>>
>>>>>
>>>>> On Tue, Aug 10, 2010 at 5:37 AM, David García
>>>>> <david.garcian@barcelonamedia.org>    wrote:
>>>>>>
>>>>>>   Hi,
>>>>>>
>>>>>> testing the C++ UIMA annotator I implemented in a UIMA pipeline with
>>>>>> other
>>>>>> Java UIMA components, I got following error, caused by a
>>>>>> ResourceInitializationException:
>>>>>>
>>>>>>
>>>>>> Caused by: org.apache.uima.uimacpp.UimacppException: null;
>>>>>>         org.apache.uima.uimacpp.InternalTafException:
>>>>>> Error number  : 2001
>>>>>> Recoverable   : No
>>>>>> Error         : Error loading annotator 'DeSR'.
>>>>>> '/usr/local/share/uima/pipelines/DeSR/installed_pears/DeSR/DeSR.so:
>>>>>> undefined symbol: _ZTVN4Tanl14MorphExtractorE'
>>>>>>    While      : Error loading annotator '???'. '???'
>>>>>>   (2001)
>>>>>>         at
>>>>>>
>>>>>>
>>>>>> org.apache.uima.uimacpp.UimacppEngine.throwJTafException(UimacppEngine.java:499)
>>>>>>         at
>>>>>>
>>>>>> org.apache.uima.uimacpp.UimacppEngine.initialize(UimacppEngine.java:262)
>>>>>>         at
>>>>>>
>>>>>>
>>>>>> org.apache.uima.uimacpp.UimacppEngine.createJTafTAE(UimacppEngine.java:226)
>>>>>>         at
>>>>>>
>>>>>>
>>>>>> org.apache.uima.uimacpp.UimacppAnalysisComponent.initialize(UimacppAnalysisComponent.java:152)
>>>>>>
>>>>>>
>>>>>> I have setted all the environment variables required by UIMA SDK:
>>>>>>
>>>>>> export UIMACPP_HOME=/home/d/uimacpp/uimacpp
>>>>>> export PATH=$PATH:$UIMACPP_HOME/bin
>>>>>> export LD_LIBRARY_PATH=$UIMACPP_HOME/lib
>>>>>> export
>>>>>>
>>>>>>
>>>>>> LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/share/uima/pipelines/DeSR/installed_pears/DeSR/DeSR.so
>>>>>>
>>>>>>
>>>>>> It seems the UIMA pipeline can't load the C++ component. Am I doing
>>>>>> anything
>>>>>> wrong?
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>> David
>>>>>>
>>>>>> El 06/08/2010 13:24, Eddie Epstein escribió:
>>>>>>>
>>>>>>> Hi David,
>>>>>>>
>>>>>>> A C++ annotator is intended to be fully interoperable with those
>>>>>>> written in Java. That is, it can access feature structures found
in
>>>>>>> the CAS and create new FS in the CAS. The type system of the
CAS is
>>>>>>> the superset of types defined by all annotators, including any
C++
>>>>>>> components.
>>>>>>>
>>>>>>> So yes, you can use eclipse and integrate both java and c++
>>>>>>> components.
>>>>>>>
>>>>>>> Regards,
>>>>>>> Eddie
>>>>>>>
>>>>>>> On Fri, Aug 6, 2010 at 3:35 AM, David García
>>>>>>> <david.garcian@barcelonamedia.org>     wrote:
>>>>>>>>
>>>>>>>>   Hi Eddie,
>>>>>>>>
>>>>>>>> this C++ UIMA annotator needs previous Java UIMA annotators
>>>>>>>> annotations,
>>>>>>>> as
>>>>>>>> this C++ UIMA annotator needs them to work with.
>>>>>>>> But this types are implemented by means of Java classes,
as these
>>>>>>>> previous
>>>>>>>> UIMA annotators are implemented in Java.
>>>>>>>> So my question is whether once I have developed this C++
UIMA
>>>>>>>> annotator,
>>>>>>>> generated the dynamic library, and composed the pipeline
will work.
>>>>>>>>
>>>>>>>> Moreover, this C++ UIMA annotator has its own type, which
should be
>>>>>>>> implemented, and I neither know if this implementation could
be done
>>>>>>>> in
>>>>>>>> Java
>>>>>>>> or should be in C++.
>>>>>>>>
>>>>>>>> My idea is to develop the annotator in C++, and afterwards,
generate
>>>>>>>> its
>>>>>>>> own
>>>>>>>> type automatically from its descriptor in an Eclipse UIMA
Java
>>>>>>>> project.
>>>>>>>> Is
>>>>>>>> this correct?
>>>>>>>>
>>>>>>>>
>>>>>>>> David
>>>>>>>>
>>>>>>>> El 05/08/2010 14:40, Eddie Epstein escribió:
>>>>>>>>>
>>>>>>>>> Hi David,
>>>>>>>>>
>>>>>>>>> Capabilities for any annotator should only declare the
input types
>>>>>>>>> needed by that annotator and the output types generated
by that
>>>>>>>>> annotator. Why would you need types from other annotators?
>>>>>>>>>
>>>>>>>>> Eddie
>>>>>>>>>
>>>>>>>>> On Thu, Aug 5, 2010 at 6:48 AM, David García
>>>>>>>>> <david.garcian@barcelonamedia.org>       wrote:
>>>>>>>>>>
>>>>>>>>>>   Hi,
>>>>>>>>>>
>>>>>>>>>> I have a doubt regarding UIMA C++ annotator.
>>>>>>>>>> I'm developing a C++ annotator to be combined within
a UIMA
>>>>>>>>>> pipeline
>>>>>>>>>> with
>>>>>>>>>> other Java annotators. The point is this C++ annotator
requires,
>>>>>>>>>> as
>>>>>>>>>> input
>>>>>>>>>> capabilities, another Java annotator annotations.
>>>>>>>>>> My question is whether it is necessary to translate
to C++ the
>>>>>>>>>> input
>>>>>>>>>> capability types defined in Java by the ohter Java
annotators, as
>>>>>>>>>> well
>>>>>>>>>> as
>>>>>>>>>> the C++ annotator types.
>>>>>>>>>>
>>>>>>>>>> My idea is to develop the C++ annotator, generating
the dynamic
>>>>>>>>>> library,
>>>>>>>>>> and
>>>>>>>>>> afterwards, create an Eclipse UIMA project by using
the proper
>>>>>>>>>> descriptor
>>>>>>>>>> for the C++ UIMA annotator. Then, in this UIMA project,
include
>>>>>>>>>> the
>>>>>>>>>> Java
>>>>>>>>>> types required for the C++ UIMA annotator as well
as its own
>>>>>>>>>> types.
>>>>>>>>>>
>>>>>>>>>> Am I wrong, or would it be correct?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> David
>>>>>>>>>>
>>>>>>>>>> El 22/07/2010 10:02, David García escribió:
>>>>>>>>>>>
>>>>>>>>>>>    It was version problem. Now it works.
>>>>>>>>>>>
>>>>>>>>>>> Thank you Eddie.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> David
>>>>>>>>>>>
>>>>>>>>>>> El 21/07/2010 20:34, Eddie Epstein escribió:
>>>>>>>>>>>>
>>>>>>>>>>>> Probably a mismatch between 32 and 64-bit
versions.
>>>>>>>>>>>>
>>>>>>>>>>>> To confirm, use the "file" command on DaveDetector.o
and on
>>>>>>>>>>>> uimacpp/lib/libuima.so
>>>>>>>>>>>>
>>>>>>>>>>>> UIMACPP binary packages come in both flavors
for Linux, so if
>>>>>>>>>>>> this
>>>>>>>>>>>> is
>>>>>>>>>>>> the problem, get the other one.
>>>>>>>>>>>>
>>>>>>>>>>>> One other solution if your OS is 64-bit and
the uimacpp package
>>>>>>>>>>>> is
>>>>>>>>>>>> 32-bit: modify uimacpp/lib/base.mak to force
all compiles to be
>>>>>>>>>>>> 32-bit.
>>>>>>>>>>>>
>>>>>>>>>>>> Regards,
>>>>>>>>>>>> Eddie
>>>>>>>>>>>>
>>>>>>>>>>>> On Wed, Jul 21, 2010 at 4:00 AM, David García
>>>>>>>>>>>> <david.garcian@barcelonamedia.org>
         wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>    Thanks for your answer Eddie. You
are right, the include
>>>>>>>>>>>>> of<memory>
>>>>>>>>>>>>> must
>>>>>>>>>>>>> be setted before "uima/api.hpp" include.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Now when I make the DaveDetector example
( make -f
>>>>>>>>>>>>> DaveDetector.mak
>>>>>>>>>>>>> )
>>>>>>>>>>>>> I
>>>>>>>>>>>>> get
>>>>>>>>>>>>> following error message:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> /usr/bin/ld: skipping incompatible
>>>>>>>>>>>>> /home/david.garcian/uimacpp/uimacpp/lib/libuima.so
when
>>>>>>>>>>>>> searching
>>>>>>>>>>>>> for
>>>>>>>>>>>>> -luima
>>>>>>>>>>>>> /usr/bin/ld: cannot find -luima
>>>>>>>>>>>>> collect2: ld returned 1 exit status
>>>>>>>>>>>>> make: *** [DaveDetector.so] Error 1
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> It says libuima.so is icompatible. Does
it have anything to do
>>>>>>>>>>>>> with
>>>>>>>>>>>>> the
>>>>>>>>>>>>> version of Linux or gcc?
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> David
>>>>>>>>>>>>>
>>>>>>>>>>>>> El 19/07/2010 15:13, Eddie Epstein escribió:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> If you add the include to DaveDetector.cpp,
it must be before
>>>>>>>>>>>>>> the include of uima/api.hpp. A better
way to go would be to
>>>>>>>>>>>>>> put the include of<memory>
           into
>>>>>>>>>>>>>> lowlevel_internal_indexes.hpp
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Eddie
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Mon, Jul 19, 2010 at 3:01 AM,
David García
>>>>>>>>>>>>>> <david.garcian@barcelonamedia.org>
           wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>    Hi Eddie,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I have tried adding "#include<memory>",
but I've got the same
>>>>>>>>>>>>>>> error
>>>>>>>>>>>>>>> message.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I've also tried using gcc version
4.3.4 and I've also got the
>>>>>>>>>>>>>>> same
>>>>>>>>>>>>>>> error.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>>>> David
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> El 16/07/2010 19:44, Eddie Epstein
escribió:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hi David,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> More recent versions of g++
are always getting stricter.
>>>>>>>>>>>>>>>> Try adding
>>>>>>>>>>>>>>>> #include<memory>
>>>>>>>>>>>>>>>> to DaveDetector.cpp.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> A goal for uimacpp annotators
is that they be portable,
>>>>>>>>>>>>>>>> meaning
>>>>>>>>>>>>>>>> that
>>>>>>>>>>>>>>>> the annotator code and any
non-standard dependencies could
>>>>>>>>>>>>>>>> be
>>>>>>>>>>>>>>>> packaged
>>>>>>>>>>>>>>>> together, and installed anyplace
on a target system.
>>>>>>>>>>>>>>>> LD_LIBRARY_PATH
>>>>>>>>>>>>>>>> is very useful for this.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> The alternative is to install
uimacpp and it's dependencies
>>>>>>>>>>>>>>>> in
>>>>>>>>>>>>>>>> some
>>>>>>>>>>>>>>>> standard system directory,
but this would require root
>>>>>>>>>>>>>>>> access.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>>>>> Eddie
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Thu, Jul 15, 2010 at 8:04
AM, David García
>>>>>>>>>>>>>>>> <david.garcian@barcelonamedia.org>
             wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>    Hi all,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I am trying to use uimacpp,
Linux version, but I have got
>>>>>>>>>>>>>>>>> problems
>>>>>>>>>>>>>>>>> making
>>>>>>>>>>>>>>>>> C++ examples.
>>>>>>>>>>>>>>>>> I follow README instructions,
and when I do:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> make -f DaveDetector.mak
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I get following error:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> /uimacpp/include/uima/lowlevel_internal_indexes.hpp:
In
>>>>>>>>>>>>>>>>> member
>>>>>>>>>>>>>>>>> function
>>>>>>>>>>>>>>>>> ‘virtual void
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> uima::lowlevel::internal::CachedCompositeIndex<T>::clearAndFillCache()’:
>>>>>>>>>>>>>>>>> /uimacpp/include/uima/lowlevel_internal_indexes.hpp:348:
>>>>>>>>>>>>>>>>> error:
>>>>>>>>>>>>>>>>> ‘auto_ptr’
>>>>>>>>>>>>>>>>> was not declared in this
scope
>>>>>>>>>>>>>>>>> /uimacpp/include/uima/lowlevel_internal_indexes.hpp:348:
>>>>>>>>>>>>>>>>> error:
>>>>>>>>>>>>>>>>> expected
>>>>>>>>>>>>>>>>> primary-expression before
‘>’ token
>>>>>>>>>>>>>>>>> /uimacpp/include/uima/lowlevel_internal_indexes.hpp:348:
>>>>>>>>>>>>>>>>> error:
>>>>>>>>>>>>>>>>> there
>>>>>>>>>>>>>>>>> are
>>>>>>>>>>>>>>>>> no
>>>>>>>>>>>>>>>>> arguments to ‘apit’
that depend on a template parameter, so
>>>>>>>>>>>>>>>>> a
>>>>>>>>>>>>>>>>> declaration
>>>>>>>>>>>>>>>>> of
>>>>>>>>>>>>>>>>> ‘apit’ must be available
>>>>>>>>>>>>>>>>> /uimacpp/include/uima/lowlevel_internal_indexes.hpp:348:
>>>>>>>>>>>>>>>>> note:
>>>>>>>>>>>>>>>>> (if
>>>>>>>>>>>>>>>>> you
>>>>>>>>>>>>>>>>> use
>>>>>>>>>>>>>>>>> ‘-fpermissive’, G++
will accept your code, but allowing the
>>>>>>>>>>>>>>>>> use
>>>>>>>>>>>>>>>>> of
>>>>>>>>>>>>>>>>> an
>>>>>>>>>>>>>>>>> undeclared name is deprecated)
>>>>>>>>>>>>>>>>> /uimacpp/include/uima/lowlevel_internal_indexes.hpp:349:
>>>>>>>>>>>>>>>>> error:
>>>>>>>>>>>>>>>>> ‘apit’
>>>>>>>>>>>>>>>>> was
>>>>>>>>>>>>>>>>> not declared in this
scope
>>>>>>>>>>>>>>>>> make: *** [DaveDetector.o]
Error 1
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I am using gcc version
4.4.1 (Ubuntu 4.4.1-4ubuntu9).
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Am I doing something
wrong?
>>>>>>>>>>>>>>>>> I have also found that
it is not a good practise to use
>>>>>>>>>>>>>>>>> LD_LIBRARY_PATH
>>>>>>>>>>>>>>>>> env
>>>>>>>>>>>>>>>>> variable. Is this correct?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Thanks in advanced,
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> David
>>>>>>>>>>>>>>>>>
>

Mime
View raw message