This repository has been archived by the owner. It is now read-only.

Open Babel #16508

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
5 participants
@agiliopadua
Contributor

agiliopadua commented Dec 10, 2012

Open source chemistry and molecular modeling file format conversion and
data analysis tools. Updated to Open Babel 2.3.2.

Open Babel
Open source chemistry and molecular modeling file format conversion and
data analysis tools.
@jacknagel

This comment has been minimized.

Show comment Hide comment
@jacknagel

jacknagel Dec 11, 2012

Contributor

Lots of removed code without any explanation...

Contributor

jacknagel commented Dec 11, 2012

Lots of removed code without any explanation...

@jacknagel

View changes

Library/Formula/open-babel.rb
+ args << '-DPYTHON_BINDINGS=ON' if build.include? 'python-bindings'
+ args << '-DBUILD_GUI=ON' if build.include? 'build-gui'
+ args << '-DCAIRO_INCLUDE_DIRS=/usr/local/include/cairo '\
+ '-DCAIRO_LIBRARIES=/usr/local/lib/libcairo.dylib' if build.include? 'png'

This comment has been minimized.

Show comment Hide comment
@jacknagel

jacknagel Dec 11, 2012

Contributor

Can't hardcode /usr/local

@jacknagel

jacknagel Dec 11, 2012

Contributor

Can't hardcode /usr/local

This comment has been minimized.

Show comment Hide comment
@agiliopadua

agiliopadua Dec 12, 2012

Contributor

I've corrected this.
Thanks

@agiliopadua

agiliopadua Dec 12, 2012

Contributor

I've corrected this.
Thanks

@agiliopadua

This comment has been minimized.

Show comment Hide comment
@agiliopadua

agiliopadua Dec 12, 2012

Contributor

I've tried compiling several language bindings with Openbabel 2.3.2.
Python and Java bindings compile fine.
Perl and Ruby bindings fail due to a problem in the build procedure.
Applying known patch 08_perl_cmakelists.diff does not completely solve the problem
I've posted a ticket #850 in the openbabel sourceforge.
It seems openbabel gives priority to support python bindings and support for other languages is falling behind.

Contributor

agiliopadua commented Dec 12, 2012

I've tried compiling several language bindings with Openbabel 2.3.2.
Python and Java bindings compile fine.
Perl and Ruby bindings fail due to a problem in the build procedure.
Applying known patch 08_perl_cmakelists.diff does not completely solve the problem
I've posted a ticket #850 in the openbabel sourceforge.
It seems openbabel gives priority to support python bindings and support for other languages is falling behind.

@agiliopadua

This comment has been minimized.

Show comment Hide comment
@agiliopadua

agiliopadua Dec 12, 2012

Contributor

Concerning your comment on "Lots of removed code without any explanation...", the build procedure completely changed between the previous version (based on configure) and the present one (based on cmake), therefore most of the previous formula is outdated.

Contributor

agiliopadua commented Dec 12, 2012

Concerning your comment on "Lots of removed code without any explanation...", the build procedure completely changed between the previous version (based on configure) and the present one (based on cmake), therefore most of the previous formula is outdated.

@fredrikw

This comment has been minimized.

Show comment Hide comment
@fredrikw

fredrikw Dec 13, 2012

Contributor

Just wanted to chime in and say that I just successfully installed open-babel with png support and python bindings with the formula in 4437292, although brew did complain about the python bindings were put in "lib".

Contributor

fredrikw commented Dec 13, 2012

Just wanted to chime in and say that I just successfully installed open-babel with png support and python bindings with the formula in 4437292, although brew did complain about the python bindings were put in "lib".

@agiliopadua

This comment has been minimized.

Show comment Hide comment
@agiliopadua

agiliopadua Dec 13, 2012

Contributor

Hi. Good to know! Can you give more details about the complaint? I don't get any...

$ brew install --python --png --java --gui open-babel
==> Downloading http://sourceforge.net/projects/openbabel/files/openbabel/2.3.2/openbabel-2.3.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/open-babel-2.3.2.tar.gz
==> mkdir ../build
==> cd ../build
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/open-babel/2.3.2 -DPYTHON_BINDINGS=ON -DJAVA_BINDINGS=ON -DBUILD_GUI=ON -DCAIRO_I
==> make
==> make install
==> Caveats
Language bindings will be installed to the same location as the
Open Babel libraries. To prepare to use the bindings, prepend the
install directory to the appropriate environment variable:
PYTHONPATH for Python, CLASSPATH for Java.
==> Summary
/usr/local/Cellar/open-babel/2.3.2: 280 files, 21M, built in 2.4 minutes

I end up with the python bindings openbabel.py, openbabel.pyc, pybel.py in /usr/local/lib without complaints...

Contributor

agiliopadua commented Dec 13, 2012

Hi. Good to know! Can you give more details about the complaint? I don't get any...

$ brew install --python --png --java --gui open-babel
==> Downloading http://sourceforge.net/projects/openbabel/files/openbabel/2.3.2/openbabel-2.3.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/open-babel-2.3.2.tar.gz
==> mkdir ../build
==> cd ../build
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/open-babel/2.3.2 -DPYTHON_BINDINGS=ON -DJAVA_BINDINGS=ON -DBUILD_GUI=ON -DCAIRO_I
==> make
==> make install
==> Caveats
Language bindings will be installed to the same location as the
Open Babel libraries. To prepare to use the bindings, prepend the
install directory to the appropriate environment variable:
PYTHONPATH for Python, CLASSPATH for Java.
==> Summary
/usr/local/Cellar/open-babel/2.3.2: 280 files, 21M, built in 2.4 minutes

I end up with the python bindings openbabel.py, openbabel.pyc, pybel.py in /usr/local/lib without complaints...

@fredrikw

This comment has been minimized.

Show comment Hide comment
@fredrikw

fredrikw Dec 13, 2012

Contributor

==> Downloading http://sourceforge.net/projects/openbabel/files/openbabel/2.3.2/openbabel-2.3.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/open-babel-2.3.2.tar.gz
==> mkdir ../build
==> cd ../build
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/open-babel/2.3.2 -DPYTHON_BINDINGS=ON -DCAIRO_INCLUDE_DIRS=/usr/local/Cellar/open-babel/2.3.2/
==> make
==> make install
==> Caveats
Language bindings will be installed to the same location as the
Open Babel libraries. To prepare to use the bindings, prepend the
install directory to the appropriate environment variable:
PYTHONPATH for Python, CLASSPATH for Java.
Warning: Non-libraries were installed to "lib".
Installing non-libraries to "lib" is bad practice.
The offending files are:
/usr/local/Cellar/open-babel/2.3.2/lib/openbabel.py
/usr/local/Cellar/open-babel/2.3.2/lib/pybel.py

Contributor

fredrikw commented Dec 13, 2012

==> Downloading http://sourceforge.net/projects/openbabel/files/openbabel/2.3.2/openbabel-2.3.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/open-babel-2.3.2.tar.gz
==> mkdir ../build
==> cd ../build
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/open-babel/2.3.2 -DPYTHON_BINDINGS=ON -DCAIRO_INCLUDE_DIRS=/usr/local/Cellar/open-babel/2.3.2/
==> make
==> make install
==> Caveats
Language bindings will be installed to the same location as the
Open Babel libraries. To prepare to use the bindings, prepend the
install directory to the appropriate environment variable:
PYTHONPATH for Python, CLASSPATH for Java.
Warning: Non-libraries were installed to "lib".
Installing non-libraries to "lib" is bad practice.
The offending files are:
/usr/local/Cellar/open-babel/2.3.2/lib/openbabel.py
/usr/local/Cellar/open-babel/2.3.2/lib/pybel.py

@fredrikw

This comment has been minimized.

Show comment Hide comment
@fredrikw

fredrikw Dec 13, 2012

Contributor

And:

brew --version
0.9.3

Contributor

fredrikw commented Dec 13, 2012

And:

brew --version
0.9.3

@agiliopadua

This comment has been minimized.

Show comment Hide comment
@agiliopadua

agiliopadua Dec 13, 2012

Contributor

I also have 0.9.3. openbabel.pyc does not seem to offend.
The recommended place for python modules is lib/pythonX.Y/site-packages, but formulas built with cmake may not easily comply to this. Can try to fix it for python bindings but the same problem will pose for ruby, perl, etc. if these bindings compile successfully in the future. Better if this is solved upstream.

Contributor

agiliopadua commented Dec 13, 2012

I also have 0.9.3. openbabel.pyc does not seem to offend.
The recommended place for python modules is lib/pythonX.Y/site-packages, but formulas built with cmake may not easily comply to this. Can try to fix it for python bindings but the same problem will pose for ruby, perl, etc. if these bindings compile successfully in the future. Better if this is solved upstream.

Python modules now install to lib/python2.7/site-packages
modules openbabel.py and pybel.py are also byte-compiled.
@adamv

This comment has been minimized.

Show comment Hide comment
@adamv

adamv Dec 17, 2012

Contributor

Please squash to a single commit for review

Contributor

adamv commented Dec 17, 2012

Please squash to a single commit for review

@talipovm

This comment has been minimized.

Show comment Hide comment
@talipovm

talipovm Dec 21, 2012

Thank you for the formula! It definitely needs to be in the main repository, as the new release of Open Babel contains really nice features, like png support.
For me this formula works perfect except support of python binding. Although the installation is successful, 'import openbabel' causes Python to crash. Is it a common problem with this formula?

Thank you for the formula! It definitely needs to be in the main repository, as the new release of Open Babel contains really nice features, like png support.
For me this formula works perfect except support of python binding. Although the installation is successful, 'import openbabel' causes Python to crash. Is it a common problem with this formula?

@agiliopadua

This comment has been minimized.

Show comment Hide comment
@agiliopadua

agiliopadua Dec 21, 2012

Contributor

I can 'import babel' and use the modules to do conversions without any problems...
Do you have PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local/lib?

Contributor

agiliopadua commented Dec 21, 2012

I can 'import babel' and use the modules to do conversions without any problems...
Do you have PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local/lib?

@talipovm

This comment has been minimized.

Show comment Hide comment
@talipovm

talipovm Dec 21, 2012

Yes, and that's what I got:

import openbabel
Fatal Python error: PyThreadState_Get: no current thread
zsh: abort (core dumped) python

Looks like the problem is not specific to openbabel (titanous/homebrew-gnuradio#7).
Probably, openbabel linked to the Apple's python rather than to Homebrew's. I'll check it out.

Yes, and that's what I got:

import openbabel
Fatal Python error: PyThreadState_Get: no current thread
zsh: abort (core dumped) python

Looks like the problem is not specific to openbabel (titanous/homebrew-gnuradio#7).
Probably, openbabel linked to the Apple's python rather than to Homebrew's. I'll check it out.

@agiliopadua

This comment has been minimized.

Show comment Hide comment
@agiliopadua

agiliopadua Dec 21, 2012

Contributor

I don't have Homebrew's python installed.

Contributor

agiliopadua commented Dec 21, 2012

I don't have Homebrew's python installed.

@talipovm

This comment has been minimized.

Show comment Hide comment
@talipovm

talipovm Dec 22, 2012

[SOLVED] The problem was that cbind linked openbabel against Apple's python library in the /usr/lib, whereas I use Homebrew's python installed with the --Framework option. As a result, when I tried to import openbabel in python, I got 'Fatal Python error: PyThreadState_Get: no current thread'.

I found that lines 56-84 in the opencv.rb formula address this particular situation.
I just copied them into openbabel.rb, and cmake picked up the correct library.

[SOLVED] The problem was that cbind linked openbabel against Apple's python library in the /usr/lib, whereas I use Homebrew's python installed with the --Framework option. As a result, when I tried to import openbabel in python, I got 'Fatal Python error: PyThreadState_Get: no current thread'.

I found that lines 56-84 in the opencv.rb formula address this particular situation.
I just copied them into openbabel.rb, and cmake picked up the correct library.

@adamv

This comment has been minimized.

Show comment Hide comment
@adamv

adamv Jan 2, 2013

Contributor

Probably needs to be squashed to a single commit for review.

Contributor

adamv commented Jan 2, 2013

Probably needs to be squashed to a single commit for review.

@adamv adamv closed this in 27eebef Jan 15, 2013

norioxkimura added a commit to norioxkimura/homebrew that referenced this pull request Jan 16, 2013

Open Babel 2.3.2
Closes #16508.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.