rdkit / homebrew-rdkit

Homebrew formula for rdkit
44 stars 19 forks source link

Linking CXX shared library ./../lib/libRDGeneral.dylib #20

Closed supern8ent closed 9 years ago

supern8ent commented 9 years ago

I encountered an error while installing rdkit via brew on osx 10.9.5. Here's what happened:

$ brew tap rdkit/rdkit
$ brew install rdkit

...some dependencies are installed, then

==> Installing rdki

...

==> make
make[1]: *** [Code/RDBoost/CMakeFiles/RDBoost.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX shared library ../../lib/libRDGeneral.dylib
[  5%] Built target RDGeneral
make: *** [all] Error 2

brew gist-logs rdkit: https://gist.github.com/a437c40ea71027f3d1a6

In case it matters, I use virtualenvwrapper and had one activated when I ran brew install rdkit

mcs07 commented 9 years ago

I think the virtualenv is the cause of this problem. As it stands, RDKit doesn't have very good support for virtualenvs. You can see in the cmake log:

-- Found PythonInterp: /Users/nathan/.virtualenvs/A0/bin/python (found version "2.7.6") 
-- Found PythonLibs: /Users/nathan/.virtualenvs/A0/lib/libpython2.7.dylib (found version "2.7.6") 

I don't think that libpython2.7.dylib actually exists within each virtualenv? They use the lib in the main python installation.

Ideally RDKit could support virtualenvs by having a separate python package that could be installed with pip that just installed the python language bindings into a virtualenv's site-packages directory, with all virtualenvs just referring to a main RDKit installation. Open Babel manages this with its swig-based language bindings, but unfortunately I'm not sure if this is possible with boost-python.

In the meantime, this is how I handle RDKit with virtualenvs:

You might also consider using Anaconda to create isolated Python environments instead of virtualenv: https://github.com/rdkit/conda-rdkit

supern8ent commented 9 years ago

Thanks mcs07! I was able to brew install/compile outside the virtualenv, then copy rdkit directory from cellar to virtualenv, and now I have working rdkit.Chem in python.