[ome-devel] Getting started with C++ API for OMERO.server clients

josh.moore at gmx.de josh.moore at gmx.de
Tue Sep 1 15:48:31 BST 2009


Nick Perry writes:
 > I dont need the special API dist on my computer to function do I?

Nope.

 > I tried to
 > get it to turn on but something kept failing so I turned the old one back
 > on... 

Do you know offhand what svn version and what distribution you have?
Probably the database version was wrong.

 > I just need the library right?

The library and the include files. Right.

 > In theory I could destroy all the files in this special
 > API-files-included server distribution and just keep the API files
 > that I need to compile, right? (not that I would do this...)

Sure.
~J.

 > On Tue, Sep 1, 2009 at 4:39 PM, <josh.moore at gmx.de> wrote:
 > 
 > >
 > > Nick Perry writes:
 > >  > ooh, so i just need the distribution from the SVN with the API stuff on
 > > MY
 > >  > computer, so that when I compile it i have access to the libraries. The
 > > API
 > >  > library does NOT need to be on other OMERO servers to work. gotcha
 > >
 > > Exactly! It's what I should have said in the first place. ;)
 > >
 > > Cheers,
 > > ~Josh
 > >
 > >
 > >  > On Tue, Sep 1, 2009 at 4:20 PM, <josh.moore at gmx.de> wrote:
 > >  >
 > >  > >
 > >  > > Nick Perry writes:
 > >  > >  > "So, the 3rd party client would build the library from svn like you
 > >  > >  > are doing, and then it would be able to talk directly to OMERO."
 > >  > >  >
 > >  > >  > K, library is built.
 > >  > >
 > >  > > Awesome.
 > >  > >
 > >  > >  > I imagine it creates a file I need to include at the top of my
 > >  > >  > scripts so I can use the API.
 > >  > >
 > >  > > Hmmm....sorry, now I'm lost. What scripts are these? The Makefile
 > >  > > script?
 > >  > >
 > >  > >  > Where is the location of this API library file?  My understanding
 > >  > >  > is that after I compile it this file is found on the server.
 > >  > >
 > >  > > After you compile, there are artifacts under dist/lib and
 > >  > > dist/include, but that doesn't have anything to do with your
 > >  > > server. It can be completely ignorant of the fact (and in fact, it
 > >  > > *is* completely ignorant of the fact) that you are calling it from
 > >  > > C++.
 > >  > >
 > >  > > So, if you are still in the "omero" directory, and you've successfully
 > >  > > built the library via "build-cpp" and downloaded the files from
 > >  > > OmeroCpp, then you should be ready to call:
 > >  > >
 > >  > >  make OMERO_DIST=dist yourcode
 > >  > >
 > >  > > i.e.
 > >  > >
 > > http://trac.openmicroscopy.org.uk/omero/wiki/OmeroCpp#Compilingandrunningyourcode
 > >  > >
 > >  > > ~Josh.
 > >  > >
 > >  > >  > On Tue, Sep 1, 2009 at 4:09 PM, <josh.moore at gmx.de> wrote:
 > >  > >  >
 > >  > >  > > Nick Perry writes:
 > >  > >
 > >  > >  > > Yeah but only certain server distributions I can DL have the C++
 > >  > >  > > library for > the client. If that's not supplied by the OMERO
 > >  > >  > > server, where is a 3rd party > app supposed to get the library?
 > >  > >  > >
 > >  > >  > > By building from the branch which matches the server version.
 > >  > >  > >
 > >  > >  > >  > In other words, let's say I DL the version of the OMERO server
 > >  > >  > >  > *without* the API libraries. And let's say I try to connect to
 > >  > >  > >  > this server with a 3rd party client that uses the C++
 > >  > >  > >  > API. Where will it get the library for the API unless the
 > >  > >  > >  > server provides it?
 > >  > >  > >
 > >  > >  > > The server doesn't really provide a C++ API, rather it just
 > >  > >  > > provides a single API, which can be connected to by C++, Python,
 > >  > >  > > and Java.. So, the 3rd party client would build the library from
 > >  > >  > > svn like you are doing, and then it would be able to talk
 > >  > >  > > directly to OMERO.
 > >  > >  > >
 > >  > >  > > All of this is based on Ice (http://zeroc.com) which is a
 > >  > >  > > cross-language library. It handles the low-level details, so that
 > >  > >  > > the OMERO Java server (with no C++ library) can seamlessly be
 > >  > >  > > talked to by a 3rd party client which builds it's own C++
 > >  > >  > > library.
 > >  > >  > >
 > >  > >  > > Sorry for the (possibly continuing) confusion,
 > >  > >  > > ~Josh
 > >  > >  > >
 > >  > >  > >  > On Tue, Sep 1, 2009 at 3:48 PM, <josh.moore at gmx.de> wrote:
 > >  > >  > >  >
 > >  > >  > >  > > Nick Perry writes:
 > >  > >  > >  > >  > Hey Josh,
 > >  > >  > >  > >
 > >  > >  > >  > > Hey Nick,
 > >  > >  > >  > >
 > >  > >  > >  > >  > Does this mean that *any* OMERO server that intends to
 > > have
 > >  > > 3rd
 > >  > >  > >  > >  > party apps connect using the API needs to use this
 > > special
 > >  > > OMERO
 > >  > >  > >  > >  > distribution that has the API?
 > >  > >  > >  > >
 > >  > >  > >  > > No. The intention is that any server with the version x.y
 > > will be
 > >  > >  > >  > > accessible to any client API implementation (OmeroPy,
 > > OmeroCpp,
 > >  > >  > >  > > OmeroJava, OmeroMatlab, ...) built from the same x.y
 > > version.
 > >  > > We've
 > >  > >  > >  > > made some mistakes in this regard this year, so it's safer
 > > to
 > >  > > say:
 > >  > >  > >  > >
 > >  > >  > >  > >    server version x.y.z is accessible from client version
 > > x.y.z
 > >  > >  > >  > >    regardless where you got either: svn-checkout-build,
 > > binary
 > >  > >  > >  > >    distribution, etc.
 > >  > >  > >  > >
 > >  > >  > >  > > Another way of saying this is that the server and the
 > > clients
 > >  > > (client
 > >  > >  > >  > > APIs) are to some extent independent, so that even if we
 > > don't
 > >  > > supply
 > >  > >  > >  > > the C++ libraries, there's nothing from stopping you from
 > >  > > building and
 > >  > >  > >  > > using them with your server, as long as the version matches.
 > >  > >  > >  > >
 > >  > >  > >  > > Cheers,
 > >  > >  > >  > > ~Josh
 > >  > >  > >  > >
 > >  > >  > >  > >  > Nick
 > >  > >  > >  > >  >
 > >  > >  > >  > >  > On Tue, Sep 1, 2009 at 12:24 PM, <josh.moore at gmx.de>
 > > wrote:
 > >  > >  > >  > >  >
 > >  > >  > >  > >  > > Nick Perry writes:
 > >  > >  > >  > >  > >  > the previous* command (not following). Sorry.
 > >  > >  > >  > >  > >  >
 > >  > >  > >  > >  > >  > On Tue, Sep 1, 2009 at 12:11 PM, Nick Perry <
 > >  > >  > > nperry at stanford.edu>
 > >  > >  > >  > >  > > wrote:
 > >  > >  > >  > >  > >  >
 > >  > >  > >  > >  > >  > > Hey Josh,
 > >  > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > > Sorry to bug you again.
 > >  > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > > I'm trying to put together in my head everything
 > > I've
 > >  > > done
 > >  > >  > > so
 > >  > >  > >  > > far.
 > >  > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > > With the command:
 > >  > >  > >  > >  > >  > > svn co
 > >  > > http://cvs.openmicroscopy.org.uk/svn/omero/trunkomero
 > >  > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > > I'm checking out a new omero distribution, right?
 > > So if
 > >  > > I
 > >  > >  > > had the
 > >  > >  > >  > >  > >  > > omero
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > > Correct.
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > > server up and running already on my computer (the
 > >  > > standard
 > >  > >  > >  > > download),
 > >  > >  > >  > >  > > I've
 > >  > >  > >  > >  > >  > > messed things up, right?
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > > Not really. You'll need to shut it off (bin/omero admin
 > >  > > stop) in
 > >  > >  > > order
 > >  > >  > >  > >  > > to start the new server. If you've already deleted the
 > >  > > directory,
 > >  > >  > > you
 > >  > >  > >  > >  > > can use:
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  killall icegridnode
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > > to get rid of the runing server.
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > > I was just looking in my previous omero
 > > distribution
 > >  > > folder
 > >  > >  > > and
 > >  > >  > >  > >  > >  > > this new checked out one, and they share files but
 > > the
 > >  > >  > > latter has
 > >  > >  > >  > >  > >  > > the build.py. So if I'm guessing correctly, I need
 > > to
 > >  > > run
 > >  > >  > > the
 > >  > >  > >  > >  > >  > > omero server out of this new, special
 > > distribution,
 > >  > > right?
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > > Right. When you run ./build.py from a checkout it
 > > produces
 > >  > > the
 > >  > >  > > "dist"
 > >  > >  > >  > >  > > directory. This is the same as the distribution which
 > > is
 > >  > >  > > available for
 > >  > >  > >  > >  > > download.
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > > So the omero server with API is DIFFERENT than the
 > >  > > normal
 > >  > >  > > omero
 > >  > >  > >  > >  > >  > > server, and in order to write C++ api for
 > > connecting
 > >  > > 3rd
 > >  > >  > > party
 > >  > >  > >  > >  > >  > > clients to omero i need to be running the omero
 > > server
 > >  > > using
 > >  > >  > > the
 > >  > >  > >  > >  > >  > > distribution I check out with the following
 > > command...?
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > > Not at all. As long as the versions match, you can use
 > > a
 > >  > >  > > distribution
 > >  > >  > >  > >  > > with a checkout. Your distribution is most likely
 > > 4.0.x, so
 > >  > >  > > you'll
 > >  > >  > >  > >  > > need to be checking out from:
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >
 > >  > > http://cvs.openmicroscopy.org.uk/svn/omero/branches/Beta4.0/
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > > The reason that the svn checkout is required is that we
 > >  > > don't
 > >  > >  > >  > >  > > currently provide the C++ library with the
 > > distribution.
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > > Thanks for the help,
 > >  > >  > >  > >  > >  > > Nick
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > > Gladly,
 > >  > >  > >  > >  > > ~Josh.
 > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > > On Tue, Sep 1, 2009 at 12:00 PM, Nick Perry <
 > >  > >  > > nperry at stanford.edu
 > >  > >  > >  > > >
 > >  > >  > >  > >  > > wrote:
 > >  > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >  > >> Hey Josh,
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >> Sorry I'm not as familiar with compiling C++ /
 > >  > > makefiles as
 > >  > >  > > I
 > >  > >  > >  > > should
 > >  > >  > >  > >  > > be,
 > >  > >  > >  > >  > >  > >> but in the following step:
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >> Finding the library ¶<
 > >  > >  > >  > >  > >
 > >  > >  > >  > >
 > >  > >  > >
 > >  > >
 > > http://trac.openmicroscopy.org.uk/omero/wiki/OmeroCpp#Findingthelibrary>
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >> What will be produced by that build are two sets
 > > of
 > >  > >  > > artifacts:
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >>    - dist/include contains C++ header files as
 > > well as
 > >  > > the
 > >  > >  > > slice
 > >  > >  > >  > >  > > files
 > >  > >  > >  > >  > >  > >>    from which the Ice-based model is generated.
 > > You
 > >  > > will
 > >  > >  > > need to
 > >  > >  > >  > > pass
 > >  > >  > >  > >  > > these to
 > >  > >  > >  > >  > >  > >>    your compiler.
 > >  > >  > >  > >  > >  > >>    - dist/lib contains the shared library file,
 > > which
 > >  > > you
 > >  > >  > > will
 > >  > >  > >  > > need
 > >  > >  > >  > >  > > to
 > >  > >  > >  > >  > >  > >>    pass to your linker. On Linux
 > > libomero_client.so on
 > >  > > OS X
 > >  > >  > >  > >  > >  > >>    libomero_client.dylib and on Windows
 > >  > > omero_client.dll,
 > >  > >  > > in 32
 > >  > >  > >  > > or
 > >  > >  > >  > >  > > 64-bit
 > >  > >  > >  > >  > >  > >>    mode depending on your CXXFLAGS (See
 > > OmeroBuild<
 > >  > >  > >  > >  > >
 > > http://trac.openmicroscopy.org.uk/omero/wiki/OmeroBuild>)
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >> Note: the shared library files can be quite
 > > large,
 > >  > > even
 > >  > >  > > over
 > >  > >  > >  > > 200MB.
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >> For bullet 2, do I need to pass my shared library
 > > file
 > >  > >  > >  > > explicitly in
 > >  > >  > >  > >  > > a
 > >  > >  > >  > >  > >  > >> step I should know how to do, or is this
 > > accomplished
 > >  > > in
 > >  > >  > > the
 > >  > >  > >  > > next
 > >  > >  > >  > >  > > step when
 > >  > >  > >  > >  > >  > >> I use the make file?
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >> Thanks,
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >> Nick
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >> On Tue, Sep 1, 2009 at 11:54 AM, <
 > > josh.moore at gmx.de>
 > >  > >  > > wrote:
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >>>
 > >  > >  > >  > >  > >  > >>> *whew*
 > >  > >  > >  > >  > >  > >>>
 > >  > >  > >  > >  > >  > >>> Good to hear. ~J.
 > >  > >  > >  > >  > >  > >>>
 > >  > >  > >  > >  > >  > >>> Nick Perry writes:
 > >  > >  > >  > >  > >  > >>>  > just kidding; i hadn't given the svn command
 > > my
 > >  > > proxy
 > >  > >  > > info
 > >  > >  > >  > > :)
 > >  > >  > >  > >  > >  > >>>  >
 > >  > >  > >  > >  > >  > >>>  > On Tue, Sep 1, 2009 at 11:11 AM, Nick Perry <
 > >  > >  > >  > > nperry at stanford.edu
 > >  > >  > >  > >  > > >
 > >  > >  > >  > >  > >  > >>> wrote:
 > >  > >  > >  > >  > >  > >>>  >
 > >  > >  > >  > >  > >  > >>>  > > SVN still not working:
 > >  > >  > >  > >  > >  > >>>  > >
 > >  > >  > >  > >  > >  > >>>  > > svn co
 > >  > >  > > http://cvs.openmicroscopy.org.uk/svn/omero/trunkomero
 > >  > >  > >  > >  > >  > >>>  > >
 > >  > >  > >  > >  > >  > >>>  > > svn: PROPFIND request failed on
 > >  > > '/svn/omero/trunk'
 > >  > >  > >  > >  > >  > >>>  > > svn: PROPFIND of '/svn/omero/trunk': could
 > > not
 > >  > >  > > connect to
 > >  > >  > >  > >  > > server (
 > >  > >  > >  > >  > >  > >>>  > > http://cvs.openmicroscopy.org.uk)
 > >  > >  > >  > >  > >  > >>>  > >
 > >  > >  > >  > >  > >  > >>>  > > On Mon, Aug 31, 2009 at 8:05 PM, <
 > >  > > josh.moore at gmx.de>
 > >  > >  > >  > > wrote:
 > >  > >  > >  > >  > >  > >>>  > >
 > >  > >  > >  > >  > >  > >>>  > >>
 > >  > >  > >  > >  > >  > >>>  > >> Nick Perry writes:
 > >  > >  > >  > >  > >  > >>>  > >>  > Hi,
 > >  > >  > >  > >  > >  > >>>  > >>
 > >  > >  > >  > >  > >  > >>>  > >> Hi Nick,
 > >  > >  > >  > >  > >  > >>>  > >>
 > >  > >  > >  > >  > >  > >>>  > >>  > I'm extremely confused about where to
 > > start
 > >  > > when
 > >  > >  > >  > > trying to
 > >  > >  > >  > >  > > play
 > >  > >  > >  > >  > >  > >>>  > >>  > around with the OMERO server C++ API
 > > for
 > >  > > OMERO
 > >  > >  > >  > > clients. I
 > >  > >  > >  > >  > > think
 > >  > >  > >  > >  > >  > >>>  > >>  > this is the correct page to start on
 > >  > >  > >  > >  > >  > >>>  > >>  >
 > >  > >  > > http://trac.openmicroscopy.org.uk/omero/wiki/OmeroCpp,
 > >  > >  > >  > > but
 > >  > >  > >  > >  > > I'm
 > >  > >  > >  > >  > >  > >>>  > >>  > having a hard time understanding what's
 > >  > > going on.
 > >  > >  > >  > >  > >  > >>>  > >>
 > >  > >  > >  > >  > >  > >>>  > >> That is the correct page, but as always,
 > > the
 > >  > > docs
 > >  > >  > > can use
 > >  > >  > >  > >  > >  > >>>  > >> improvements. I've updated them; can you
 > > give
 > >  > > take a
 > >  > >  > >  > > look, and
 > >  > >  > >  > >  > > tell
 > >  > >  > >  > >  > >  > >>> me
 > >  > >  > >  > >  > >  > >>>  > >> if things are clearer now?
 > >  > >  > >  > >  > >  > >>>  > >>
 > >  > >  > >  > >  > >  > >>>  > >>  > First of all, the svn call
 > >  > >  > >  > >  > >  > >>>  > >>  > on that page (svn co
 > >  > >  > >  > >  > >  > >>>
 > >  > > http://cvs.openmicroscopy.org.uk/svn/omero/trunkomero)
 > >  > >  > >  > >  > >  > >>>  > >>  > doesn't work; i get the following
 > > error:
 > >  > >  > >  > >  > >  > >>>  > >>  >
 > >  > >  > >  > >  > >  > >>>  > >>  > svn: PROPFIND request failed on
 > >  > >  > > '/svn/omero/trunk'
 > >  > >  > >  > >  > >  > >>>  > >>  > svn: PROPFIND of '/svn/omero/trunk':
 > > could
 > >  > > not
 > >  > >  > > connect
 > >  > >  > >  > > to
 > >  > >  > >  > >  > > server
 > >  > >  > >  > >  > >  > >>> (
 > >  > >  > >  > >  > >  > >>>  > >>  > http://cvs.openmicroscopy.org.uk)
 > >  > >  > >  > >  > >  > >>>  > >>  >
 > >  > >  > >  > >  > >  > >>>  > >>  > Why is this not working?
 > >  > >  > >  > >  > >  > >>>  > >>
 > >  > >  > >  > >  > >  > >>>  > >> This morning there was a short outage of
 > > all
 > >  > >  > > developer
 > >  > >  > >  > >  > >  > >>>  > >> resources. Could you re-try and let us
 > > know if
 > >  > > it's
 > >  > >  > >  > > working
 > >  > >  > >  > >  > > now?
 > >  > >  > >  > >  > >  > >>>  > >>
 > >  > >  > >  > >  > >  > >>>  > >> ...
 > >  > >  > >  > >  > >  > >>>  > >>  > Thanks,
 > >  > >  > >  > >  > >  > >>>  > >>  > Nick
 > >  > >  > >  > >  > >  > >>>  > >>
 > >  > >  > >  > >  > >  > >>>  > >> ~Josh.
 > >  > >  > >  > >  > >  > >>>  > >>
 > >  > >  > >  > >  > >  > >>>  > >
 > >  > >  > >  > >  > >  > >>>  > >
 > >  > >  > >  > >  > >  > >>>
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >>
 > >  > >  > >  > >  > >  > >
 > >  > >  > >  > >  > >
 > >  > >  > >  > >
 > >  > >  > >
 > >  > >
 > >


More information about the ome-devel mailing list