building python wrapper from current source

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

building python wrapper from current source

TJ O'Donnell
I've successfully compiled the cpp code and built the .so's using
the current subversion source, but ran into a problem making the
python bindings.  The error (python setup.py build in openbabel/scripts/python)
is that openbabel.py is missing.  I see openbabel-python.i in
openbabel/scripts.  Is that for swig?  Do I need to run swig to
create openbabel.py?  Can someone tell me how to do that?

Thanks,
TJ

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: building python wrapper from current source

Tim Vandermeersch
On Fri, Jul 23, 2010 at 8:56 PM, TJ O'Donnell <[hidden email]> wrote:
> I've successfully compiled the cpp code and built the .so's using
> the current subversion source, but ran into a problem making the
> python bindings.  The error (python setup.py build in openbabel/scripts/python)
> is that openbabel.py is missing.  I see openbabel-python.i in
> openbabel/scripts.  Is that for swig?  Do I need to run swig to
> create openbabel.py?  Can someone tell me how to do that?

Using cmake, make sure these variables are set to ON in CMakeCache.txt
(in your build dir):

ENABLE_PYTHON
RUN_SWIG

$ cd openbabel
$mkdir build
$ cd build
$ cmake -DENABLE_PYTHON:=ON -DRUN_SWIG:=ON ..
$ make

This will build the python bindings.

Tim

> Thanks,
> TJ
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: building python wrapper from current source

TJ O'Donnell
I see my problem.  I didn't pay attention to the output from cmake

-- SWIG version is 1.3.40
-- SWIG version 2.0.0 exactly is required

Guess I'll have to make 2.0 happen

Thanks,
TJ

On 7/23/2010 12:00 PM, Tim Vandermeersch wrote:
> cmake -DENABLE_PYTHON:=ON -DRUN_SWIG:=ON

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: building python wrapper from current source

TJ O'Donnell
In reply to this post by Tim Vandermeersch
I've got openbabel and the python stuff built fine using the latest subversion source.
But I'm getting an error importing openbabel.

Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import openbabel
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 42, in <module>
     _openbabel = swig_import_helper()
   File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 38, in swig_import_helper
     _mod = imp.load_module('_openbabel', fp, pathname, description)
ImportError: /usr/local/lib/python2.6/dist-packages/_openbabel.so: undefined symbol: _ZTVN9OpenBabel22OBEnergyConformerScoreE
 >>>

Any ideas on what might be going wrong?
Do I need to get LD_LIBRARY_PATH set right?  I have it as
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/lib/openbabel/2.2.99/
This is where the .so's from my current build were installed

Thanks,
TJ

On 7/23/2010 12:00 PM, Tim Vandermeersch wrote:

> On Fri, Jul 23, 2010 at 8:56 PM, TJ O'Donnell<[hidden email]>  wrote:
>> I've successfully compiled the cpp code and built the .so's using
>> the current subversion source, but ran into a problem making the
>> python bindings.  The error (python setup.py build in openbabel/scripts/python)
>> is that openbabel.py is missing.  I see openbabel-python.i in
>> openbabel/scripts.  Is that for swig?  Do I need to run swig to
>> create openbabel.py?  Can someone tell me how to do that?
>
> Using cmake, make sure these variables are set to ON in CMakeCache.txt
> (in your build dir):
>
> ENABLE_PYTHON
> RUN_SWIG
>
> $ cd openbabel
> $mkdir build
> $ cd build
> $ cmake -DENABLE_PYTHON:=ON -DRUN_SWIG:=ON ..
> $ make
>
> This will build the python bindings.
>
> Tim
>
>> Thanks,
>> TJ
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: building python wrapper from current source

TJ O'Donnell
In reply to this post by Tim Vandermeersch
I've got openbabel and the python stuff built fine using the latest
subversion source.
But I'm getting an error importing openbabel.

Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import openbabel
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 42, in
<module>
    _openbabel = swig_import_helper()
  File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 38, in
swig_import_helper
    _mod = imp.load_module('_openbabel', fp, pathname, description)
ImportError: /usr/local/lib/python2.6/dist-packages/_openbabel.so:
undefined symbol: _ZTVN9OpenBabel22OBEnergyConformerScoreE
>>>

Any ideas on what might be going wrong?
Do I need to get LD_LIBRARY_PATH set right?  I have it as
export
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/lib/openbabel/2.2.99/
This is where the .so's from my current build were installed

Thanks,
TJ

> On Fri, Jul 23, 2010 at 8:56 PM, TJ O'Donnell <[hidden email]> wrote:
>> I've successfully compiled the cpp code and built the .so's using
>> the current subversion source, but ran into a problem making the
>> python bindings.  The error (python setup.py build in
>> openbabel/scripts/python)
>> is that openbabel.py is missing.  I see openbabel-python.i in
>> openbabel/scripts.  Is that for swig?  Do I need to run swig to
>> create openbabel.py?  Can someone tell me how to do that?
>
> Using cmake, make sure these variables are set to ON in CMakeCache.txt
> (in your build dir):
>
> ENABLE_PYTHON
> RUN_SWIG
>
> $ cd openbabel
> $mkdir build
> $ cd build
> $ cmake -DENABLE_PYTHON:=ON -DRUN_SWIG:=ON ..
> $ make
>
> This will build the python bindings.
>
> Tim
>
>> Thanks,
>> TJ
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>



------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: building python wrapper from current source

Noel O'Boyle
Administrator
In reply to this post by TJ O'Donnell
We need to add a conditional compile for Eigen2.

In the meanwhile, either compile with Eigen2
(-DEIGEN2_INCLUDE_DIR=path_to_eigen2) or else revert
openbabel-python.i back to the revision of two weeks ago (use "svn
log" on the file, and then "svn update -r NNNN openbabel-python.i".

- Noel

On 23 July 2010 22:45, TJ O'Donnell <[hidden email]> wrote:

> I've got openbabel and the python stuff built fine using the latest subversion source.
> But I'm getting an error importing openbabel.
>
> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
> [GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import openbabel
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 42, in <module>
>     _openbabel = swig_import_helper()
>   File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 38, in swig_import_helper
>     _mod = imp.load_module('_openbabel', fp, pathname, description)
> ImportError: /usr/local/lib/python2.6/dist-packages/_openbabel.so: undefined symbol: _ZTVN9OpenBabel22OBEnergyConformerScoreE
>  >>>
>
> Any ideas on what might be going wrong?
> Do I need to get LD_LIBRARY_PATH set right?  I have it as
> export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/lib/openbabel/2.2.99/
> This is where the .so's from my current build were installed
>
> Thanks,
> TJ
>
> On 7/23/2010 12:00 PM, Tim Vandermeersch wrote:
>> On Fri, Jul 23, 2010 at 8:56 PM, TJ O'Donnell<[hidden email]>  wrote:
>>> I've successfully compiled the cpp code and built the .so's using
>>> the current subversion source, but ran into a problem making the
>>> python bindings.  The error (python setup.py build in openbabel/scripts/python)
>>> is that openbabel.py is missing.  I see openbabel-python.i in
>>> openbabel/scripts.  Is that for swig?  Do I need to run swig to
>>> create openbabel.py?  Can someone tell me how to do that?
>>
>> Using cmake, make sure these variables are set to ON in CMakeCache.txt
>> (in your build dir):
>>
>> ENABLE_PYTHON
>> RUN_SWIG
>>
>> $ cd openbabel
>> $mkdir build
>> $ cd build
>> $ cmake -DENABLE_PYTHON:=ON -DRUN_SWIG:=ON ..
>> $ make
>>
>> This will build the python bindings.
>>
>> Tim
>>
>>> Thanks,
>>> TJ
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net email is sponsored by Sprint
>>> What will you do first with EVO, the first 4G phone?
>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>>> _______________________________________________
>>> OpenBabel-discuss mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: building python wrapper from current source

Noel O'Boyle
Administrator
This should be fixed now in the latest revision.

On 26 July 2010 10:29, Noel O'Boyle <[hidden email]> wrote:

> We need to add a conditional compile for Eigen2.
>
> In the meanwhile, either compile with Eigen2
> (-DEIGEN2_INCLUDE_DIR=path_to_eigen2) or else revert
> openbabel-python.i back to the revision of two weeks ago (use "svn
> log" on the file, and then "svn update -r NNNN openbabel-python.i".
>
> - Noel
>
> On 23 July 2010 22:45, TJ O'Donnell <[hidden email]> wrote:
>> I've got openbabel and the python stuff built fine using the latest subversion source.
>> But I'm getting an error importing openbabel.
>>
>> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
>> [GCC 4.4.3] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>  >>> import openbabel
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 42, in <module>
>>     _openbabel = swig_import_helper()
>>   File "/usr/local/lib/python2.6/dist-packages/openbabel.py", line 38, in swig_import_helper
>>     _mod = imp.load_module('_openbabel', fp, pathname, description)
>> ImportError: /usr/local/lib/python2.6/dist-packages/_openbabel.so: undefined symbol: _ZTVN9OpenBabel22OBEnergyConformerScoreE
>>  >>>
>>
>> Any ideas on what might be going wrong?
>> Do I need to get LD_LIBRARY_PATH set right?  I have it as
>> export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/lib/openbabel/2.2.99/
>> This is where the .so's from my current build were installed
>>
>> Thanks,
>> TJ
>>
>> On 7/23/2010 12:00 PM, Tim Vandermeersch wrote:
>>> On Fri, Jul 23, 2010 at 8:56 PM, TJ O'Donnell<[hidden email]>  wrote:
>>>> I've successfully compiled the cpp code and built the .so's using
>>>> the current subversion source, but ran into a problem making the
>>>> python bindings.  The error (python setup.py build in openbabel/scripts/python)
>>>> is that openbabel.py is missing.  I see openbabel-python.i in
>>>> openbabel/scripts.  Is that for swig?  Do I need to run swig to
>>>> create openbabel.py?  Can someone tell me how to do that?
>>>
>>> Using cmake, make sure these variables are set to ON in CMakeCache.txt
>>> (in your build dir):
>>>
>>> ENABLE_PYTHON
>>> RUN_SWIG
>>>
>>> $ cd openbabel
>>> $mkdir build
>>> $ cd build
>>> $ cmake -DENABLE_PYTHON:=ON -DRUN_SWIG:=ON ..
>>> $ make
>>>
>>> This will build the python bindings.
>>>
>>> Tim
>>>
>>>> Thanks,
>>>> TJ
>>>>
>>>> ------------------------------------------------------------------------------
>>>> This SF.net email is sponsored by Sprint
>>>> What will you do first with EVO, the first 4G phone?
>>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>>>> _______________________________________________
>>>> OpenBabel-discuss mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: building python wrapper from current source

Carlos Fenollosa
Hi,

We're encountering the same problem and we installed Openbabel just yesterday, from the official source code.

Is there anything else we can check? Eigen and Openbabel are properly installed, the $LD_LIBRARY_PATH and $PYTHONPATH are set, and in fact the binaries work, it's just the python bindings which fail to be imported.

Thanks
Carlos