ChemmineOB cannot find installed open-babel
2
0
Entering edit mode
yun YAN ▴ 20
@yun-yan-6355
Last seen 5.4 years ago
Canada

I have installed ChemmineOB and also open-babel but when the package is called inside R console, it seems that my open-babel is not found. Actually open-babel could be called by using its command line in terminal. I got confused and any suggestions will help a lot. 

Thank you so much. 

 

install open-babel

brew install open-babel

locate OPEN_BABEL_INCDIR and OPEN_BABEL_LIBDIR

OPEN_BABEL_INCDIR is /usr/local/Cellar/open-babel/2.3.2/lib/openbabel/2.3.2, where files likealias.hdescriptor.hpointgroup.hatom.h etc.

OPEN_BABEL_LIBDIR is /usr/local/Cellar/open-babel/2.3.2/lib/openbabel/2.3.2, where files likeAPIInterface.sofastsearchformat.sooutformat.soCSRformat.so, etc.

install ChemmineOB

R CMD INSTALL --configure-args='--with-openbabel-include=/usr/local/Cellar/open-babel/2.3.2/include/openbabel-2.0/openbabel --with-openbabel-lib=/usr/local/Cellar/open-babel/2.3.2/lib/openbabel/2.3.2' ChemmineOB_1.2.9.tgz

Errors reported

Error : .onLoad failed in loadNamespace() for 'ChemmineOB', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/ChemmineOB/libs/ChemmineOB.so': dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/ChemmineOB/libs/ChemmineOB.so, 10): Symbol not found: __ZN9OpenBabel10FastSearch11FindSimilarEPNS_6OBBaseERSt8multimapIdjSt4lessIdESaISt4pairIKdjEEEdd
Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/ChemmineOB/libs/ChemmineOB.so
Expected in: /usr/local/lib/libopenbabel.4.dylib in /Library/Frameworks/R.framework/Versions/3.1/Resources/library/ChemmineOB/libs/ChemmineOB.so
Error: package or namespace load failed for ‘ChemmineOB’

Environment

R version 3.1.1 (2014-07-10) -- "Sock it to Me"

Platform: x86_64-apple-darwin13.1.0 (64-bit) Mac OS X 10.9.5

Xcode 6.0.1

ChemmineOB openbabel • 5.7k views
ADD COMMENT
1
Entering edit mode
Dan Tenenbaum ★ 8.2k
@dan-tenenbaum-4256
Last seen 6 months ago
United States

I suggest you uninstall the brew-provided version of Open Babel and install it instead from here:

 

http://sourceforge.net/projects/openbabel/files/openbabel/2.3.1/OpenBabel-2.3.1.mac.zip/download

This is the version of Open Babel used by the Mac build machines at Bioconductor.

Then install ChemmineOB as follows:

source("http://bioconductor.org/biocLite.R")

biocLite("ChemmineOB")

That will install the binary version of ChemmineOB, which is already compiled. 

I just tried these steps on my own machine and they worked fine.

Dan

ADD COMMENT
0
Entering edit mode

This worked for me; thanks, Dan.

ADD REPLY
0
Entering edit mode

I do this way on mac os but still getting error? Error: package or namespace load failed for ‘ChemmineOB’: .onLoad failed in loadNamespace() for 'ChemmineOB', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ChemmineOB/libs/ChemmineOB.so': dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/ChemmineOB/libs/ChemmineOB.so, 10): Library not loaded: /usr/local/opt/open-babel/lib/libopenbabel.5.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/ChemmineOB/libs/ChemmineOB.so Reason: image not found

ADD REPLY
0
Entering edit mode

First ensure that the file "/usr/local/opt/open-babel/lib/libopenbabel.5.dylib" exists. If it does not, then open babel is not installed properly. If it does exist, make sure that the environment variable OPEN_BABEL_LIBDIR is defined and points to "/usr/local/opt/open-babel/lib", or wherever the "libopenbabel.5.dynlib" library is located. Also make sure that the environment variable OPEN_BABEL_INCDIR is set to the location of the open babel header files. These two variables need to be set not just when you install ChemmineOB, but also whenever you use it in R.

ADD REPLY
0
Entering edit mode
dave • 0
@786ef19d
Last seen 2.8 years ago
United States

Wanted to provide updated guidance as it appears the SourceForge page for Open Babel has depreciated, and the Homebrew install was not working for me. I spent longer than I'd like to admit troubleshooting this on a Mac, but found using Conda was a quick fix once I understood the issue, that's also the recommended source by the Open Babel devs on GitHub. If you don't have admin access on your Mac, setting the environment variables OPEN_BABEL_INCDIR and OPEN_BABEL_LIBDIR to the respective install locations is the way to go if you're able to do that.

conda create -p usr/local/opt/open-babel 
conda activate /usr/local/opt/open-babel
conda install -c conda-forge openbabel

This installs Open Babel in the location expected by R/ChemmineOB with the correct formatting. Please note, I'm using ChemmineOB 1.3.2, Open Babel 3.1.1, Conda 4.11.0 and R 4.1.2

ADD COMMENT

Login before adding your answer.

Traffic: 478 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6