|
From: Noel O'B. <bao...@gm...> - 2007-05-14 14:25:41
|
I've already noticed that the latest SVN is not compatible with SWIG
due to changes introducted at r1954. You'll need to check out r1953,
and use "svn merge -r 1957:1958" to patch with r1958.
Noel
On 14/05/07, Jens Thomas <j.m...@dl...> wrote:
> Hi Noel, Jerome and Chris,
>
> Firstly, many thanks for the quick response and warm welcome to the
> list! Please accept my apologies for not replying sooner, but I've been
> away without access to email.
>
> I've tried checking out the latest version of openbabel from SVN onto my
> Ubuntu box (Dapper on a Pentium 4) so that I can try some of the changes
> you've committed. I ran a normal configure (./configure), but the make
> currently fails with:
>
> make[2]: Leaving directory `/home/jmht/openbabel/test/cmltest'
> make[2]: Entering directory `/home/jmht/openbabel/test'
> g++ -DHAVE_CONFIG_H -I. -I../src -I../include
> -DTESTDATADIR="\"../test/files/\"" -g -O2 -MT roundtrip.o -MD -MP -MF
> .deps/roundtrip.Tpo -c -o roundtrip.o roundtrip.cpp
> mv -f .deps/roundtrip.Tpo .deps/roundtrip.Po
> /bin/sh ../libtool --tag=CXX --mode=link g++ -g -O2 -o roundtrip
> roundtrip.o ../src/libopenbabel.la -ldl -lm
> mkdir .libs
> g++ -g -O2 -o .libs/roundtrip roundtrip.o ../src/.libs/libopenbabel.so
> -ldl -lm -Wl,--rpath -Wl,/usr/local/lib
> ../src/.libs/libopenbabel.so: undefined reference to
> `OpenBabel::OBFormat::FormatFromMIME(char const*)'
> ../src/.libs/libopenbabel.so: undefined reference to
> `OpenBabel::OBPlugin::Display(std::basic_string<char,
> std::char_traits<char>, std::allocator<char> >&, char const*, char const*)'
> ../src/.libs/libopenbabel.so: undefined reference to `vtable for
> OpenBabel::OBDescriptor'
> ../src/.libs/libopenbabel.so: undefined reference to
> `OpenBabel::OBDescriptor::Compare(OpenBabel::OBBase*,
> std::basic_istream<char, std::char_traits<char> >&, bool)'
> ../src/.libs/libopenbabel.so: undefined reference to `vtable for
> OpenBabel::OBPlugin'
> ../src/.libs/libopenbabel.so: undefined reference to
> `OpenBabel::OBPlugin::ListAsVector(char const*, char const*,
> std::vector<std::basic_string<char, std::char_traits<char>,
> std::allocator<char> >, std::allocator<std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > > >&)'
> ../src/.libs/libopenbabel.so: undefined reference to `typeinfo for
> OpenBabel::OBPlugin'
> ../src/.libs/libopenbabel.so: undefined reference to
> `OpenBabel::OBDescriptor::AddProperties(OpenBabel::OBBase*,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >
> const&)'
> ../src/.libs/libopenbabel.so: undefined reference to
> `OpenBabel::OBDescriptor::GetStringValue(OpenBabel::OBBase*,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
> ../src/.libs/libopenbabel.so: undefined reference to
> `OpenBabel::OBDescriptor::FilterCompare(OpenBabel::OBBase*,
> std::basic_istream<char, std::char_traits<char> >&, bool)'
> ../src/.libs/libopenbabel.so: undefined reference to
> `OpenBabel::OBFormat::RegisterFormat(char const*, char const*)'
> ../src/.libs/libopenbabel.so: undefined reference to `typeinfo for
> OpenBabel::OBDescriptor'
> ../src/.libs/libopenbabel.so: undefined reference to
> `OpenBabel::OBDescriptor::DeleteProperties(OpenBabel::OBBase*,
> std::basic_string<char, std::char_traits<char>, std::allocator<char> >
> const&)'
> collect2: ld returned 1 exit status
> make[2]: *** [roundtrip] Error 1
>
> I'm not that familiar with C++ and so am bit stuck as to how to sort
> this one out.
>
> Do you have any suggestions?
>
> Best wishes,
>
> Jens
>
>
> Noel O'Boyle wrote:
> > On 12/05/07, Chris Morley <c.m...@ds...> wrote:
> >
> >> In the revamped code for formats (and other plugins) recently committed
> >> to SVN HEAD (for the next OB version) I tried to maintain backward
> >> compatibility as far as possible. So OBConversion::SupportedInputFormat()
> >> works as before but, you'll be pleased to hear, without the '[Read-only]'.
> >>
> > Sounds good but SWIG doesn't like the new code. When I try to compile
> > openbabel_python.cpp, I get:
> >
> > ../../include/openbabel/fingerprint.h:48: error: 'static
> > std::map<const char*, OpenBabel::OBPlugin*,
> > OpenBabel::OBPlugin::CharPtrLess, std::allocator<std::pair<const char*
> > const, OpenBabel::OBPlugin*> > >& OpenBabel::OBFingerprint::Map()'
> > cannot be overloaded
> > ../../include/openbabel/fingerprint.h:43: error: with 'static
> > std::map<const char*, OpenBabel::OBPlugin*,
> > OpenBabel::OBPlugin::CharPtrLess, std::allocator<std::pair<const char*
> > const, OpenBabel::OBPlugin*> > >& OpenBabel::OBFingerprint::Map()'
> > ../../include/openbabel/fingerprint.h:53: error: 'static
> > OpenBabel::OBFingerprint*& OpenBabel::OBFingerprint::Default()' cannot
> > be overloaded
> > ../../include/openbabel/fingerprint.h:43: error: with 'static
> > OpenBabel::OBFingerprint*& OpenBabel::OBFingerprint::Default()'
> > ../../include/openbabel/fingerprint.h: In constructor
> > 'OpenBabel::OBFingerprint::OBFingerprint(std::string, bool)':
> > ../../include/openbabel/fingerprint.h:63: error: no match for
> > 'operator[]' in 'OpenBabel::OBFingerprint::Map()[ID]'
> > /usr/include/c++/4.0.2/bits/stl_map.h:331: note: candidates are: _Tp&
> > std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const _Key&) [with
> > _Key = const char*, _Tp = OpenBabel::OBPlugin*, _Compare =
> > OpenBabel::OBPlugin::CharPtrLess, _Alloc =
> > std::allocator<std::pair<const char* const, OpenBabel::OBPlugin*> >]
> >
> >
> >> But in an effort to provide more choice on the form of the output, there
> >> are three functions which provide a list of formats(or other plugin
> >> classes): OBPlugin::ListAsVector, ListAsString and List. The first two
> >> were intended to be compatible with scripting, although I need some
> >> advice here. ListAsString returns a (big) std::string, but ListAsVector
> >> has a parameter which is a reference to a std::vector. If this is
> >> incompatible with scripting languages I should change it.
> >>
> > There's no problem with vectors in general; these are simply
> > translated to lists by SWIG.
> >
> >
> >> All three have a parameter which can control what is in the output. For
> >> example if it contains "verbose" it output the whole description, not
> >> just the first line. So it would be easy to add code (4 extra lines) to
> >> output only the IDs if that would be useful:
> >> ListAsVector("formats","in/ids", stringvector)
> >>
> >> Post-processing in pybel I'm sure is useful, but if the C++ code was
> >> adequate it could serve other scripting languages as well.
> >>
> > I think so too. In the meanwhile, I would like to push out a Windows
> > Python release based on 2.1.0 with the current pybel enhancements. I'm
> > going to try to get this together this weekend and do some testing.
> >
> > Noel
> >
> >
> >> Chris
> >>
> >> Noel O'Boyle wrote:
> >>
> >>> After looking at the C++ code, I realise that maybe returning a list
> >>> of strings is the only choice for SupportedInputFormat. Anyway, in the
> >>> meanwhile I've added some code to pybel, so that if you access
> >>> pybel.informats or outformats, you will get a dictionary of supported
> >>> formats.
> >>>
> >>> On 12/05/07, Noel O'Boyle <bao...@gm...> wrote:
> >>>
> >>>> Actually, a vector of std::strings had not yet been swigified, so I
> >>>> needed to added to a line to openbabel-python.i to set it up (not yet
> >>>> checked in). However, there's an additional problem, which Jerome may
> >>>> like to address.
> >>>>
> >>>> The data that's returned is similar to:
> >>>> ('acr -- ACR format [Read-only]', 'alc -- Alchemy format', ... )
> >>>>
> >>>> whereas it would make more sense to me either to return:
> >>>> ('acr', 'alc', ...)
> >>>> or
> >>>> a std::map (i.e. a Python dict) of ['acr' : 'ACR format', 'alc':
> >>>> 'Alchemy format']
> >>>>
> >>>> Note that the text [Read-only] is not really necessary in a list of
> >>>> supported input formats.
> >>>>
> >>>> Since this function was added for the benefit of scripting interfaces,
> >>>> it makes sense to make it as easy as possible to access the list of
> >>>> formats.
> >>>>
> >>>> Noel
> >>>>
> >>>> On 11/05/07, Noel O'Boyle <bao...@gm...> wrote:
> >>>>
> >>>>> Hello again Jens,
> >>>>>
> >>>>> Good to hear from you on this list... :-)
> >>>>>
> >>>>> On 10/05/07, Jens Thomas <j.m...@dl...> wrote:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> I'm trying to enable our ccp1gui code
> >>>>>> (http://sourceforge.net/projects/ccp1gui/) to use openbabel so that we
> >>>>>> no longer have to support so many formats.
> >>>>>>
> >>>>>> I've got most of the machinery in place, but am a bit stuck on how to
> >>>>>> dynamically determine what input formats are supported by openbabel.
> >>>>>>
> >>>>>> I originally tried to use OBConversion.GetNextFormat, but ran into the
> >>>>>> ground fairly quickly. I then discovered the post at:
> >>>>>>
> >>>>>> http://sourceforge.net/mailarchive/forum.php?thread_name=200702191105.25888.j.pansanel%40pansanel.net&forum_name=openbabel-scripting
> >>>>>>
> >>>>>> which suggest that I should be able to get what I want using
> >>>>>> GetSupportedInputFormat(), however, I'm currently pretty clueless as to
> >>>>>> how I extract the information from the object. I get something back as
> >>>>>> shown below, but I'd appreciated any advice on what I then need to do
> >>>>>> with it.
> >>>>>>
> >> -------------------------------------------------------------------------
> >> This SF.net email is sponsored by DB2 Express
> >> Download DB2 Express C - the FREE version of DB2 express and take
> >> control of your XML. No limits. Just data. Click to get it now.
> >> http://sourceforge.net/powerbar/db2/
> >> _______________________________________________
> >> OpenBabel-scripting mailing list
> >> Ope...@li...
> >> https://lists.sourceforge.net/lists/listinfo/openbabel-scripting
> >>
> >>
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > OpenBabel-scripting mailing list
> > Ope...@li...
> > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting
> >
> >
>
>
|